Changes in / [daa714:4917cc4]


Ignore:
Files:
78 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionRegistry.cpp

    rdaa714 r4917cc4  
    4343}
    4444
    45 void ActionRegistry::unregisterAction(Action* action){
    46   actionMap.erase(action->getName());
    47 }
    48 
    4945std::map<const std::string,Action*>::iterator ActionRegistry::getBeginIter()
    5046{
  • src/Actions/ActionRegistry.hpp

    rdaa714 r4917cc4  
    2222  Action* getActionByName(const std::string);
    2323  void registerAction(Action*);
    24   void unregisterAction(Action*);
    2524
    2625  std::map<const std::string,Action*>::iterator getBeginIter();
  • src/Actions/CmdAction/HelpAction.cpp

    rdaa714 r4917cc4  
    1616#include "UIElements/UIFactory.hpp"
    1717#include "UIElements/Dialog.hpp"
    18 #include "Actions/MapOfActions.hpp"
    1918
    2019const char CommandLineHelpAction::NAME[] = "help";
  • src/Actions/CmdAction/VersionAction.cpp

    rdaa714 r4917cc4  
    1616#include "UIElements/UIFactory.hpp"
    1717#include "UIElements/Dialog.hpp"
    18 #include "Actions/MapOfActions.hpp"
    1918
    2019const char CommandLineVersionAction::NAME[] = "version";
  • src/Actions/MoleculeAction/ChangeNameAction.cpp

    rdaa714 r4917cc4  
    1515#include "UIElements/UIFactory.hpp"
    1616#include "UIElements/Dialog.hpp"
    17 #include "Actions/MapOfActions.hpp"
    1817
    1918#include "atom.hpp"
     
    3635const char MoleculeChangeNameAction::NAME[] = "Change filename of Molecule";
    3736
    38 MoleculeChangeNameAction::MoleculeChangeNameAction() :
    39   Action(NAME)
     37MoleculeChangeNameAction::MoleculeChangeNameAction(MoleculeListClass *_molecules) :
     38  Action(NAME),
     39  molecules(_molecules)
    4040{}
    4141
     
    4848  Dialog *dialog = UIFactory::getInstance().makeDialog();
    4949
    50   dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
     50  dialog->queryMolecule("Enter index of molecule: ",&mol,molecules);
    5151  dialog->queryString("Enter name: ",&filename);
    5252
  • src/Actions/MoleculeAction/ChangeNameAction.hpp

    rdaa714 r4917cc4  
    1616class MoleculeChangeNameAction : public Action {
    1717public:
    18   MoleculeChangeNameAction();
     18  MoleculeChangeNameAction(MoleculeListClass*);
    1919  virtual ~MoleculeChangeNameAction();
    2020
  • src/Actions/ParserAction/LoadXyzAction.cpp

    rdaa714 r4917cc4  
    1616#include "UIElements/UIFactory.hpp"
    1717#include "UIElements/Dialog.hpp"
    18 #include "Actions/MapOfActions.hpp"
    1918
    2019#include "atom.hpp"
  • src/Actions/ParserAction/SaveXyzAction.cpp

    rdaa714 r4917cc4  
    1616#include "UIElements/UIFactory.hpp"
    1717#include "UIElements/Dialog.hpp"
    18 #include "Actions/MapOfActions.hpp"
    1918
    2019#include "atom.hpp"
  • src/CommandLineParser.cpp

    rdaa714 r4917cc4  
    3636void CommandLineParser::Parse()
    3737{
    38   po::store(po::command_line_parser(argc,argv).options(cmdline_options).options(visible).positional(inputfile).run(), vm);
     38  po::store(po::command_line_parser(argc,argv).options(cmdline_options).run(), vm);
     39  po::store(po::command_line_parser(argc,argv).options(visible).run(), vm);
    3940  ifstream input;
    4041  input.open("example.cfg");
     
    4445  po::notify(vm);
    4546}
    46 
    47 
    4847
    4948/** States whether there are command line arguments.
  • src/CommandLineParser.hpp

    rdaa714 r4917cc4  
    3434  po::options_description config;
    3535  po::options_description hidden;
    36   po::positional_options_description inputfile;
    3736
    3837  po::options_description visible;
  • src/Legacy/oldmenu.cpp

    rdaa714 r4917cc4  
    3535#include "Menu/DisplayMenuItem.hpp"
    3636#include "Menu/SubMenuItem.hpp"
    37 #include "Actions/MapOfActions.hpp"
    3837#include "Actions/MethodAction.hpp"
    3938#include "Actions/ErrorAction.hpp"
     
    909908  molecule *srcmol = NULL, *destmol = NULL;
    910909  Dialog *dialog = UIFactory::getInstance().makeDialog();
    911   dialog->queryMolecule("molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
    912   dialog->queryMolecule("molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
     910  dialog->queryMolecule("Enter index of destination molecule: ",&destmol, molecules);
     911  dialog->queryMolecule("Enter index of source molecule to add from: ",&srcmol, molecules);
    913912  if(dialog->display()) {
    914913    molecules->SimpleAdd(srcmol, destmol);
     
    923922  molecule *srcmol = NULL, *destmol = NULL;
    924923  Dialog *dialog = UIFactory::getInstance().makeDialog();
    925   dialog->queryMolecule("molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
    926   dialog->queryMolecule("molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
     924  dialog->queryMolecule("Enter index of matrix molecule (the variable one): ",&srcmol,molecules);
     925  dialog->queryMolecule("Enter index of molecule to merge into (the fixed one): ",&destmol,molecules);
    927926  if(dialog->display()) {
    928927    molecules->EmbedMerge(destmol, srcmol);
  • src/Makefile.am

    rdaa714 r4917cc4  
    5050
    5151ACTIONSSOURCE = Actions/Action.cpp \
    52   ${ANALYSISACTIONSOURCE} \
    5352  ${ATOMACTIONSOURCE} \
    5453  ${CMDACTIONSOURCE} \
     
    5756  ${PARSERACTIONSOURCE} \
    5857  ${TESSELATIONACTIONSOURCE} \
    59   ${WORLDACTIONSOURCE} \
    6058  Actions/ActionHistory.cpp \
    6159  Actions/ActionRegistry.cpp \
     
    6462  Actions/MakroAction.cpp \
    6563  Actions/ManipulateAtomsProcess.cpp \
    66   Actions/MapOfActions.cpp \
    6764  Actions/MethodAction.cpp \
    6865  Actions/Process.cpp
    6966
    7067ACTIONSHEADER = Actions/Action.hpp \
    71   ${ANALYSISACTIONHEADER} \
    7268  ${ATOMACTIONHEADER} \
    7369  ${CMDACTIONHEADER} \
     
    7672  ${PARSERACTIONHEADER} \
    7773  ${TESSELATIONACTIONHEADER} \
    78   ${WORLDACTIONHEADER} \
    7974  Actions/ActionHistory.hpp \
    8075  Actions/ActionRegistry.hpp \
     
    8580  Actions/MakroAction.hpp \
    8681  Actions/ManipulateAtomsProcess.hpp \
    87   Actions/MapOfActions.hpp \
    8882  Actions/MethodAction.hpp \
    8983  Actions/Process.hpp
    9084 
    91 ANALYSISACTIONSOURCE = \
    92   Actions/AnalysisAction/MolecularVolumeAction.cpp \
    93   Actions/AnalysisAction/PairCorrelationAction.cpp \
    94   Actions/AnalysisAction/PairCorrelationToPointAction.cpp \
    95   Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp \
    96   Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
    97 ANALYSISACTIONHEADER = \
    98   Actions/AnalysisAction/MolecularVolumeAction.hpp \
    99   Actions/AnalysisAction/PairCorrelationAction.hpp \
    100   Actions/AnalysisAction/PairCorrelationToPointAction.hpp \
    101   Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp \
    102   Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
    103 
    104 ATOMACTIONSOURCE = \
    105   Actions/AtomAction/AddAction.cpp \
    106   Actions/AtomAction/ChangeElementAction.cpp \
    107   Actions/AtomAction/RemoveAction.cpp
    108 ATOMACTIONHEADER = \
    109   Actions/AtomAction/AddAction.hpp \
    110   Actions/AtomAction/ChangeElementAction.hpp \
    111   Actions/AtomAction/RemoveAction.cpp
     85ATOMACTIONSOURCE =
     86#  Actions/AtomAction/SomeAction.cpp               
     87ATOMACTIONHEADER =
     88#  Actions/AtomAction/SomeAction.hpp
    11289
    11390CMDACTIONSOURCE = \
    114   Actions/CmdAction/BondLengthTableAction.cpp \
    115   Actions/CmdAction/ElementDbAction.cpp \
    116   Actions/CmdAction/FastParsingAction.cpp \
    11791  Actions/CmdAction/HelpAction.cpp \
    118   Actions/CmdAction/VerboseAction.cpp \
    11992  Actions/CmdAction/VersionAction.cpp
    12093CMDACTIONHEADER = \
    121   Actions/CmdAction/BondLengthTableAction.hpp \
    122   Actions/CmdAction/ElementDbAction.hpp \
    123   Actions/CmdAction/FastParsingAction.hpp \
    12494  Actions/CmdAction/HelpAction.hpp \
    125   Actions/CmdAction/VerboseAction.hpp \
    12695  Actions/CmdAction/VersionAction.hpp
    12796
    128 FRAGMENTATIONACTIONSOURCE = \
    129   Actions/FragmentationAction/DepthFirstSearchAction.cpp \
    130   Actions/FragmentationAction/FragmentationAction.cpp \
    131   Actions/FragmentationAction/SubgraphDissectionAction.cpp               
    132 FRAGMENTATIONACTIONHEADER = \
    133   Actions/FragmentationAction/DepthFirstSearchAction.hpp \
    134   Actions/FragmentationAction/FragmentationAction.hpp \
    135   Actions/FragmentationAction/SubgraphDissectionAction.hpp
     97FRAGMENTATIONACTIONSOURCE =
     98#  Actions/FragmentationAction/SomeAction.cpp               
     99FRAGMENTATIONACTIONHEADER =
     100#  Actions/FragmentationAction/SomeAction.hpp
    136101
    137102MOLECULEACTIONSOURCE = \
    138   Actions/MoleculeAction/BondFileAction.cpp \
    139   Actions/MoleculeAction/ChangeNameAction.cpp \
    140   Actions/MoleculeAction/FillWithMoleculeAction.cpp \
    141   Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \
    142   Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
    143   Actions/MoleculeAction/SaveAdjacencyAction.cpp \
    144   Actions/MoleculeAction/SaveBondsAction.cpp \
    145   Actions/MoleculeAction/SaveTemperatureAction.cpp \
    146   Actions/MoleculeAction/SuspendInWaterAction.cpp \
    147   Actions/MoleculeAction/TranslateAction.cpp \
    148   Actions/MoleculeAction/VerletIntegrationAction.cpp
     103  Actions/MoleculeAction/ChangeNameAction.cpp
    149104MOLECULEACTIONHEADER = \
    150   Actions/MoleculeAction/BondFileAction.hpp \
    151   Actions/MoleculeAction/ChangeNameAction.hpp \
    152   Actions/MoleculeAction/FillWithMoleculeAction.hpp \
    153   Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \
    154   Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
    155   Actions/MoleculeAction/SaveAdjacencyAction.hpp \
    156   Actions/MoleculeAction/SaveBondsAction.hpp \
    157   Actions/MoleculeAction/SaveTemperatureAction.hpp \
    158   Actions/MoleculeAction/SuspendInWaterAction.hpp \
    159   Actions/MoleculeAction/TranslateAction.hpp \
    160   Actions/MoleculeAction/VerletIntegrationAction.hpp
     105  Actions/MoleculeAction/ChangeNameAction.hpp
    161106                 
    162107PARSERACTIONSOURCE = \
     
    167112  Actions/ParserAction/SaveXyzAction.hpp
    168113
    169 TESSELATIONACTIONSOURCE = \
    170   Actions/TesselationAction/ConvexEnvelopeAction.cpp \
    171   Actions/TesselationAction/NonConvexEnvelopeAction.cpp               
    172 TESSELATIONACTIONHEADER = \
    173   Actions/TesselationAction/ConvexEnvelopeAction.hpp \
    174   Actions/TesselationAction/NonConvexEnvelopeAction.hpp
    175 
    176 WORLDACTIONSOURCE = \
    177   Actions/WorldAction/AddEmptyBoundaryAction.cpp \
    178   Actions/WorldAction/BoundInBoxAction.cpp \
    179   Actions/WorldAction/CenterInBoxAction.cpp \
    180   Actions/WorldAction/CenterOnEdgeAction.cpp \
    181   Actions/WorldAction/ChangeBoxAction.cpp \
    182   Actions/WorldAction/RemoveSphereOfAtomsAction.cpp \
    183   Actions/WorldAction/RepeatBoxAction.cpp \
    184   Actions/WorldAction/ScaleBoxAction.cpp \
    185   Actions/WorldAction/SetDefaultNameAction.cpp \
    186   Actions/WorldAction/SetGaussianBasisAction.cpp               
    187 WORLDACTIONHEADER = \
    188   Actions/WorldAction/AddEmptyBoundaryAction.hpp \
    189   Actions/WorldAction/BoundInBoxAction.hpp \
    190   Actions/WorldAction/CenterInBoxAction.hpp \
    191   Actions/WorldAction/CenterOnEdgeAction.hpp \
    192   Actions/WorldAction/ChangeBoxAction.hpp \
    193   Actions/WorldAction/RemoveSphereOfAtomsAction.hpp \
    194   Actions/WorldAction/RepeatBoxAction.hpp \
    195   Actions/WorldAction/ScaleBoxAction.hpp \
    196   Actions/WorldAction/SetDefaultNameAction.hpp \
    197   Actions/WorldAction/SetGaussianBasisAction.hpp
    198 
    199 
     114TESSELATIONACTIONSOURCE =
     115#  Actions/TesselationAction/SomeAction.cpp               
     116TESSELATIONACTIONHEADER =
     117#  Actions/TesselationAction/SomeAction.hpp
    200118
    201119PARSERSOURCE = \
  • src/Parser/XyzParser.cpp

    rdaa714 r4917cc4  
    5959
    6060  vector<atom*> atoms = World::getInstance().getAllAtoms();
    61   for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) {
     61  for(vector<atom*>::iterator it = atoms.begin(); it < atoms.end(); it++) {
    6262    *file << fixed << (*it)->getType()->symbol << "\t" << (*it)->x[0] << "\t" << (*it)->x[1] << "\t" << (*it)->x[2] << endl;
    6363  }
  • src/UIElements/CommandLineDialog.cpp

    rdaa714 r4917cc4  
    1010#include <iostream>
    1111
    12 #include <Descriptors/AtomDescriptor.hpp>
    13 #include <Descriptors/AtomIdDescriptor.hpp>
    1412#include <Descriptors/MoleculeDescriptor.hpp>
    1513#include <Descriptors/MoleculeIdDescriptor.hpp>
    1614#include "UIElements/CommandLineDialog.hpp"
    1715
    18 #include "element.hpp"
    1916#include "periodentafel.hpp"
     17#include "atom.hpp"
    2018#include "CommandLineParser.hpp"
    2119#include "defs.hpp"
     20#include "molecule.hpp"
    2221#include "log.hpp"
    23 #include "periodentafel.hpp"
    2422#include "verbose.hpp"
    2523#include "World.hpp"
    26 
    27 #include "atom.hpp"
    28 #include "element.hpp"
    29 #include "molecule.hpp"
    30 #include "vector.hpp"
    3124
    3225using namespace std;
     
    5043}
    5144
    52 void CommandLineDialog::queryBoolean(const char* title, bool* target, string _description){
    53   registerQuery(new BooleanCommandLineQuery(title,target, _description));
    54 }
    55 
    5645void CommandLineDialog::queryDouble(const char* title, double* target, string _description){
    5746  registerQuery(new DoubleCommandLineQuery(title,target, _description));
     
    6251}
    6352
    64 void CommandLineDialog::queryAtom(const char* title, atom **target, string _description) {
    65   registerQuery(new AtomCommandLineQuery(title,target, _description));
    66 }
    67 
    68 void CommandLineDialog::queryMolecule(const char* title, molecule **target, string _description) {
    69   registerQuery(new MoleculeCommandLineQuery(title,target, _description));
     53void CommandLineDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string _description) {
     54  registerQuery(new MoleculeCommandLineQuery(title,target,molecules, _description));
    7055}
    7156
    7257void CommandLineDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string _description) {
    7358  registerQuery(new VectorCommandLineQuery(title,target,cellSize,check, _description));
    74 }
    75 
    76 void CommandLineDialog::queryBox(const char* title, double ** const cellSize, string _description) {
    77   registerQuery(new BoxCommandLineQuery(title,cellSize,_description));
    7859}
    7960
     
    10990}
    11091
    111 CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title,bool *_target, string _description) :
    112     Dialog::BooleanQuery(title,_target, _description)
    113 {}
    114 
    115 CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
    116 
    117 bool CommandLineDialog::BooleanCommandLineQuery::handle() {
    118   bool badInput = false;
    119   char input = ' ';
    120   do{
    121     badInput = false;
    122     Log() << Verbose(0) << getTitle();
    123     cin >> input;
    124     if ((input == 'y' ) || (input == 'Y')) {
    125       tmp = true;
    126     } else if ((input == 'n' ) || (input == 'N')) {
    127       tmp = false;
    128     } else {
    129       badInput=true;
    130       cin.clear();
    131       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    132       Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
    133     }
    134   } while(badInput);
    135   // clear the input buffer of anything still in the line
    136   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    137   return true;
    138 }
    139 
    14092CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title,string *_target, string _description) :
    14193    Dialog::StringQuery(title,_target, _description)
     
    166118}
    167119
    168 CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, atom **_target, string _description) :
    169     Dialog::AtomQuery(title,_target, _description)
    170 {}
    171 
    172 CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
    173 
    174 bool CommandLineDialog::AtomCommandLineQuery::handle() {
    175   int IdxOfAtom = -1;
    176   if (CommandLineParser::getInstance().vm.count(getTitle())) {
    177     IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
    178     tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
    179     return true;
    180   } else
    181     return false;
    182 }
    183 
    184 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, string _description) :
    185     Dialog::MoleculeQuery(title,_target, _description)
     120CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, MoleculeListClass *_molecules, string _description) :
     121    Dialog::MoleculeQuery(title,_target,_molecules, _description)
    186122{}
    187123
     
    210146    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
    211147    assert((temp.size() == 3) && "Vector from command line does not have three components.");
     148    tmp = new Vector;
    212149    for (int i=0;i<NDIM;i++)
    213150      tmp->at(i) = temp[i];
     
    217154}
    218155
    219 
    220 CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, double ** const _cellSize, string _description) :
    221     Dialog::BoxQuery(title,_cellSize, _description)
    222 {}
    223 
    224 CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
    225 {}
    226 
    227 bool CommandLineDialog::BoxCommandLineQuery::handle() {
    228   vector<double> temp;
    229   if (CommandLineParser::getInstance().vm.count(getTitle())) {
    230     temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
    231     assert((temp.size() == 6) && "Symmetric box matrix from command line does not have six components.");
    232     for (int i=0;i<6;i++)
    233       tmp[i] = temp[i];
    234     return true;
    235   } else
    236     return false;
    237 }
    238156
    239157CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, const element **target, string _description) :
     
    245163
    246164bool CommandLineDialog::ElementCommandLineQuery::handle() {
    247   // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
    248   int Z;
     165  int Z = -1;
    249166  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    250     vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
    251     vector<int>::iterator ElementRunner = AllElements.begin();
    252     Z = *ElementRunner;
    253     // TODO: So far, this does not really erase the element in the parsed list.
    254     AllElements.erase(ElementRunner);
     167    Z = CommandLineParser::getInstance().vm[getTitle()].as<int>();
    255168    tmp = World::getInstance().getPeriode()->FindElement(Z);
    256169    return true;
  • src/UIElements/CommandLineDialog.hpp

    rdaa714 r4917cc4  
    1010
    1111#include <string>
    12 
    13 class atom;
    14 class element;
    15 class molecule;
    16 class Vector;
    1712
    1813#include "UIElements/Dialog.hpp"
     
    2924  virtual void queryEmpty(const char *, std::string = "");
    3025  virtual void queryInt(const char *, int *, std::string = "");
    31   virtual void queryBoolean(const char *, bool *, std::string = "");
    3226  virtual void queryString(const char*, std::string *, std::string = "");
    3327  virtual void queryDouble(const char*, double*, std::string = "");
    34   virtual void queryAtom(const char*,atom**, std::string = "");
    35   virtual void queryMolecule(const char*,molecule**,std::string = "");
     28  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "");
    3629  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
    37   virtual void queryBox(const char*,double ** const, std::string = "");
    3830  virtual void queryElement(const char*,const element **, std::string = "");
    3931
     
    5446  };
    5547
    56   class BooleanCommandLineQuery : public Dialog::BooleanQuery {
    57   public:
    58     BooleanCommandLineQuery(std::string title, bool *_target, std::string _description = "");
    59     virtual ~BooleanCommandLineQuery();
    60     virtual bool handle();
    61   };
    62 
    6348  class DoubleCommandLineQuery : public Dialog::DoubleQuery {
    6449  public:
     
    7560  };
    7661
    77   class AtomCommandLineQuery : public Dialog::AtomQuery {
    78   public:
    79     AtomCommandLineQuery(std::string title, atom **_target, std::string _description = "");
    80     virtual ~AtomCommandLineQuery();
    81     virtual bool handle();
    82   };
    83 
    8462  class MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
    8563  public:
    86     MoleculeCommandLineQuery(std::string title, molecule **_target, std::string _description = "");
     64    MoleculeCommandLineQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = "");
    8765    virtual ~MoleculeCommandLineQuery();
    8866    virtual bool handle();
     
    9371    VectorCommandLineQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
    9472    virtual ~VectorCommandLineQuery();
    95     virtual bool handle();
    96   };
    97 
    98   class BoxCommandLineQuery : public Dialog::BoxQuery {
    99   public:
    100     BoxCommandLineQuery(std::string title,double ** const _cellSize, std::string _description = "");
    101     virtual ~BoxCommandLineQuery();
    10273    virtual bool handle();
    10374  };
  • src/UIElements/CommandLineWindow.cpp

    rdaa714 r4917cc4  
    1212
    1313#include "Actions/ActionRegistry.hpp"
    14 #include "Actions/AnalysisAction/PairCorrelationAction.hpp"
    15 #include "Actions/AnalysisAction/PairCorrelationToPointAction.hpp"
    16 #include "Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp"
    17 #include "Actions/AtomAction/AddAction.hpp"
    18 #include "Actions/AtomAction/ChangeElementAction.hpp"
    19 #include "Actions/AtomAction/RemoveAction.hpp"
    20 #include "Actions/CmdAction/BondLengthTableAction.hpp"
    21 #include "Actions/CmdAction/ElementDbAction.hpp"
    22 #include "Actions/CmdAction/FastParsingAction.hpp"
    2314#include "Actions/CmdAction/HelpAction.hpp"
    24 #include "Actions/CmdAction/VerboseAction.hpp"
    2515#include "Actions/CmdAction/VersionAction.hpp"
    26 #include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
    27 #include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
    28 #include "Actions/MoleculeAction/BondFileAction.hpp"
    29 #include "Actions/MoleculeAction/ChangeNameAction.hpp"
    30 #include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
    31 #include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
    32 #include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
    33 #include "Actions/MoleculeAction/SaveBondsAction.hpp"
    34 #include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
    35 #include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
    3616#include "Actions/ParserAction/LoadXyzAction.hpp"
    3717#include "Actions/ParserAction/SaveXyzAction.hpp"
    38 #include "Actions/TesselationAction/ConvexEnvelopeAction.hpp"
    39 #include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp"
    40 #include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
    41 #include "Actions/WorldAction/BoundInBoxAction.hpp"
    42 #include "Actions/WorldAction/CenterInBoxAction.hpp"
    43 #include "Actions/WorldAction/CenterOnEdgeAction.hpp"
    44 #include "Actions/WorldAction/ChangeBoxAction.hpp"
    45 #include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
    46 #include "Actions/WorldAction/RepeatBoxAction.hpp"
    47 #include "Actions/WorldAction/ScaleBoxAction.hpp"
    48 #include "Actions/WorldAction/SetDefaultNameAction.hpp"
    49 #include "Actions/WorldAction/SetGaussianBasisAction.hpp"
    5018#include "CommandLineParser.hpp"
    5119
     
    5826{
    5927  // create and register all command line callable actions
    60   populateAnalysisActions();
    6128  populateAtomActions();
    6229  populateCmdActions();
     
    6532  populateParserActions();
    6633  populateTesselationActions();
    67   populateWorldActions();
    6834
    6935  // Add status indicators etc...
     
    7339CommandLineWindow::~CommandLineWindow()
    7440{
    75   // go through all possible actions
    76   for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRegistry::getInstance().getBeginIter() != ActionRegistry::getInstance().getEndIter(); ActionRunner = ActionRegistry::getInstance().getBeginIter()) {
    77     ActionRegistry::getInstance().unregisterAction(ActionRunner->second);
    78     delete(ActionRunner->second);
    79   }
    80 
    8141  delete statusIndicator;
    8242}
     
    9252}
    9353
    94 void CommandLineWindow::populateAnalysisActions()
    95 {
    96   new AnalysisPairCorrelationAction();
    97   new AnalysisPairCorrelationToPointAction();
    98   new AnalysisPairCorrelationToSurfaceAction();
    99 }
    100 
    10154void CommandLineWindow::populateAtomActions()
    10255{
    103   new AtomAddAction();
    104   new AtomChangeElementAction();
    105   new AtomRemoveAction();
    10656}
    10757
    10858void CommandLineWindow::populateCmdActions()
    10959{
    110   new CommandLineBondLengthTableAction();
    111   new CommandLineElementDbAction();
    112   new CommandLineFastParsingAction();
    11360  new CommandLineHelpAction();
    114   new CommandLineVerboseAction();
    11561  new CommandLineVersionAction();
    11662}
     
    11864void CommandLineWindow::populateFragmentationActions()
    11965{
    120   new FragmentationDepthFirstSearchAction();
    12166}
    12267
    12368void CommandLineWindow::populateMoleculeActions()
    12469{
    125   new MoleculeBondFileAction();
    126   new MoleculeChangeNameAction();
    127   new MoleculeFillWithMoleculeAction();
    128   new MoleculeLinearInterpolationofTrajectoriesAction();
    129   new MoleculeSaveAdjacencyAction();
    130   new MoleculeSaveBondsAction();
    131   new MoleculeSaveTemperatureAction();
    132   new MoleculeVerletIntegrationAction();
    13370}
    13471
     
    14178void CommandLineWindow::populateTesselationActions()
    14279{
    143   new TesselationConvexEnvelopeAction();
    144   new TesselationNonConvexEnvelopeAction();
    14580}
    14681
    147 void CommandLineWindow::populateWorldActions()
    148 {
    149   new WorldAddEmptyBoundaryAction();
    150   new WorldBoundInBoxAction();
    151   new WorldCenterInBoxAction();
    152   new WorldCenterOnEdgeAction();
    153   new WorldChangeBoxAction();
    154   new WorldRemoveSphereOfAtomsAction();
    155   new WorldRepeatBoxAction();
    156   new WorldScaleBoxAction();
    157   new WorldSetDefaultNameAction();
    158   new WorldSetGaussianBasisAction();
    159 }
  • src/UIElements/CommandLineWindow.hpp

    rdaa714 r4917cc4  
    2323private:
    2424  // populaters
    25   void populateAnalysisActions();
    2625  void populateAtomActions();
    2726  void populateCmdActions();
     
    3029  void populateParserActions();
    3130  void populateTesselationActions();
    32   void populateWorldActions();
    3331
    3432  CommandLineStatusIndicator *statusIndicator;
  • src/UIElements/Dialog.cpp

    rdaa714 r4917cc4  
    1010#include "UIElements/Dialog.hpp"
    1111
    12 #include "atom.hpp"
    13 #include "element.hpp"
    14 #include "molecule.hpp"
    1512#include "vector.hpp"
    1613
     
    9188}
    9289
    93 // Int Queries
    94 
    95 Dialog::BooleanQuery::BooleanQuery(string title,bool *_target, std::string description) :
    96     Query(title, description), target(_target)
    97 {}
    98 
    99 Dialog::BooleanQuery::~BooleanQuery() {}
    100 
    101 void Dialog::BooleanQuery::setResult() {
    102   *target = tmp;
    103 }
    104 
    10590// String Queries
    10691
     
    128113
    129114
    130 // Atom Queries
     115// Molecule Queries
    131116
    132 Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) :
     117Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) :
    133118    Query(title, _description),
    134119    tmp(0),
    135     target(_target)
    136 
    137 {}
    138 
    139 Dialog::AtomQuery::~AtomQuery() {}
    140 
    141 void Dialog::AtomQuery::setResult() {
    142   *target = tmp;
    143 }
    144 
    145 // Molecule Queries
    146 
    147 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) :
    148     Query(title, _description),
    149     tmp(0),
     120    molecules(_molecules),
    150121    target(_target)
    151122
     
    178149}
    179150
    180 // Box Queries
    181 
    182 Dialog::BoxQuery::BoxQuery(std::string title, double ** const _cellSize, std::string _description) :
    183   Query(title, _description),
    184   target(_cellSize)
    185 {
    186     tmp = new double[6];
    187 }
    188 
    189 Dialog::BoxQuery::~BoxQuery()
    190 {
    191   delete[] tmp;
    192 }
    193 
    194 void Dialog::BoxQuery::setResult() {
    195   for (int i=0;i<6;i++)
    196     *target[i] = tmp[i];
    197 }
    198 
    199151// Element Queries
    200152Dialog::ElementQuery::ElementQuery(std::string title, const element **_target, std::string _description) :
  • src/UIElements/Dialog.hpp

    rdaa714 r4917cc4  
    1212#include<list>
    1313
    14 class atom;
    15 class element;
     14class MoleculeListClass;
    1615class molecule;
    1716class Vector;
     17class element;
    1818
    1919class Dialog
     
    2424
    2525  virtual void queryEmpty(const char *, std::string = "")=0;
    26   virtual void queryBoolean(const char *, bool *, std::string = "")=0;
    2726  virtual void queryInt(const char *, int *, std::string = "")=0;
    2827  virtual void queryDouble(const char*,double *, std::string = "")=0;
    2928  virtual void queryString(const char*, std::string *, std::string = "")=0;
    30   virtual void queryAtom(const char*,atom**,std::string = "")=0;
    31   virtual void queryMolecule(const char*,molecule**, std::string = "")=0;
     29  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "")=0;
    3230  virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0;
    33   virtual void queryBox(const char*,double ** const, std::string = "")=0;
    3431  virtual void queryElement(const char*,const element **, std::string = "")=0;
    3532
     
    7269
    7370  //Specialized classes for certain types. GUI-Types are not specialized at this time
    74   class BooleanQuery : public Query {
    75   public:
    76     BooleanQuery(std::string title,bool *_target, std::string _description = "");
    77     virtual ~BooleanQuery();
    78     virtual bool handle()=0;
    79     virtual void setResult();
    80   protected:
    81     bool tmp;
    82   private:
    83     bool *target;
    84   };
    85 
    8671  class IntQuery : public Query {
    8772  public:
     
    120105  };
    121106
     107
    122108  class MoleculeQuery : public Query {
    123109  public:
    124     MoleculeQuery(std::string title, molecule **_target, std::string _description = "");
     110    MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = "");
    125111    virtual ~MoleculeQuery();
    126112    virtual bool handle()=0;
     
    128114  protected:
    129115    molecule *tmp;
     116    MoleculeListClass *molecules;
    130117  private:
    131118    molecule **target;
    132   };
    133 
    134   class AtomQuery : public Query {
    135   public:
    136     AtomQuery(std::string title, atom **_target, std::string _description = "");
    137     virtual ~AtomQuery();
    138     virtual bool handle()=0;
    139     virtual void setResult();
    140   protected:
    141     atom *tmp;
    142   private:
    143     atom **target;
    144119  };
    145120
     
    156131    private:
    157132      Vector *target;
    158   };
    159 
    160   class BoxQuery : public Query {
    161   public:
    162       BoxQuery(std::string title,double ** const _cellSize, std::string _description = "");
    163       virtual ~BoxQuery();
    164       virtual bool handle()=0;
    165       virtual void setResult();
    166     protected:
    167       double *tmp;
    168     private:
    169       double **target;
    170133  };
    171134
  • src/UIElements/TextDialog.cpp

    rdaa714 r4917cc4  
    88#include <iostream>
    99
    10 #include <Descriptors/AtomDescriptor.hpp>
    11 #include <Descriptors/AtomIdDescriptor.hpp>
    12 #include <Descriptors/MoleculeDescriptor.hpp>
    13 #include <Descriptors/MoleculeIdDescriptor.hpp>
    1410#include "UIElements/TextDialog.hpp"
    1511
    1612#include "World.hpp"
    1713#include "periodentafel.hpp"
     14#include "atom.hpp"
     15#include "molecule.hpp"
    1816#include "log.hpp"
    1917#include "verbose.hpp"
    2018
    21 #include "atom.hpp"
    22 #include "element.hpp"
    23 #include "molecule.hpp"
    24 #include "vector.hpp"
    25 
    2619using namespace std;
    2720
     
    4033}
    4134
    42 void TextDialog::queryBoolean(const char* title, bool* target, string description){
    43   registerQuery(new BooleanTextQuery(title,target,description));
    44 }
    45 
    4635void TextDialog::queryInt(const char* title, int* target, string description){
    4736  registerQuery(new IntTextQuery(title,target,description));
     
    5645}
    5746
    58 void TextDialog::queryAtom(const char* title, atom **target, string description) {
    59   registerQuery(new AtomTextQuery(title,target,description));
    60 }
    61 
    62 void TextDialog::queryMolecule(const char* title, molecule **target, string description) {
    63   registerQuery(new MoleculeTextQuery(title,target,description));
     47void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string description) {
     48  registerQuery(new MoleculeTextQuery(title,target,molecules,description));
    6449}
    6550
    6651void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) {
    6752  registerQuery(new VectorTextQuery(title,target,cellSize,check,description));
    68 }
    69 
    70 void TextDialog::queryBox(const char* title,double ** const cellSize, string description) {
    71   registerQuery(new BoxTextQuery(title,cellSize,description));
    7253}
    7354
     
    11394}
    11495
    115 TextDialog::BooleanTextQuery::BooleanTextQuery(string title, bool * _target, std::string _description) :
    116     Dialog::BooleanQuery(title,_target,_description)
    117 {}
    118 
    119 TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
    120 
    121 bool TextDialog::BooleanTextQuery::handle() {
    122   bool badInput = false;
    123   char input = ' ';
    124   do{
    125     badInput = false;
    126     Log() << Verbose(0) << getTitle();
    127     cin >> input;
    128     if ((input == 'y' ) || (input == 'Y')) {
    129       tmp = true;
    130     } else if ((input == 'n' ) || (input == 'N')) {
    131       tmp = false;
    132     } else {
    133       badInput=true;
    134       cin.clear();
    135       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    136       Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
    137     }
    138   } while(badInput);
    139   // clear the input buffer of anything still in the line
    140   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    141   return true;
    142 }
    143 
    14496TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) :
    14597    Dialog::StringQuery(title,_target,_description)
     
    177129}
    178130
    179 TextDialog::AtomTextQuery::AtomTextQuery(string title, atom **_target, std::string _description) :
    180     Dialog::AtomQuery(title,_target,_description)
    181 {}
    182 
    183 TextDialog::AtomTextQuery::~AtomTextQuery() {}
    184 
    185 bool TextDialog::AtomTextQuery::handle() {
    186   int idxOfAtom=0;
    187   bool badInput = false;
    188   do{
    189     badInput = false;
    190     Log() << Verbose(0) << getTitle();
    191     cin >> idxOfAtom;
    192     if(cin.fail()){
    193       badInput = true;
    194       cin.clear();
    195       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    196       Log() << Verbose(0) << "Input was not a number!" << endl;
    197       continue;
    198     }
    199 
    200     tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
    201     if(!tmp && idxOfAtom!=-1){
    202       Log() << Verbose(0) << "Invalid Atom Index" << endl;
    203       badInput = true;
    204     }
    205 
    206   } while(badInput);
    207   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    208   return (idxOfAtom!=-1);
    209 }
    210 
    211 TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, std::string _description) :
    212     Dialog::MoleculeQuery(title,_target,_description)
     131TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) :
     132    Dialog::MoleculeQuery(title,_target,_molecules,_description)
    213133{}
    214134
     
    230150    }
    231151
    232     tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
     152    tmp = molecules->ReturnIndex(idxOfMol);
    233153    if(!tmp && idxOfMol!=-1){
    234154      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
     
    263183}
    264184
    265 TextDialog::BoxTextQuery::BoxTextQuery(std::string title, double ** const _cellSize, std::string _description) :
    266     Dialog::BoxQuery(title,_cellSize,_description)
    267 {}
    268 
    269 TextDialog::BoxTextQuery::~BoxTextQuery()
    270 {}
    271 
    272 bool TextDialog::BoxTextQuery::handle() {
    273   Log() << Verbose(0) << getTitle();
    274 
    275   std::string coords[6] = {"xx","xy","xz", "yy", "yz", "zz"};
    276   for (int i=0;i<6;i++) {
    277     Log() << Verbose(0) << coords[i] << ": ";
    278     cin >> tmp[i];
    279   }
    280   return true;
    281 }
    282185
    283186TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) :
  • src/UIElements/TextDialog.hpp

    rdaa714 r4917cc4  
    1313#include "UIElements/Dialog.hpp"
    1414
    15 class atom;
    16 class element;
    17 class molecule;
    18 class Vector;
    19 
    2015class TextDialog : public Dialog
    2116{
     
    2520
    2621  virtual void queryEmpty(const char *, std::string = "");
    27   virtual void queryBoolean(const char *, bool *, std::string = "");
    2822  virtual void queryInt(const char *, int *, std::string = "");
    2923  virtual void queryString(const char*, std::string *, std::string = "");
    3024  virtual void queryDouble(const char*, double*, std::string = "");
    31   virtual void queryAtom(const char*,atom**,std::string = "");
    32   virtual void queryMolecule(const char*,molecule**,std::string = "");
     25  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "");
    3326  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
    34   virtual void queryBox(const char*,double ** const, std::string = "");
    3527  virtual void queryElement(const char*,const element **, std::string = "");
    3628
     
    4133    EmptyTextQuery(std::string title, std::string _description = NULL);
    4234    virtual ~EmptyTextQuery();
    43     virtual bool handle();
    44   };
    45 
    46   class BooleanTextQuery : public Dialog::BooleanQuery {
    47   public:
    48     BooleanTextQuery(std::string title, bool *_target, std::string _description = NULL);
    49     virtual ~BooleanTextQuery();
    5035    virtual bool handle();
    5136  };
     
    7257  };
    7358
    74   class AtomTextQuery : public Dialog::AtomQuery {
    75   public:
    76     AtomTextQuery(std::string title, atom **_target, std::string _description = NULL);
    77     virtual ~AtomTextQuery();
    78     virtual bool handle();
    79   };
    80 
    8159  class MoleculeTextQuery : public Dialog::MoleculeQuery {
    8260  public:
    83     MoleculeTextQuery(std::string title, molecule **_target, std::string _description = NULL);
     61    MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = NULL);
    8462    virtual ~MoleculeTextQuery();
    8563    virtual bool handle();
     
    9068    VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL);
    9169    virtual ~VectorTextQuery();
    92     virtual bool handle();
    93   };
    94 
    95   class BoxTextQuery : public Dialog::BoxQuery {
    96   public:
    97     BoxTextQuery(std::string title,double ** const _cellSize, std::string _description = NULL);
    98     virtual ~BoxTextQuery();
    9970    virtual bool handle();
    10071  };
  • src/UIElements/TextWindow.cpp

    rdaa714 r4917cc4  
    144144  new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);
    145145
    146   Action *changeFilenameAction = new MoleculeChangeNameAction();
     146  Action *changeFilenameAction = new MoleculeChangeNameAction(molecules);
    147147  new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);
    148148
  • src/World.cpp

    rdaa714 r4917cc4  
    5858std::vector<molecule*> World::getAllMolecules(MoleculeDescriptor descriptor){
    5959  return descriptor.findAll();
    60 }
    61 
    62 std::vector<molecule*> World::getAllMolecules(){
    63   return getAllMolecules(AllMolecules());
    6460}
    6561
  • src/World.hpp

    rdaa714 r4917cc4  
    115115   */
    116116  std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor);
    117   std::vector<molecule*> getAllMolecules();
    118117
    119118  /**
  • src/bondgraph.hpp

    rdaa714 r4917cc4  
    2727
    2828class molecule;
    29 class BondedParticle;
     29class periodentafel;
    3030class MatrixContainer;
    3131
  • src/builder.cpp

    rdaa714 r4917cc4  
    7777#include "Actions/ActionRegistry.hpp"
    7878#include "Actions/ActionHistory.hpp"
    79 #include "Actions/MapOfActions.hpp"
    8079#include "Actions/MethodAction.hpp"
    8180#include "Actions/MoleculeAction/ChangeNameAction.hpp"
     
    14811480
    14821481/** Parses the command line options.
    1483  * Note that this function is from now on transitional. All commands that are not passed
    1484  * here are handled by CommandLineParser and the actions of CommandLineUIFactory.
    14851482 * \param argc argument count
    14861483 * \param **argv arguments array
     
    14901487 * \param *ConfigFileName pointer to config file name in **argv
    14911488 * \param *PathToDatabases pointer to db's path in **argv
    1492  * \param &ArgcList list of arguments that we do not parse here
    14931489 * \return exit code (0 - successful, all else - something's wrong)
    14941490 */
    1495 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,
    1496                                    config& configuration, char *&ConfigFileName, list<int> &ArgcList)
     1491static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,\
     1492                                   config& configuration, char *&ConfigFileName)
    14971493{
    14981494  Vector x,y,z,n;  // coordinates for absolute point in cell volume
     
    15121508  molecule *mol = NULL;
    15131509  string BondGraphFileName("\n");
     1510  int verbosity = 0;
    15141511  strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1);
    15151512
     
    15251522          case 'H':
    15261523          case '?':
    1527             ArgcList.push_back(argptr-1);
    1528             return(1);
     1524            DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl);
     1525            DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl);
     1526            DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl);
     1527            DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl);
     1528            DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl);
     1529            DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
     1530            DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
     1531            DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl);
     1532            DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl);
     1533            DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl);
     1534            DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl);
     1535            DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl);
     1536            DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl);
     1537            DoLog(0) && (Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl);
     1538            DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
     1539            DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
     1540            DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl);
     1541            DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl);
     1542            DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl);
     1543            DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl);
     1544            DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl);
     1545            DoLog(0) && (Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl);
     1546            DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl);
     1547            DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl);
     1548            DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl);
     1549            DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl);
     1550            DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl);
     1551            DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl);
     1552            DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl);
     1553            DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl);
     1554            DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl);
     1555            DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl);
     1556            DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl);
     1557            DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl);
     1558            DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl);
     1559            DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl);
     1560            DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl);
     1561            DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl);
     1562            DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl);
     1563            DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl);
     1564            DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl);
     1565            return (1);
    15291566            break;
    15301567          case 'v':
    1531             ArgcList.push_back(argptr-1);
    1532             return(1);
     1568            while (argv[argptr-1][verbosity+1] == 'v') {
     1569              verbosity++;
     1570            }
     1571            setVerbosity(verbosity);
     1572            DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
    15331573            break;
    15341574          case 'V':
    1535             ArgcList.push_back(argptr-1);
    1536             ArgcList.push_back(argptr);
    1537             argptr++;
     1575            DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl);
     1576            DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl);
     1577            return (1);
    15381578            break;
    15391579          case 'B':
     
    24752515
    24762516void cleanUp(){
     2517  UIFactory::purgeInstance();
    24772518  World::purgeInstance();
    24782519  Log() << Verbose(0) <<  "Maximum of allocated memory: "
     
    24832524  logger::purgeInstance();
    24842525  errorLogger::purgeInstance();
    2485   UIFactory::purgeInstance();
    2486   MapOfActions::purgeInstance();
    24872526  CommandLineParser::purgeInstance();
    24882527  ActionRegistry::purgeInstance();
     
    24972536    ofstream output;
    24982537    string line;
    2499     char **Arguments = NULL;
    2500     int ArgcSize = 0;
    2501     bool ArgumentsCopied = false;
    25022538
    25032539    cout << ESPACKVersion << endl;
     
    25072543    ActionHistory::init();
    25082544
    2509     // Parse command line options and if present create respective UI
    25102545    {
    2511       list<int> ArgcList;
    2512       ArgcList.push_back(0); // push back program!
    2513       ArgcList.push_back(1); // push back config file name
    2514       char ConfigFileName[MAXSTRINGSIZE];
    2515       // handle arguments by ParseCommandLineOptions()
    2516       ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), (char *&)ConfigFileName, ArgcList);
    2517       // copy all remaining arguments to a new argv
    2518       Arguments = Malloc<char *>(ArgcList.size(), "main - **Arguments");
    2519       cout << "The following arguments are handled by CommandLineParser: ";
    2520       for (list<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
    2521         Arguments[ArgcSize] = Malloc<char>(strlen(argv[*ArgcRunner])+2, "main - *Arguments[]");
    2522         strcpy(Arguments[ArgcSize], argv[*ArgcRunner]);
    2523         cout << " " << argv[*ArgcRunner];
    2524         ArgcSize++;
    2525       }
    2526       cout << endl;
    2527       ArgumentsCopied = true;
    2528       // handle remaining arguments by CommandLineParser
    2529       MapOfActions::getInstance().AddOptionsToParser();
    2530       CommandLineParser::getInstance().Run(ArgcSize,Arguments);
    2531       if (!CommandLineParser::getInstance().isEmpty()) {
    2532         DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl);
     2546      // Parse command line options and if present create respective UI
     2547      CommandLineParser::getInstance().generic.add_options()
     2548          ("help,h", "produce help message")
     2549          ("version,v", "show version")
     2550          ("parse-xyz,p", po::value< vector<string> >(), "parse xyz file into World")
     2551          ;
     2552      CommandLineParser::getInstance().Run(argc,argv);
     2553      if (!CommandLineParser::getInstance().isEmpty())
    25332554        UIFactory::makeUserInterface(UIFactory::CommandLine);
    2534       } else {
    2535         DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl);
     2555      else
    25362556        UIFactory::makeUserInterface(UIFactory::Text);
    2537       }
    25382557    }
    25392558
     
    25502569        Log() << Verbose(0) << "Saving of elements.db failed." << endl;
    25512570
    2552   // free the new argv
    2553   if (ArgumentsCopied) {
    2554     for (int i=0; i<ArgcSize;i++)
    2555       Free(&Arguments[i]);
    2556     Free(&Arguments);
    2557   }
    2558 
    25592571  cleanUp();
     2572
    25602573  Memory::getState();
    25612574  return (0);
  • src/molecule.hpp

    rdaa714 r4917cc4  
    3535#include "Patterns/Observer.hpp"
    3636#include "Patterns/Cacheable.hpp"
    37 
    38 #include "Descriptors/MoleculeDescriptor_impl.hpp"
    3937
    4038/****************************************** forward declarations *****************************/
  • tests/Tesselations/defs.in

    rdaa714 r4917cc4  
    6262        #cat stderr
    6363        #cat stdout
    64         grep -E "^[0-9]* [0-9]* [0-9]*$" ../../../../../molecuilder/tests/Tesselations/$mol/$2/${FILENAME}-$mol.dat | sort -n >reference-triangles.dat
    65         grep -E "^[0-9]* [0-9]* [0-9]*$" ${FILENAME}.dat | sort -n >new-triangles.dat
    66         diff reference-triangles.dat new-triangles.dat 2>diffstderr >diffstdout || exitcode=$?
     64        diff ${FILENAME}.dat ../@srcdir@/$mol/$2/${FILENAME}-$mol.dat 2>diffstderr >diffstdout || exitcode=$?
    6765        #echo "Diff done with exitcode $exitcode."
    6866        #cat diffstderr
Note: See TracChangeset for help on using the changeset viewer.