Changes in / [d74077:8f4df1]


Ignore:
Files:
74 added
38 deleted
246 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    rd74077 r8f4df1  
    11ACLOCAL_AMFLAGS = -I m4
    22SUBDIRS = src src/unittests doc tests
     3
     4AUTOMAKE_OPTIONS = subdir-objects
    35
    46EXTRA_DIST = autogen.sh
     
    79doc:
    810        cd doc && make doxygen-docs
     11       
     12unity:
     13        cd src && make unity
  • configure.ac

    rd74077 r8f4df1  
    66AC_CONFIG_AUX_DIR(config)
    77AC_CONFIG_SRCDIR([src/builder.cpp])
    8 AC_CONFIG_HEADER([config.h])
     8AC_CONFIG_HEADER([config.h libmolecuilder_config.h])
     9AC_CONFIG_MACRO_DIR([m4])
    910
    1011AM_INIT_AUTOMAKE(dist-bzip2 parallel-tests)
     
    1415AC_PROG_CXX
    1516AC_PROG_CC
    16 AC_PROG_RANLIB
     17# obselete by LT_INIT
     18#AC_PROG_RANLIB
    1719AC_PROG_INSTALL
    1820AC_CHECK_PROG([LATEX],[latex],[latex],[:])
     
    2325AM_MISSING_PROG([DOXYGEN], [doxygen])
    2426
     27LT_INIT([disable-static])
     28
     29# Define these substitions here to keep all version information in one place.
     30# For information on how to properly maintain the library version information,
     31# refer to the libtool manual, section "Updating library version information":
     32# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
     33AC_SUBST([MOLECUILDER_SO_VERSION], [1:2:0])
     34AC_SUBST([MOLECUILDER_API_VERSION], [1.0])
     35
    2536# Checks for libraries.
    26 AC_CHECK_LIB(m, sqrt, ,AC_MSG_ERROR([compatible libc math library not found]))
     37AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
    2738
    2839# Boost libraries
     
    110121        doc/molecuilder.xml])
    111122AC_CONFIG_FILES([
     123  molecuilder-${MOLECUILDER_API_VERSION}.pc:molecuilder.pc.in])
     124AC_CONFIG_FILES([
    112125        Makefile
    113126        doc/Makefile
    114127        src/Makefile
    115128        src/Actions/Makefile
     129  src/Exceptions/Makefile
     130  src/Helpers/Makefile
     131  src/LinearAlgebra/Makefile
     132  src/Parser/Makefile
    116133        src/UIElements/Makefile
    117134        src/unittests/Makefile])
  • m4/gwqt4.m4

    rd74077 r8f4df1  
    147147        QT_LIBS="$QT_LIB"
    148148        if test $QT_IS_STATIC = yes ; then
    149             QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE"
     149            QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE"
    150150        fi
    151151        ;;
     
    154154        QT_LIBS="$QT_LIB"
    155155        if test $QT_IS_STATIC = yes ; then
    156             QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -ldl"
     156            QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE -ldl"
    157157        fi
    158158        ;;
     
    162162        QT_LIBS="$QT_LIB"
    163163        if test $QT_IS_STATIC = yes ; then
    164             QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE"
     164            QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE"
    165165        fi
    166166        ;;
     
    169169        QT_LIBS="$QT_LIB"
    170170        if test $QT_IS_STATIC = yes ; then
    171             QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl"
     171            QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl"
    172172        fi
    173173        ;;
  • src/Actions/Action.cpp

    rd74077 r8f4df1  
    1616#include "UIElements/Dialog.hpp"
    1717#include "Helpers/MemDebug.hpp"
     18#include "UIElements/UIFactory.hpp"
    1819
    19 #include "log.hpp"
    20 #include "verbose.hpp"
     20#include "Helpers/Log.hpp"
     21#include "Helpers/Verbose.hpp"
    2122
    2223using namespace std;
     
    4546}
    4647
     48Dialog * Action::createDialog(){
     49  Dialog *dialog = UIFactory::getInstance().makeDialog();
     50  return fillDialog(dialog);
     51}
     52
    4753void Action::call(enum QueryOptions flag){
    4854  if(!isActive()){
     
    5258  if (flag == Interactive) {
    5359    Dialog* dialog = createDialog();
    54     if (dialog != NULL) {
     60    if (dialog->hasQueries()) {
    5561      dialog->display();
    56       delete(dialog);
    5762    }
     63    delete(dialog);
    5864  }
    5965  state_ptr state = Action::failure;
  • src/Actions/Action.hpp

    rd74077 r8f4df1  
    369369  static state_ptr failure;
    370370
    371 private:
    372371  /**
    373372   * This creates the dialog requesting the information needed for this action from the user
    374373   * via means of the user interface.
    375374   */
    376   virtual Dialog * createDialog()=0;
     375  Dialog * createDialog();
     376
     377private:
     378
     379  virtual Dialog * fillDialog(Dialog*)=0;
    377380
    378381  /**
  • src/Actions/ActionHistory.cpp

    rd74077 r8f4df1  
    8686}
    8787
    88 Dialog* ActionHistory::UndoAction::createDialog(){
    89   return NULL;
     88Dialog* ActionHistory::UndoAction::fillDialog(Dialog *dialog){
     89  ASSERT(dialog,"No Dialog given when filling action dialog");
     90  return dialog;
    9091}
    9192
     
    124125}
    125126
    126 Dialog* ActionHistory::RedoAction::createDialog(){
    127   return NULL;
     127Dialog* ActionHistory::RedoAction::fillDialog(Dialog *dialog){
     128  ASSERT(dialog,"No Dialog given when filling action dialog");
     129  return dialog;
    128130}
    129131
  • src/Actions/ActionHistory.hpp

    rd74077 r8f4df1  
    3838
    3939    virtual bool isActive();
    40 
     40  protected:
     41    virtual Dialog * fillDialog(Dialog *dialog);
    4142  private:
    42     virtual Dialog * createDialog();
    4343    virtual Action::state_ptr performCall();
    4444    virtual Action::state_ptr performUndo(Action::state_ptr);
     
    5858    virtual bool isActive();
    5959
     60  protected:
     61    virtual Dialog * fillDialog(Dialog *dialog);
    6062  private:
    61     virtual Dialog * createDialog();
    6263    virtual Action::state_ptr performCall();
    6364    virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/ActionSequence.cpp

    rd74077 r8f4df1  
    4141// this method is used outside the ActionModule
    4242// Each action registers itself with the history
    43 void ActionSequence::callAllDialogs(){
     43Dialog* ActionSequence::fillAllDialogs(Dialog *dialog){
    4444  for(actionSet::iterator it=actions.begin(); it!=actions.end(); it++){
    45     // we want to have a global bookkeeping for all actions in the sequence, so
    46     // we bypass the normal call
    47     Dialog * dialog = (*it)->createDialog();
    48     if (dialog != NULL) {
    49       dialog->display();
    50       delete(dialog);
    51     }
     45    dialog = (*it)->fillDialog(dialog);
    5246  }
    53 }
    54 
    55 // This method is used internally when MakroActions are constructed.
    56 // In this case only the makro Action should be registered and
    57 // handle the states
    58 ActionSequence::stateSet ActionSequence::callAllDialogs(bool){
    59   stateSet states;
    60   for(actionSet::iterator it=actions.begin(); it!=actions.end(); it++){
    61     // we want to have a global bookkeeping for all actions in the sequence, so
    62     // we bypass the normal call
    63     (*it)->createDialog()->display();
    64   }
    65   return states;
     47  return dialog;
    6648}
    6749
  • src/Actions/ActionSequence.hpp

    rd74077 r8f4df1  
    3030
    3131  void callAll();
    32   void callAllDialogs();
    3332
    3433  bool canUndo();
     
    3736protected:
    3837  stateSet callAll(bool); // Dummy parameter to allow overloading
    39   stateSet callAllDialogs(bool); // Dummy parameter to allow overloading
     38  Dialog* fillAllDialogs(Dialog *dialog);
    4039  stateSet undoAll(stateSet);
    4140  stateSet redoAll(stateSet);
  • src/Actions/AnalysisAction/MolecularVolumeAction.cpp

    rd74077 r8f4df1  
    1414#include "molecule.hpp"
    1515#include "linkedcell.hpp"
    16 #include "log.hpp"
    17 #include "verbose.hpp"
     16#include "Helpers/Log.hpp"
     17#include "Helpers/Verbose.hpp"
    1818#include "World.hpp"
    1919
     
    2525#include "UIElements/UIFactory.hpp"
    2626#include "UIElements/Dialog.hpp"
    27 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2828
    2929const char AnalysisMolecularVolumeAction::NAME[] = "molecular-volume";
     
    4040};
    4141
    42 Dialog * AnalysisMolecularVolumeAction::createDialog() {
    43   Dialog *dialog = UIFactory::getInstance().makeDialog();
    44 
     42Dialog * AnalysisMolecularVolumeAction::fillDialog(Dialog *dialog) {
     43  ASSERT(dialog,"No Dialog given when filling action dialog");
    4544  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
    4645
  • src/Actions/AnalysisAction/MolecularVolumeAction.hpp

    rd74077 r8f4df1  
    2323
    2424  virtual const std::string getName();
     25
     26protected:
     27  virtual Dialog * fillDialog(Dialog*);
    2528private:
    26   virtual Dialog * createDialog();
    2729  virtual Action::state_ptr performCall();
    2830  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/AnalysisAction/PairCorrelationAction.cpp

    rd74077 r8f4df1  
    1313#include "boundary.hpp"
    1414#include "linkedcell.hpp"
    15 #include "verbose.hpp"
    16 #include "log.hpp"
     15#include "Helpers/Verbose.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "element.hpp"
    1818#include "molecule.hpp"
    1919#include "periodentafel.hpp"
    20 #include "vector.hpp"
     20#include "LinearAlgebra/Vector.hpp"
    2121#include "World.hpp"
    2222
     
    2828#include "UIElements/UIFactory.hpp"
    2929#include "UIElements/Dialog.hpp"
    30 #include "UIElements/ValueStorage.hpp"
     30#include "Actions/ValueStorage.hpp"
    3131
    3232const char AnalysisPairCorrelationAction::NAME[] = "pair-correlation";
     
    5151
    5252
    53 Dialog* AnalysisPairCorrelationAction::createDialog() {
    54   Dialog *dialog = UIFactory::getInstance().makeDialog();
     53Dialog* AnalysisPairCorrelationAction::fillDialog(Dialog* dialog) {
     54  ASSERT(dialog,"No Dialog given when filling action dialog");
    5555
    5656  dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements"));
  • src/Actions/AnalysisAction/PairCorrelationAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
     12#include <string>
    1213#include <vector>
    13 #include <string>
    1414
    1515class element;
     
    2727
    2828  virtual const std::string getName();
    29 
     29protected:
     30  virtual Dialog * fillDialog(Dialog*);
    3031private:
    31   virtual Dialog * createDialog();
    32   virtual Action::state_ptr performCall();
     32   virtual Action::state_ptr performCall();
    3333  virtual Action::state_ptr performUndo(Action::state_ptr);
    3434  virtual Action::state_ptr performRedo(Action::state_ptr);
  • src/Actions/AnalysisAction/PointCorrelationAction.cpp

    rd74077 r8f4df1  
    1313#include "boundary.hpp"
    1414#include "linkedcell.hpp"
    15 #include "verbose.hpp"
    16 #include "log.hpp"
     15#include "Helpers/Verbose.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "element.hpp"
    1818#include "molecule.hpp"
    1919#include "periodentafel.hpp"
    20 #include "vector.hpp"
     20#include "LinearAlgebra/Vector.hpp"
    2121#include "World.hpp"
    2222
     
    2828#include "UIElements/UIFactory.hpp"
    2929#include "UIElements/Dialog.hpp"
    30 #include "UIElements/ValueStorage.hpp"
     30#include "Actions/ValueStorage.hpp"
    3131
    3232const char AnalysisPointCorrelationAction::NAME[] = "point-correlation";
     
    5151};
    5252
    53 Dialog* AnalysisPointCorrelationAction::createDialog() {
    54   Dialog *dialog = UIFactory::getInstance().makeDialog();
     53Dialog* AnalysisPointCorrelationAction::fillDialog(Dialog *dialog) {
     54  ASSERT(dialog,"No Dialog given when filling action dialog");
    5555
    5656  dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position"));
  • src/Actions/AnalysisAction/PointCorrelationAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313#include <vector>
    1414#include <string>
     
    2929
    3030  virtual const std::string getName();
     31protected:
     32  virtual Dialog * fillDialog(Dialog*);
    3133private:
    32   virtual Dialog * createDialog();
    3334  virtual Action::state_ptr performCall();
    3435  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
     12#include "Helpers/Log.hpp"
     13#include "Helpers/Verbose.hpp"
     14#include "LinearAlgebra/Matrix.hpp"
     15#include "LinearAlgebra/Vector.hpp"
     16#include "element.hpp"
    1217#include "molecule.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
    1518
    1619#include <iostream>
     
    2124#include "UIElements/UIFactory.hpp"
    2225#include "UIElements/Dialog.hpp"
    23 #include "UIElements/ValueStorage.hpp"
     26#include "Actions/ValueStorage.hpp"
    2427
    2528const char AnalysisPrincipalAxisSystemAction::NAME[] = "principal-axis-system";
     
    3639};
    3740
    38 Dialog* AnalysisPrincipalAxisSystemAction::createDialog() {
    39   Dialog *dialog = UIFactory::getInstance().makeDialog();
     41Dialog* AnalysisPrincipalAxisSystemAction::fillDialog(Dialog *dialog) {
     42  ASSERT(dialog,"No Dialog given when filling action dialog");
    4043
    4144  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
     
    4649Action::state_ptr AnalysisPrincipalAxisSystemAction::performCall() {
    4750  molecule *mol = NULL;
     51  Matrix InertiaTensor;
    4852
    4953  ValueStorage::getInstance().queryCurrentValue(NAME, mol);
     
    5155  for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
    5256    molecule *mol = iter->second;
    53     mol->PrincipalAxisSystem(false);
     57    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
     58
     59    // reset inertia tensor
     60    InertiaTensor.zero();
     61
     62    // sum up inertia tensor
     63    for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     64      Vector x = (*iter)->getPosition();
     65      x -= *CenterOfGravity;
     66      const double mass = (*iter)->getType()->mass;
     67      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
     68      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
     69      InertiaTensor.at(0,2) += mass*(-x[0]*x[2]);
     70      InertiaTensor.at(1,0) += mass*(-x[1]*x[0]);
     71      InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]);
     72      InertiaTensor.at(1,2) += mass*(-x[1]*x[2]);
     73      InertiaTensor.at(2,0) += mass*(-x[2]*x[0]);
     74      InertiaTensor.at(2,1) += mass*(-x[2]*x[1]);
     75      InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]);
     76    }
     77    // print InertiaTensor for debugging
     78    DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl);
    5479  }
    5580  return Action::success;
  • src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp

    rd74077 r8f4df1  
    1313#include "boundary.hpp"
    1414#include "linkedcell.hpp"
    15 #include "verbose.hpp"
    16 #include "log.hpp"
     15#include "Helpers/Verbose.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "element.hpp"
    1818#include "molecule.hpp"
    1919#include "periodentafel.hpp"
    20 #include "vector.hpp"
     20#include "LinearAlgebra/Vector.hpp"
    2121#include "World.hpp"
    2222
     
    2828#include "UIElements/UIFactory.hpp"
    2929#include "UIElements/Dialog.hpp"
    30 #include "UIElements/ValueStorage.hpp"
     30#include "Actions/ValueStorage.hpp"
    3131
    3232const char AnalysisSurfaceCorrelationAction::NAME[] = "surface-correlation";
     
    5252
    5353
    54 Dialog* AnalysisSurfaceCorrelationAction::createDialog() {
    55   Dialog *dialog = UIFactory::getInstance().makeDialog();
     54Dialog* AnalysisSurfaceCorrelationAction::fillDialog(Dialog *dialog) {
     55  ASSERT(dialog,"No Dialog given when filling action dialog");
    5656
    5757  dialog->queryMolecule("molecule-by-id", ValueStorage::getInstance().getDescription("molecule-by-id"));
  • src/Actions/AnalysisAction/SurfaceCorrelationAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
     12#include <string>
    1213#include <vector>
    13 #include <string>
    1414
    1515class element;
     
    2828
    2929  virtual const std::string getName();
     30protected:
     31  virtual Dialog * fillDialog(Dialog*);
    3032private:
    31   virtual Dialog * createDialog();
    3233  virtual Action::state_ptr performCall();
    3334  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/AtomAction/AddAction.cpp

    rd74077 r8f4df1  
    1212#include "atom.hpp"
    1313#include "element.hpp"
    14 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1515#include "molecule.hpp"
    16 #include "vector.hpp"
    17 #include "verbose.hpp"
     16#include "LinearAlgebra/Vector.hpp"
     17#include "Helpers/Verbose.hpp"
    1818#include "World.hpp"
    1919
     
    2525#include "UIElements/UIFactory.hpp"
    2626#include "UIElements/Dialog.hpp"
    27 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2828
    2929const char AtomAddAction::NAME[] = "add-atom";
     
    4242};
    4343
    44 Dialog * AtomAddAction::createDialog() {
    45   Dialog *dialog = UIFactory::getInstance().makeDialog();
     44Dialog * AtomAddAction::fillDialog(Dialog *dialog) {
     45  ASSERT(dialog,"No Dialog given when filling action dialog");
    4646
    4747  dialog->queryElement(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/AtomAction/AddAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313
    1414class element;
     
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/AtomAction/ChangeElementAction.cpp

    rd74077 r8f4df1  
    1212#include "atom.hpp"
    1313#include "element.hpp"
    14 #include "log.hpp"
    15 #include "vector.hpp"
    16 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "LinearAlgebra/Vector.hpp"
     16#include "Helpers/Verbose.hpp"
     17#include "molecule.hpp"
    1718#include "World.hpp"
    1819
     
    2425#include "UIElements/UIFactory.hpp"
    2526#include "UIElements/Dialog.hpp"
    26 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2728
    2829const char AtomChangeElementAction::NAME[] = "change-element";
     
    4041};
    4142
    42 Dialog* AtomChangeElementAction::createDialog() {
    43   Dialog *dialog = UIFactory::getInstance().makeDialog();
     43Dialog* AtomChangeElementAction::fillDialog(Dialog *dialog) {
     44  ASSERT(dialog,"No Dialog given when filling action dialog");
    4445
    4546  dialog->queryElement(NAME, ValueStorage::getInstance().getDescription(NAME));
     
    5152  atom *first = NULL;
    5253  element *elemental = NULL;
     54  molecule *mol = NULL;
    5355
    5456  ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
     
    5759    first = iter->second;
    5860    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental->symbol << "." << endl);
     61    mol = first->getMolecule();
     62    first->removeFromMolecule(); // remove atom
    5963    first->setType(elemental);
     64    mol->AddAtom(first);  // add atom to ensure correctness of formula
    6065  }
    6166  return Action::success;
  • src/Actions/AtomAction/ChangeElementAction.hpp

    rd74077 r8f4df1  
    2626
    2727  virtual const std::string getName();
     28protected:
     29  virtual Dialog * fillDialog(Dialog*);
    2830private:
    29   virtual Dialog * createDialog();
    3031  virtual Action::state_ptr performCall();
    3132  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/AtomAction/RemoveAction.cpp

    rd74077 r8f4df1  
    1212#include "atom.hpp"
    1313#include "Descriptors/AtomDescriptor.hpp"
    14 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1515#include "molecule.hpp"
    16 #include "verbose.hpp"
     16#include "Helpers/Verbose.hpp"
    1717#include "World.hpp"
    1818
     
    2424#include "UIElements/UIFactory.hpp"
    2525#include "UIElements/Dialog.hpp"
    26 #include "UIElements/ValueStorage.hpp"
     26#include "Actions/ValueStorage.hpp"
    2727
    2828const char AtomRemoveAction::NAME[] = "remove-atom";
     
    3939};
    4040
    41 Dialog* AtomRemoveAction::createDialog() {
    42   Dialog *dialog = UIFactory::getInstance().makeDialog();
     41Dialog* AtomRemoveAction::fillDialog(Dialog *dialog) {
     42  ASSERT(dialog,"No Dialog given when filling action dialog");
    4343
    4444  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/AtomAction/RemoveAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog*);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/AtomsCalculation.hpp

    rd74077 r8f4df1  
    1111#include "Actions/Calculation.hpp"
    1212
     13class Dialog;
     14
    1315template<typename T>
    1416class AtomsCalculation : public Calculation<std::vector<T> >
     
    2022protected:
    2123  virtual std::vector<T>* doCalc();
     24  virtual Dialog *fillDialog(Dialog *dialog);
    2225
    2326private:
  • src/Actions/AtomsCalculation_impl.hpp

    rd74077 r8f4df1  
    4545}
    4646
     47template<typename T>
     48Dialog *AtomsCalculation<T>::fillDialog(Dialog *dialog){
     49  ASSERT(dialog,"No Dialog given when filling action dialog");
     50  return dialog;
     51}
    4752
    4853#endif /* ATOMSCALCULATION_IMPL_HPP_ */
  • src/Actions/Calculation.hpp

    rd74077 r8f4df1  
    6464  virtual T* doCalc()=0;
    6565private:
    66   virtual Dialog* createDialog();
    6766  virtual Action::state_ptr performCall();
    6867  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/Calculation_impl.hpp

    rd74077 r8f4df1  
    2727
    2828// methods inherited from Action
    29 
    30 template<typename T>
    31 Dialog* Calculation<T>::createDialog(){
    32   return NULL;
    33 }
    3429
    3530template<typename T>
  • src/Actions/CmdAction/BondLengthTableAction.cpp

    rd74077 r8f4df1  
    1212#include "bondgraph.hpp"
    1313#include "config.hpp"
    14 #include "log.hpp"
    15 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727const char CommandLineBondLengthTableAction::NAME[] = "bond-table";
     
    3939};
    4040
    41 Dialog* CommandLineBondLengthTableAction::createDialog() {
    42   Dialog *dialog = UIFactory::getInstance().makeDialog();
     41Dialog* CommandLineBondLengthTableAction::fillDialog(Dialog *dialog) {
     42  ASSERT(dialog,"No Dialog given when filling action dialog");
    4343
    4444  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/CmdAction/BondLengthTableAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/CmdAction/ElementDbAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "config.hpp"
    13 #include "log.hpp"
     13#include "Helpers/Log.hpp"
    1414#include "periodentafel.hpp"
    15 #include "verbose.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727const char CommandLineElementDbAction::NAME[] = "element-db";
     
    3939};
    4040
    41 Dialog* CommandLineElementDbAction::createDialog() {
    42   Dialog *dialog = UIFactory::getInstance().makeDialog();
     41Dialog* CommandLineElementDbAction::fillDialog(Dialog *dialog) {
     42  ASSERT(dialog,"No Dialog given when filling action dialog");
    4343
    4444  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/CmdAction/ElementDbAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/CmdAction/FastParsingAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "config.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626// memento to remember the state when undoing
     
    4949};
    5050
    51 Dialog* CommandLineFastParsingAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* CommandLineFastParsingAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryBoolean(NAME, MapOfActions::getInstance().getDescription(NAME));
     
    7878
    7979Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){
    80   performUndo(_state);
     80  return performUndo(_state);
    8181}
    8282
  • src/Actions/CmdAction/FastParsingAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/CmdAction/HelpAction.cpp

    rd74077 r8f4df1  
    3434};
    3535
    36 Dialog* CommandLineHelpAction::createDialog() {
    37   Dialog *dialog = UIFactory::getInstance().makeDialog();
     36Dialog* CommandLineHelpAction::fillDialog(Dialog *dialog) {
     37  ASSERT(dialog,"No Dialog given when filling action dialog");
    3838
    3939  ostringstream usage;
  • src/Actions/CmdAction/HelpAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/CmdAction/VerboseAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/CmdAction/VerboseAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
    13 #include "verbose.hpp"
     12#include "Helpers/Log.hpp"
     13#include "Helpers/Verbose.hpp"
    1414
    1515#include <iostream>
     
    2020#include "UIElements/UIFactory.hpp"
    2121#include "UIElements/Dialog.hpp"
    22 #include "UIElements/ValueStorage.hpp"
     22#include "Actions/ValueStorage.hpp"
    2323
    2424// memento to remember the state when undoing
     
    4747};
    4848
    49 Dialog* CommandLineVerboseAction::createDialog() {
    50   Dialog *dialog = UIFactory::getInstance().makeDialog();
     49Dialog* CommandLineVerboseAction::fillDialog(Dialog *dialog) {
     50  ASSERT(dialog,"No Dialog given when filling action dialog");
    5151
    5252  dialog->queryInt(NAME, ValueStorage::getInstance().getDescription(NAME));
     
    7676
    7777Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){
    78   performUndo(_state);
     78  return performUndo(_state);
    7979}
    8080
  • src/Actions/CmdAction/VerboseAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/CmdAction/VersionAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/CmdAction/VersionAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
     12#include "version.h"
    1213
    1314#include <iostream>
     
    1819#include "UIElements/UIFactory.hpp"
    1920#include "UIElements/Dialog.hpp"
    20 #include "UIElements/ValueStorage.hpp"
     21#include "Actions/ValueStorage.hpp"
    2122
    2223const char CommandLineVersionAction::NAME[] = "version";
     
    3334};
    3435
    35 Dialog* CommandLineVersionAction::createDialog() {
    36   Dialog *dialog = UIFactory::getInstance().makeDialog();
     36Dialog* CommandLineVersionAction::fillDialog(Dialog *dialog) {
     37  ASSERT(dialog,"No Dialog given when filling action dialog");
    3738
    3839  dialog->queryEmpty(NAME, ESPACKVersion);
  • src/Actions/CmdAction/VersionAction.hpp

    rd74077 r8f4df1  
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/ErrorAction.cpp

    rd74077 r8f4df1  
    1111
    1212#include "Actions/ErrorAction.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "Helpers/Assert.hpp"
    1616
  • src/Actions/FragmentationAction/DepthFirstSearchAction.cpp

    rd74077 r8f4df1  
    1313#include "bondgraph.hpp"
    1414#include "config.hpp"
    15 #include "log.hpp"
     15#include "Helpers/Log.hpp"
    1616#include "molecule.hpp"
    1717#include "Descriptors/MoleculeDescriptor.hpp"
    1818#include "Descriptors/MoleculeIdDescriptor.hpp"
    1919#include "stackclass.hpp"
    20 #include "verbose.hpp"
     20#include "Helpers/Verbose.hpp"
    2121#include "World.hpp"
    2222
     
    2828#include "UIElements/UIFactory.hpp"
    2929#include "UIElements/Dialog.hpp"
    30 #include "UIElements/ValueStorage.hpp"
     30#include "Actions/ValueStorage.hpp"
    3131
    3232const char FragmentationDepthFirstSearchAction::NAME[] = "depth-first-search";
     
    4444};
    4545
    46 Dialog* FragmentationDepthFirstSearchAction::createDialog() {
    47   Dialog *dialog = UIFactory::getInstance().makeDialog();
     46Dialog* FragmentationDepthFirstSearchAction::fillDialog(Dialog *dialog) {
     47  ASSERT(dialog,"No Dialog given when filling action dialog");
    4848
    4949  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/FragmentationAction/DepthFirstSearchAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/FragmentationAction/FragmentationAction.cpp

    rd74077 r8f4df1  
    1313#include "bondgraph.hpp"
    1414#include "config.hpp"
    15 #include "log.hpp"
     15#include "Helpers/Log.hpp"
    1616#include "molecule.hpp"
    1717#include "Descriptors/MoleculeDescriptor.hpp"
     
    2626#include "UIElements/UIFactory.hpp"
    2727#include "UIElements/Dialog.hpp"
    28 #include "UIElements/ValueStorage.hpp"
     28#include "Actions/ValueStorage.hpp"
    2929
    3030const char FragmentationFragmentationAction::NAME[] = "fragment-mol";
     
    4444};
    4545
    46 Dialog* FragmentationFragmentationAction::createDialog() {
    47   Dialog *dialog = UIFactory::getInstance().makeDialog();
     46Dialog* FragmentationFragmentationAction::fillDialog(Dialog *dialog) {
     47  ASSERT(dialog,"No Dialog given when filling action dialog");
    4848
    4949  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/FragmentationAction/FragmentationAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/FragmentationAction/SubgraphDissectionAction.cpp

    rd74077 r8f4df1  
    1616#include "bondgraph.hpp"
    1717#include "config.hpp"
    18 #include "log.hpp"
     18#include "Helpers/Log.hpp"
    1919#include "molecule.hpp"
    2020#include "stackclass.hpp"
     
    2828#include "UIElements/UIFactory.hpp"
    2929#include "UIElements/Dialog.hpp"
    30 #include "UIElements/ValueStorage.hpp"
     30#include "Actions/ValueStorage.hpp"
    3131
    3232const char FragmentationSubgraphDissectionAction::NAME[] = "subgraph-dissect";
     
    4343};
    4444
    45 Dialog* FragmentationSubgraphDissectionAction::createDialog() {
    46   Dialog *dialog = UIFactory::getInstance().makeDialog();
     45Dialog* FragmentationSubgraphDissectionAction::fillDialog(Dialog *dialog) {
     46  ASSERT(dialog,"No Dialog given when filling action dialog");
    4747
    4848  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
  • src/Actions/FragmentationAction/SubgraphDissectionAction.hpp

    rd74077 r8f4df1  
    77
    88#ifndef SUBGRAPHDISSECTIONACTION_HPP_
    9 #define SUBGRAPHDISSECTIONACTION_HPP_f
     9#define SUBGRAPHDISSECTIONACTION_HPP_
    1010
    1111#include "Actions/Action.hpp"
     
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/Makefile.am

    rd74077 r8f4df1  
    66AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl
    77AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
    8 
    9 noinst_LIBRARIES = libMolecuilderActions.a
    10 libMolecuilderActions_a_SOURCES = ${ACTIONSSOURCE} ${ACTIONSHEADER}
    118
    129ACTIONSSOURCE = \
     
    2017  ${TESSELATIONACTIONSOURCE} \
    2118  ${WORLDACTIONSOURCE} \
    22   MapOfActions.cpp
     19  MapOfActions.cpp \
     20  ValueStorage.cpp
    2321
    2422ACTIONSHEADER = \
     
    3331  ${WORLDACTIONHEADER} \
    3432  MapOfActions.hpp \
     33  ValueStorage.hpp \
    3534  Values.hpp
    3635 
     
    8685  MoleculeAction/FillWithMoleculeAction.cpp \
    8786  MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \
     87  MoleculeAction/RotateAroundOriginByAngleAction.cpp \
     88  MoleculeAction/RotateAroundSelfByAngleAction.cpp \
    8889  MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
    8990  MoleculeAction/SaveAdjacencyAction.cpp \
     
    9899  MoleculeAction/FillWithMoleculeAction.hpp \
    99100  MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \
     101  MoleculeAction/RotateAroundOriginByAngleAction.hpp \
     102  MoleculeAction/RotateAroundSelfByAngleAction.hpp \
    100103  MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
    101104  MoleculeAction/SaveAdjacencyAction.hpp \
     
    168171  WorldAction/SetOutputFormatsAction.hpp               
    169172
     173
     174lib_LTLIBRARIES = libMolecuilderActions-@MOLECUILDER_API_VERSION@.la
     175libMolecuilderActions_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
     176libMolecuilderActions_libs = ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la
     177nobase_libMolecuilderActions_include_HEADERS = ${ACTIONSHEADER}
     178
     179## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
     180## target.  Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and
     181## will therefore be treated as if it were literally part of the target name,
     182## and the variable name derived from that.
     183## The file extension .cc is recognized by Automake, and makes it produce
     184## rules which invoke the C++ compiler to produce a libtool object file (.lo)
     185## from each source file.  Note that it is not necessary to list header files
     186## which are already listed elsewhere in a _HEADERS variable assignment.
     187libMolecuilderActions_@MOLECUILDER_API_VERSION@_la_SOURCES = ${ACTIONSSOURCE}
     188
     189## Instruct libtool to include ABI version information in the generated shared
     190## library file (.so).  The library ABI version is defined in configure.ac, so
     191## that all version information is kept in one place.
     192libMolecuilderActions_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
     193
     194## The generated configuration header is installed in its own subdirectory of
     195## $(libdir).  The reason for this is that the configuration information put
     196## into this header file describes the target platform the installed library
     197## has been built for.  Thus the file must not be installed into a location
     198## intended for architecture-independent files, as defined by the Filesystem
     199## Hierarchy Standard (FHS).
     200## The nodist_ prefix instructs Automake to not generate rules for including
     201## the listed files in the distribution on 'make dist'.  Files that are listed
     202## in _HEADERS variables are normally included in the distribution, but the
     203## configuration header file is generated at configure time and should not be
     204## shipped with the source tarball.
     205libMolecuilderActions_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include
     206nodist_libMolecuilderActions_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
     207
     208## Install the generated pkg-config file (.pc) into the expected location for
     209## architecture-dependent package configuration information.  Occasionally,
     210## pkg-config files are also used for architecture-independent data packages,
     211## in which case the correct install location would be $(datadir)/pkgconfig.
     212pkgconfigdir = $(libdir)/pkgconfig
     213pkgconfig_DATA = $(top_builddir)/molecuilder-$(MOLECUILDER_API_VERSION).pc
     214
     215unity.cpp:
     216        echo "" >  unity.cpp; \
     217        list='$(ACTIONSSOURCE)'; for file in $$list; do \
     218          echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \
     219        done;
     220       
     221MOSTLYCLEANFILES = unity.cpp
  • src/Actions/MakroAction.cpp

    rd74077 r8f4df1  
    4444}
    4545
    46 Dialog* MakroAction::createDialog() {
    47   actions->callAllDialogs();
     46Dialog* MakroAction::fillDialog(Dialog *dialog) {
     47  return actions->fillAllDialogs(dialog);
    4848}
    4949
  • src/Actions/MakroAction.hpp

    rd74077 r8f4df1  
    2929  bool shouldUndo();
    3030
     31protected:
     32  virtual Dialog *fillDialog(Dialog *dialog);
    3133private:
    32   virtual Dialog * createDialog();
    3334  virtual Action::state_ptr performCall();
    3435  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/ManipulateAtomsProcess.cpp

    rd74077 r8f4df1  
    2727{}
    2828
    29 Dialog* ManipulateAtomsProcess::createDialog(){
    30   return NULL;
     29Dialog* ManipulateAtomsProcess::fillDialog(Dialog *dialog){
     30  ASSERT(dialog,"No Dialog given when filling action dialog");
     31  return dialog;
    3132}
    3233
  • src/Actions/ManipulateAtomsProcess.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual void doManipulate(World *);
     29
     30protected:
     31  virtual Dialog * fillDialog(Dialog*);
    2932private:
    30 
    31   virtual Dialog* createDialog();
    3233  virtual Action::state_ptr performCall();
    3334  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MapOfActions.cpp

    rd74077 r8f4df1  
    2626#include "CommandLineParser.hpp"
    2727#include "element.hpp"
    28 #include "log.hpp"
    29 #include "Matrix.hpp"
     28#include "Helpers/Log.hpp"
     29#include "LinearAlgebra/Matrix.hpp"
    3030#include "molecule.hpp"
    3131#include "periodentafel.hpp"
    32 #include "vector.hpp"
    33 #include "verbose.hpp"
     32#include "LinearAlgebra/Vector.hpp"
     33#include "Helpers/Verbose.hpp"
    3434
    3535#include "Actions/ActionRegistry.hpp"
     
    5555#include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
    5656#include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
     57#include "Actions/MoleculeAction/RotateAroundOriginByAngleAction.hpp"
     58#include "Actions/MoleculeAction/RotateAroundSelfByAngleAction.hpp"
    5759#include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp"
    5860#include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
     
    203205  DescriptionMap["remove-sphere"] = "remove sphere of atoms of around a specified atom";
    204206  DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis";
     207  DescriptionMap["rotate-origin"] = "rotates molecules by a specific angle around origin";
     208  DescriptionMap["rotate-self"] = "rotates molecules by a specific angle around own center of gravity";
    205209  DescriptionMap["rotate-to-pas"] = "calculate the principal axis system of the specified molecule and rotate specified axis to align with main axis";
    206210  DescriptionMap["save-adjacency"] = "name of the adjacency file to write to";
     
    319323  TypeMap["remove-sphere"] = &typeid(double);
    320324  TypeMap["repeat-box"] = &typeid(VectorValue);
    321   TypeMap["rotate-to-pas"] = &typeid(molecule);
     325  TypeMap["rotate-origin"] = &typeid(double);
     326  TypeMap["rotate-self"] = &typeid(double);
     327  TypeMap["rotate-to-pas"] = &typeid(VectorValue);
    322328  TypeMap["save-adjacency"] = &typeid(std::string);
    323329  TypeMap["save-bonds"] = &typeid(std::string);
     
    423429  MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "fill-molecule") );
    424430  MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "linear-interpolate") );
     431  MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "rotate-origin") );
     432  MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "rotate-self") );
    425433  MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "rotate-to-pas") );
    426434  MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "save-adjacency") );
     
    487495  generic.insert("remove-sphere");
    488496  generic.insert("repeat-box");
     497  generic.insert("rotate-origin");
     498  generic.insert("rotate-self");
    489499  generic.insert("rotate-to-pas");
    490500        generic.insert("save-adjacency");
     
    807817  new MoleculeFillWithMoleculeAction();
    808818  new MoleculeLinearInterpolationofTrajectoriesAction();
     819  new MoleculeRotateAroundOriginByAngleAction();
     820  new MoleculeRotateAroundSelfByAngleAction();
    809821  new MoleculeRotateToPrincipalAxisSystemAction();
    810822  new MoleculeSaveAdjacencyAction();
  • src/Actions/MethodAction.cpp

    rd74077 r8f4df1  
    2626{}
    2727
    28 Dialog* MethodAction::createDialog() {
    29   return NULL;
     28Dialog* MethodAction::fillDialog(Dialog *dialog) {
     29  ASSERT(dialog,"No Dialog given when filling action dialog");
     30  return dialog;
    3031}
    3132
  • src/Actions/MethodAction.hpp

    rd74077 r8f4df1  
    2525  virtual bool shouldUndo();
    2626
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/BondFileAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/MoleculeAction/BondFileAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "molecule.hpp"
    14 #include "verbose.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727
     
    5454};
    5555
    56 Dialog* MoleculeBondFileAction::createDialog() {
    57   Dialog *dialog = UIFactory::getInstance().makeDialog();
     56Dialog* MoleculeBondFileAction::fillDialog(Dialog *dialog) {
     57  ASSERT(dialog,"No Dialog given when filling action dialog");
    5858
    5959  dialog->queryString(NAME, MapOfActions::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/BondFileAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/ChangeNameAction.cpp

    rd74077 r8f4df1  
    2020#include "UIElements/UIFactory.hpp"
    2121#include "UIElements/Dialog.hpp"
    22 #include "UIElements/ValueStorage.hpp"
     22#include "Actions/ValueStorage.hpp"
    2323
    2424/****** MoleculeChangeNameAction *****/
     
    5050};
    5151
    52 Dialog* MoleculeChangeNameAction::createDialog() {
    53   Dialog *dialog = UIFactory::getInstance().makeDialog();
     52Dialog* MoleculeChangeNameAction::fillDialog(Dialog *dialog) {
     53  ASSERT(dialog,"No Dialog given when filling action dialog");
    5454
    5555  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/ChangeNameAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/FillWithMoleculeAction.cpp

    rd74077 r8f4df1  
    1515#include "config.hpp"
    1616#include "molecule.hpp"
    17 #include "verbose.hpp"
     17#include "Helpers/Verbose.hpp"
    1818#include "World.hpp"
    1919
     
    2626#include "UIElements/UIFactory.hpp"
    2727#include "UIElements/Dialog.hpp"
    28 #include "UIElements/ValueStorage.hpp"
     28#include "Actions/ValueStorage.hpp"
    2929
    3030/****** MoleculeFillWithMoleculeAction *****/
     
    6060};
    6161
    62 Dialog* MoleculeFillWithMoleculeAction::createDialog() {
    63   Dialog *dialog = UIFactory::getInstance().makeDialog();
     62Dialog* MoleculeFillWithMoleculeAction::fillDialog(Dialog *dialog) {
     63  ASSERT(dialog,"No Dialog given when filling action dialog");
    6464
    6565  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/FillWithMoleculeAction.hpp

    rd74077 r8f4df1  
    1111#include "Actions/Action.hpp"
    1212#include "Actions/Process.hpp"
    13 #include "vector.hpp"
     13#include "LinearAlgebra/Vector.hpp"
    1414
    1515class MoleculeListClass;
     
    2828
    2929  virtual const std::string getName();
     30protected:
     31  virtual Dialog * fillDialog(Dialog *dialog);
    3032private:
    31   virtual Dialog * createDialog();
    3233  virtual Action::state_ptr performCall();
    3334  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp

    rd74077 r8f4df1  
    1212#include "atom.hpp"
    1313#include "defs.hpp"
    14 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1515#include "molecule.hpp"
    16 #include "verbose.hpp"
     16#include "Helpers/Verbose.hpp"
    1717#include "World.hpp"
    1818
     
    2525#include "UIElements/UIFactory.hpp"
    2626#include "UIElements/Dialog.hpp"
    27 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2828
    2929
     
    5959};
    6060
    61 Dialog* MoleculeLinearInterpolationofTrajectoriesAction::createDialog() {
    62   Dialog *dialog = UIFactory::getInstance().makeDialog();
     61Dialog* MoleculeLinearInterpolationofTrajectoriesAction::fillDialog(Dialog *dialog) {
     62  ASSERT(dialog,"No Dialog given when filling action dialog");
    6363
    6464  dialog->queryString(NAME, MapOfActions::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
     13#include "Helpers/Verbose.hpp"
     14#include "LinearAlgebra/Line.hpp"
     15#include "LinearAlgebra/Matrix.hpp"
     16#include "LinearAlgebra/Vector.hpp"
     17#include "element.hpp"
    1318#include "molecule.hpp"
    14 #include "verbose.hpp"
    1519
    1620
     
    2327#include "UIElements/UIFactory.hpp"
    2428#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     29#include "Actions/ValueStorage.hpp"
    2630
    2731/****** MoleculeRotateToPrincipalAxisSystemAction *****/
     
    4852{}
    4953
    50 void MoleculeRotateToPrincipalAxisSystem() {
     54void MoleculeRotateToPrincipalAxisSystem(Vector &Axis) {
     55  ValueStorage::getInstance().setCurrentValue(MoleculeRotateToPrincipalAxisSystemAction::NAME, Axis);
    5156  ActionRegistry::getInstance().getActionByName(MoleculeRotateToPrincipalAxisSystemAction::NAME)->call(Action::NonInteractive);
    5257};
    5358
    54 Dialog* MoleculeRotateToPrincipalAxisSystemAction::createDialog() {
    55   Dialog *dialog = UIFactory::getInstance().makeDialog();
     59Dialog* MoleculeRotateToPrincipalAxisSystemAction::fillDialog(Dialog *dialog) {
     60  ASSERT(dialog,"No Dialog given when filling action dialog");
    5661
    57   dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
     62  dialog->queryVector(NAME, false, MapOfActions::getInstance().getDescription(NAME));
    5863
    5964  return dialog;
     
    6267Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performCall() {
    6368  molecule *mol = NULL;
     69  Vector Axis;
     70
     71  // obtain axis to rotate to
     72  ValueStorage::getInstance().queryCurrentValue(NAME, Axis);
    6473
    6574  for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
    6675    mol = iter->second;
    6776    DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl);
    68     mol->PrincipalAxisSystem(true);
     77    Matrix InertiaTensor;
     78    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
     79
     80    // reset inertia tensor
     81    InertiaTensor.zero();
     82
     83    // sum up inertia tensor
     84    for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     85      Vector x = (*iter)->getPosition();
     86      x -= *CenterOfGravity;
     87      const double mass = (*iter)->getType()->mass;
     88      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
     89      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
     90      InertiaTensor.at(0,2) += mass*(-x[0]*x[2]);
     91      InertiaTensor.at(1,0) += mass*(-x[1]*x[0]);
     92      InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]);
     93      InertiaTensor.at(1,2) += mass*(-x[1]*x[2]);
     94      InertiaTensor.at(2,0) += mass*(-x[2]*x[0]);
     95      InertiaTensor.at(2,1) += mass*(-x[2]*x[1]);
     96      InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]);
     97    }
     98    // print InertiaTensor for debugging
     99    DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl);
     100
     101    // diagonalize to determine principal axis system
     102    Vector Eigenvalues = InertiaTensor.transformToEigenbasis();
     103
     104    for(int i=0;i<NDIM;i++)
     105      DoLog(0) && (Log() << Verbose(0) << "eigenvalue = " << Eigenvalues[i] << ", eigenvector = " << InertiaTensor.column(i) << endl);
     106
     107    // check whether we rotate or not
     108    DoLog(0) && (Log() << Verbose(0) << "Transforming molecule into PAS ... ");
     109
     110    // obtain first column, eigenvector to biggest eigenvalue
     111    Vector BiggestEigenvector(InertiaTensor.column(Eigenvalues.SmallestComponent()));
     112    Vector DesiredAxis(Axis);
     113
     114    // Creation Line that is the rotation axis
     115    DesiredAxis.VectorProduct(BiggestEigenvector);
     116    Line RotationAxis(Vector(0.,0.,0.), DesiredAxis);
     117
     118    // determine angle
     119    const double alpha = BiggestEigenvector.Angle(Axis);
     120
     121    DoLog(0) && (Log() << Verbose(0) << alpha << endl);
     122
     123    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     124      *(*iter) -= *CenterOfGravity;
     125      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha));
     126      *(*iter) += *CenterOfGravity;
     127    }
     128    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
     129
     130    // summing anew for debugging (resulting matrix has to be diagonal!)
     131    // reset inertia tensor
     132    InertiaTensor.zero();
     133
     134    // sum up inertia tensor
     135    for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     136      Vector x = (*iter)->getPosition();
     137      x -= *CenterOfGravity;
     138      const double mass = (*iter)->getType()->mass;
     139      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
     140      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
     141      InertiaTensor.at(0,2) += mass*(-x[0]*x[2]);
     142      InertiaTensor.at(1,0) += mass*(-x[1]*x[0]);
     143      InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]);
     144      InertiaTensor.at(1,2) += mass*(-x[1]*x[2]);
     145      InertiaTensor.at(2,0) += mass*(-x[2]*x[0]);
     146      InertiaTensor.at(2,1) += mass*(-x[2]*x[1]);
     147      InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]);
     148      // print InertiaTensor for debugging
     149      DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl);
     150    }
     151
     152    // free everything
     153    delete(CenterOfGravity);
    69154  }
    70155  return Action::success;
  • src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp

    rd74077 r8f4df1  
    1313
    1414class MoleculeListClass;
     15class Vector;
    1516
    16 void MoleculeRotateToPrincipalAxisSystem();
     17void MoleculeRotateToPrincipalAxisSystem(Vector &Axis);
    1718
    1819class MoleculeRotateToPrincipalAxisSystemAction : public Action {
    19   friend void MoleculeRotateToPrincipalAxisSystem();
     20  friend void MoleculeRotateToPrincipalAxisSystem(Vector &Axis);
    2021
    2122public:
     
    2728
    2829  virtual const std::string getName();
     30protected:
     31  virtual Dialog * fillDialog(Dialog *dialog);
    2932private:
    30   virtual Dialog * createDialog();
    3133  virtual Action::state_ptr performCall();
    3234  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/SaveAdjacencyAction.cpp

    rd74077 r8f4df1  
    1212#include "bondgraph.hpp"
    1313#include "config.hpp"
    14 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1515#include "molecule.hpp"
    16 #include "verbose.hpp"
     16#include "Helpers/Verbose.hpp"
    1717#include "World.hpp"
    1818
     
    2626#include "UIElements/UIFactory.hpp"
    2727#include "UIElements/Dialog.hpp"
    28 #include "UIElements/ValueStorage.hpp"
     28#include "Actions/ValueStorage.hpp"
    2929
    3030/****** MoleculeSaveAdjacencyAction *****/
     
    5656};
    5757
    58 Dialog* MoleculeSaveAdjacencyAction::createDialog() {
    59   Dialog *dialog = UIFactory::getInstance().makeDialog();
     58Dialog* MoleculeSaveAdjacencyAction::fillDialog(Dialog *dialog) {
     59  ASSERT(dialog,"No Dialog given when filling action dialog");
    6060
    6161  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/SaveAdjacencyAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/SaveBondsAction.cpp

    rd74077 r8f4df1  
    1212#include "bondgraph.hpp"
    1313#include "config.hpp"
    14 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1515#include "molecule.hpp"
    16 #include "verbose.hpp"
     16#include "Helpers/Verbose.hpp"
    1717#include "World.hpp"
    1818
     
    2626#include "UIElements/UIFactory.hpp"
    2727#include "UIElements/Dialog.hpp"
    28 #include "UIElements/ValueStorage.hpp"
     28#include "Actions/ValueStorage.hpp"
    2929
    3030/****** MoleculeSaveBondsAction *****/
     
    5656};
    5757
    58 Dialog* MoleculeSaveBondsAction::createDialog() {
    59   Dialog *dialog = UIFactory::getInstance().makeDialog();
     58Dialog* MoleculeSaveBondsAction::fillDialog(Dialog *dialog) {
     59  ASSERT(dialog,"No Dialog given when filling action dialog");
    6060
    6161  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/SaveBondsAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/SaveTemperatureAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "molecule.hpp"
    14 #include "verbose.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727/****** MoleculeSaveTemperatureAction *****/
     
    5353};
    5454
    55 Dialog* MoleculeSaveTemperatureAction::createDialog() {
    56   Dialog *dialog = UIFactory::getInstance().makeDialog();
     55Dialog* MoleculeSaveTemperatureAction::fillDialog(Dialog *dialog) {
     56  ASSERT(dialog,"No Dialog given when filling action dialog");
    5757
    5858  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/SaveTemperatureAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/SuspendInWaterAction.cpp

    rd74077 r8f4df1  
    1212#include "boundary.hpp"
    1313#include "config.hpp"
    14 #include "log.hpp"
    15 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727/****** MoleculeSuspendInWaterAction *****/
     
    5353};
    5454
    55 Dialog* MoleculeSuspendInWaterAction::createDialog() {
    56   Dialog *dialog = UIFactory::getInstance().makeDialog();
     55Dialog* MoleculeSuspendInWaterAction::fillDialog(Dialog *dialog) {
     56  ASSERT(dialog,"No Dialog given when filling action dialog");
    5757
    5858  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/SuspendInWaterAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/TranslateAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/MoleculeAction/TranslateAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "molecule.hpp"
    14 #include "vector.hpp"
    15 #include "verbose.hpp"
     14#include "LinearAlgebra/Vector.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2424#include "UIElements/UIFactory.hpp"
    2525#include "UIElements/Dialog.hpp"
    26 #include "UIElements/ValueStorage.hpp"
     26#include "Actions/ValueStorage.hpp"
    2727
    2828/****** MoleculeTranslateAction *****/
     
    5555};
    5656
    57 Dialog* MoleculeTranslateAction::createDialog() {
    58   Dialog *dialog = UIFactory::getInstance().makeDialog();
     57Dialog* MoleculeTranslateAction::fillDialog(Dialog *dialog) {
     58  ASSERT(dialog,"No Dialog given when filling action dialog");
    5959
    6060  dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/TranslateAction.hpp

    rd74077 r8f4df1  
    1111#include "Actions/Action.hpp"
    1212#include "Actions/Process.hpp"
    13 #include "vector.hpp"
     13#include "LinearAlgebra/Vector.hpp"
    1414
    1515class MoleculeListClass;
     
    2828
    2929  virtual const std::string getName();
     30protected:
     31  virtual Dialog * fillDialog(Dialog *dialog);
    3032private:
    31   virtual Dialog * createDialog();
    3233  virtual Action::state_ptr performCall();
    3334  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/MoleculeAction/VerletIntegrationAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "molecule.hpp"
    14 #include "verbose.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727/****** MoleculeVerletIntegrationAction *****/
     
    5353};
    5454
    55 Dialog* MoleculeVerletIntegrationAction::createDialog() {
    56   Dialog *dialog = UIFactory::getInstance().makeDialog();
     55Dialog* MoleculeVerletIntegrationAction::fillDialog(Dialog *dialog) {
     56  ASSERT(dialog,"No Dialog given when filling action dialog");
    5757
    5858  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/MoleculeAction/VerletIntegrationAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/ParserAction/LoadXyzAction.cpp

    rd74077 r8f4df1  
    1414#include "Parser/XyzParser.hpp"
    1515#include "atom.hpp"
    16 #include "log.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "molecule.hpp"
    18 #include "verbose.hpp"
     18#include "Helpers/Verbose.hpp"
    1919#include "World.hpp"
    2020
     
    2626#include "UIElements/UIFactory.hpp"
    2727#include "UIElements/Dialog.hpp"
    28 #include "UIElements/ValueStorage.hpp"
     28#include "Actions/ValueStorage.hpp"
    2929
    3030/****** ParserLoadXyzAction *****/
     
    5656};
    5757
    58 Dialog* ParserLoadXyzAction::createDialog() {
    59   Dialog *dialog = UIFactory::getInstance().makeDialog();
     58Dialog* ParserLoadXyzAction::fillDialog(Dialog *dialog) {
     59  ASSERT(dialog,"No Dialog given when filling action dialog");
    6060
    6161  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/ParserAction/LoadXyzAction.hpp

    rd74077 r8f4df1  
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/ParserAction/SaveXyzAction.cpp

    rd74077 r8f4df1  
    2121#include "UIElements/UIFactory.hpp"
    2222#include "UIElements/Dialog.hpp"
    23 #include "UIElements/ValueStorage.hpp"
     23#include "Actions/ValueStorage.hpp"
    2424
    2525
     
    5252};
    5353
    54 Dialog* ParserSaveXyzAction::createDialog() {
    55   Dialog *dialog = UIFactory::getInstance().makeDialog();
     54Dialog* ParserSaveXyzAction::fillDialog(Dialog *dialog) {
     55  ASSERT(dialog,"No Dialog given when filling action dialog");
    5656
    5757  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/ParserAction/SaveXyzAction.hpp

    rd74077 r8f4df1  
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/AllAtomsAction.cpp

    rd74077 r8f4df1  
    1212#include "Descriptors/AtomDescriptor.hpp"
    1313#include "atom.hpp"
    14 #include "log.hpp"
    15 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727
     
    4949};
    5050
    51 Dialog* SelectionAllAtomsAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionAllAtomsAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/SelectionAction/AllAtomsAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog* createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/AllMoleculesAction.cpp

    rd74077 r8f4df1  
    1212#include "Descriptors/MoleculeDescriptor.hpp"
    1313#include "atom.hpp"
    14 #include "log.hpp"
    15 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727
     
    4949};
    5050
    51 Dialog* SelectionAllMoleculesAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionAllMoleculesAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/SelectionAction/AllMoleculesAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog* createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/AtomByIdAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626
     
    4949};
    5050
    51 Dialog* SelectionAtomByIdAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionAtomByIdAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/SelectionAction/AtomByIdAction.hpp

    rd74077 r8f4df1  
    2626
    2727  virtual const std::string getName();
     28protected:
     29  virtual Dialog * fillDialog(Dialog *dialog);
    2830private:
    29   virtual Dialog* createDialog();
    3031  virtual Action::state_ptr performCall();
    3132  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/MoleculeByIdAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "molecule.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626
     
    4949};
    5050
    51 Dialog* SelectionMoleculeByIdAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionMoleculeByIdAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/SelectionAction/MoleculeByIdAction.hpp

    rd74077 r8f4df1  
    2626
    2727  virtual const std::string getName();
     28protected:
     29  virtual Dialog * fillDialog(Dialog *dialog);
    2830private:
    29   virtual Dialog* createDialog();
    3031  virtual Action::state_ptr performCall();
    3132  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/NotAllAtomsAction.cpp

    rd74077 r8f4df1  
    1212#include "Descriptors/AtomDescriptor.hpp"
    1313#include "atom.hpp"
    14 #include "log.hpp"
    15 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727
    2828// memento to remember the state when undoing
    2929
    30 class SelectionAllAtomsState : public ActionState {
     30class SelectionNotAllAtomsState : public ActionState {
    3131public:
    32   SelectionAllAtomsState(std::vector<atom*> _selectedAtoms) :
     32  SelectionNotAllAtomsState(std::vector<atom*> _selectedAtoms) :
    3333    selectedAtoms(_selectedAtoms)
    3434  {}
     
    4949};
    5050
    51 Dialog* SelectionNotAllAtomsAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionNotAllAtomsAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
     
    6161  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms." << endl);
    6262  World::getInstance().clearAtomSelection();
    63   return Action::state_ptr(new SelectionAllAtomsState(selectedAtoms));
     63  return Action::state_ptr(new SelectionNotAllAtomsState(selectedAtoms));
    6464}
    6565
    6666Action::state_ptr SelectionNotAllAtomsAction::performUndo(Action::state_ptr _state) {
    67   SelectionAllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());
     67  SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get());
    6868
    6969  World::getInstance().clearAtomSelection();
     
    7171    World::getInstance().selectAtom(*iter);
    7272
    73   return Action::state_ptr(new SelectionAllAtomsState(state->selectedAtoms));
     73  return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms));
    7474}
    7575
    7676Action::state_ptr SelectionNotAllAtomsAction::performRedo(Action::state_ptr _state){
    77   SelectionAllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());
     77  SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get());
    7878
    7979  World::getInstance().clearAtomSelection();
    8080
    81   return Action::state_ptr(new SelectionAllAtomsState(state->selectedAtoms));
     81  return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms));
    8282}
    8383
  • src/Actions/SelectionAction/NotAllAtomsAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog* createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/NotAllMoleculesAction.cpp

    rd74077 r8f4df1  
    1212#include "Descriptors/MoleculeDescriptor.hpp"
    1313#include "atom.hpp"
    14 #include "log.hpp"
    15 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727
     
    4949};
    5050
    51 Dialog* SelectionNotAllMoleculesAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionNotAllMoleculesAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/SelectionAction/NotAllMoleculesAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog* createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/NotAtomByIdAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626
     
    4949};
    5050
    51 Dialog* SelectionNotAtomByIdAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionNotAtomByIdAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/SelectionAction/NotAtomByIdAction.hpp

    rd74077 r8f4df1  
    2626
    2727  virtual const std::string getName();
     28protected:
     29  virtual Dialog * fillDialog(Dialog *dialog);
    2830private:
    29   virtual Dialog* createDialog();
    3031  virtual Action::state_ptr performCall();
    3132  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/SelectionAction/NotMoleculeByIdAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "molecule.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626
     
    4949};
    5050
    51 Dialog* SelectionNotMoleculeByIdAction::createDialog() {
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
     51Dialog* SelectionNotMoleculeByIdAction::fillDialog(Dialog *dialog) {
     52  ASSERT(dialog,"No Dialog given when filling action dialog");
    5353
    5454  dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/SelectionAction/NotMoleculeByIdAction.hpp

    rd74077 r8f4df1  
    2626
    2727  virtual const std::string getName();
     28protected:
     29  virtual Dialog * fillDialog(Dialog *dialog);
    2830private:
    29   virtual Dialog* createDialog();
    3031  virtual Action::state_ptr performCall();
    3132  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/TesselationAction/ConvexEnvelopeAction.cpp

    rd74077 r8f4df1  
    1313#include "config.hpp"
    1414#include "linkedcell.hpp"
    15 #include "log.hpp"
     15#include "Helpers/Log.hpp"
    1616#include "molecule.hpp"
    17 #include "verbose.hpp"
     17#include "Helpers/Verbose.hpp"
    1818#include "World.hpp"
    1919
     
    2525#include "UIElements/UIFactory.hpp"
    2626#include "UIElements/Dialog.hpp"
    27 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2828
    2929/****** TesselationConvexEnvelopeAction *****/
     
    5656};
    5757
    58 Dialog* TesselationConvexEnvelopeAction::createDialog() {
    59   Dialog *dialog = UIFactory::getInstance().makeDialog();
     58Dialog* TesselationConvexEnvelopeAction::fillDialog(Dialog *dialog) {
     59  ASSERT(dialog,"No Dialog given when filling action dialog");
    6060
    6161  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/TesselationAction/ConvexEnvelopeAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp

    rd74077 r8f4df1  
    1212#include "boundary.hpp"
    1313#include "linkedcell.hpp"
    14 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1515#include "molecule.hpp"
    16 #include "verbose.hpp"
     16#include "Helpers/Verbose.hpp"
    1717#include "World.hpp"
    1818
     
    2424#include "UIElements/UIFactory.hpp"
    2525#include "UIElements/Dialog.hpp"
    26 #include "UIElements/ValueStorage.hpp"
     26#include "Actions/ValueStorage.hpp"
    2727
    2828/****** TesselationNonConvexEnvelopeAction *****/
     
    5555};
    5656
    57 Dialog* TesselationNonConvexEnvelopeAction::createDialog() {
    58   Dialog *dialog = UIFactory::getInstance().makeDialog();
     57Dialog* TesselationNonConvexEnvelopeAction::fillDialog(Dialog *dialog) {
     58  ASSERT(dialog,"No Dialog given when filling action dialog");
    5959
    6060  dialog->queryDouble(NAME, MapOfActions::getInstance().getDescription(NAME));
  • src/Actions/TesselationAction/NonConvexEnvelopeAction.hpp

    rd74077 r8f4df1  
    2727
    2828  virtual const std::string getName();
     29protected:
     30  virtual Dialog * fillDialog(Dialog *dialog);
    2931private:
    30   virtual Dialog * createDialog();
    3132  virtual Action::state_ptr performCall();
    3233  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/AddEmptyBoundaryAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
    13 #include "log.hpp"
    14 #include "vector.hpp"
     13#include "Helpers/Log.hpp"
     14#include "LinearAlgebra/Vector.hpp"
    1515#include "World.hpp"
    1616
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626#include "Helpers/Assert.hpp"
    2727
     
    4040};
    4141
    42 Dialog* WorldAddEmptyBoundaryAction::createDialog() {
    43   Dialog *dialog = UIFactory::getInstance().makeDialog();
     42Dialog* WorldAddEmptyBoundaryAction::fillDialog(Dialog *dialog) {
     43  ASSERT(dialog,"No Dialog given when filling action dialog");
    4444
    4545  dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/AddEmptyBoundaryAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313
    1414void WorldAddEmptyBoundary(Vector &boundary);
     
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/BoundInBoxAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/WorldAction/BoundInBoxAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "molecule.hpp"
    1414#include "World.hpp"
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626const char WorldBoundInBoxAction::NAME[] = "bound-in-box";
     
    3737};
    3838
    39 Dialog* WorldBoundInBoxAction::createDialog() {
    40   Dialog *dialog = UIFactory::getInstance().makeDialog();
     39Dialog* WorldBoundInBoxAction::fillDialog(Dialog *dialog) {
     40  ASSERT(dialog,"No Dialog given when filling action dialog");
    4141
    4242  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/BoundInBoxAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/CenterInBoxAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "Box.hpp"
    13 #include "log.hpp"
     13#include "Helpers/Log.hpp"
    1414#include "molecule.hpp"
    1515#include "World.hpp"
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626const char WorldCenterInBoxAction::NAME[] = "center-in-box";
     
    3838};
    3939
    40 Dialog* WorldCenterInBoxAction::createDialog() {
    41   Dialog *dialog = UIFactory::getInstance().makeDialog();
     40Dialog* WorldCenterInBoxAction::fillDialog(Dialog *dialog) {
     41  ASSERT(dialog,"No Dialog given when filling action dialog");
    4242
    4343  dialog->queryBox(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/CenterInBoxAction.hpp

    rd74077 r8f4df1  
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/CenterOnEdgeAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
    13 #include "log.hpp"
    14 #include "vector.hpp"
     13#include "Helpers/Log.hpp"
     14#include "LinearAlgebra/Vector.hpp"
    1515#include "World.hpp"
    16 #include "Matrix.hpp"
     16#include "LinearAlgebra/Matrix.hpp"
    1717
    1818#include <iostream>
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626#include "Helpers/Assert.hpp"
    2727
     
    3939};
    4040
    41 Dialog* WorldCenterOnEdgeAction::createDialog() {
    42   Dialog *dialog = UIFactory::getInstance().makeDialog();
     41Dialog* WorldCenterOnEdgeAction::fillDialog(Dialog *dialog) {
     42  ASSERT(dialog,"No Dialog given when filling action dialog");
    4343
    4444  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/CenterOnEdgeAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/ChangeBoxAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/WorldAction/ChangeBoxAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
    13 #include "verbose.hpp"
     12#include "Helpers/Log.hpp"
     13#include "Helpers/Verbose.hpp"
    1414#include "World.hpp"
    1515#include "Box.hpp"
    16 #include "Matrix.hpp"
     16#include "LinearAlgebra/Matrix.hpp"
    1717
    1818#include <iostream>
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727const char WorldChangeBoxAction::NAME[] = "change-box";
     
    3939};
    4040
    41 Dialog* WorldChangeBoxAction::createDialog() {
    42   Dialog *dialog = UIFactory::getInstance().makeDialog();
     41Dialog* WorldChangeBoxAction::fillDialog(Dialog *dialog) {
     42  ASSERT(dialog,"No Dialog given when filling action dialog");
    4343
    4444  dialog->queryBox(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/ChangeBoxAction.hpp

    rd74077 r8f4df1  
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/InputAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/WorldAction/InputAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "molecule.hpp"
    1414#include "Parser/FormatParserStorage.hpp"
    1515#include "Parser/PcpParser.hpp"
    16 #include "verbose.hpp"
     16#include "Helpers/Verbose.hpp"
    1717#include "World.hpp"
    1818
     
    2424#include "UIElements/UIFactory.hpp"
    2525#include "UIElements/Dialog.hpp"
    26 #include "UIElements/ValueStorage.hpp"
     26#include "Actions/ValueStorage.hpp"
    2727
    2828const char WorldInputAction::NAME[] = "input";
     
    4040};
    4141
    42 Dialog* WorldInputAction::createDialog() {
    43   Dialog *dialog = UIFactory::getInstance().makeDialog();
     42Dialog* WorldInputAction::fillDialog(Dialog *dialog) {
     43  ASSERT(dialog,"No Dialog given when filling action dialog");
    4444
    4545  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/InputAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/OutputAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "Parser/ChangeTracker.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626const char WorldOutputAction::NAME[] = "output";
     
    3737};
    3838
    39 Dialog* WorldOutputAction::createDialog() {
    40   Dialog *dialog = UIFactory::getInstance().makeDialog();
     39Dialog* WorldOutputAction::fillDialog(Dialog *dialog) {
     40  ASSERT(dialog,"No Dialog given when filling action dialog");
    4141
    4242  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/OutputAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp

    rd74077 r8f4df1  
    1212#include "Descriptors/AtomDescriptor.hpp"
    1313#include "atom.hpp"
    14 #include "element.hpp"
    15 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1615#include "molecule.hpp"
    17 #include "vector.hpp"
    18 #include "verbose.hpp"
     16#include "LinearAlgebra/Vector.hpp"
     17#include "Helpers/Verbose.hpp"
    1918#include "World.hpp"
    2019
     
    2625#include "UIElements/UIFactory.hpp"
    2726#include "UIElements/Dialog.hpp"
    28 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2928
    3029const char WorldRemoveSphereOfAtomsAction::NAME[] = "remove-sphere";
     
    4342};
    4443
    45 Dialog* WorldRemoveSphereOfAtomsAction::createDialog() {
    46   Dialog *dialog = UIFactory::getInstance().makeDialog();
     44Dialog* WorldRemoveSphereOfAtomsAction::fillDialog(Dialog *dialog) {
     45  ASSERT(dialog,"No Dialog given when filling action dialog");
    4746
    4847  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/RemoveSphereOfAtomsAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313
    1414
     
    2626
    2727  virtual const std::string getName();
     28protected:
     29  virtual Dialog * fillDialog(Dialog *dialog);
    2830private:
    29   virtual Dialog * createDialog();
    3031  virtual Action::state_ptr performCall();
    3132  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/RepeatBoxAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
    13 #include "log.hpp"
     13#include "Helpers/Log.hpp"
    1414#include "molecule.hpp"
    15 #include "vector.hpp"
    16 #include "Matrix.hpp"
    17 #include "verbose.hpp"
     15#include "LinearAlgebra/Vector.hpp"
     16#include "LinearAlgebra/Matrix.hpp"
     17#include "Helpers/Verbose.hpp"
    1818#include "World.hpp"
    1919#include "Box.hpp"
     
    2727#include "UIElements/UIFactory.hpp"
    2828#include "UIElements/Dialog.hpp"
    29 #include "UIElements/ValueStorage.hpp"
     29#include "Actions/ValueStorage.hpp"
    3030#include "Descriptors/MoleculeDescriptor.hpp"
    3131#include "Descriptors/MoleculePtrDescriptor.hpp"
     
    4545};
    4646
    47 Dialog * WorldRepeatBoxAction::createDialog() {
    48   Dialog *dialog = UIFactory::getInstance().makeDialog();
     47Dialog * WorldRepeatBoxAction::fillDialog(Dialog *dialog) {
     48  ASSERT(dialog,"No Dialog given when filling action dialog");
    4949
    5050  dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/RepeatBoxAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313
    1414void WorldRepeatBox(Vector &Repeater);
     
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/ScaleBoxAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
    13 #include "log.hpp"
    14 #include "vector.hpp"
    15 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "LinearAlgebra/Vector.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717#include "Box.hpp"
    18 #include "Matrix.hpp"
     18#include "LinearAlgebra/Matrix.hpp"
    1919
    2020#include <iostream>
     
    2525#include "UIElements/UIFactory.hpp"
    2626#include "UIElements/Dialog.hpp"
    27 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2828
    2929const char WorldScaleBoxAction::NAME[] = "scale-box";
     
    4141};
    4242
    43 Dialog* WorldScaleBoxAction::createDialog() {
    44   Dialog *dialog = UIFactory::getInstance().makeDialog();
     43Dialog* WorldScaleBoxAction::fillDialog(Dialog *dialog) {
     44  ASSERT(dialog,"No Dialog given when filling action dialog");
    4545
    4646  dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/ScaleBoxAction.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Actions/Action.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313
    1414void WorldScaleBox(Vector &Scaler);
     
    2525
    2626  virtual const std::string getName();
     27protected:
     28  virtual Dialog * fillDialog(Dialog *dialog);
    2729private:
    28   virtual Dialog * createDialog();
    2930  virtual Action::state_ptr performCall();
    3031  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/SetDefaultNameAction.cpp

    rd74077 r8f4df1  
    1010#include "Actions/WorldAction/SetDefaultNameAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "log.hpp"
    13 #include "verbose.hpp"
     12#include "Helpers/Log.hpp"
     13#include "Helpers/Verbose.hpp"
    1414#include "World.hpp"
    1515
     
    2121#include "UIElements/UIFactory.hpp"
    2222#include "UIElements/Dialog.hpp"
    23 #include "UIElements/ValueStorage.hpp"
     23#include "Actions/ValueStorage.hpp"
    2424
    2525
     
    4848};
    4949
    50 Dialog* WorldSetDefaultNameAction::createDialog() {
    51   Dialog *dialog = UIFactory::getInstance().makeDialog();
     50Dialog* WorldSetDefaultNameAction::fillDialog(Dialog *dialog) {
     51  ASSERT(dialog,"No Dialog given when filling action dialog");
    5252
    5353  string defaultname = World::getInstance().getDefaultName();
     
    7979
    8080Action::state_ptr WorldSetDefaultNameAction::performRedo(Action::state_ptr _state){
    81   performUndo(_state);
     81  return performUndo(_state);
    8282}
    8383
  • src/Actions/WorldAction/SetDefaultNameAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/SetGaussianBasisAction.cpp

    rd74077 r8f4df1  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "config.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
    1515#include "World.hpp"
    1616
     
    2222#include "UIElements/UIFactory.hpp"
    2323#include "UIElements/Dialog.hpp"
    24 #include "UIElements/ValueStorage.hpp"
     24#include "Actions/ValueStorage.hpp"
    2525
    2626
     
    5050};
    5151
    52 Dialog* WorldSetGaussianBasisAction::createDialog() {
    53   Dialog *dialog = UIFactory::getInstance().makeDialog();
     52Dialog* WorldSetGaussianBasisAction::fillDialog(Dialog *dialog) {
     53  ASSERT(dialog,"No Dialog given when filling action dialog");
    5454
    5555  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
     
    7979
    8080Action::state_ptr WorldSetGaussianBasisAction::performRedo(Action::state_ptr _state){
    81   performUndo(_state);
     81  return performUndo(_state);
    8282}
    8383
  • src/Actions/WorldAction/SetGaussianBasisAction.hpp

    rd74077 r8f4df1  
    2424
    2525  virtual const std::string getName();
     26protected:
     27  virtual Dialog * fillDialog(Dialog *dialog);
    2628private:
    27   virtual Dialog * createDialog();
    2829  virtual Action::state_ptr performCall();
    2930  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/Actions/WorldAction/SetOutputFormatsAction.cpp

    rd74077 r8f4df1  
    1212#include "Parser/ChangeTracker.hpp"
    1313#include "Parser/FormatParserStorage.hpp"
    14 #include "log.hpp"
    15 #include "verbose.hpp"
     14#include "Helpers/Log.hpp"
     15#include "Helpers/Verbose.hpp"
    1616#include "World.hpp"
    1717
     
    2323#include "UIElements/UIFactory.hpp"
    2424#include "UIElements/Dialog.hpp"
    25 #include "UIElements/ValueStorage.hpp"
     25#include "Actions/ValueStorage.hpp"
    2626
    2727const char WorldSetOutputFormatsAction::NAME[] = "set-output";
     
    3939};
    4040
    41 Dialog* WorldSetOutputFormatsAction::createDialog() {
    42   Dialog *dialog = UIFactory::getInstance().makeDialog();
     41Dialog* WorldSetOutputFormatsAction::fillDialog(Dialog *dialog) {
     42  ASSERT(dialog,"No Dialog given when filling action dialog");
    4343
    4444  dialog->queryStrings(NAME, ValueStorage::getInstance().getDescription(NAME));
  • src/Actions/WorldAction/SetOutputFormatsAction.hpp

    rd74077 r8f4df1  
    2626
    2727  virtual const std::string getName();
     28protected:
     29  virtual Dialog * fillDialog(Dialog *dialog);
    2830private:
    29   virtual Dialog * createDialog();
    3031  virtual Action::state_ptr performCall();
    3132  virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/BoundaryLineSet.cpp

    rd74077 r8f4df1  
    1515
    1616#include "Helpers/Assert.hpp"
    17 #include "info.hpp"
    18 #include "log.hpp"
     17#include "Helpers/Info.hpp"
     18#include "Helpers/Log.hpp"
     19#include "Helpers/Verbose.hpp"
    1920#include "tesselationhelpers.hpp"
    20 #include "vector.hpp"
    21 #include "verbose.hpp"
     21#include "LinearAlgebra/Vector.hpp"
    2222
    2323using namespace std;
  • src/BoundaryPointSet.cpp

    rd74077 r8f4df1  
    1515
    1616#include "Helpers/Assert.hpp"
    17 #include "info.hpp"
    18 #include "log.hpp"
    19 #include "vector.hpp"
    20 #include "verbose.hpp"
     17#include "Helpers/Info.hpp"
     18#include "Helpers/Log.hpp"
     19#include "LinearAlgebra/Vector.hpp"
     20#include "Helpers/Verbose.hpp"
    2121
    2222using namespace std;
  • src/BoundaryPolygonSet.cpp

    rd74077 r8f4df1  
    1616
    1717#include "Helpers/Assert.hpp"
    18 #include "helpers.hpp"
    19 #include "info.hpp"
    20 #include "log.hpp"
    21 #include "Plane.hpp"
    22 #include "vector.hpp"
    23 #include "verbose.hpp"
     18#include "Helpers/helpers.hpp"
     19#include "Helpers/Info.hpp"
     20#include "Helpers/Log.hpp"
     21#include "LinearAlgebra/Plane.hpp"
     22#include "LinearAlgebra/Vector.hpp"
     23#include "Helpers/Verbose.hpp"
    2424
    2525using namespace std;
  • src/BoundaryTriangleSet.cpp

    rd74077 r8f4df1  
    1515
    1616#include "Helpers/Assert.hpp"
    17 #include "info.hpp"
    18 #include "Line.hpp"
    19 #include "log.hpp"
    20 #include "Plane.hpp"
    21 #include "vector.hpp"
    22 #include "verbose.hpp"
     17#include "Helpers/Info.hpp"
     18#include "LinearAlgebra/Line.hpp"
     19#include "Helpers/Log.hpp"
     20#include "LinearAlgebra/Plane.hpp"
     21#include "LinearAlgebra/Vector.hpp"
     22#include "Helpers/Verbose.hpp"
    2323
    2424using namespace std;
  • src/BoundaryTriangleSet.hpp

    rd74077 r8f4df1  
    1010
    1111#include "BoundaryMaps.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313
    1414#include <set>
  • src/Box.cpp

    rd74077 r8f4df1  
    1111
    1212#include <cmath>
    13 
    14 #include "Matrix.hpp"
    15 #include "vector.hpp"
     13#include <iostream>
     14#include <cstdlib>
     15
     16#include "LinearAlgebra/Matrix.hpp"
     17#include "LinearAlgebra/Vector.hpp"
     18#include "LinearAlgebra/Plane.hpp"
    1619
    1720#include "Helpers/Assert.hpp"
     21
     22using namespace std;
    1823
    1924Box::Box()
     
    2328  Minv = new Matrix();
    2429  Minv->one();
     30  conditions.resize(3);
     31  conditions[0] = conditions[1] = conditions[2] = Wrap;
    2532}
    2633
     
    2835  M=new Matrix(*src.M);
    2936  Minv = new Matrix(*src.Minv);
     37  conditions = src.conditions;
    3038}
    3139
     
    6068  Vector helper = translateOut(point);
    6169  for(int i=NDIM;i--;){
    62     double intpart,fracpart;
    63     fracpart = modf(helper.at(i),&intpart);
    64     if(fracpart<0.)
    65       fracpart+=1.;
    66     helper.at(i)=fracpart;
     70
     71    switch(conditions[i]){
     72    case Wrap:
     73      helper.at(i)=fmod(helper.at(i),1);
     74      helper.at(i)+=(helper.at(i)>=0)?0:1;
     75      break;
     76    case Bounce:
     77      {
     78        // there probably is a better way to handle this...
     79        // all the fabs and fmod modf probably makes it very slow
     80        double intpart,fracpart;
     81        fracpart = modf(fabs(helper.at(i)),&intpart);
     82        helper.at(i) = fabs(fracpart-fmod(intpart,2));
     83      }
     84      break;
     85    case Ignore:
     86      break;
     87    default:
     88      ASSERT(0,"No default case for this");
     89    }
     90
    6791  }
    6892  return translateIn(helper);
     
    7296{
    7397  bool result = true;
    74   Vector tester = (*Minv) * point;
     98  Vector tester = translateOut(point);
    7599
    76100  for(int i=0;i<NDIM;i++)
    77     result = result && ((tester[i] >= -MYEPSILON) && ((tester[i] - 1.) < MYEPSILON));
     101    result = result &&
     102              ((conditions[i] == Ignore) ||
     103               ((tester[i] >= -MYEPSILON) &&
     104               ((tester[i] - 1.) < MYEPSILON)));
    78105
    79106  return result;
     
    82109
    83110VECTORSET(std::list) Box::explode(const Vector &point,int n) const{
     111  ASSERT(isInside(point),"Exploded point not inside Box");
    84112  VECTORSET(std::list) res;
    85113
    86   // translate the Vector into each of the 27 neighbourhoods
    87 
    88   // first create all translation Vectors
    89   // there are (n*2+1)^3 such vectors
    90   int max_dim = (n*2+1);
    91   int max_dim2 = max_dim*max_dim;
    92   int max = max_dim2*max_dim;
    93   // only one loop to avoid unneccessary jumps
    94   for(int i = 0;i<max;++i){
    95     // get all coordinates for this iteration
    96     int n1 = (i%max_dim)-n;
    97     int n2 = ((i/max_dim)%max_dim)-n;
    98     int n3 = ((i/max_dim2))-n;
    99     Vector translation = translateIn(Vector(n1,n2,n3));
    100     res.push_back(translation);
    101   }
    102   // translate all the translation vector by the offset defined by point
    103   res.translate(point);
     114  Vector translater = translateOut(point);
     115  Vector mask; // contains the ignored coordinates
     116
     117  // count the number of coordinates we need to do
     118  int dims = 0; // number of dimensions that are not ignored
     119  vector<int> coords;
     120  vector<int> index;
     121  for(int i=0;i<NDIM;++i){
     122    if(conditions[i]==Ignore){
     123      mask[i]=translater[i];
     124      continue;
     125    }
     126    coords.push_back(i);
     127    index.push_back(-n);
     128    dims++;
     129  } // there are max vectors in total we need to create
     130
     131  if(!dims){
     132    // all boundaries are ignored
     133    res.push_back(point);
     134    return res;
     135  }
     136
     137  bool done = false;
     138  while(!done){
     139    // create this vector
     140    Vector helper;
     141    for(int i=0;i<dims;++i){
     142      switch(conditions[coords[i]]){
     143        case Wrap:
     144          helper[coords[i]] = index[i]+translater[coords[i]];
     145          break;
     146        case Bounce:
     147          {
     148            // Bouncing the coordinate x produces the series:
     149            // 0 -> x
     150            // 1 -> 2-x
     151            // 2 -> 2+x
     152            // 3 -> 4-x
     153            // 4 -> 4+x
     154            // the first number is the next bigger even number (n+n%2)
     155            // the next number is the value with alternating sign (x-2*(n%2)*x)
     156            // the negative numbers produce the same sequence reversed and shifted
     157            int n = abs(index[i]) + ((index[i]<0)?-1:0);
     158            int sign = (index[i]<0)?-1:+1;
     159            int even = n%2;
     160            helper[coords[i]]=n+even+translater[coords[i]]-2*even*translater[coords[i]];
     161            helper[coords[i]]*=sign;
     162          }
     163          break;
     164        case Ignore:
     165          ASSERT(0,"Ignored coordinate handled in generation loop");
     166        default:
     167          ASSERT(0,"No default case for this switch-case");
     168      }
     169
     170    }
     171    // add back all ignored coordinates (not handled in above loop)
     172    helper+=mask;
     173    res.push_back(translateIn(helper));
     174    // set the new indexes
     175    int pos=0;
     176    ++index[pos];
     177    while(index[pos]>n){
     178      index[pos++]=-n;
     179      if(pos>=dims) { // it's trying to increase one beyond array... all vectors generated
     180        done = true;
     181        break;
     182      }
     183      ++index[pos];
     184    }
     185  }
    104186  return res;
    105187}
    106188
    107189VECTORSET(std::list) Box::explode(const Vector &point) const{
    108   VECTORSET(std::list) res;
    109 
    110   // translate the Vector into each of the 27 neighbourhoods
    111 
    112   // first create all 27 translation Vectors
    113   // these loops depend on fixed parameters and can easily be expanded
    114   // by the compiler to allow code without jumps
    115   for(int n1 = -1;n1<=1;++n1){
    116     for(int n2 = -1;n2<=1;++n2){
    117       for(int n3 = -1;n3<=1;++n3){
    118         // get all coordinates for this iteration
    119         Vector translation = translateIn(Vector(n1,n2,n3));
    120         res.push_back(translation);
    121       }
    122     }
    123   }
    124   // translate all the translation vector by the offset defined by point
    125   res.translate(point);
    126   return res;
     190  ASSERT(isInside(point),"Exploded point not inside Box");
     191  return explode(point,1);
    127192}
    128193
    129194double Box::periodicDistanceSquared(const Vector &point1,const Vector &point2) const{
    130   VECTORSET(std::list) expansion = explode(point1);
    131   double res = expansion.minDistSquared(point2);
     195  Vector helper1 = WrapPeriodically(point1);
     196  Vector helper2 = WrapPeriodically(point2);
     197  VECTORSET(std::list) expansion = explode(helper1);
     198  double res = expansion.minDistSquared(helper2);
    132199  return res;
    133200}
     
    137204  res = sqrt(periodicDistanceSquared(point1,point2));
    138205  return res;
     206}
     207
     208const Box::Conditions_t Box::getConditions(){
     209  return conditions;
     210}
     211
     212void Box::setCondition(int i,Box::BoundaryCondition_t condition){
     213  conditions[i]=condition;
     214}
     215
     216const vector<pair<Plane,Plane> >  Box::getBoundingPlanes(){
     217  vector<pair<Plane,Plane> > res;
     218  for(int i=0;i<NDIM;++i){
     219    Vector base1,base2,base3;
     220    base2[(i+1)%NDIM] = 1.;
     221    base3[(i+2)%NDIM] = 1.;
     222    Plane p1(translateIn(base1),
     223             translateIn(base2),
     224             translateIn(base3));
     225    Vector offset;
     226    offset[i]=1;
     227    Plane p2(translateIn(base1+offset),
     228             translateIn(base2+offset),
     229             translateIn(base3+offset));
     230    res.push_back(make_pair(p1,p2));
     231  }
     232  return res;
     233}
     234
     235void Box::setCuboid(const Vector &endpoint){
     236  ASSERT(endpoint[0]>0 && endpoint[1]>0 && endpoint[2]>0,"Vector does not define a full cuboid");
     237  M->one();
     238  M->diagonal()=endpoint;
     239  Vector &dinv = Minv->diagonal();
     240  for(int i=NDIM;i--;)
     241    dinv[i]=1/endpoint[i];
    139242}
    140243
     
    145248    M    = new Matrix(*src.M);
    146249    Minv = new Matrix(*src.Minv);
     250    conditions = src.conditions;
    147251  }
    148252  return *this;
  • src/Box.hpp

    rd74077 r8f4df1  
    1111class Matrix;
    1212class Vector;
     13class Plane;
    1314
    1415#include <list>
    15 #include "VectorSet.hpp"
     16#include <vector>
     17#include "LinearAlgebra/VectorSet.hpp"
    1618
    1719/**
     
    2628{
    2729public:
     30  typedef enum{
     31    Wrap,
     32    Bounce,
     33    Ignore
     34  } BoundaryCondition_t;
     35
     36  typedef vector<BoundaryCondition_t> Conditions_t;
     37
    2838  Box();
    2939  Box(const Box&);
     
    8999  double periodicDistance(const Vector &point1,const Vector &point2) const;
    90100
     101  const Conditions_t getConditions();
     102  void setCondition(int,BoundaryCondition_t);
     103
     104  const vector<pair<Plane,Plane> > getBoundingPlanes();
     105
     106  void setCuboid(const Vector&);
     107
    91108private:
     109  Conditions_t conditions;
    92110  Matrix *M;    //!< Defines the layout of the box
    93111  Matrix *Minv; //!< Inverse of M to avoid recomputation
  • src/CandidateForTesselation.cpp

    rd74077 r8f4df1  
    1616
    1717#include "Helpers/Assert.hpp"
    18 #include "info.hpp"
     18#include "Helpers/Info.hpp"
    1919//#include "Line.hpp"
    2020#include "linkedcell.hpp"
    21 #include "log.hpp"
     21#include "Helpers/Log.hpp"
    2222//#include "Plane.hpp"
    23 #include "vector.hpp"
    24 #include "verbose.hpp"
     23#include "LinearAlgebra/Vector.hpp"
     24#include "Helpers/Verbose.hpp"
    2525
    2626using namespace std;
  • src/CandidateForTesselation.hpp

    rd74077 r8f4df1  
    1010
    1111#include "BoundaryMaps.hpp"
    12 #include "vector.hpp"
     12#include "LinearAlgebra/Vector.hpp"
    1313
    1414#include <list>
  • src/CommandLineParser.cpp

    rd74077 r8f4df1  
    1515#include "Patterns/Singleton_impl.hpp"
    1616#include "CommandLineParser.hpp"
    17 #include "log.hpp"
    18 #include "verbose.hpp"
     17#include "Helpers/Log.hpp"
     18#include "Helpers/Verbose.hpp"
    1919
    2020using namespace std;
  • src/ConfigFileBuffer.cpp

    rd74077 r8f4df1  
    77
    88#include "ConfigFileBuffer.hpp"
    9 #include "helpers.hpp"
     9#include "Helpers/helpers.hpp"
    1010#include "lists.hpp"
    11 #include "verbose.hpp"
    12 #include "log.hpp"
     11#include "Helpers/Verbose.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "World.hpp"
    1414
  • src/Descriptors/AtomDescriptor.hpp

    rd74077 r8f4df1  
    3535  // close coupling to the world to allow access
    3636  friend atom* World::getAtom(AtomDescriptor descriptor);
    37   friend std::vector<atom*> World::getAllAtoms(AtomDescriptor descriptor);
     37  friend World::AtomComposite World::getAllAtoms(AtomDescriptor descriptor);
    3838  template <class,class,class> friend class SelectiveIterator;
    3939
  • src/Descriptors/AtomSelectionDescriptor.cpp

    rd74077 r8f4df1  
    99#include "Descriptors/AtomSelectionDescriptor_impl.hpp"
    1010
    11 #include "helpers.hpp"
     11#include "Helpers/helpers.hpp"
    1212
    1313AtomSelectionDescriptor_impl::AtomSelectionDescriptor_impl(){}
  • src/Descriptors/MoleculeSelectionDescriptor.cpp

    rd74077 r8f4df1  
    99#include "Descriptors/MoleculeSelectionDescriptor_impl.hpp"
    1010
    11 #include "helpers.hpp"
     11#include "Helpers/helpers.hpp"
    1212
    1313MoleculeSelectionDescriptor_impl::MoleculeSelectionDescriptor_impl(){}
  • src/Descriptors/SelectiveIterator_impl.hpp

    rd74077 r8f4df1  
    99#define SELECTIVEITERATOR_IMPL_HPP_
    1010
    11 #include "helpers.hpp"
     11#include "Helpers/helpers.hpp"
    1212
    1313template<class _Target,
  • src/Formula.cpp

    rd74077 r8f4df1  
    5555
    5656void Formula::fromString(const std::string &formula) throw(ParseError){
     57  // make this transactional, in case an error is thrown
     58  Formula res;
     59  string::const_iterator begin = formula.begin();
     60  string::const_iterator end = formula.end();
     61  res.parseFromString(begin,end,static_cast<char>(0));
     62  (*this)=res;
     63}
     64
     65int Formula::parseMaybeNumber(string::const_iterator &it,string::const_iterator &end) throw(ParseError){
     66  static const range<char> Numbers = makeRange('0',static_cast<char>('9'+1));
     67  int count = 0;
     68  while(it!=end && Numbers.isInRange(*it))
     69    count = (count*10) + ((*it++)-Numbers.first);
     70  // one is implicit
     71  count = (count!=0)?count:1;
     72  return count;
     73}
     74
     75void Formula::parseFromString(string::const_iterator &it,string::const_iterator &end,char delimiter) throw(ParseError){
    5776  // some constants needed for parsing... Assumes ASCII, change if other encodings are used
    5877  static const range<char> CapitalLetters = makeRange('A',static_cast<char>('Z'+1));
    5978  static const range<char> SmallLetters = makeRange('a',static_cast<char>('z'+1));
    60   static const range<char> Numbers = makeRange('0',static_cast<char>('9'+1));
     79  map<char,char> delimiters;
     80  delimiters['('] = ')';
     81  delimiters['['] = ']';
    6182  // clean the formula
    6283  clear();
    63   string::const_iterator end = formula.end(); // will be used frequently
    64   for(string::const_iterator it=formula.begin();it!=end;){
     84  for(/*send from above*/;it!=end && *it!=delimiter;/*updated in loop*/){
     85    // we might have a sub formula
     86    if(delimiters.count(*it)){
     87      Formula sub;
     88      char nextdelim=delimiters[*it];
     89      sub.parseFromString(++it,end,nextdelim);
     90      if(!sub.getElementCount()){
     91        throw(ParseError(__FILE__,__LINE__));
     92      }
     93      int count = parseMaybeNumber(++it,end);
     94      addFormula(sub,count);
     95      continue;
     96    }
    6597    string shorthand;
    6698    // Atom names start with a capital letter
     
    71103    while(it!=end && SmallLetters.isInRange(*it))
    72104      shorthand+=(*it++);
    73     // now we can count the occurences
    74     int count = 0;
    75     while(it!=end && Numbers.isInRange(*it))
    76       count = (count*10) + ((*it++)-Numbers.first);
    77     // one is implicit
    78     count = (count!=0)?count:1;
     105    int count = parseMaybeNumber(it,end);
    79106    // test if the shorthand exists
    80107    if(!World::getInstance().getPeriode()->FindElement(shorthand))
     
    83110    addElements(shorthand,count);
    84111  }
     112  if(it==end && delimiter!=0){
     113    throw(ParseError(__FILE__,__LINE__));
     114  }
    85115}
    86116
     
    93123    *output << "#Ion_TypeNr.\tAmount\tZ\tRGauss\tL_Max(PP)L_Loc(PP)IonMass\t# chemical name, symbol" << endl;
    94124    for(const_iterator iter=begin(); iter!=end();++iter){
    95       (*iter).first->No = No;
    96125      result = result && (*iter).first->Checkout(output, No++, (*iter).second);
    97126    }
     
    195224}
    196225
     226void Formula::addFormula(const Formula &formula,unsigned int n){
     227  for(Formula::const_iterator iter=formula.begin();iter!=formula.end();++iter){
     228    this->addElements(iter->first,iter->second*n);
     229  }
     230}
     231
     232enumeration<Formula::key_type> Formula::enumerateElements() const{
     233  enumeration<key_type> res(1);
     234  for(Formula::const_iterator iter=begin();iter!=end();++iter){
     235    res.add(iter->first);
     236  }
     237  return res;
     238}
     239
    197240const unsigned int Formula::operator[](const element *element) const{
    198241  ASSERT(element,"Invalid pointer in access of Formula");
  • src/Formula.hpp

    rd74077 r8f4df1  
    1616
    1717#include "types.hpp"
     18#include "Helpers/helpers.hpp"
    1819
    1920class element;
     
    2223{
    2324public:
    24   typedef element*                                      key_type;
     25  typedef const element*                                key_type;
    2526  typedef unsigned int                                  mapped_type;
    2627  typedef std::pair<key_type, mapped_type>              value_type;
     
    6566
    6667  unsigned int getElementCount() const;
    67   bool hasElement(const element*)       const;
     68  bool hasElement(key_type)             const;
    6869  bool hasElement(atomicNumber_t)       const;
    6970  bool hasElement(const std::string&)   const;
    7071
    71   void operator+=(const element*);
     72  void operator+=(key_type);
    7273  void operator+=(atomicNumber_t);
    7374  void operator+=(const std::string&);
    7475
    75   void operator-=(const element*);
     76  void operator-=(key_type);
    7677  void operator-=(atomicNumber_t);
    7778  void operator-=(const std::string&);
    7879
    79   void addElements(const element*,unsigned int);
     80  void addElements(key_type,unsigned int);
    8081  void addElements(atomicNumber_t,unsigned int);
    8182  void addElements(const std::string&,unsigned int);
    8283
     84  void addFormula(const Formula&,unsigned int);
     85
     86  enumeration<key_type> enumerateElements() const;
     87
    8388  // only const versions, because someone might try to increment a previously
    8489  // not set element
    85   const unsigned int operator[](const element*) const;
     90  const unsigned int operator[](key_type) const;
    8691  const unsigned int operator[](atomicNumber_t) const;
    8792  const unsigned int operator[](std::string)    const;
     
    98103
    99104private:
     105  void parseFromString(std::string::const_iterator&,std::string::const_iterator&,char) throw(ParseError);
     106  int parseMaybeNumber(std::string::const_iterator &it,std::string::const_iterator &end) throw(ParseError);
    100107  // this contains all counts of elements in the formula
    101108  // the size of the actual structure might be used in comparisons
  • src/Helpers/Assert.cpp

    rd74077 r8f4df1  
    55 *      Author: crueger
    66 */
    7 
    8 #include "Helpers/MemDebug.hpp"
    97
    108#include "Helpers/Assert.hpp"
     
    4644}
    4745
    48 using namespace Assert;
    49 
    5046#ifndef NDEBUG
    5147
    52 Action _my_assert::defaultAction = Ask;
    53 std::vector<Assert::hook_t> _my_assert::hooks;
     48#ifdef __GNUC__
     49#include <cstdlib>
     50#include <execinfo.h>
     51#include <cxxabi.h>
     52#endif
    5453
    55 std::map<std::string,bool> _wrapper::ignores;
    56 const char* _wrapper::message_ptr = "source pointer did not point to object of desired type";
    57 const char* _wrapper::message_ref = "source reference did not contain object of desired type";
     54Assert::Action Assert::_my_assert::defaultAction = Ask;
     55std::vector<Assert::hook_t> Assert::_my_assert::hooks;
    5856
     57std::map<std::string,bool> Assert::_wrapper::ignores;
     58const char* Assert::_wrapper::message_ptr = "source pointer did not point to object of desired type";
     59const char* Assert::_wrapper::message_ref = "source reference did not contain object of desired type";
    5960
    60 bool _my_assert::check(const bool res,
    61                        const char* condition,
    62                        const char* message,
    63                        const char* filename,
    64                        const int line,
    65                        bool& ignore)
     61bool Assert::_my_assert::check(const char* condition,
     62                               const char* message,
     63                               const char* filename,
     64                               const int line,
     65                               bool& ignore)
    6666{
    67   if(!res){
    68     cout << "Assertion \"" << condition << "\" failed in file " << filename << " at line " << line << endl;
    69     cout << "Assertion Message: " << message << std::endl;
    70     while(true){
    71       char choice;
    72       if(defaultAction==Ask) {
    73         cout << "Please choose: (a)bort, (t)hrow execption, (i)gnore, al(w)ays ignore" << endl;
    74         cin >> choice;
    75       }
    76       else{
    77         choice = ActionKeys[defaultAction];
    78       }
    79       switch(choice){
    80         case 'a':
    81           return true;
    82           break;
    83         case 't':
    84           throw AssertionFailure(condition,filename,line,message);
    85           break;
    86         case 'w':
    87           ignore = true;
    88           // fallthrough
    89         case 'i':
    90           return false;
    91           break;
    92       }
     67  cout << "Assertion \"" << condition << "\" failed in file " << filename << " at line " << line << endl;
     68  cout << "Assertion Message: " << message << std::endl;
     69  while(true){
     70    char choice;
     71    if(defaultAction==Assert::Ask) {
     72#ifdef __GNUC__
     73      cout << "Please choose: (a)bort, (t)hrow execption, show (b)actrace, (i)gnore, al(w)ays ignore" << endl;
     74#else
     75      cout << "Please choose: (a)bort, (t)hrow execption, (i)gnore, al(w)ays ignore" << endl;
     76#endif /* __GNUC__ */
     77      cin >> choice;
     78    }
     79    else{
     80      choice = ActionKeys[defaultAction];
     81    }
     82    switch(choice){
     83      case 'a':
     84        return true;
     85        break;
     86      case 't':
     87        throw AssertionFailure(condition,filename,line,message);
     88        break;
     89#ifdef __GNUC__
     90      case 'b':
     91        Assert::_my_assert::backtrace(filename,line);
     92       break;
     93#endif /* __GNUC__ */
     94      case 'w':
     95        ignore = true;
     96        // fallthrough
     97      case 'i':
     98        return false;
     99        break;
    93100    }
    94101  }
     
    96103}
    97104
    98 void _my_assert::doHooks(){
     105#ifdef __GNUC__
     106void Assert::_my_assert::backtrace(const char *file, int line){
     107  const size_t max_depth = 100;
     108  void* stack_addrs[max_depth];
     109  size_t stack_depth;
     110  char **stack_strings=0;
     111  const char *func_name=0;
     112  size_t sz = 64;
     113
     114  // get the backtrace
     115  stack_depth   = ::backtrace(stack_addrs,max_depth);
     116  stack_strings = backtrace_symbols(stack_addrs, stack_depth);
     117  // used later for demangling
     118  // reserved here, so we can free it unconditionally
     119  char *dm_function = static_cast<char*>(malloc(sz));
     120  if(!dm_function){
     121    // malloc failed... we are out of luck
     122    cout << "cannot provide stack trace due to exhausted memory" << endl;
     123    return;
     124  }
     125
     126  cout << "Backtrace from  " << file << "@" << line << ":" << endl;
     127
     128  // i=2 because we don't want this function, nor the assertion handler
     129  for(unsigned int i=2;i<stack_depth-2;++i){
     130    // find the mangled function name
     131    char *begin = stack_strings[i];
     132    // function name starts with a (
     133    while(*begin && *begin!='(') ++begin;
     134    char *end=begin;
     135    while(*end && *end!='+') ++end;
     136
     137    // see if we found our function name
     138    if(*begin && *end){
     139      *begin++ = 0;
     140      *end = 0;
     141      // use the C++ demangler
     142
     143      int status;
     144      char *func_ret = abi::__cxa_demangle(begin, dm_function, &sz, &status);
     145      if(func_ret){
     146        // abi might have realloced...
     147        dm_function = func_ret;
     148        func_name = dm_function;
     149      }
     150      else{
     151        // demangling failed... get the function name without demangling
     152        func_name = begin;
     153      }
     154    }
     155    else{
     156      // function name not found... get the whole line
     157      func_name = stack_strings[i];
     158    }
     159    cout << func_name << endl;
     160  }
     161  free(dm_function);
     162  free(stack_strings); // malloc()ed by backtrace_symbols
     163}
     164#endif /* __GNUC__ */
     165
     166void Assert::_my_assert::doHooks(){
    99167  for(vector<hook_t>::reverse_iterator iter = hooks.rbegin(); iter!=hooks.rend(); ++iter ){
    100168    (*iter)();
     
    102170}
    103171
    104 void _my_assert::addHook(hook_t hook){
     172void Assert::_my_assert::addHook(hook_t hook){
    105173  hooks.push_back(hook);
    106174}
    107175
    108 void _my_assert::removeHook(Assert::hook_t hook){
     176void Assert::_my_assert::removeHook(Assert::hook_t hook){
    109177  for(vector<hook_t>::iterator iter = hooks.begin(); iter!=hooks.end();){
    110178    if((*iter)==hook){
     
    117185}
    118186
    119 void _my_assert::setDefault(Assert::Action action){
     187void Assert::_my_assert::setDefault(Assert::Action action){
    120188  defaultAction = action;
    121189}
    122 Assert::Action _my_assert::getDefault(){
     190Assert::Action Assert::_my_assert::getDefault(){
    123191  return defaultAction;
    124192}
    125 std::string _my_assert::printDefault(){
     193std::string Assert::_my_assert::printDefault(){
    126194  return ActionNames[defaultAction];
    127195}
  • src/Helpers/Assert.hpp

    rd74077 r8f4df1  
    234234      static bool ignore = false;\
    235235      if(!ignore){\
    236         if(Assert::_my_assert::check((condition),STRINGIFY(condition),(message),\
    237                                      __FILE__,__LINE__,ignore)){\
     236        if(!(condition) && Assert::_my_assert::check(STRINGIFY(condition),(message),\
     237                                                     __FILE__,__LINE__,ignore)){\
    238238          Assert::_my_assert::doHooks();\
    239239          DEBUG_BREAK;\
     
    247247                  static bool ignore = false; \
    248248                  if(!ignore){\
    249                           if(Assert::_my_assert::check(false,"Exception caught",(message),__FILE__,__LINE__,ignore)){\
     249                          if(Assert::_my_assert::check("Exception caught",(message),__FILE__,__LINE__,ignore)){\
    250250                            Assert::_my_assert::doHooks();\
    251           DEBUG_BREAK;\
     251                            DEBUG_BREAK;\
    252252                          }\
    253253                  }\
     
    299299    class _my_assert{
    300300    public:
    301       static bool check(const bool res,
    302                         const char* condition,
     301      static bool check(const char* condition,
    303302                        const char* message,
    304303                        const char* filename,
    305304                        const int line,
    306305                        bool& ignore);
     306#ifdef __GNUC__
     307      static void backtrace(const char *file, int line);
     308#endif /* __GNUC__ */
    307309      static void addHook(Assert::hook_t hook);
    308310      static void removeHook(Assert::hook_t hook);
     
    332334
    333335      if(!ignore){
    334         if(_my_assert::check(dynamic_cast<target>(src)==static_cast<target>(src),"type-safe typecast",
    335                                        message_ptr,file,line,ignore)){
     336        bool res = dynamic_cast<target>(src)==static_cast<target>(src);
     337        if(!res && _my_assert::check("type-safe typecast",message_ptr,file,line,ignore)){
    336338          _my_assert::doHooks();
    337339          DEBUG_BREAK;
     
    354356      catch(...){
    355357        if(!ignore){
    356           if(_my_assert::check(0,"type-safe typecast",message_ref,file,line,ignore)){
     358          if(_my_assert::check("type-safe typecast",message_ref,file,line,ignore)){
    357359            _my_assert::doHooks();
    358360            DEBUG_BREAK;
  • src/Helpers/MemDebug.cpp

    rd74077 r8f4df1  
    7272  // all allocated memory blocks
    7373  struct entry_t {
     74    typedef unsigned int checksum_t;
    7475    // we seperate the tracking info from the rest
    7576    // A checksum will be calculated for this part of
     
    9091    } info;
    9192    bool isIgnored;
    92     char checksum;
     93    checksum_t checksum;
    9394    entry_t *prev;
    9495    entry_t *next;
     
    117118  // calculates a simple checksum for the info block
    118119  // the checksum is used to find memory corruptions
    119   inline char calcChecksum(entry_t::info_t *info){
     120  inline entry_t::checksum_t calcChecksum(entry_t::info_t *info){
    120121    char *buffer = (char*)info;
    121     char checksum =0;
     122    entry_t::checksum_t checksum =0;
    122123    for(size_t i=0;i<sizeof(entry_t::info_t);i++){
    123124      checksum+=buffer[i];
     
    154155      cout << "Chunk reserved at: " << pos->info.file << ":" << pos->info.line << endl;
    155156#endif
     157    }
     158  }
     159
     160  void dumpMemory(std::ostream &ost){
     161    ost << "Maximum allocated Memory: " << max << " bytes" << endl;
     162    ost << "Maximum allocated Memory: " << max << " bytes" << endl;
     163    ost << "Currently allocated Memory: " << state <<" bytes" << endl;
     164    ost << allocs << " allocated chunks total" << endl;
     165    bool corrupted=false;
     166    for(entry_t *pos=begin;pos;pos=pos->next){
     167      ost << "\nChunk of " << pos->info.nbytes << " bytes" << " still available" << endl;
     168#     ifdef __GNUC__
     169        ost << "Chunk reserved at: " << pos->info.function
     170             << " (" << pos->info.file << ":" << pos->info.line  << ")" << endl;
     171#     else
     172        ost << "Chunk reserved at: " << pos->info.file << ":" << pos->info.line << endl;
     173#     endif
     174        ost << "Chunk address: " << pos->info.location << endl;
     175        entry_t::checksum_t checksum = calcChecksum(&pos->info);
     176        ost << "Checksum of chunk: " << checksum << endl;
     177        ost << "Checksum at allocation time: " << pos->checksum << endl;
     178        if(checksum!=pos->checksum){
     179          ost << "!!!Chunk was corrupted!!!" << endl;
     180          corrupted=true;
     181        }
     182    }
     183    if(corrupted){
     184      ost << "\n!!!Memory corruption detected!!!" << endl;
    156185    }
    157186  }
  • src/Helpers/MemDebug.hpp

    rd74077 r8f4df1  
    6161   */
    6262  void getState();
     63  void dumpMemory(std::ostream&);
    6364
    6465  void _ignore(void*);
     
    100101
    101102#else
     103
     104#include <iosfwd>
     105
    102106// memory debugging was disabled
    103107
    104108namespace Memory {
    105   inline void getState(){}
     109  inline void getState(){};
     110
     111  inline void dumpMemory(std::ostream&){};
    106112
    107113  template <typename T>
  • src/Legacy/oldmenu.cpp

    rd74077 r8f4df1  
    2020#include "element.hpp"
    2121#include "ellipsoid.hpp"
    22 #include "helpers.hpp"
     22#include "Helpers/helpers.hpp"
    2323#include "leastsquaremin.hpp"
    2424#include "linkedcell.hpp"
    25 #include "log.hpp"
     25#include "Helpers/Log.hpp"
    2626#include "memoryusageobserverunittest.hpp"
    2727#include "molecule.hpp"
    2828#include "periodentafel.hpp"
    2929#include "vector_ops.hpp"
    30 #include "Plane.hpp"
    31 #include "Line.hpp"
     30#include "LinearAlgebra/Plane.hpp"
     31#include "LinearAlgebra/Line.hpp"
    3232
    3333#include "UIElements/UIFactory.hpp"
  • src/Makefile.am

    rd74077 r8f4df1  
    22# Also indentation by a single tab
    33
    4 SUBDIRS = Actions UIElements
    5 
    6 # this includes source files that need to be present at multiple points
    7 HELPERSOURCE =  \
    8   Helpers/Assert.cpp \
    9   Helpers/MemDebug.cpp
    10                        
     4SUBDIRS = Actions Exceptions Helpers LinearAlgebra Parser UIElements
     5
    116ATOMSOURCE = \
    127  atom.cpp \
     
    3025  atom_trajectoryparticleinfo.hpp
    3126
    32 LINALGSOURCE = \
    33   ${HELPERSOURCE} \
    34   gslmatrix.cpp \
    35   gslvector.cpp \
    36   linearsystemofequations.cpp \
    37   Space.cpp \
    38   vector.cpp
    39                            
    40 LINALGHEADER = \
    41   gslmatrix.hpp \
    42   gslvector.hpp \
    43   linearsystemofequations.hpp \
    44   Space.hpp \
    45   vector.hpp
    46                            
    4727ANALYSISSOURCE = \
    4828  analysis_bonds.cpp \
     
    7656  Actions/MethodAction.hpp \
    7757  Actions/Process.hpp
    78 
    79 EXCEPTIONSOURCE = \
    80   Exceptions/CustomException.cpp \
    81   Exceptions/IllegalTypeException.cpp \
    82   Exceptions/LinearDependenceException.cpp \
    83   Exceptions/MathException.cpp \
    84   Exceptions/MissingValueException.cpp \
    85   Exceptions/NotInvertibleException.cpp \
    86   Exceptions/ParseError.cpp \
    87   Exceptions/SkewException.cpp \
    88   Exceptions/ZeroVectorException.cpp
    89                                  
    90 EXCEPTIONHEADER = \
    91   Exceptions/CustomException.hpp \
    92   Exceptions/IllegalTypeException.hpp \
    93   Exceptions/LinearDependenceException.hpp \
    94   Exceptions/MathException.hpp \
    95   Exceptions/MissingValueException.hpp \
    96   Exceptions/NotInvertibleException.hpp \
    97   Exceptions/ParseError.hpp \
    98   Exceptions/SkewException.hpp \
    99   Exceptions/ZeroVectorException.hpp
    100 
    101 PARSERSOURCE = \
    102   Parser/ChangeTracker.cpp \
    103   Parser/FormatParser.cpp \
    104   Parser/FormatParserStorage.cpp \
    105   Parser/MpqcParser.cpp \
    106   Parser/PcpParser.cpp \
    107   Parser/TremoloParser.cpp \
    108   Parser/XyzParser.cpp
    109 
    110 PARSERHEADER = \
    111   Parser/ChangeTracker.hpp \
    112   Parser/FormatParser.hpp \
    113   Parser/FormatParserStorage.hpp \
    114   Parser/MpqcParser.hpp \
    115   Parser/PcpParser.hpp \
    116   Parser/TremoloParser.hpp \
    117   Parser/XyzParser.hpp
    11858
    11959PATTERNSOURCE = \
     
    13272  Shapes/Shape.hpp \
    13373  Shapes/ShapeOps.hpp
     74
    13475 
    135 
    136 QTUIMOC_HEADER = UIElements/QT4/QTDialog.hpp \
    137         UIElements/QT4/QTMainWindow.hpp \
    138         UIElements/Menu/QT4/QTMenu.hpp \
    139         UIElements/Views/QT4/QTWorldView.hpp \
    140         UIElements/Views/QT4/GLMoleculeView.hpp \
    141         UIElements/Views/QT4/QTMoleculeView.hpp \
    142         UIElements/Views/QT4/QTStatusBar.hpp
    143  
    144 QTUIMOC_TARGETS = QTMainWindow.moc.cpp \
    145         QTMenu.moc.cpp\
    146         QTDialog.moc.cpp \
    147         QTWorldView.moc.cpp \
    148         GLMoleculeView.moc.cpp \
    149         QTMoleculeView.moc.cpp \
    150         QTStatusBar.moc.cpp
    151 
    15276DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \
    15377  Descriptors/AtomIdDescriptor.cpp \
     
    17296  Descriptors/MoleculePtrDescriptor.hpp \
    17397  Descriptors/MoleculeSelectionDescriptor.cpp
     98
     99
     100QTUIMOC_HEADER = UIElements/QT4/QTDialog.hpp \
     101        UIElements/QT4/QTMainWindow.hpp \
     102        UIElements/Menu/QT4/QTMenu.hpp \
     103        UIElements/Views/QT4/QTWorldView.hpp \
     104        UIElements/Views/QT4/GLMoleculeView.hpp \
     105        UIElements/Views/QT4/QTMoleculeView.hpp \
     106        UIElements/Views/QT4/QTStatusBar.hpp
    174107                                 
    175 QTUISOURCE = ${QTUIMOC_TARGETS} \
     108QTUISOURCE = allmocs.moc.cpp \
    176109        UIElements/QT4/QTMainWindow.cpp \
    177110        UIElements/QT4/QTDialog.cpp \
     
    195128  PointCloud.cpp \
    196129  tesselation.cpp \
     130  tesselationhelpers.cpp \
    197131  TesselPoint.cpp
    198132 
     
    205139  PointCloud.hpp \
    206140  tesselation.hpp \
     141  tesselationhelpers.hpp \
    207142  TesselPoint.hpp
    208143
    209 SOURCE = \
     144MOLECUILDERSOURCE = \
    210145  ${ANALYSISSOURCE} \
    211146  ${ACTIONSSOURCE} \
    212147  ${ATOMSOURCE} \
    213   ${EXCEPTIONSOURCE} \
    214148  ${PATTERNSOURCE} \
    215   ${PARSERSOURCE} \
    216149  ${SHAPESOURCE} \
    217150  ${DESCRIPTORSOURCE} \
    218   ${HELPERSOURCE} \
    219151  ${TESSELATIONSOURCE} \
    220152  bond.cpp \
     
    228160  elements_db.cpp \
    229161  ellipsoid.cpp \
    230   errorlogger.cpp \
    231162  Formula.cpp \
    232163  graph.cpp \
    233   helpers.cpp \
    234   info.cpp \
    235164  leastsquaremin.cpp \
    236   Line.cpp \
    237165  linkedcell.cpp \
    238   log.cpp \
    239   logger.cpp \
    240   Matrix.cpp \
    241166  moleculelist.cpp \
    242167  molecule.cpp \
     
    248173  parser.cpp \
    249174  periodentafel.cpp \
    250   Plane.cpp \
    251   Space.cpp \
    252   tesselation.cpp \
    253   tesselationhelpers.cpp \
    254175  ThermoStatContainer.cpp \
    255176  triangleintersectionlist.cpp \
    256   vector.cpp \
    257   vector_ops.cpp \
    258   VectorInterface.cpp \
    259   verbose.cpp \
     177  UIElements/UIFactory.cpp \
    260178  World.cpp
    261179
    262 HEADER = \
     180MOLECUILDERHEADER = \
    263181  ${ANALYSISHEADER} \
    264182  ${ACTIONSHEADER} \
    265183  ${ATOMHEADER} \
    266   ${EXCEPTIONHEADER} \
    267   ${PARSERHEADER} \
    268184  ${PATTERNHEADER} \
    269185  ${SHAPEHEADER} \
     
    281197  elements_db.hpp \
    282198  ellipsoid.hpp \
    283   errorlogger.hpp \
    284199  Formula.hpp \
    285200  graph.hpp \
    286   helpers.hpp \
    287   info.hpp \
    288201  leastsquaremin.hpp \
    289   Line.hpp \
    290202  linkedcell.hpp \
    291203  lists.hpp \
    292   log.hpp \
    293   logger.hpp \
    294   Matrix.hpp \
    295204  molecule.hpp \
    296205  molecule_template.hpp \
    297206  parser.hpp \
    298207  periodentafel.hpp \
    299   Plane.hpp \
    300208  stackclass.hpp \
    301   tesselation.hpp \
    302   tesselationhelpers.hpp \
    303209  ThermoStatContainer.hpp \
    304210  triangleintersectionlist.hpp \
    305   verbose.hpp \
    306   vector_ops.hpp \
    307   VectorInterface.hpp \
     211  UIElements/UIFactory.hpp \
    308212  World.hpp
    309213
    310 # the following files are no longer used:
    311 #  memoryallocator.hpp \
    312 #  memoryallocator.cpp \
    313 #  memoryusageobserver.hpp \
    314 #  memoryusageobserver.cpp
     214lib_LTLIBRARIES = libMolecuilder-@MOLECUILDER_API_VERSION@.la
     215libMolecuilder_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
     216libMolecuilder_LIBS = \
     217        LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
     218        ${BOOST_PROGRAM_OPTIONS_LIB}
     219
     220#       UIElements/libMolecuilderUI.a \
     221        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
     222        Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
     223        Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
     224        Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
     225        $(BOOST_LIB) \
     226        ${BOOST_THREAD_LIB}
     227
     228nobase_libMolecuilder_include_HEADERS = ${MOLECUILDERHEADER}
     229
     230## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
     231## target.  Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and
     232## will therefore be treated as if it were literally part of the target name,
     233## and the variable name derived from that.
     234## The file extension .cc is recognized by Automake, and makes it produce
     235## rules which invoke the C++ compiler to produce a libtool object file (.lo)
     236## from each source file.  Note that it is not necessary to list header files
     237## which are already listed elsewhere in a _HEADERS variable assignment.
     238libMolecuilder_@MOLECUILDER_API_VERSION@_la_SOURCES = ${MOLECUILDERSOURCE} $(srcdir)/version.c
     239
     240## Instruct libtool to include ABI version information in the generated shared
     241## library file (.so).  The library ABI version is defined in configure.ac, so
     242## that all version information is kept in one place.
     243libMolecuilder_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
     244
     245## The generated configuration header is installed in its own subdirectory of
     246## $(libdir).  The reason for this is that the configuration information put
     247## into this header file describes the target platform the installed library
     248## has been built for.  Thus the file must not be installed into a location
     249## intended for architecture-independent files, as defined by the Filesystem
     250## Hierarchy Standard (FHS).
     251## The nodist_ prefix instructs Automake to not generate rules for including
     252## the listed files in the distribution on 'make dist'.  Files that are listed
     253## in _HEADERS variables are normally included in the distribution, but the
     254## configuration header file is generated at configure time and should not be
     255## shipped with the source tarball.
     256libMolecuilder_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include
     257nodist_libMolecuilder_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
     258
     259## Install the generated pkg-config file (.pc) into the expected location for
     260## architecture-dependent package configuration information.  Occasionally,
     261## pkg-config files are also used for architecture-independent data packages,
     262## in which case the correct install location would be $(datadir)/pkgconfig.
     263pkgconfigdir = $(libdir)/pkgconfig
     264pkgconfig_DATA = $(top_builddir)/molecuilder-$(MOLECUILDER_API_VERSION).pc
     265
    315266
    316267BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
     
    318269INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements
    319270
    320 noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a libmenu.a libparser.a
     271noinst_LIBRARIES = libmenu.a
    321272bin_PROGRAMS = molecuilder molecuildergui joiner analyzer
     273EXTRA_PROGRAMS = unity
    322274
    323275molecuilderdir = ${bindir}
    324276
    325 libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
    326 
    327277libmenu_a_SOURCES = ${UISOURCE} ${UIHEADER}
    328 libparser_a_SOURCES = ${PARSERSOURCE} ${PARSERHEADER}
    329 libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER}
    330278
    331279molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db
     
    334282#molecuilder_CXXFLAGS += -DNO_CACHING
    335283molecuilder_LDFLAGS = $(BOOST_LIB)
    336 molecuilder_SOURCES = ${LEGACYSOURCE} builder.cpp
    337 molecuilder_SOURCES += $(srcdir)/version.c
    338 molecuilder_LDADD = UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libparser.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
     284molecuilder_SOURCES = builder.cpp
     285molecuilder_LDADD = \
     286        UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
     287        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
     288        libMolecuilder-@MOLECUILDER_API_VERSION@.la \
     289        Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
     290        LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
     291        Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
     292        Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
     293        $(BOOST_LIB) \
     294        ${BOOST_THREAD_LIB} \
     295        ${BOOST_PROGRAM_OPTIONS_LIB}
     296
    339297
    340298#Stuff for building the GUI using QT
    341 molecuildergui_SOURCES = ${QTUISOURCE} ${LEGACYSOURCE} builder.cpp
    342 molecuildergui_SOURCES += $(srcdir)/version.c
     299molecuildergui_SOURCES = ${QTUISOURCE} builder.cpp
    343300molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT
    344301molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS} ${GLU_LDFLAGS}
    345 molecuildergui_LDADD = UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libparser.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}  ${GUI_LIBS}
    346 
    347 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
    348 joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
    349 
    350 analyzer_SOURCES = analyzer.cpp datacreator.cpp parser.cpp helpers.hpp periodentafel.hpp parser.hpp datacreator.hpp
    351 analyzer_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
     302
     303unity_SOURCES = unity.cpp
     304unity_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
     305
     306molecuildergui_LDADD = \
     307        UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
     308        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
     309        libMolecuilder-@MOLECUILDER_API_VERSION@.la \
     310        Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
     311        LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
     312        Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
     313        Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
     314        $(BOOST_LIB) \
     315        ${BOOST_THREAD_LIB} \
     316        ${BOOST_PROGRAM_OPTIONS_LIB} \
     317        ${GUI_LIBS}
     318
     319joiner_SOURCES = joiner.cpp datacreator.cpp datacreator.hpp periodentafel.hpp
     320joiner_LDADD = \
     321        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
     322        libMolecuilder-@MOLECUILDER_API_VERSION@.la \
     323        Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
     324        LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
     325        Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
     326        Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
     327        $(BOOST_LIB) \
     328        ${BOOST_THREAD_LIB} \
     329        ${BOOST_PROGRAM_OPTIONS_LIB}
     330
     331analyzer_SOURCES = analyzer.cpp datacreator.cpp periodentafel.hpp datacreator.hpp
     332analyzer_LDADD = \
     333        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
     334        libMolecuilder-@MOLECUILDER_API_VERSION@.la \
     335        Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
     336        LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
     337        Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
     338        Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
     339        $(BOOST_LIB) \
     340        ${BOOST_THREAD_LIB} \
     341        ${BOOST_PROGRAM_OPTIONS_LIB}
    352342
    353343#Rules needed for QT4
     
    355345# Therfore `%'-rules do not seem to work
    356346#Quick fix to get it done otherwise
    357 ${QTUIMOC_TARGETS}: ${QTUIMOC_HEADER}
     347allmocs.moc.cpp: ${QTUIMOC_HEADER}
     348        echo "" > allmocs.moc.cpp;\
    358349        list='$(QTUIMOC_HEADER)'; for header in $$list; do \
    359350        echo "Making mocfile for $$header"; \
     
    361352        $(MOC) $(srcdir)/$$header -o $$target \
    362353        || eval $$failcom; \
     354        echo "#include \"$$target\"" >> allmocs.moc.cpp; \
    363355        done;
    364356
    365 MOSTLYCLEANFILES = ${QTUIMOC_TARGETS}
    366        
    367357#EXTRA_DIST = ${molecuilder_DATA}
    368358
     
    383373
    384374
     375unity.cpp: ${MOLECUILDERSOURCE} ${MOLECUILDERHEADER}
     376        echo "" >  unity.cpp; \
     377        list='$(MOLECUILDERSOURCE)'; for file in $$list; do \
     378          echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \
     379        done; \
     380        subdirs='$(SUBDIRS)';for directory in $$subdirs; do\
     381                olddir=$$PWD;\
     382                cd $$directory && make unity.cpp;\
     383                cd $$olddir;\
     384                echo "#include \"$$directory/unity.cpp\"" >> unity.cpp;\
     385        done;\
     386        echo "#include \"$(srcdir)/builder.cpp\"" >> unity.cpp;
     387        echo "#include \"$(srcdir)/version.c\"" >> unity.cpp;
     388
     389MOSTLYCLEANFILES = allmocs.moc.cpp unity.cpp
     390       
  • src/Parser/ChangeTracker.cpp

    rd74077 r8f4df1  
    99#include "Parser/ChangeTracker.hpp"
    1010#include "Patterns/Singleton_impl.hpp"
    11 
     11#include "Helpers/Log.hpp"
     12#include "Helpers/Verbose.hpp"
    1213
    1314/**
     
    4950 */
    5051void ChangeTracker::saveStatus() {
     52  DoLog(0) && (Log() << Verbose(0) << "Saving changes." << std::endl);
    5153  if (hasChanged()) {
    5254    notifyAll();
  • src/Parser/FormatParserStorage.cpp

    rd74077 r8f4df1  
    1717#include "Parser/XyzParser.hpp"
    1818
    19 #include "log.hpp"
    20 #include "verbose.hpp"
     19#include "Helpers/Log.hpp"
     20#include "Helpers/Verbose.hpp"
    2121
    2222#include "Helpers/Assert.hpp"
  • src/Parser/MpqcParser.cpp

    rd74077 r8f4df1  
    1111#include "config.hpp"
    1212#include "element.hpp"
    13 #include "log.hpp"
     13#include "Helpers/Log.hpp"
     14#include "Helpers/Verbose.hpp"
     15#include "LinearAlgebra/Vector.hpp"
    1416#include "periodentafel.hpp"
    15 #include "vector.hpp"
    16 #include "verbose.hpp"
    1717#include "World.hpp"
    1818
     
    4343void MpqcParser::save(ostream *file)
    4444{
     45  DoLog(0) && (Log() << Verbose(0) << "Saving changes to MPQC ." << std::endl);
     46
    4547  if (HessianPresent)
    4648    saveHessian(file);
  • src/Parser/PcpParser.cpp

    rd74077 r8f4df1  
    1414#include "element.hpp"
    1515#include "Helpers/Assert.hpp"
    16 #include "log.hpp"
     16#include "Helpers/Log.hpp"
     17#include "Helpers/Verbose.hpp"
     18#include "LinearAlgebra/Matrix.hpp"
    1719#include "molecule.hpp"
    1820#include "PcpParser.hpp"
    1921#include "periodentafel.hpp"
    2022#include "ThermoStatContainer.hpp"
    21 #include "verbose.hpp"
    2223#include "World.hpp"
    23 #include "Matrix.hpp"
    2424#include "Box.hpp"
    2525
     
    332332void PcpParser::save(std::ostream* file)
    333333{
     334  DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl);
     335
    334336  const Matrix &domain = World::getInstance().getDomain().getM();
    335337  class ThermoStatContainer *Thermostats = World::getInstance().getThermostats();
  • src/Parser/TremoloParser.cpp

    rd74077 r8f4df1  
    99
    1010#include "Helpers/Assert.hpp"
     11#include "Helpers/Log.hpp"
     12#include "Helpers/Verbose.hpp"
    1113#include "TremoloParser.hpp"
    1214#include "World.hpp"
     
    2123
    2224using namespace std;
    23 using namespace boost;
    2425
    2526/**
     
    99100 */
    100101void TremoloParser::save(ostream* file) {
     102  DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl);
     103
    101104  vector<atom*>::iterator atomIt;
    102105  vector<string>::iterator it;
  • src/Parser/XyzParser.cpp

    rd74077 r8f4df1  
    88#include "Helpers/MemDebug.hpp"
    99
     10#include "Helpers/Log.hpp"
     11#include "Helpers/Verbose.hpp"
    1012#include "XyzParser.hpp"
    1113#include "World.hpp"
    1214#include "atom.hpp"
     15#include "molecule.hpp"
    1316#include "element.hpp"
    1417#include "periodentafel.hpp"
     
    3538 */
    3639void XyzParser::load(istream* file) {
    37   atom* newAtom;
     40  atom* newAtom = NULL;
     41  molecule* newmol = NULL;
    3842  int numberOfAtoms;
    3943  char commentBuffer[512], type[3];
     
    4549  comment = commentBuffer;
    4650
     51  newmol = World::getInstance().createMolecule();
     52  newmol->ActiveFlag = true;
     53  World::getInstance().getMolecules()->insert(newmol);
    4754  for (int i = 0; i < numberOfAtoms; i++) {
    4855    newAtom = World::getInstance().createAtom();
     
    5360    }
    5461    newAtom->setType(World::getInstance().getPeriode()->FindElement(type));
     62    newmol->AddAtom(newAtom);
    5563  }
    5664}
     
    6270 */
    6371void XyzParser::save(ostream* file) {
     72  DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl);
    6473  if (comment == "") {
    6574    time_t now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
  • src/Patterns/Registry_impl.hpp

    rd74077 r8f4df1  
    1515
    1616#include "Helpers/Assert.hpp"
    17 #include <iostream>
     17#include <iosfwd>
    1818
    1919/** Constructor for class Registry.
  • src/Shapes/BaseShapes.cpp

    rd74077 r8f4df1  
    99#include "Shapes/BaseShapes_impl.hpp"
    1010
    11 #include "vector.hpp"
     11#include "LinearAlgebra/Vector.hpp"
    1212
    1313bool Sphere_impl::isInside(const Vector &point){
  • src/Shapes/ShapeOps_impl.hpp

    rd74077 r8f4df1  
    1010
    1111#include "Shapes/Shape_impl.hpp"
    12 #include "vector.hpp"
    13 #include "Matrix.hpp"
     12#include "LinearAlgebra/Vector.hpp"
     13#include "LinearAlgebra/Matrix.hpp"
    1414
    1515class Resize_impl :  public Shape_impl
  • src/ThermoStatContainer.cpp

    rd74077 r8f4df1  
    1010#include "ConfigFileBuffer.hpp"
    1111#include "config.hpp"
    12 #include "log.hpp"
     12#include "Helpers/Log.hpp"
    1313#include "ThermoStatContainer.hpp"
    14 #include "verbose.hpp"
     14#include "Helpers/Verbose.hpp"
    1515
    1616/** Constructor for class ThermoStatContainer.
  • src/UIElements/CommandLineUI/CommandLineDialog.cpp

    rd74077 r8f4df1  
    2323#include "CommandLineParser.hpp"
    2424#include "defs.hpp"
    25 #include "log.hpp"
    26 #include "Matrix.hpp"
     25#include "Helpers/Log.hpp"
     26#include "LinearAlgebra/Matrix.hpp"
    2727#include "periodentafel.hpp"
    28 #include "verbose.hpp"
     28#include "Helpers/Verbose.hpp"
    2929#include "World.hpp"
    3030#include "Box.hpp"
     
    3333#include "element.hpp"
    3434#include "molecule.hpp"
    35 #include "vector.hpp"
     35#include "LinearAlgebra/Vector.hpp"
    3636
    3737using namespace std;
  • src/UIElements/Dialog.cpp

    rd74077 r8f4df1  
    99
    1010#include "Dialog.hpp"
    11 #include "ValueStorage.hpp"
    12 
    13 #include "verbose.hpp"
     11#include "Actions/ValueStorage.hpp"
     12
     13#include "Helpers/Verbose.hpp"
    1414#include "atom.hpp"
    1515#include "element.hpp"
    1616#include "molecule.hpp"
    17 #include "vector.hpp"
    18 #include "Matrix.hpp"
     17#include "LinearAlgebra/Vector.hpp"
     18#include "LinearAlgebra/Matrix.hpp"
    1919#include "Box.hpp"
    2020
     
    6868}
    6969
     70bool Dialog::hasQueries(){
     71  return queries.size();
     72}
     73
    7074/****************** Query types Infrastructure **************************/
    7175
  • src/UIElements/Dialog.hpp

    rd74077 r8f4df1  
    1414
    1515#include "Box.hpp"
    16 #include "vector.hpp"
     16#include "LinearAlgebra/Vector.hpp"
    1717
    1818class atom;
     
    6161  virtual void setAll();
    6262
     63  virtual bool hasQueries();
     64
    6365protected:
    6466  // methodology for handling queries
  • src/UIElements/Makefile.am

    rd74077 r8f4df1  
    55AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl
    66AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
    7 
    8 noinst_LIBRARIES = libMolecuilderUI.a
    9 libMolecuilderUI_a_SOURCES = ${UISOURCE} ${UIHEADER}
    107
    118VIEWSOURCE = \
     
    4542  ${VIEWSOURCE} \
    4643  Dialog.cpp \
    47   MainWindow.cpp \
    48   UIFactory.cpp \
    49   ValueStorage.cpp
     44  MainWindow.cpp
    5045 
    5146UIHEADER = \
     
    5651  ${VIEWHEADER} \
    5752  Dialog.hpp \
    58   MainWindow.hpp \
    59   UIFactory.hpp \
    60   ValueStorage.hpp
     53  MainWindow.hpp
    6154
    6255TEXTUISOURCE = \
     
    8275  CommandLineUI/CommandLineWindow.hpp
    8376
     77lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la
     78libMolecuilderUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
     79libMolecuilderUI_LIBS = \
     80        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la
    8481
     82nobase_libMolecuilderUI_include_HEADERS = ${UIHEADER}
     83
     84## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
     85## target.  Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and
     86## will therefore be treated as if it were literally part of the target name,
     87## and the variable name derived from that.
     88## The file extension .cc is recognized by Automake, and makes it produce
     89## rules which invoke the C++ compiler to produce a libtool object file (.lo)
     90## from each source file.  Note that it is not necessary to list header files
     91## which are already listed elsewhere in a _HEADERS variable assignment.
     92libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${UISOURCE}
     93
     94## Instruct libtool to include ABI version information in the generated shared
     95## library file (.so).  The library ABI version is defined in configure.ac, so
     96## that all version information is kept in one place.
     97libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
     98
     99## The generated configuration header is installed in its own subdirectory of
     100## $(libdir).  The reason for this is that the configuration information put
     101## into this header file describes the target platform the installed library
     102## has been built for.  Thus the file must not be installed into a location
     103## intended for architecture-independent files, as defined by the Filesystem
     104## Hierarchy Standard (FHS).
     105## The nodist_ prefix instructs Automake to not generate rules for including
     106## the listed files in the distribution on 'make dist'.  Files that are listed
     107## in _HEADERS variables are normally included in the distribution, but the
     108## configuration header file is generated at configure time and should not be
     109## shipped with the source tarball.
     110libMolecuilderUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include
     111nodist_libMolecuilderUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
     112
     113## Install the generated pkg-config file (.pc) into the expected location for
     114## architecture-dependent package configuration information.  Occasionally,
     115## pkg-config files are also used for architecture-independent data packages,
     116## in which case the correct install location would be $(datadir)/pkgconfig.
     117pkgconfigdir = $(libdir)/pkgconfig
     118pkgconfig_DATA = $(top_builddir)/molecuilder-$(MOLECUILDER_API_VERSION).pc
     119
     120unity.cpp:
     121        echo "" >  unity.cpp; \
     122        list='$(UISOURCE)'; for file in $$list; do \
     123          echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \
     124        done;
     125       
     126MOSTLYCLEANFILES = unity.cpp
  • src/UIElements/Menu/TextMenu.cpp

    rd74077 r8f4df1  
    127127}
    128128
    129 Dialog* TextMenu::LeaveAction::createDialog(){
     129Dialog* TextMenu::LeaveAction::fillDialog(Dialog *dialog){
     130  ASSERT(dialog,"No Dialog given when filling action dialog");
     131  return dialog;
    130132}
    131133
  • src/UIElements/Menu/TextMenu.hpp

    rd74077 r8f4df1  
    1010
    1111#include <list>
    12 #include <ostream>
     12#include <iosfwd>
    1313#include <string>
    1414
     
    3535    bool shouldUndo();
    3636
     37  protected:
     38    virtual Dialog* fillDialog(Dialog *dialog);
    3739  private:
    38     virtual Dialog* createDialog();
    3940    virtual Action::state_ptr performCall();
    4041    virtual Action::state_ptr performUndo(Action::state_ptr);
  • src/UIElements/QT4/QTDialog.cpp

    rd74077 r8f4df1  
    2424#include <Qt/qcombobox.h>
    2525
     26#include <boost/lexical_cast.hpp>
     27
    2628#include "Helpers/MemDebug.hpp"
    2729
     
    3335#include "Descriptors/AtomIdDescriptor.hpp"
    3436#include "Descriptors/MoleculeIdDescriptor.hpp"
    35 #include "Matrix.hpp"
     37#include "LinearAlgebra/Matrix.hpp"
    3638#include "Box.hpp"
    3739
  • src/UIElements/QT4/QTMainWindow.cpp

    rd74077 r8f4df1  
    2121#include "atom.hpp"
    2222#include "molecule.hpp"
    23 #include "verbose.hpp"
     23#include "Helpers/Verbose.hpp"
    2424#include "Actions/Action.hpp"
    2525#include "Actions/ActionRegistry.hpp"
  • src/UIElements/TextUI/TextDialog.cpp

    rd74077 r8f4df1  
    1414#include <Descriptors/MoleculeDescriptor.hpp>
    1515#include <Descriptors/MoleculeIdDescriptor.hpp>
     16#include <boost/lexical_cast.hpp>
    1617#include "TextUI/TextDialog.hpp"
    1718
    1819#include "World.hpp"
    1920#include "periodentafel.hpp"
    20 #include "log.hpp"
    21 #include "verbose.hpp"
     21#include "Helpers/Log.hpp"
     22#include "Helpers/Verbose.hpp"
    2223
    2324#include "atom.hpp"
    2425#include "element.hpp"
    2526#include "molecule.hpp"
    26 #include "vector.hpp"
    27 #include "Matrix.hpp"
     27#include "LinearAlgebra/Vector.hpp"
     28#include "LinearAlgebra/Matrix.hpp"
    2829#include "Box.hpp"
    2930
  • src/UIElements/TextUI/TextWindow.cpp

    rd74077 r8f4df1  
    2525#include "Views/StreamStringView.hpp"
    2626#include "Views/MethodStringView.hpp"
    27 #include "Helpers/MemDebug.hpp"
    2827
    2928#include "defs.hpp"
    30 #include "log.hpp"
    31 #include "verbose.hpp"
     29#include "Helpers/Log.hpp"
     30#include "Helpers/Verbose.hpp"
    3231
    3332// all needed due to config::SaveAll()
  • src/UIElements/Views/QT4/QTStatusBar.cpp

    rd74077 r8f4df1  
    1414#include "QTStatusBar.hpp"
    1515#include "World.hpp"
    16 #include "helpers.hpp"
     16#include "Helpers/helpers.hpp"
    1717#include "Actions/Process.hpp"
    1818
  • src/World.cpp

    rd74077 r8f4df1  
    2525#include "Helpers/Assert.hpp"
    2626#include "Box.hpp"
    27 #include "Matrix.hpp"
     27#include "LinearAlgebra/Matrix.hpp"
    2828#include "defs.hpp"
    2929
     
    3232
    3333using namespace std;
     34
     35const unsigned int MAX_POOL_FRAGMENTATION=20;
     36const unsigned int MAX_FRAGMENTATION_SKIPS=100;
    3437
    3538/******************************* getter and setter ************************/
     
    4851}
    4952
    50 vector<atom*> World::getAllAtoms(AtomDescriptor descriptor){
     53World::AtomComposite World::getAllAtoms(AtomDescriptor descriptor){
    5154  return descriptor.findAll();
    5255}
    5356
    54 vector<atom*> World::getAllAtoms(){
     57World::AtomComposite World::getAllAtoms(){
    5558  return getAllAtoms(AllAtoms());
    5659}
     
    718721  delete cell_size;
    719722  delete molecules_deprecated;
    720   delete periode;
    721   delete configuration;
    722   delete Thermostats;
    723723  MoleculeSet::iterator molIter;
    724724  for(molIter=molecules.begin();molIter!=molecules.end();++molIter){
     
    731731  }
    732732  atoms.clear();
     733  delete periode;
     734  delete configuration;
     735  delete Thermostats;
    733736}
    734737
  • src/World.hpp

    rd74077 r8f4df1  
    2525#include "Patterns/ObservedContainer.hpp"
    2626#include "Helpers/Range.hpp"
     27#include "AtomSet.hpp"
    2728
    2829// include config.h
     
    7677  typedef ObservedContainer<std::map<moleculeId_t,molecule*> > MoleculeSet;
    7778
     79  typedef ATOMSET(std::vector) AtomComposite;
     80
    7881  /***** getter and setter *****/
    7982  // reference to pointer is used for legacy reason... reference will be removed latter to keep encapsulation of World object
     
    97100   * returns a vector containing all atoms that match a given descriptor
    98101   */
    99   std::vector<atom*> getAllAtoms(AtomDescriptor descriptor);
    100   std::vector<atom*> getAllAtoms();
     102  AtomComposite getAllAtoms(AtomDescriptor descriptor);
     103  AtomComposite getAllAtoms();
    101104
    102105  /**
  • src/analysis_bonds.cpp

    rd74077 r8f4df1  
    1212#include "bond.hpp"
    1313#include "element.hpp"
    14 #include "info.hpp"
    15 #include "verbose.hpp"
    16 #include "log.hpp"
     14#include "Helpers/Info.hpp"
     15#include "Helpers/Verbose.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "molecule.hpp"
    1818
  • src/analysis_correlation.cpp

    rd74077 r8f4df1  
    1414#include "analysis_correlation.hpp"
    1515#include "element.hpp"
    16 #include "info.hpp"
    17 #include "log.hpp"
     16#include "Helpers/Info.hpp"
     17#include "Helpers/Log.hpp"
    1818#include "molecule.hpp"
    1919#include "tesselation.hpp"
    2020#include "tesselationhelpers.hpp"
    2121#include "triangleintersectionlist.hpp"
    22 #include "vector.hpp"
    23 #include "Matrix.hpp"
    24 #include "verbose.hpp"
     22#include "LinearAlgebra/Vector.hpp"
     23#include "LinearAlgebra/Matrix.hpp"
     24#include "Helpers/Verbose.hpp"
    2525#include "World.hpp"
    2626#include "Box.hpp"
  • src/analysis_correlation.hpp

    rd74077 r8f4df1  
    2727
    2828#include "atom.hpp"
    29 #include "helpers.hpp"
    30 #include "log.hpp"
    31 #include "verbose.hpp"
     29#include "Helpers/Verbose.hpp"
    3230
    3331/****************************************** forward declarations *****************************/
  • src/analyzer.cpp

    rd74077 r8f4df1  
    1313
    1414#include "datacreator.hpp"
    15 #include "helpers.hpp"
     15#include "Helpers/helpers.hpp"
    1616#include "parser.hpp"
    1717#include "periodentafel.hpp"
    18 #include "verbose.hpp"
     18#include "Helpers/Verbose.hpp"
    1919
    2020// include config.h
  • src/atom.cpp

    rd74077 r8f4df1  
    1313#include "lists.hpp"
    1414#include "parser.hpp"
    15 #include "vector.hpp"
     15#include "LinearAlgebra/Vector.hpp"
    1616#include "World.hpp"
    1717#include "molecule.hpp"
     
    1919
    2020#include <iomanip>
     21#include <iostream>
    2122
    2223/************************************* Functions for class atom *************************************/
     
    105106};
    106107
     108bool atom::isFather(const atom *ptr){
     109  return ptr==father;
     110}
     111
    107112/** Checks whether atom is within the given box.
    108113 * \param offset offset to box origin
     
    157162  * \return true - \a *out present, false - \a *out is NULL
    158163 */
    159 bool atom::OutputArrayIndexed(ostream * const out, const int *ElementNo, int *AtomNo, const char *comment) const
     164bool atom::OutputArrayIndexed(ostream * const out,const enumeration<const element*> &elementLookup, int *AtomNo, const char *comment) const
    160165{
    161166  AtomNo[getType()->Z]++;  // increment number
    162167  if (out != NULL) {
    163     *out << "Ion_Type" << ElementNo[getType()->Z] << "_" << AtomNo[getType()->Z] << "\t"  << fixed << setprecision(9) << showpoint;
     168    const element *elemental = getType();
     169    cout << "Looking for atom with element " << *elemental << endl;
     170    ASSERT(elementLookup.there.find(elemental)!=elementLookup.there.end(),"Type of this atom was not in the formula upon enumeration");
     171    *out << "Ion_Type" << elementLookup.there.find(elemental)->second << "_" << AtomNo[elemental->Z] << "\t"  << fixed << setprecision(9) << showpoint;
    164172    *out << at(0) << "\t" << at(1) << "\t" << at(2);
    165173    *out << "\t" << FixedIon;
     
    337345  mol = _mol;
    338346  if(!mol->containsAtom(this)){
    339     mol->AddAtom(this);
     347    mol->insert(this);
    340348  }
    341349}
  • src/atom.hpp

    rd74077 r8f4df1  
    2222#include <vector>
    2323
     24#include "Helpers/helpers.hpp"
    2425#include "atom_atominfo.hpp"
    2526#include "atom_bondedparticle.hpp"
     
    5253
    5354  bool OutputIndexed(ofstream * const out, const int ElementNo, const int AtomNo, const char *comment = NULL) const;
    54   bool OutputArrayIndexed(ostream * const out, const int *ElementNo, int *AtomNo, const char *comment = NULL) const;
     55  bool OutputArrayIndexed(ostream * const out,const enumeration<const element*>&, int *AtomNo, const char *comment = NULL) const;
    5556  bool OutputXYZLine(ofstream *out) const;
    5657  bool OutputTrajectory(ofstream * const out, const int *ElementNo, int *AtomNo, const int step) const;
     
    6162
    6263  void EqualsFather ( const atom *ptr, const atom **res ) const;
     64  bool isFather(const atom *ptr);
    6365  void CorrectFather();
    6466  atom *GetTrueFather();
  • src/atom_atominfo.hpp

    rd74077 r8f4df1  
    1919#endif
    2020
    21 #include "vector.hpp"
    22 #include "VectorInterface.hpp"
     21#include "LinearAlgebra/Vector.hpp"
     22#include "LinearAlgebra/VectorInterface.hpp"
    2323
    2424/****************************************** forward declarations *****************************/
  • src/atom_bondedparticle.cpp

    rd74077 r8f4df1  
    1313#include "element.hpp"
    1414#include "lists.hpp"
    15 #include "log.hpp"
    16 #include "verbose.hpp"
     15#include "Helpers/Log.hpp"
     16#include "Helpers/Verbose.hpp"
    1717
    1818/** Constructor of class BondedParticle.
  • src/atom_graphnode.cpp

    rd74077 r8f4df1  
    99
    1010#include "atom_graphnode.hpp"
    11 #include "log.hpp"
    12 #include "verbose.hpp"
     11#include "Helpers/Log.hpp"
     12#include "Helpers/Verbose.hpp"
    1313
    1414/** Constructor of class GraphNode.
  • src/atom_trajectoryparticle.cpp

    rd74077 r8f4df1  
    1212#include "config.hpp"
    1313#include "element.hpp"
    14 #include "info.hpp"
    15 #include "log.hpp"
     14#include "Helpers/Info.hpp"
     15#include "Helpers/Log.hpp"
    1616#include "parser.hpp"
    1717#include "ThermoStatContainer.hpp"
    18 #include "verbose.hpp"
     18#include "Helpers/Verbose.hpp"
    1919
    2020/** Constructor of class TrajectoryParticle.
  • src/atom_trajectoryparticleinfo.hpp

    rd74077 r8f4df1  
    2020#include <vector>
    2121
    22 #include "vector.hpp"
    23 #include "VectorSet.hpp"
     22#include "LinearAlgebra/Vector.hpp"
     23#include "LinearAlgebra/VectorSet.hpp"
    2424
    2525/********************************************** declarations *******************************/
  • src/bond.cpp

    rd74077 r8f4df1  
    77#include "Helpers/MemDebug.hpp"
    88
     9#include "Helpers/Log.hpp"
     10#include "Helpers/Verbose.hpp"
    911#include "atom.hpp"
    1012#include "bond.hpp"
    1113#include "element.hpp"
    1214#include "lists.hpp"
    13 #include "log.hpp"
    14 #include "verbose.hpp"
    1515
    1616
  • src/bondgraph.cpp

    rd74077 r8f4df1  
    1414#include "bondgraph.hpp"
    1515#include "element.hpp"
    16 #include "info.hpp"
    17 #include "verbose.hpp"
    18 #include "log.hpp"
     16#include "Helpers/Info.hpp"
     17#include "Helpers/Verbose.hpp"
     18#include "Helpers/Log.hpp"
    1919#include "molecule.hpp"
    2020#include "parser.hpp"
    2121#include "periodentafel.hpp"
    22 #include "vector.hpp"
     22#include "LinearAlgebra/Vector.hpp"
    2323
    2424/** Constructor of class BondGraph.
  • src/boundary.cpp

    rd74077 r8f4df1  
    66#include "Helpers/MemDebug.hpp"
    77
     8#include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp"
    89#include "BoundaryPointSet.hpp"
    910#include "BoundaryLineSet.hpp"
    1011#include "BoundaryTriangleSet.hpp"
    1112#include "CandidateForTesselation.hpp"
    12 #include "BoundaryPolygonSet.hpp"
    13 #include "TesselPoint.hpp"
     13//#include "TesselPoint.hpp"
    1414#include "World.hpp"
    1515#include "atom.hpp"
     
    1818#include "config.hpp"
    1919#include "element.hpp"
    20 #include "helpers.hpp"
    21 #include "info.hpp"
     20#include "Helpers/helpers.hpp"
     21#include "Helpers/Info.hpp"
    2222#include "linkedcell.hpp"
    23 #include "verbose.hpp"
    24 #include "log.hpp"
     23#include "Helpers/Verbose.hpp"
     24#include "Helpers/Log.hpp"
    2525#include "molecule.hpp"
    2626#include "tesselation.hpp"
    2727#include "tesselationhelpers.hpp"
    2828#include "World.hpp"
    29 #include "Plane.hpp"
    30 #include "Matrix.hpp"
     29#include "LinearAlgebra/Plane.hpp"
     30#include "LinearAlgebra/Matrix.hpp"
    3131#include "Box.hpp"
    3232
     
    679679  double cellvolume = 0.;
    680680
    681   // transform to PAS
    682   mol->PrincipalAxisSystem(true);
     681  // transform to PAS by Action
     682  Vector MainAxis(0.,0.,1.);
     683  MoleculeRotateToPrincipalAxisSystem(MainAxis);
    683684
    684685  IsAngstroem = configuration->GetIsAngstroem();
  • src/builder.cpp

    rd74077 r8f4df1  
    5959#include "CommandLineParser.hpp"
    6060#include "config.hpp"
    61 #include "log.hpp"
     61#include "Helpers/Log.hpp"
    6262#include "molecule.hpp"
    6363#include "periodentafel.hpp"
     
    7272#include "UIElements/Dialog.hpp"
    7373#include "Menu/ActionMenuItem.hpp"
    74 #include "verbose.hpp"
     74#include "Helpers/Verbose.hpp"
    7575#include "World.hpp"
    7676
     
    110110}
    111111
     112void dumpMemory(){
     113  ofstream ost("molecuilder.memdump");
     114  Memory::dumpMemory(ost);
     115}
     116
    112117int main(int argc, char **argv)
    113118{
    114119  // while we are non interactive, we want to abort from asserts
    115   //ASSERT_DO(Assert::Abort);
     120  ASSERT_DO(Assert::Abort);
     121  ASSERT_HOOK(dumpMemory);
    116122  string line;
    117123  char **Arguments = NULL;
     
    127133  // need to init the history before any action is created
    128134  ActionHistory::init();
    129 
    130   // In the interactive mode, we can leave the user the choice in case of error
    131   ASSERT_DO(Assert::Ask);
    132135
    133136  // from this moment on, we need to be sure to deeinitialize in the correct order
     
    155158      UIFactory::makeUserInterface("CommandLine");
    156159    } else {
     160      // In the interactive mode, we can leave the user the choice in case of error
     161      ASSERT_DO(Assert::Ask);
    157162      #ifdef USE_GUI_QT
    158163        DoLog(0) && (Log() << Verbose(0) << "Setting UI to QT4." << endl);
  • src/config.cpp

    rd74077 r8f4df1  
    1616#include "ConfigFileBuffer.hpp"
    1717#include "element.hpp"
    18 #include "helpers.hpp"
    19 #include "info.hpp"
     18#include "Helpers/helpers.hpp"
     19#include "Helpers/Info.hpp"
    2020#include "lists.hpp"
    21 #include "verbose.hpp"
    22 #include "log.hpp"
     21#include "Helpers/Verbose.hpp"
     22#include "Helpers/Log.hpp"
    2323#include "molecule.hpp"
    2424#include "molecule.hpp"
     
    2626#include "ThermoStatContainer.hpp"
    2727#include "World.hpp"
    28 #include "Matrix.hpp"
     28#include "LinearAlgebra/Matrix.hpp"
    2929#include "Box.hpp"
    3030
  • src/datacreator.cpp

    rd74077 r8f4df1  
    1010
    1111#include "datacreator.hpp"
    12 #include "helpers.hpp"
     12#include "Helpers/helpers.hpp"
    1313#include "parser.hpp"
    14 #include "verbose.hpp"
     14#include "Helpers/Verbose.hpp"
    1515
    1616#include <iomanip>
  • src/defs.hpp

    rd74077 r8f4df1  
    8484#define MOLECUILDER_NAME "Molecuilder"
    8585
    86 const unsigned int MAX_POOL_FRAGMENTATION=20;
    87 const unsigned int MAX_FRAGMENTATION_SKIPS=100;
     86const extern unsigned int MAX_POOL_FRAGMENTATION;
     87const extern unsigned int MAX_FRAGMENTATION_SKIPS;
    8888
    8989#endif /*DEFS_HPP_*/
  • src/element.cpp

    rd74077 r8f4df1  
    2626        next(NULL),
    2727        sort(NULL),
    28         No(-1),
    2928        Valence(0),
    3029        NoValenceOrbitals(0)
     
    7069  return string(symbol);
    7170}
     71
     72std::string element::getName() const{
     73  return string(name);
     74}
     75
     76std::ostream &operator<<(std::ostream &ost,const element &elem){
     77  ost << elem.getName() << "(" << elem.getNumber() << ")";
     78  return ost;
     79}
  • src/element.hpp

    rd74077 r8f4df1  
    4141    element *next;  //!< next element in list
    4242    int *sort;      //!< sorc criteria
    43     int No;         //!< number of element set on periodentafel::Output()
    4443    double Valence;   //!< number of valence electrons for this element
    4544    int NoValenceOrbitals;  //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix()
     
    5352  atomicNumber_t getNumber() const;
    5453  std::string getSymbol() const;
     54  std::string getName() const;
    5555
    5656  //> print element entries to screen
     
    6161};
    6262
     63std::ostream &operator<<(std::ostream&,const element&);
    6364
    6465#endif /* ELEMENT_HPP_ */
  • src/ellipsoid.cpp

    rd74077 r8f4df1  
    1919#include "ellipsoid.hpp"
    2020#include "linkedcell.hpp"
    21 #include "log.hpp"
     21#include "Helpers/Log.hpp"
    2222#include "tesselation.hpp"
    23 #include "vector.hpp"
    24 #include "Matrix.hpp"
    25 #include "verbose.hpp"
     23#include "LinearAlgebra/Vector.hpp"
     24#include "LinearAlgebra/Matrix.hpp"
     25#include "Helpers/Verbose.hpp"
    2626
    2727/** Determines squared distance for a given point \a x to surface of ellipsoid.
  • src/graph.cpp

    rd74077 r8f4df1  
    1313#include "config.hpp"
    1414#include "graph.hpp"
    15 #include "verbose.hpp"
    16 #include "log.hpp"
     15#include "Helpers/Verbose.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "molecule.hpp"
    1818
  • src/joiner.cpp

    rd74077 r8f4df1  
    1313
    1414#include "datacreator.hpp"
    15 #include "helpers.hpp"
     15#include "Helpers/helpers.hpp"
    1616#include "parser.hpp"
    1717#include "periodentafel.hpp"
    18 #include "verbose.hpp"
     18#include "Helpers/Verbose.hpp"
    1919
    2020//============================== MAIN =============================
  • src/leastsquaremin.cpp

    rd74077 r8f4df1  
    1111
    1212#include "leastsquaremin.hpp"
    13 #include "vector.hpp"
     13#include "LinearAlgebra/Vector.hpp"
    1414
    1515/** Determines sum of squared distances of \a X to all \a **vectors.
  • src/linkedcell.cpp

    rd74077 r8f4df1  
    88
    99#include "atom.hpp"
    10 #include "helpers.hpp"
     10#include "Helpers/helpers.hpp"
    1111#include "linkedcell.hpp"
    12 #include "verbose.hpp"
    13 #include "log.hpp"
     12#include "Helpers/Verbose.hpp"
     13#include "Helpers/Log.hpp"
    1414#include "molecule.hpp"
    1515#include "tesselation.hpp"
    16 #include "vector.hpp"
     16#include "LinearAlgebra/Vector.hpp"
    1717
    1818// ========================================================= class LinkedCell ===========================================
  • src/linkedcell.hpp

    rd74077 r8f4df1  
    2424
    2525#include "defs.hpp"
    26 #include "vector.hpp"
     26#include "LinearAlgebra/Vector.hpp"
    2727
    2828/****************************************** forward declarations *****************************/
  • src/molecule.cpp

    rd74077 r8f4df1  
    2424#include "element.hpp"
    2525#include "graph.hpp"
    26 #include "helpers.hpp"
     26#include "Helpers/helpers.hpp"
    2727#include "leastsquaremin.hpp"
    2828#include "linkedcell.hpp"
    2929#include "lists.hpp"
    30 #include "log.hpp"
     30#include "Helpers/Log.hpp"
    3131#include "molecule.hpp"
    3232
     
    3434#include "stackclass.hpp"
    3535#include "tesselation.hpp"
    36 #include "vector.hpp"
    37 #include "Matrix.hpp"
     36#include "LinearAlgebra/Vector.hpp"
     37#include "LinearAlgebra/Matrix.hpp"
    3838#include "World.hpp"
    3939#include "Box.hpp"
    40 #include "Plane.hpp"
     40#include "LinearAlgebra/Plane.hpp"
    4141#include "Exceptions/LinearDependenceException.hpp"
    4242
     
    151151molecule::const_iterator molecule::erase( const_iterator loc )
    152152{
     153  OBSERVE;
    153154  molecule::const_iterator iter = loc;
    154155  iter--;
     
    156157  atomIds.erase( atom->getId() );
    157158  atoms.remove( atom );
     159  formula-=atom->getType();
    158160  atom->removeFromMolecule();
    159161  return iter;
     
    162164molecule::const_iterator molecule::erase( atom * key )
    163165{
     166  OBSERVE;
    164167  molecule::const_iterator iter = find(key);
    165168  if (iter != end()){
    166169    atomIds.erase( key->getId() );
    167170    atoms.remove( key );
     171    formula-=key->getType();
    168172    key->removeFromMolecule();
    169173  }
     
    183187pair<molecule::iterator,bool> molecule::insert ( atom * const key )
    184188{
     189  OBSERVE;
    185190  pair<atomIdSet::iterator,bool> res = atomIds.insert(key->getId());
    186191  if (res.second) { // push atom if went well
    187192    atoms.push_back(key);
     193    formula+=key->getType();
    188194    return pair<iterator,bool>(molecule::iterator(--end()),res.second);
    189195  } else {
     
    233239  if (pointer != NULL) {
    234240    atom *walker = pointer->clone();
     241    formula += walker->getType();
    235242    walker->setName(pointer->getName());
    236243    walker->nr = last_atom++;  // increase number within molecule
     
    616623{
    617624  molecule *copy = World::getInstance().createMolecule();
    618   atom *LeftAtom = NULL, *RightAtom = NULL;
    619625
    620626  // copy all atoms
    621   ActOnCopyWithEachAtom ( &molecule::AddCopyAtom, copy );
     627  for_each(atoms.begin(),atoms.end(),bind1st(mem_fun(&molecule::AddCopyAtom),copy));
    622628
    623629  // copy all bonds
    624   bond *Binder = NULL;
    625   bond *NewBond = NULL;
    626630  for(molecule::iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner)
    627631    for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
    628632      if ((*BondRunner)->leftatom == *AtomRunner) {
    629         Binder = (*BondRunner);
     633        bond *Binder = (*BondRunner);
    630634
    631635        // get the pendant atoms of current bond in the copy molecule
    632         copy->ActOnAllAtoms( &atom::EqualsFather, (const atom *)Binder->leftatom, (const atom **)&LeftAtom );
    633         copy->ActOnAllAtoms( &atom::EqualsFather, (const atom *)Binder->rightatom, (const atom **)&RightAtom );
    634 
    635         NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
     636        atomSet::iterator leftiter=find_if(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::isFather),Binder->leftatom));
     637        atomSet::iterator rightiter=find_if(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::isFather),Binder->rightatom));
     638        ASSERT(leftiter!=atoms.end(),"No original left atom for bondcopy found");
     639        ASSERT(leftiter!=atoms.end(),"No original right atom for bondcopy found");
     640        atom *LeftAtom = *leftiter;
     641        atom *RightAtom = *rightiter;
     642
     643        bond *NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
    636644        NewBond->Cyclic = Binder->Cyclic;
    637645        if (Binder->Cyclic)
     
    640648      }
    641649  // correct fathers
    642   ActOnAllAtoms( &atom::CorrectFather );
     650  for_each(atoms.begin(),atoms.end(),mem_fun(&atom::CorrectFather));
    643651
    644652  // copy values
     
    849857 * \param *out output stream
    850858 */
    851 bool molecule::Output(ofstream * const output)
    852 {
    853   int ElementNo[MAX_ELEMENTS], AtomNo[MAX_ELEMENTS];
    854 
    855   for (int i=0;i<MAX_ELEMENTS;++i) {
    856     AtomNo[i] = 0;
    857     ElementNo[i] = 0;
    858   }
     859bool molecule::Output(ostream * const output)
     860{
    859861  if (output == NULL) {
    860862    return false;
    861863  } else {
     864    int AtomNo[MAX_ELEMENTS];
     865    memset(AtomNo,0,(MAX_ELEMENTS-1)*sizeof(*AtomNo));
     866    enumeration<const element*> elementLookup = formula.enumerateElements();
     867    for(map<const element*,unsigned int>::iterator iter=elementLookup.there.begin();
     868        iter!=elementLookup.there.end();++iter){
     869      cout << "Enumerated element " << *iter->first << " with number " << iter->second << endl;
     870    }
    862871    *output << "#Ion_TypeNr._Nr.R[0]    R[1]    R[2]    MoveType (0 MoveIon, 1 FixedIon)" << endl;
    863     SetIndexedArrayForEachAtomTo ( ElementNo, &element::Z, &AbsoluteValue, 1);
    864     int current=1;
    865     for (int i=0;i<MAX_ELEMENTS;++i) {
    866       if (ElementNo[i] == 1)
    867         ElementNo[i] = current++;
    868     }
    869     ActOnAllAtoms( &atom::OutputArrayIndexed, (ostream * const) output, (const int *)ElementNo, (int *)AtomNo, (const char *) NULL );
     872    for_each(atoms.begin(),atoms.end(),boost::bind(&atom::OutputArrayIndexed,_1,output,elementLookup,AtomNo,(const char*)0));
    870873    return true;
    871874  }
     
    910913{
    911914  DoLog(2) && (Log() << Verbose(2) << endl << "From Contents of ListOfBonds, all non-hydrogen atoms:" << endl);
    912   ActOnAllAtoms (&atom::OutputBondOfAtom );
     915  for_each(atoms.begin(),atoms.end(),mem_fun(&atom::OutputBondOfAtom));
    913916  DoLog(0) && (Log() << Verbose(0) << endl);
    914917};
     
    933936    for (int step=0;step<MDSteps;step++) {
    934937      *output << getAtomCount() << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now);
    935       ActOnAllAtoms( &atom::OutputTrajectoryXYZ, output, step );
     938      for_each(atoms.begin(),atoms.end(),boost::bind(&atom::OutputTrajectoryXYZ,_1,output,step));
    936939    }
    937940    return true;
     
    950953    now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    951954    *output << getAtomCount() << "\n\tCreated by molecuilder on " << ctime(&now);
    952     ActOnAllAtoms( &atom::OutputXYZLine, output );
     955    for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputXYZLine),output));
    953956    return true;
    954957  } else
  • src/molecule.hpp

    rd74077 r8f4df1  
    2929#include "Patterns/Cacheable.hpp"
    3030#include "Formula.hpp"
     31#include "AtomSet.hpp"
    3132
    3233#include "Descriptors/MoleculeDescriptor_impl.hpp"
     
    8485
    8586  public:
    86     typedef std::list<atom*> atomSet;
     87    typedef ATOMSET(std::list) atomSet;
    8788    typedef std::set<atomId_t> atomIdSet;
    8889    typedef ObservedIterator<atomSet> iterator;
     
    257258  void Scale(const double ** const factor);
    258259  void DeterminePeriodicCenter(Vector &center);
    259   Vector * DetermineCenterOfGravity();
     260  Vector * DetermineCenterOfGravity() const;
    260261  Vector * DetermineCenterOfAll() const;
    261262  Vector * DetermineCenterOfBox() const;
     
    265266  bool VerletForceIntegration(char *file, config &configuration, const size_t offset);
    266267  void Thermostats(config &configuration, double ActualTemp, int Thermostat);
    267   void PrincipalAxisSystem(bool DoRotate);
    268268  double VolumeOfConvexEnvelope(bool IsAngstroem);
    269269
     
    328328
    329329  // Output routines.
    330   bool Output(ofstream * const output);
     330  bool Output(std::ostream * const output);
    331331  bool OutputTrajectories(ofstream * const output);
    332332  void OutputListOfBonds() const;
  • src/molecule_dynamics.cpp

    rd74077 r8f4df1  
    1212#include "config.hpp"
    1313#include "element.hpp"
    14 #include "info.hpp"
    15 #include "verbose.hpp"
    16 #include "log.hpp"
     14#include "Helpers/Info.hpp"
     15#include "Helpers/Verbose.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "molecule.hpp"
    1818#include "parser.hpp"
    19 #include "Plane.hpp"
     19#include "LinearAlgebra/Plane.hpp"
    2020#include "ThermoStatContainer.hpp"
    2121
  • src/molecule_fragmentation.cpp

    rd74077 r8f4df1  
    1515#include "config.hpp"
    1616#include "element.hpp"
    17 #include "helpers.hpp"
     17#include "Helpers/helpers.hpp"
    1818#include "lists.hpp"
    19 #include "verbose.hpp"
    20 #include "log.hpp"
     19#include "Helpers/Verbose.hpp"
     20#include "Helpers/Log.hpp"
    2121#include "molecule.hpp"
    2222#include "periodentafel.hpp"
    2323#include "World.hpp"
    24 #include "Matrix.hpp"
     24#include "LinearAlgebra/Matrix.hpp"
    2525#include "Box.hpp"
    2626#include "stackclass.hpp"
  • src/molecule_geometry.cpp

    rd74077 r8f4df1  
    1010#endif
    1111
     12#include "Helpers/helpers.hpp"
     13#include "Helpers/Log.hpp"
    1214#include "Helpers/MemDebug.hpp"
     15#include "Helpers/Verbose.hpp"
     16#include "LinearAlgebra/Line.hpp"
     17#include "LinearAlgebra/Matrix.hpp"
     18#include "LinearAlgebra/Plane.hpp"
    1319
    1420#include "atom.hpp"
     
    1622#include "config.hpp"
    1723#include "element.hpp"
    18 #include "helpers.hpp"
    1924#include "leastsquaremin.hpp"
    20 #include "verbose.hpp"
    21 #include "log.hpp"
    2225#include "molecule.hpp"
    2326#include "World.hpp"
    24 #include "Plane.hpp"
    25 #include "Matrix.hpp"
     27
    2628#include "Box.hpp"
     29
    2730#include <boost/foreach.hpp>
    2831
     
    4851    *iter -= *Center;
    4952    *iter -= *CenterBox;
    50     iter->setPosition(domain.WrapPeriodically(iter->getPosition()));
    51   }
     53  }
     54  atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
    5255
    5356  delete(Center);
     
    6669
    6770  // go through all atoms
    68   BOOST_FOREACH(atom* iter, atoms){
    69     iter->setPosition(domain.WrapPeriodically(iter->getPosition()));
    70   }
     71  atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
    7172
    7273  return status;
     
    167168 * \return pointer to center of gravity vector
    168169 */
    169 Vector * molecule::DetermineCenterOfGravity()
     170Vector * molecule::DetermineCenterOfGravity() const
    170171{
    171172  molecule::const_iterator iter = begin();  // start at first in list
     
    250251  BOOST_FOREACH(atom* iter, atoms){
    251252    *iter += *trans;
    252     iter->setPosition(domain.WrapPeriodically(iter->getPosition()));
    253   }
     253  }
     254  atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
    254255
    255256};
     
    263264  OBSERVE;
    264265  Plane p(*n,0);
    265   BOOST_FOREACH(atom* iter, atoms ){
    266     iter->setPosition(p.mirrorVector(iter->getPosition()));
    267   }
     266  atoms.transformNodes(boost::bind(&Plane::mirrorVector,p,_1));
    268267};
    269268
     
    325324};
    326325
    327 /** Transforms/Rotates the given molecule into its principal axis system.
    328  * \param *out output stream for debugging
    329  * \param DoRotate whether to rotate (true) or only to determine the PAS.
    330  * TODO treatment of trajetories missing
    331  */
    332 void molecule::PrincipalAxisSystem(bool DoRotate)
    333 {
    334   double InertiaTensor[NDIM*NDIM];
    335   Vector *CenterOfGravity = DetermineCenterOfGravity();
    336 
    337   CenterPeriodic();
    338 
    339   // reset inertia tensor
    340   for(int i=0;i<NDIM*NDIM;i++)
    341     InertiaTensor[i] = 0.;
    342 
    343   // sum up inertia tensor
    344   for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    345     Vector x = (*iter)->getPosition();
    346     //x.SubtractVector(CenterOfGravity);
    347     InertiaTensor[0] += (*iter)->getType()->mass*(x[1]*x[1] + x[2]*x[2]);
    348     InertiaTensor[1] += (*iter)->getType()->mass*(-x[0]*x[1]);
    349     InertiaTensor[2] += (*iter)->getType()->mass*(-x[0]*x[2]);
    350     InertiaTensor[3] += (*iter)->getType()->mass*(-x[1]*x[0]);
    351     InertiaTensor[4] += (*iter)->getType()->mass*(x[0]*x[0] + x[2]*x[2]);
    352     InertiaTensor[5] += (*iter)->getType()->mass*(-x[1]*x[2]);
    353     InertiaTensor[6] += (*iter)->getType()->mass*(-x[2]*x[0]);
    354     InertiaTensor[7] += (*iter)->getType()->mass*(-x[2]*x[1]);
    355     InertiaTensor[8] += (*iter)->getType()->mass*(x[0]*x[0] + x[1]*x[1]);
    356   }
    357   // print InertiaTensor for debugging
    358   DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
    359   for(int i=0;i<NDIM;i++) {
    360     for(int j=0;j<NDIM;j++)
    361       DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
    362     DoLog(0) && (Log() << Verbose(0) << endl);
    363   }
    364   DoLog(0) && (Log() << Verbose(0) << endl);
    365 
    366   // diagonalize to determine principal axis system
    367   gsl_eigen_symmv_workspace *T = gsl_eigen_symmv_alloc(NDIM);
    368   gsl_matrix_view m = gsl_matrix_view_array(InertiaTensor, NDIM, NDIM);
    369   gsl_vector *eval = gsl_vector_alloc(NDIM);
    370   gsl_matrix *evec = gsl_matrix_alloc(NDIM, NDIM);
    371   gsl_eigen_symmv(&m.matrix, eval, evec, T);
    372   gsl_eigen_symmv_free(T);
    373   gsl_eigen_symmv_sort(eval, evec, GSL_EIGEN_SORT_ABS_DESC);
    374 
    375   for(int i=0;i<NDIM;i++) {
    376     DoLog(1) && (Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i));
    377     DoLog(0) && (Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl);
    378   }
    379 
    380   // check whether we rotate or not
    381   if (DoRotate) {
    382     DoLog(1) && (Log() << Verbose(1) << "Transforming molecule into PAS ... ");
    383     // the eigenvectors specify the transformation matrix
    384     Matrix M = Matrix(evec->data);
    385     Vector tempVector;
    386     BOOST_FOREACH(atom* iter, atoms){
    387       tempVector = iter->getPosition();
    388       tempVector *= M;
    389       iter->setPosition(tempVector);
    390     }
    391     DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    392 
    393     // summing anew for debugging (resulting matrix has to be diagonal!)
    394     // reset inertia tensor
    395     for(int i=0;i<NDIM*NDIM;i++)
    396       InertiaTensor[i] = 0.;
    397 
    398     // sum up inertia tensor
    399     for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    400       Vector x = (*iter)->getPosition();
    401       InertiaTensor[0] += (*iter)->getType()->mass*(x[1]*x[1] + x[2]*x[2]);
    402       InertiaTensor[1] += (*iter)->getType()->mass*(-x[0]*x[1]);
    403       InertiaTensor[2] += (*iter)->getType()->mass*(-x[0]*x[2]);
    404       InertiaTensor[3] += (*iter)->getType()->mass*(-x[1]*x[0]);
    405       InertiaTensor[4] += (*iter)->getType()->mass*(x[0]*x[0] + x[2]*x[2]);
    406       InertiaTensor[5] += (*iter)->getType()->mass*(-x[1]*x[2]);
    407       InertiaTensor[6] += (*iter)->getType()->mass*(-x[2]*x[0]);
    408       InertiaTensor[7] += (*iter)->getType()->mass*(-x[2]*x[1]);
    409       InertiaTensor[8] += (*iter)->getType()->mass*(x[0]*x[0] + x[1]*x[1]);
    410     }
    411     // print InertiaTensor for debugging
    412     DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
    413     for(int i=0;i<NDIM;i++) {
    414       for(int j=0;j<NDIM;j++)
    415         DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
    416       DoLog(0) && (Log() << Verbose(0) << endl);
    417     }
    418     DoLog(0) && (Log() << Verbose(0) << endl);
    419   }
    420 
    421   // free everything
    422   delete(CenterOfGravity);
    423   gsl_vector_free(eval);
    424   gsl_matrix_free(evec);
    425 };
    426 
    427 
    428326/** Align all atoms in such a manner that given vector \a *n is along z axis.
    429327 * \param n[] alignment vector.
  • src/molecule_graph.cpp

    rd74077 r8f4df1  
    1818#include "defs.hpp"
    1919#include "element.hpp"
    20 #include "helpers.hpp"
    21 #include "info.hpp"
     20#include "Helpers/helpers.hpp"
     21#include "Helpers/Info.hpp"
    2222#include "linkedcell.hpp"
    2323#include "lists.hpp"
    24 #include "verbose.hpp"
    25 #include "log.hpp"
     24#include "Helpers/Verbose.hpp"
     25#include "Helpers/Log.hpp"
    2626#include "molecule.hpp"
    2727#include "World.hpp"
    2828#include "Helpers/fast_functions.hpp"
    2929#include "Helpers/Assert.hpp"
    30 #include "Matrix.hpp"
     30#include "LinearAlgebra/Matrix.hpp"
    3131#include "Box.hpp"
    3232#include "stackclass.hpp"
  • src/molecule_pointcloud.cpp

    rd74077 r8f4df1  
    1010#include "atom.hpp"
    1111#include "config.hpp"
    12 #include "info.hpp"
     12#include "Helpers/Info.hpp"
    1313#include "molecule.hpp"
    1414
  • src/moleculelist.cpp

    rd74077 r8f4df1  
    2323#include "config.hpp"
    2424#include "element.hpp"
    25 #include "helpers.hpp"
     25#include "Helpers/helpers.hpp"
    2626#include "linkedcell.hpp"
    2727#include "lists.hpp"
    28 #include "verbose.hpp"
    29 #include "log.hpp"
     28#include "Helpers/Verbose.hpp"
     29#include "Helpers/Log.hpp"
    3030#include "molecule.hpp"
    3131#include "periodentafel.hpp"
    3232#include "Helpers/Assert.hpp"
    33 #include "Matrix.hpp"
     33#include "LinearAlgebra/Matrix.hpp"
    3434#include "Box.hpp"
    3535#include "stackclass.hpp"
  • src/parser.cpp

    rd74077 r8f4df1  
    1111#include <cstring>
    1212
    13 #include "helpers.hpp"
     13#include "Helpers/helpers.hpp"
    1414#include "parser.hpp"
    15 #include "verbose.hpp"
     15#include "Helpers/Verbose.hpp"
    1616
    1717// include config.h
  • src/periodentafel.cpp

    rd74077 r8f4df1  
    1717#include "element.hpp"
    1818#include "elements_db.hpp"
    19 #include "helpers.hpp"
     19#include "Helpers/helpers.hpp"
    2020#include "lists.hpp"
    21 #include "log.hpp"
     21#include "Helpers/Log.hpp"
    2222#include "periodentafel.hpp"
    23 #include "verbose.hpp"
     23#include "Helpers/Verbose.hpp"
    2424
    2525using namespace std;
  • src/stackclass.hpp

    rd74077 r8f4df1  
    1111#endif
    1212
    13 #include "verbose.hpp"
    14 #include "log.hpp"
     13#include "Helpers/Verbose.hpp"
     14#include "Helpers/Log.hpp"
    1515
    1616/****************************************** forward declarations *****************************/
  • src/tesselation.cpp

    rd74077 r8f4df1  
    1111#include <iomanip>
    1212
     13#include "Helpers/helpers.hpp"
     14#include "Helpers/Info.hpp"
    1315#include "BoundaryPointSet.hpp"
    1416#include "BoundaryLineSet.hpp"
     
    1820#include "CandidateForTesselation.hpp"
    1921#include "PointCloud.hpp"
    20 #include "helpers.hpp"
    21 #include "info.hpp"
    2222#include "linkedcell.hpp"
    23 #include "log.hpp"
     23#include "Helpers/Log.hpp"
    2424#include "tesselation.hpp"
    2525#include "tesselationhelpers.hpp"
    2626#include "triangleintersectionlist.hpp"
    27 #include "vector.hpp"
    28 #include "Line.hpp"
    29 #include "vector_ops.hpp"
    30 #include "verbose.hpp"
    31 #include "Plane.hpp"
     27#include "LinearAlgebra/Vector.hpp"
     28#include "LinearAlgebra/Line.hpp"
     29#include "LinearAlgebra/vector_ops.hpp"
     30#include "Helpers/Verbose.hpp"
     31#include "LinearAlgebra/Plane.hpp"
    3232#include "Exceptions/LinearDependenceException.hpp"
    3333#include "Helpers/Assert.hpp"
  • src/tesselation.hpp

    rd74077 r8f4df1  
    3030#include "TesselPoint.hpp"
    3131#include "atom_particleinfo.hpp"
    32 #include "helpers.hpp"
    33 #include "vector.hpp"
     32#include "Helpers/helpers.hpp"
     33#include "LinearAlgebra/Vector.hpp"
    3434
    3535
  • src/tesselationhelpers.cpp

    rd74077 r8f4df1  
    1515#include "BoundaryTriangleSet.hpp"
    1616#include "CandidateForTesselation.hpp"
    17 #include "info.hpp"
     17#include "Helpers/Info.hpp"
    1818#include "linkedcell.hpp"
    19 #include "linearsystemofequations.hpp"
    20 #include "log.hpp"
     19#include "LinearAlgebra/linearsystemofequations.hpp"
     20#include "Helpers/Log.hpp"
    2121#include "tesselation.hpp"
    2222#include "tesselationhelpers.hpp"
    23 #include "vector.hpp"
    24 #include "Line.hpp"
    25 #include "vector_ops.hpp"
    26 #include "verbose.hpp"
    27 #include "Plane.hpp"
    28 #include "Matrix.hpp"
     23#include "LinearAlgebra/Vector.hpp"
     24#include "LinearAlgebra/Line.hpp"
     25#include "LinearAlgebra/vector_ops.hpp"
     26#include "Helpers/Verbose.hpp"
     27#include "LinearAlgebra/Plane.hpp"
     28#include "LinearAlgebra/Matrix.hpp"
    2929
    3030void GetSphere(Vector * const center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS)
  • src/test/ActOnAlltest.hpp

    rd74077 r8f4df1  
    1212
    1313#include <list>
    14 #include "../vector.hpp"
     14#include "../LinearAlgebra/Vector.hpp"
    1515
    1616#define ListOfVectors list<Vector *>
  • src/triangleintersectionlist.cpp

    rd74077 r8f4df1  
    1515#include "triangleintersectionlist.hpp"
    1616
     17#include "Helpers/Info.hpp"
     18#include "BoundaryMaps.hpp"
    1719#include "BoundaryPointSet.hpp"
    1820#include "BoundaryLineSet.hpp"
    1921#include "BoundaryTriangleSet.hpp"
    20 #include "info.hpp"
    2122#include "tesselation.hpp"
    22 #include "vector.hpp"
    23 #include "verbose.hpp"
     23#include "LinearAlgebra/Vector.hpp"
     24#include "Helpers/Verbose.hpp"
    2425
    2526/** Constructor for class TriangleIntersectionList.
  • src/unittests/ActOnAllUnitTest.cpp

    rd74077 r8f4df1  
    1414#include "../test/ActOnAlltest.hpp"
    1515#include "ActOnAllUnitTest.hpp"
    16 #include "vector.hpp"
     16#include "LinearAlgebra/Vector.hpp"
    1717
    1818#ifdef HAVE_TESTRUNNER
  • src/unittests/ActionSequenceTest.cpp

    rd74077 r8f4df1  
    1717#include "Actions/ActionRegistry.hpp"
    1818
     19#include "DummyUI.hpp"
     20
    1921#ifdef HAVE_TESTRUNNER
    2022#include "UnitTestMain.hpp"
     
    3335  virtual ~canUndoActionStub(){}
    3436
    35   virtual Dialog* createDialog(){
    36     return NULL;
     37  virtual Dialog* fillDialog(Dialog *dialog){
     38    ASSERT(dialog,"No Dialog given when filling action dialog");
     39    return dialog;
    3740  }
    3841
     
    6063  virtual ~cannotUndoActionStub(){}
    6164
    62   virtual Dialog* createDialog(){
    63     return NULL;
     65  virtual Dialog* fillDialog(Dialog *dialog){
     66    ASSERT(dialog,"No Dialog given when filling action dialog");
     67    return dialog;
    6468  }
    6569
     
    9094  virtual ~wasCalledActionStub(){}
    9195
    92   virtual Dialog* createDialog(){
    93     return NULL;
     96  virtual Dialog* fillDialog(Dialog *dialog){
     97    return dialog;
    9498  }
    9599  virtual Action::state_ptr performCall(){
     
    119123
    120124void ActionSequenceTest::setUp(){
     125  static bool hasDescriptor = false;
    121126  ActionHistory::init();
     127  // TODO: find a way to really reset the factory to a clean state in tear-down
     128  if(!hasDescriptor){
     129    UIFactory::registerFactory(new DummyUIFactory::description());
     130    hasDescriptor = true;
     131  }
     132  UIFactory::makeUserInterface("Dummy");
    122133  // create some necessary stubs used in this test
    123134  positive1 = new canUndoActionStub();
     
    146157  ActionHistory::purgeInstance();
    147158  ActionRegistry::purgeInstance();
     159  UIFactory::purgeInstance();
    148160}
    149161
     
    231243
    232244  CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled());
    233   CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled());
     245  CPPUNIT_ASSERT_EQUAL(true,wasCalled2->wasCalled());
    234246
    235247  ActionHistory::getInstance().undoLast();
    236248
    237249  CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled());
    238   CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled());
    239 
    240 }
    241 
    242 
     250  CPPUNIT_ASSERT_EQUAL(false,wasCalled2->wasCalled());
     251
     252}
     253
     254
  • src/unittests/FormulaUnittest.cpp

    rd74077 r8f4df1  
    185185  }
    186186  {
     187    Formula formula("CH2(COOH)2");
     188    CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)4);
     189    CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)4);
     190    CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)3);
     191    CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0);
     192    CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0);
     193  }
     194  {
     195    Formula formula("K4[Fe(CN)6]");
     196    CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)0);
     197    CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)0);
     198    CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)6);
     199    CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0);
     200    CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0);
     201    CPPUNIT_ASSERT_EQUAL(formula["K"],(unsigned int)4);
     202    CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)1);
     203    CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)6);
     204  }
     205  {
     206    Formula formula("[CrCl3(H2O)3]");
     207    CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)6);
     208    CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)3);
     209    CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)0);
     210    CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0);
     211    CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0);
     212    CPPUNIT_ASSERT_EQUAL(formula["Cr"],(unsigned int)1);
     213    CPPUNIT_ASSERT_EQUAL(formula["Cl"],(unsigned int)3);
     214  }
     215  {
     216    Formula formula("Mg3[Fe(CN)6]2");
     217    CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)0);
     218    CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)0);
     219    CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)12);
     220    CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0);
     221    CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0);
     222    CPPUNIT_ASSERT_EQUAL(formula["Mg"],(unsigned int)3);
     223    CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)2);
     224    CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)12);
     225  }
     226  {
     227    Formula formula("Na[Fe((HO2CCH2)2NCH2CH2N(CH2CO2H)2)]");
     228    CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)16);
     229    CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)8);
     230    CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)10);
     231    CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)1);
     232    CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0);
     233    CPPUNIT_ASSERT_EQUAL(formula["Mg"],(unsigned int)0);
     234    CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)1);
     235    CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)2);
     236  }
     237  {
    187238    CPPUNIT_ASSERT_THROW(Formula formula("74107"),ParseError);
    188239    CPPUNIT_ASSERT_THROW(Formula formula("  "),ParseError);
     
    192243    CPPUNIT_ASSERT_THROW(Formula formula("1NaCl"),ParseError);
    193244    CPPUNIT_ASSERT_THROW(Formula formula("Mag"),ParseError);
     245    CPPUNIT_ASSERT_THROW(Formula formula("AgCl)"),ParseError);
     246    CPPUNIT_ASSERT_THROW(Formula formula("(Na"),ParseError);
     247    CPPUNIT_ASSERT_THROW(Formula formula("(Mag)"),ParseError);
     248    CPPUNIT_ASSERT_THROW(Formula formula("MgCl2)"),ParseError);
     249    CPPUNIT_ASSERT_THROW(Formula formula("((MgCl2)"),ParseError);
     250    CPPUNIT_ASSERT_THROW(Formula formula("(MgCl2))"),ParseError);
     251    CPPUNIT_ASSERT_THROW(Formula formula("(MgCl2]"),ParseError);
     252    CPPUNIT_ASSERT_THROW(Formula formula("[MgCl2)"),ParseError);
     253    CPPUNIT_ASSERT_THROW(Formula formula("N(aCl"),ParseError);
     254    CPPUNIT_ASSERT_THROW(Formula formula("Na()Cl"),ParseError);
    194255  }
    195256
  • src/unittests/LineUnittest.cpp

    rd74077 r8f4df1  
    88#include "LineUnittest.hpp"
    99
    10 #include "vector.hpp"
     10#include "LinearAlgebra/Vector.hpp"
    1111#include "Exceptions/LinearDependenceException.hpp"
    1212#include "Exceptions/SkewException.hpp"
  • src/unittests/LineUnittest.hpp

    rd74077 r8f4df1  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #include "Line.hpp"
     13#include "LinearAlgebra/Line.hpp"
    1414
    1515class LineUnittest : public CppUnit::TestFixture
  • src/unittests/Makefile.am

    rd74077 r8f4df1  
    77AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
    88
    9 MENUTESTS = \
    10   ActionSequenceTest
    11 
    129TESTS = \
     10  ActionSequenceTest \
    1311  ActOnAllUnitTest \
    1412  AnalysisBondsUnitTests \
     
    1917  AtomDescriptorTest \
    2018  BondGraphUnitTest \
     19  BoxUnittest \
    2120  CacheableTest \
    2221  CountBondsUnitTest \
     
    4443  Tesselation_BoundaryTriangleUnitTest \
    4544  Tesselation_InOutsideUnitTest \
    46   VectorUnitTest \
    47   ${MENUTESTS}
     45  VectorUnitTest
    4846 
    4947 
     
    5149noinst_PROGRAMS = $(TESTS) TestRunner
    5250
    53 GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
    54 ALLLIBS = ../libmolecuilder.a ${GSLLIBS}
    55 PARSERLIBS = ../libparser.a ${ALLLIBS}
     51GSLLIBS = \
     52        ../LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
     53        ../Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
     54        ../Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
     55        $(BOOST_LIB) \
     56        ${BOOST_THREAD_LIB}
     57ALLLIBS = \
     58        ../Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
     59        ${PARSERLIBS} \
     60        ../libMolecuilder-@MOLECUILDER_API_VERSION@.la \
     61        ${GSLLIBS} \
     62        ${BOOST_PROGRAM_OPTIONS_LIB}
     63PARSERLIBS = ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la
     64UILIBS = ../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la 
    5665
    5766TESTSOURCES = \
     
    6574  atomsCalculationTest.cpp \
    6675  bondgraphunittest.cpp \
     76  BoxUnittest.cpp \
    6777  CacheableTest.cpp \
    6878  CountBondsUnitTest.cpp \
     
    102112  atomsCalculationTest.hpp \
    103113  bondgraphunittest.hpp \
     114  BoxUnittest.hpp \
    104115  CacheableTest.hpp \
    105116  CountBondsUnitTest.hpp \
     
    118129  MoleculeDescriptorTest.hpp \
    119130  periodentafelTest.hpp \
     131  ParserUnitTest.hpp \
    120132  PlaneUnittest.hpp \
    121133  ObserverTest.hpp \
     
    128140 
    129141
    130 ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
    131 ActionSequenceTest_LDADD = ${ALLLIBS}
     142ActionSequenceTest_SOURCES = UnitTestMain.cpp ActionSequenceTest.cpp ActionSequenceTest.hpp
     143ActionSequenceTest_LDADD = ${UILIBS} ${ALLLIBS}
    132144
    133145ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
     
    155167BondGraphUnitTest_LDADD = ${ALLLIBS}
    156168
     169BoxUnittest_SOURCES = UnitTestMain.cpp BoxUnittest.cpp BoxUnittest.hpp
     170BoxUnittest_LDADD = ${ALLLIBS}
     171
    157172CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
    158173CacheableTest_LDADD = ${ALLLIBS}
     
    165180
    166181GSLMatrixSymmetricUnitTest_SOURCES = UnitTestMain.cpp gslmatrixsymmetricunittest.cpp gslmatrixsymmetricunittest.hpp
    167 GSLMatrixSymmetricUnitTest_LDADD = ${GSLLIBS}
     182GSLMatrixSymmetricUnitTest_LDADD = ${ALLLIBS}
    168183
    169184GSLMatrixUnitTest_SOURCES = UnitTestMain.cpp gslmatrixunittest.cpp gslmatrixunittest.hpp
    170 GSLMatrixUnitTest_LDADD = ${GSLLIBS}
     185GSLMatrixUnitTest_LDADD = ${ALLLIBS}
    171186
    172187GSLVectorUnitTest_SOURCES = UnitTestMain.cpp gslvectorunittest.cpp gslvectorunittest.hpp
    173 GSLVectorUnitTest_LDADD = ${GSLLIBS}
     188GSLVectorUnitTest_LDADD = ${ALLLIBS}
    174189
    175190InfoUnitTest_SOURCES = UnitTestMain.cpp infounittest.cpp infounittest.hpp
     
    192207
    193208manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
    194 manipulateAtomsTest_LDADD = ${ALLLIBS}
     209manipulateAtomsTest_LDADD = ${UILIBS} ${ALLLIBS}
    195210
    196211MatrixUnittest_SOURCES = UnitTestMain.cpp MatrixUnittest.cpp MatrixUnittest.hpp
     
    204219
    205220ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp
    206 ParserUnitTest_LDADD = ${PARSERLIBS}
     221ParserUnitTest_LDADD = ${ALLLIBS}
    207222
    208223periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp
     
    224239TesselationUnitTest_LDADD = ${ALLLIBS}
    225240
    226 Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp Stubs/TesselPoint_stub.cpp Stubs/TesselPoint_stub.hpp
     241Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp
    227242Tesselation_BoundaryTriangleUnitTest_LDADD = ${ALLLIBS}
    228243
    229 Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp Stubs/TesselPoint_stub.cpp Stubs/TesselPoint_stub.hpp
     244Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp
    230245Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS}
    231246
    232 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)  Stubs/TesselPoint_stub.cpp Stubs/TesselPoint_stub.hpp
    233 TestRunner_LDADD = ${ALLLIBS}
     247TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
     248TestRunner_LDADD = ${UILIBS} ${ALLLIBS}
    234249
    235250VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp
  • src/unittests/MatrixUnittest.cpp

    rd74077 r8f4df1  
    1111
    1212#include "MatrixUnittest.hpp"
    13 #include "Matrix.hpp"
    14 #include "vector.hpp"
     13#include "LinearAlgebra/Matrix.hpp"
     14#include "LinearAlgebra/Vector.hpp"
    1515#include "Exceptions/NotInvertibleException.hpp"
    1616
  • src/unittests/PlaneUnittest.cpp

    rd74077 r8f4df1  
    1818#endif /*HAVE_TESTRUNNER*/
    1919
    20 #include "vector.hpp"
    21 #include "Line.hpp"
     20#include "LinearAlgebra/Vector.hpp"
     21#include "LinearAlgebra/Line.hpp"
    2222
    2323CPPUNIT_TEST_SUITE_REGISTRATION( PlaneUnittest );
  • src/unittests/PlaneUnittest.hpp

    rd74077 r8f4df1  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #include "Plane.hpp"
     13#include "LinearAlgebra/Plane.hpp"
    1414
    1515class PlaneUnittest : public CppUnit::TestFixture
  • src/unittests/ShapeUnittest.cpp

    rd74077 r8f4df1  
    1616#endif /*HAVE_TESTRUNNER*/
    1717
     18#include "LinearAlgebra/Vector.hpp"
    1819#include "Shapes/Shape.hpp"
    19 #include "vector.cpp"
    2020
    2121// Registers the fixture into the 'registry'
  • src/unittests/ShapeUnittest.hpp

    rd74077 r8f4df1  
    1414class Vector;
    1515
    16 #include "vector.hpp"
     16#include "LinearAlgebra/Vector.hpp"
    1717
    1818class ShapeUnittest : public CppUnit::TestFixture
  • src/unittests/analysisbondsunittest.cpp

    rd74077 r8f4df1  
    2424#include "molecule.hpp"
    2525#include "periodentafel.hpp"
    26 #include "vector.hpp"
     26#include "LinearAlgebra/Vector.hpp"
    2727#include "World.hpp"
    2828
  • src/unittests/bondgraphunittest.cpp

    rd74077 r8f4df1  
    2323#include "bondgraph.hpp"
    2424#include "element.hpp"
    25 #include "log.hpp"
     25#include "Helpers/Log.hpp"
    2626#include "molecule.hpp"
    2727#include "periodentafel.hpp"
  • src/unittests/gslmatrixsymmetricunittest.hpp

    rd74077 r8f4df1  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #include "gslmatrix.hpp"
     13#include "LinearAlgebra/gslmatrix.hpp"
    1414
    1515/********************************************** Test classes **************************************/
  • src/unittests/gslmatrixunittest.hpp

    rd74077 r8f4df1  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #include "gslmatrix.hpp"
     13#include "LinearAlgebra/gslmatrix.hpp"
    1414
    1515/********************************************** Test classes **************************************/
  • src/unittests/gslvectorunittest.hpp

    rd74077 r8f4df1  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #include "gslvector.hpp"
     13#include "LinearAlgebra/gslvector.hpp"
    1414
    1515/********************************************** Test classes **************************************/
  • src/unittests/infounittest.cpp

    rd74077 r8f4df1  
    1515#include <stdio.h>
    1616
    17 #include "info.hpp"
     17#include "Helpers/Info.hpp"
    1818#include "infounittest.hpp"
    19 #include "log.hpp"
     19#include "Helpers/Log.hpp"
    2020
    2121#ifdef HAVE_TESTRUNNER
  • src/unittests/linearsystemofequationsunittest.cpp

    rd74077 r8f4df1  
    1515
    1616#include "linearsystemofequationsunittest.hpp"
    17 #include "vector.hpp"
     17#include "LinearAlgebra/Vector.hpp"
    1818
    1919#ifdef HAVE_TESTRUNNER
  • src/unittests/linearsystemofequationsunittest.hpp

    rd74077 r8f4df1  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #include "linearsystemofequations.hpp"
     13#include "LinearAlgebra/linearsystemofequations.hpp"
    1414
    1515/********************************************** Test classes **************************************/
  • src/unittests/logunittest.cpp

    rd74077 r8f4df1  
    1111
    1212#include "logunittest.hpp"
    13 #include "log.hpp"
     13#include "Helpers/Log.hpp"
    1414#include "defs.hpp"
    15 #include "verbose.hpp"
     15#include "Helpers/Verbose.hpp"
    1616
    1717#ifdef HAVE_TESTRUNNER
  • src/unittests/manipulateAtomsTest.cpp

    rd74077 r8f4df1  
    2222#include "World.hpp"
    2323#include "atom.hpp"
     24
     25#include "DummyUI.hpp"
    2426
    2527#ifdef HAVE_TESTRUNNER
     
    7274// set up and tear down
    7375void manipulateAtomsTest::setUp(){
     76  static bool hasDescriptor = false;
    7477  ActionHistory::init();
    7578  World::getInstance();
     79  // TODO: find a way to really reset the factory to a clean state in tear-down
     80  if(!hasDescriptor){
     81    UIFactory::registerFactory(new DummyUIFactory::description());
     82    hasDescriptor = true;
     83  }
     84  UIFactory::makeUserInterface("Dummy");
    7685  for(int i=0;i<ATOM_COUNT;++i){
    7786    atoms[i]= new AtomStub(i);
     
    8392  ActionRegistry::purgeInstance();
    8493  ActionHistory::purgeInstance();
     94  UIFactory::purgeInstance();
    8595}
    8696
  • src/unittests/memoryallocatorunittest.cpp

    rd74077 r8f4df1  
    1313#include "memoryallocatorunittest.hpp"
    1414#include "memoryusageobserver.hpp"
    15 #include "helpers.hpp"
    16 #include "log.hpp"
     15#include "Helpers/helpers.hpp"
     16#include "Helpers/Log.hpp"
    1717#include "defs.hpp"
    1818
  • src/unittests/stackclassunittest.cpp

    rd74077 r8f4df1  
    1313
    1414#include "stackclassunittest.hpp"
    15 #include "log.hpp"
     15#include "Helpers/Log.hpp"
    1616
    1717#ifdef HAVE_TESTRUNNER
  • src/unittests/tesselation_insideoutsideunittest.cpp

    rd74077 r8f4df1  
    2121#include "CandidateForTesselation.hpp"
    2222#include "tesselation_insideoutsideunittest.hpp"
    23 #include "verbose.hpp"
     23#include "Helpers/Verbose.hpp"
    2424
    2525#ifdef HAVE_TESTRUNNER
  • src/unittests/vectorunittest.cpp

    rd74077 r8f4df1  
    1414
    1515#include "defs.hpp"
    16 #include "log.hpp"
    17 #include "vector.hpp"
    18 #include "vector_ops.hpp"
     16#include "Helpers/Log.hpp"
     17#include "LinearAlgebra/Vector.hpp"
     18#include "LinearAlgebra/vector_ops.hpp"
    1919#include "vectorunittest.hpp"
    20 #include "Plane.hpp"
     20#include "LinearAlgebra/Plane.hpp"
    2121#include "Exceptions/LinearDependenceException.hpp"
    22 #include "Matrix.hpp"
     22#include "LinearAlgebra/Matrix.hpp"
    2323
    2424#ifdef HAVE_TESTRUNNER
  • src/unittests/vectorunittest.hpp

    rd74077 r8f4df1  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #include "vector.hpp"
     13#include "LinearAlgebra/Vector.hpp"
    1414
    1515/********************************************** Test classes **************************************/
  • test_all.sh

    rd74077 r8f4df1  
    135135      echo -n "    $test: " >> $outfile;
    136136      valgrind -v --error-exitcode=255 $test >> $logfile 2>&1;
    137       if $?
     137      if [ $? ]
    138138      then
    139139        echo "OK" >> $outfile
  • tests/Tesselations/Makefile.am

    rd74077 r8f4df1  
    1 TESTS = 1_2-dimethoxyethane.test \
    2 1_2-dimethylbenzene.test \
    3 2-methylcyclohexanone.test \
    4 benzene.test \
    5 cholesterol.test \
    6 cycloheptane.test \
    7 dimethyl_bromomalonate.test \
    8 glucose.test \
    9 heptan.test \
    10 isoleucine.test \
    11 neohexane.test \
    12 N_N-dimethylacetamide.test \
    13 proline.test \
    14 putrescine.test \
    15 tartaric_acid.test
     1TESTS = \
     2        1_2-dimethoxyethane.test \
     3        1_2-dimethylbenzene.test \
     4        2-methylcyclohexanone.test \
     5        benzene.test \
     6        cholesterol.test \
     7        cycloheptane.test \
     8        dimethyl_bromomalonate.test \
     9        glucose.test \
     10        isoleucine.test \
     11        neohexane.test \
     12        N_N-dimethylacetamide.test \
     13        proline.test \
     14        putrescine.test \
     15        tartaric_acid.test
     16
     17#       heptan.test
  • tests/Tesselations/defs.in

    rd74077 r8f4df1  
    5454        #echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf -e $exec_prefix -p ../$mol.xyz -N $RADIUS $FILENAME."
    5555        if [ -e $mol.dbond ]; then
    56                 $MOLECUILDER $mol.conf -e $exec_prefix -p ../$mol.xyz -A $mol.dbond --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$?
     56                $MOLECUILDER -i ../$mol.xyz -A $mol.dbond --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$?
    5757        else
    58                 $MOLECUILDER $mol.conf -e $exec_prefix -p ../$mol.xyz --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$?
     58                $MOLECUILDER -i ../$mol.xyz --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$?
    5959        fi
    6060        #echo "Molecuilder done with exitcode $exitcode."
  • tests/regression/testsuite-molecules.at

    rd74077 r8f4df1  
    6161
    6262# 8. Rotate to PAS
    63 AT_SETUP([Molecules - BROKEN: Rotate to PAS])
     63AT_SETUP([Molecules - Rotate to PAS])
    6464AT_KEYWORDS([Molecules])
    65 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/pre/test.* .], 0)
    66 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m 0], 0, [stdout], [stderr])
    67 #AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])
     65AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/pre/test-*.xyz .], 0)
     66AT_CHECK([../../molecuilder -i test-rotated-z90.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr])
     67AT_CHECK([file="test-rotated-z90.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])
     68AT_CHECK([../../molecuilder -i test-rotated-z180.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr])
     69AT_CHECK([file="test-rotated-z180.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])
     70AT_CHECK([../../molecuilder -i test-rotated-z360.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr])
     71AT_CHECK([file="test-rotated-z360.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])
     72AT_CHECK([../../molecuilder -i test-rotated-xYz20.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr])
     73AT_CHECK([file="test-rotated-xYz20.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])
    6874AT_CLEANUP
    6975
     76# 9. Rotate around origin
     77AT_SETUP([Molecules - Rotate around origin])
     78AT_KEYWORDS([Molecules])
     79AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0)
     80AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 90. --position "0,0,1"], 0, [stdout], [stderr])
     81AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z90.xyz], 0, [ignore], [ignore])
     82AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0)
     83AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 180. --position "0,0,1"], 0, [stdout], [stderr])
     84AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z180.xyz], 0, [ignore], [ignore])
     85AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0)
     86AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 360. --position "0,0,1"], 0, [stdout], [stderr])
     87AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z360.xyz], 0, [ignore], [ignore])
     88AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz], 0, [ignore], [ignore])
     89AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0)
     90AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 20. --position "1,2,1"], 0, [stdout], [stderr])
     91AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore])
     92AT_CLEANUP
     93
     94# 9. Rotate around self
     95AT_SETUP([Molecules - Rotate around self])
     96AT_KEYWORDS([Molecules])
     97AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0)
     98AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 90. --position "0,0,1"], 0, [stdout], [stderr])
     99AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z90.xyz], 0, [ignore], [ignore])
     100AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0)
     101AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 180. --position "0,0,1"], 0, [stdout], [stderr])
     102AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z180.xyz], 0, [ignore], [ignore])
     103AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0)
     104AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 360. --position "0,0,1"], 0, [stdout], [stderr])
     105AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z360.xyz], 0, [ignore], [ignore])
     106AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz], 0, [ignore], [ignore])
     107AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0)
     108AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 20. --position "1,2,1"], 0, [stdout], [stderr])
     109AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore])
     110AT_CLEANUP
     111
Note: See TracChangeset for help on using the changeset viewer.