Changes in / [4917cc4:daa714]


Ignore:
Files:
78 added
28 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionRegistry.cpp

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

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

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

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

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

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

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

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

    r4917cc4 rdaa714  
    3636void CommandLineParser::Parse()
    3737{
    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);
     38  po::store(po::command_line_parser(argc,argv).options(cmdline_options).options(visible).positional(inputfile).run(), vm);
    4039  ifstream input;
    4140  input.open("example.cfg");
     
    4544  po::notify(vm);
    4645}
     46
     47
    4748
    4849/** States whether there are command line arguments.
  • src/CommandLineParser.hpp

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

    r4917cc4 rdaa714  
    3535#include "Menu/DisplayMenuItem.hpp"
    3636#include "Menu/SubMenuItem.hpp"
     37#include "Actions/MapOfActions.hpp"
    3738#include "Actions/MethodAction.hpp"
    3839#include "Actions/ErrorAction.hpp"
     
    908909  molecule *srcmol = NULL, *destmol = NULL;
    909910  Dialog *dialog = UIFactory::getInstance().makeDialog();
    910   dialog->queryMolecule("Enter index of destination molecule: ",&destmol, molecules);
    911   dialog->queryMolecule("Enter index of source molecule to add from: ",&srcmol, molecules);
     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"));
    912913  if(dialog->display()) {
    913914    molecules->SimpleAdd(srcmol, destmol);
     
    922923  molecule *srcmol = NULL, *destmol = NULL;
    923924  Dialog *dialog = UIFactory::getInstance().makeDialog();
    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);
     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"));
    926927  if(dialog->display()) {
    927928    molecules->EmbedMerge(destmol, srcmol);
  • src/Makefile.am

    r4917cc4 rdaa714  
    5050
    5151ACTIONSSOURCE = Actions/Action.cpp \
     52  ${ANALYSISACTIONSOURCE} \
    5253  ${ATOMACTIONSOURCE} \
    5354  ${CMDACTIONSOURCE} \
     
    5657  ${PARSERACTIONSOURCE} \
    5758  ${TESSELATIONACTIONSOURCE} \
     59  ${WORLDACTIONSOURCE} \
    5860  Actions/ActionHistory.cpp \
    5961  Actions/ActionRegistry.cpp \
     
    6264  Actions/MakroAction.cpp \
    6365  Actions/ManipulateAtomsProcess.cpp \
     66  Actions/MapOfActions.cpp \
    6467  Actions/MethodAction.cpp \
    6568  Actions/Process.cpp
    6669
    6770ACTIONSHEADER = Actions/Action.hpp \
     71  ${ANALYSISACTIONHEADER} \
    6872  ${ATOMACTIONHEADER} \
    6973  ${CMDACTIONHEADER} \
     
    7276  ${PARSERACTIONHEADER} \
    7377  ${TESSELATIONACTIONHEADER} \
     78  ${WORLDACTIONHEADER} \
    7479  Actions/ActionHistory.hpp \
    7580  Actions/ActionRegistry.hpp \
     
    8085  Actions/MakroAction.hpp \
    8186  Actions/ManipulateAtomsProcess.hpp \
     87  Actions/MapOfActions.hpp \
    8288  Actions/MethodAction.hpp \
    8389  Actions/Process.hpp
    8490 
    85 ATOMACTIONSOURCE =
    86 #  Actions/AtomAction/SomeAction.cpp               
    87 ATOMACTIONHEADER =
    88 #  Actions/AtomAction/SomeAction.hpp
     91ANALYSISACTIONSOURCE = \
     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
     97ANALYSISACTIONHEADER = \
     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
     104ATOMACTIONSOURCE = \
     105  Actions/AtomAction/AddAction.cpp \
     106  Actions/AtomAction/ChangeElementAction.cpp \
     107  Actions/AtomAction/RemoveAction.cpp
     108ATOMACTIONHEADER = \
     109  Actions/AtomAction/AddAction.hpp \
     110  Actions/AtomAction/ChangeElementAction.hpp \
     111  Actions/AtomAction/RemoveAction.cpp
    89112
    90113CMDACTIONSOURCE = \
     114  Actions/CmdAction/BondLengthTableAction.cpp \
     115  Actions/CmdAction/ElementDbAction.cpp \
     116  Actions/CmdAction/FastParsingAction.cpp \
    91117  Actions/CmdAction/HelpAction.cpp \
     118  Actions/CmdAction/VerboseAction.cpp \
    92119  Actions/CmdAction/VersionAction.cpp
    93120CMDACTIONHEADER = \
     121  Actions/CmdAction/BondLengthTableAction.hpp \
     122  Actions/CmdAction/ElementDbAction.hpp \
     123  Actions/CmdAction/FastParsingAction.hpp \
    94124  Actions/CmdAction/HelpAction.hpp \
     125  Actions/CmdAction/VerboseAction.hpp \
    95126  Actions/CmdAction/VersionAction.hpp
    96127
    97 FRAGMENTATIONACTIONSOURCE =
    98 #  Actions/FragmentationAction/SomeAction.cpp               
    99 FRAGMENTATIONACTIONHEADER =
    100 #  Actions/FragmentationAction/SomeAction.hpp
     128FRAGMENTATIONACTIONSOURCE = \
     129  Actions/FragmentationAction/DepthFirstSearchAction.cpp \
     130  Actions/FragmentationAction/FragmentationAction.cpp \
     131  Actions/FragmentationAction/SubgraphDissectionAction.cpp               
     132FRAGMENTATIONACTIONHEADER = \
     133  Actions/FragmentationAction/DepthFirstSearchAction.hpp \
     134  Actions/FragmentationAction/FragmentationAction.hpp \
     135  Actions/FragmentationAction/SubgraphDissectionAction.hpp
    101136
    102137MOLECULEACTIONSOURCE = \
    103   Actions/MoleculeAction/ChangeNameAction.cpp
     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
    104149MOLECULEACTIONHEADER = \
    105   Actions/MoleculeAction/ChangeNameAction.hpp
     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
    106161                 
    107162PARSERACTIONSOURCE = \
     
    112167  Actions/ParserAction/SaveXyzAction.hpp
    113168
    114 TESSELATIONACTIONSOURCE =
    115 #  Actions/TesselationAction/SomeAction.cpp               
    116 TESSELATIONACTIONHEADER =
    117 #  Actions/TesselationAction/SomeAction.hpp
     169TESSELATIONACTIONSOURCE = \
     170  Actions/TesselationAction/ConvexEnvelopeAction.cpp \
     171  Actions/TesselationAction/NonConvexEnvelopeAction.cpp               
     172TESSELATIONACTIONHEADER = \
     173  Actions/TesselationAction/ConvexEnvelopeAction.hpp \
     174  Actions/TesselationAction/NonConvexEnvelopeAction.hpp
     175
     176WORLDACTIONSOURCE = \
     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               
     187WORLDACTIONHEADER = \
     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
    118200
    119201PARSERSOURCE = \
  • src/Parser/XyzParser.cpp

    r4917cc4 rdaa714  
    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

    r4917cc4 rdaa714  
    1010#include <iostream>
    1111
     12#include <Descriptors/AtomDescriptor.hpp>
     13#include <Descriptors/AtomIdDescriptor.hpp>
    1214#include <Descriptors/MoleculeDescriptor.hpp>
    1315#include <Descriptors/MoleculeIdDescriptor.hpp>
    1416#include "UIElements/CommandLineDialog.hpp"
    1517
     18#include "element.hpp"
    1619#include "periodentafel.hpp"
    17 #include "atom.hpp"
    1820#include "CommandLineParser.hpp"
    1921#include "defs.hpp"
    20 #include "molecule.hpp"
    2122#include "log.hpp"
     23#include "periodentafel.hpp"
    2224#include "verbose.hpp"
    2325#include "World.hpp"
    2426
     27#include "atom.hpp"
     28#include "element.hpp"
     29#include "molecule.hpp"
     30#include "vector.hpp"
     31
    2532using namespace std;
    2633
     
    4350}
    4451
     52void CommandLineDialog::queryBoolean(const char* title, bool* target, string _description){
     53  registerQuery(new BooleanCommandLineQuery(title,target, _description));
     54}
     55
    4556void CommandLineDialog::queryDouble(const char* title, double* target, string _description){
    4657  registerQuery(new DoubleCommandLineQuery(title,target, _description));
     
    5162}
    5263
    53 void CommandLineDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string _description) {
    54   registerQuery(new MoleculeCommandLineQuery(title,target,molecules, _description));
     64void CommandLineDialog::queryAtom(const char* title, atom **target, string _description) {
     65  registerQuery(new AtomCommandLineQuery(title,target, _description));
     66}
     67
     68void CommandLineDialog::queryMolecule(const char* title, molecule **target, string _description) {
     69  registerQuery(new MoleculeCommandLineQuery(title,target, _description));
    5570}
    5671
    5772void CommandLineDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string _description) {
    5873  registerQuery(new VectorCommandLineQuery(title,target,cellSize,check, _description));
     74}
     75
     76void CommandLineDialog::queryBox(const char* title, double ** const cellSize, string _description) {
     77  registerQuery(new BoxCommandLineQuery(title,cellSize,_description));
    5978}
    6079
     
    90109}
    91110
     111CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title,bool *_target, string _description) :
     112    Dialog::BooleanQuery(title,_target, _description)
     113{}
     114
     115CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
     116
     117bool 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
    92140CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title,string *_target, string _description) :
    93141    Dialog::StringQuery(title,_target, _description)
     
    118166}
    119167
    120 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, MoleculeListClass *_molecules, string _description) :
    121     Dialog::MoleculeQuery(title,_target,_molecules, _description)
     168CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, atom **_target, string _description) :
     169    Dialog::AtomQuery(title,_target, _description)
     170{}
     171
     172CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
     173
     174bool 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
     184CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, string _description) :
     185    Dialog::MoleculeQuery(title,_target, _description)
    122186{}
    123187
     
    146210    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
    147211    assert((temp.size() == 3) && "Vector from command line does not have three components.");
    148     tmp = new Vector;
    149212    for (int i=0;i<NDIM;i++)
    150213      tmp->at(i) = temp[i];
     
    155218
    156219
     220CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, double ** const _cellSize, string _description) :
     221    Dialog::BoxQuery(title,_cellSize, _description)
     222{}
     223
     224CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
     225{}
     226
     227bool 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}
     238
    157239CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, const element **target, string _description) :
    158240    Dialog::ElementQuery(title,target, _description)
     
    163245
    164246bool CommandLineDialog::ElementCommandLineQuery::handle() {
    165   int Z = -1;
    166   if (CommandLineParser::getInstance().vm.count(getTitle())) {
    167     Z = CommandLineParser::getInstance().vm[getTitle()].as<int>();
     247  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
     248  int Z;
     249  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);
    168255    tmp = World::getInstance().getPeriode()->FindElement(Z);
    169256    return true;
  • src/UIElements/CommandLineDialog.hpp

    r4917cc4 rdaa714  
    1010
    1111#include <string>
     12
     13class atom;
     14class element;
     15class molecule;
     16class Vector;
    1217
    1318#include "UIElements/Dialog.hpp"
     
    2429  virtual void queryEmpty(const char *, std::string = "");
    2530  virtual void queryInt(const char *, int *, std::string = "");
     31  virtual void queryBoolean(const char *, bool *, std::string = "");
    2632  virtual void queryString(const char*, std::string *, std::string = "");
    2733  virtual void queryDouble(const char*, double*, std::string = "");
    28   virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "");
     34  virtual void queryAtom(const char*,atom**, std::string = "");
     35  virtual void queryMolecule(const char*,molecule**,std::string = "");
    2936  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
     37  virtual void queryBox(const char*,double ** const, std::string = "");
    3038  virtual void queryElement(const char*,const element **, std::string = "");
    3139
     
    4654  };
    4755
     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
    4863  class DoubleCommandLineQuery : public Dialog::DoubleQuery {
    4964  public:
     
    6075  };
    6176
     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
    6284  class MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
    6385  public:
    64     MoleculeCommandLineQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = "");
     86    MoleculeCommandLineQuery(std::string title, molecule **_target, std::string _description = "");
    6587    virtual ~MoleculeCommandLineQuery();
    6688    virtual bool handle();
     
    7193    VectorCommandLineQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
    7294    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();
    73102    virtual bool handle();
    74103  };
  • src/UIElements/CommandLineWindow.cpp

    r4917cc4 rdaa714  
    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"
    1423#include "Actions/CmdAction/HelpAction.hpp"
     24#include "Actions/CmdAction/VerboseAction.hpp"
    1525#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"
    1636#include "Actions/ParserAction/LoadXyzAction.hpp"
    1737#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"
    1850#include "CommandLineParser.hpp"
    1951
     
    2658{
    2759  // create and register all command line callable actions
     60  populateAnalysisActions();
    2861  populateAtomActions();
    2962  populateCmdActions();
     
    3265  populateParserActions();
    3366  populateTesselationActions();
     67  populateWorldActions();
    3468
    3569  // Add status indicators etc...
     
    3973CommandLineWindow::~CommandLineWindow()
    4074{
     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
    4181  delete statusIndicator;
    4282}
     
    5292}
    5393
     94void CommandLineWindow::populateAnalysisActions()
     95{
     96  new AnalysisPairCorrelationAction();
     97  new AnalysisPairCorrelationToPointAction();
     98  new AnalysisPairCorrelationToSurfaceAction();
     99}
     100
    54101void CommandLineWindow::populateAtomActions()
    55102{
     103  new AtomAddAction();
     104  new AtomChangeElementAction();
     105  new AtomRemoveAction();
    56106}
    57107
    58108void CommandLineWindow::populateCmdActions()
    59109{
     110  new CommandLineBondLengthTableAction();
     111  new CommandLineElementDbAction();
     112  new CommandLineFastParsingAction();
    60113  new CommandLineHelpAction();
     114  new CommandLineVerboseAction();
    61115  new CommandLineVersionAction();
    62116}
     
    64118void CommandLineWindow::populateFragmentationActions()
    65119{
     120  new FragmentationDepthFirstSearchAction();
    66121}
    67122
    68123void CommandLineWindow::populateMoleculeActions()
    69124{
     125  new MoleculeBondFileAction();
     126  new MoleculeChangeNameAction();
     127  new MoleculeFillWithMoleculeAction();
     128  new MoleculeLinearInterpolationofTrajectoriesAction();
     129  new MoleculeSaveAdjacencyAction();
     130  new MoleculeSaveBondsAction();
     131  new MoleculeSaveTemperatureAction();
     132  new MoleculeVerletIntegrationAction();
    70133}
    71134
     
    78141void CommandLineWindow::populateTesselationActions()
    79142{
     143  new TesselationConvexEnvelopeAction();
     144  new TesselationNonConvexEnvelopeAction();
    80145}
    81146
     147void 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

    r4917cc4 rdaa714  
    2323private:
    2424  // populaters
     25  void populateAnalysisActions();
    2526  void populateAtomActions();
    2627  void populateCmdActions();
     
    2930  void populateParserActions();
    3031  void populateTesselationActions();
     32  void populateWorldActions();
    3133
    3234  CommandLineStatusIndicator *statusIndicator;
  • src/UIElements/Dialog.cpp

    r4917cc4 rdaa714  
    1010#include "UIElements/Dialog.hpp"
    1111
     12#include "atom.hpp"
     13#include "element.hpp"
     14#include "molecule.hpp"
    1215#include "vector.hpp"
    1316
     
    8891}
    8992
     93// Int Queries
     94
     95Dialog::BooleanQuery::BooleanQuery(string title,bool *_target, std::string description) :
     96    Query(title, description), target(_target)
     97{}
     98
     99Dialog::BooleanQuery::~BooleanQuery() {}
     100
     101void Dialog::BooleanQuery::setResult() {
     102  *target = tmp;
     103}
     104
    90105// String Queries
    91106
     
    113128
    114129
    115 // Molecule Queries
    116 
    117 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) :
     130// Atom Queries
     131
     132Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) :
    118133    Query(title, _description),
    119134    tmp(0),
    120     molecules(_molecules),
     135    target(_target)
     136
     137{}
     138
     139Dialog::AtomQuery::~AtomQuery() {}
     140
     141void Dialog::AtomQuery::setResult() {
     142  *target = tmp;
     143}
     144
     145// Molecule Queries
     146
     147Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) :
     148    Query(title, _description),
     149    tmp(0),
    121150    target(_target)
    122151
     
    147176void Dialog::VectorQuery::setResult() {
    148177  *target = *tmp;
     178}
     179
     180// Box Queries
     181
     182Dialog::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
     189Dialog::BoxQuery::~BoxQuery()
     190{
     191  delete[] tmp;
     192}
     193
     194void Dialog::BoxQuery::setResult() {
     195  for (int i=0;i<6;i++)
     196    *target[i] = tmp[i];
    149197}
    150198
  • src/UIElements/Dialog.hpp

    r4917cc4 rdaa714  
    1212#include<list>
    1313
    14 class MoleculeListClass;
     14class atom;
     15class element;
    1516class molecule;
    1617class Vector;
    17 class element;
    1818
    1919class Dialog
     
    2424
    2525  virtual void queryEmpty(const char *, std::string = "")=0;
     26  virtual void queryBoolean(const char *, bool *, std::string = "")=0;
    2627  virtual void queryInt(const char *, int *, std::string = "")=0;
    2728  virtual void queryDouble(const char*,double *, std::string = "")=0;
    2829  virtual void queryString(const char*, std::string *, std::string = "")=0;
    29   virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "")=0;
     30  virtual void queryAtom(const char*,atom**,std::string = "")=0;
     31  virtual void queryMolecule(const char*,molecule**, std::string = "")=0;
    3032  virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0;
     33  virtual void queryBox(const char*,double ** const, std::string = "")=0;
    3134  virtual void queryElement(const char*,const element **, std::string = "")=0;
    3235
     
    6972
    7073  //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
    7186  class IntQuery : public Query {
    7287  public:
     
    105120  };
    106121
    107 
    108122  class MoleculeQuery : public Query {
    109123  public:
    110     MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = "");
     124    MoleculeQuery(std::string title, molecule **_target, std::string _description = "");
    111125    virtual ~MoleculeQuery();
    112126    virtual bool handle()=0;
     
    114128  protected:
    115129    molecule *tmp;
    116     MoleculeListClass *molecules;
    117130  private:
    118131    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;
    119144  };
    120145
     
    131156    private:
    132157      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;
    133170  };
    134171
  • src/UIElements/TextDialog.cpp

    r4917cc4 rdaa714  
    88#include <iostream>
    99
     10#include <Descriptors/AtomDescriptor.hpp>
     11#include <Descriptors/AtomIdDescriptor.hpp>
     12#include <Descriptors/MoleculeDescriptor.hpp>
     13#include <Descriptors/MoleculeIdDescriptor.hpp>
    1014#include "UIElements/TextDialog.hpp"
    1115
    1216#include "World.hpp"
    1317#include "periodentafel.hpp"
    14 #include "atom.hpp"
    15 #include "molecule.hpp"
    1618#include "log.hpp"
    1719#include "verbose.hpp"
    1820
     21#include "atom.hpp"
     22#include "element.hpp"
     23#include "molecule.hpp"
     24#include "vector.hpp"
     25
    1926using namespace std;
    2027
     
    3340}
    3441
     42void TextDialog::queryBoolean(const char* title, bool* target, string description){
     43  registerQuery(new BooleanTextQuery(title,target,description));
     44}
     45
    3546void TextDialog::queryInt(const char* title, int* target, string description){
    3647  registerQuery(new IntTextQuery(title,target,description));
     
    4556}
    4657
    47 void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string description) {
    48   registerQuery(new MoleculeTextQuery(title,target,molecules,description));
     58void TextDialog::queryAtom(const char* title, atom **target, string description) {
     59  registerQuery(new AtomTextQuery(title,target,description));
     60}
     61
     62void TextDialog::queryMolecule(const char* title, molecule **target, string description) {
     63  registerQuery(new MoleculeTextQuery(title,target,description));
    4964}
    5065
    5166void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) {
    5267  registerQuery(new VectorTextQuery(title,target,cellSize,check,description));
     68}
     69
     70void TextDialog::queryBox(const char* title,double ** const cellSize, string description) {
     71  registerQuery(new BoxTextQuery(title,cellSize,description));
    5372}
    5473
     
    94113}
    95114
     115TextDialog::BooleanTextQuery::BooleanTextQuery(string title, bool * _target, std::string _description) :
     116    Dialog::BooleanQuery(title,_target,_description)
     117{}
     118
     119TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
     120
     121bool 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
    96144TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) :
    97145    Dialog::StringQuery(title,_target,_description)
     
    129177}
    130178
    131 TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) :
    132     Dialog::MoleculeQuery(title,_target,_molecules,_description)
     179TextDialog::AtomTextQuery::AtomTextQuery(string title, atom **_target, std::string _description) :
     180    Dialog::AtomQuery(title,_target,_description)
     181{}
     182
     183TextDialog::AtomTextQuery::~AtomTextQuery() {}
     184
     185bool 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
     211TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, std::string _description) :
     212    Dialog::MoleculeQuery(title,_target,_description)
    133213{}
    134214
     
    150230    }
    151231
    152     tmp = molecules->ReturnIndex(idxOfMol);
     232    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
    153233    if(!tmp && idxOfMol!=-1){
    154234      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
     
    183263}
    184264
     265TextDialog::BoxTextQuery::BoxTextQuery(std::string title, double ** const _cellSize, std::string _description) :
     266    Dialog::BoxQuery(title,_cellSize,_description)
     267{}
     268
     269TextDialog::BoxTextQuery::~BoxTextQuery()
     270{}
     271
     272bool 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}
    185282
    186283TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) :
  • src/UIElements/TextDialog.hpp

    r4917cc4 rdaa714  
    1313#include "UIElements/Dialog.hpp"
    1414
     15class atom;
     16class element;
     17class molecule;
     18class Vector;
     19
    1520class TextDialog : public Dialog
    1621{
     
    2025
    2126  virtual void queryEmpty(const char *, std::string = "");
     27  virtual void queryBoolean(const char *, bool *, std::string = "");
    2228  virtual void queryInt(const char *, int *, std::string = "");
    2329  virtual void queryString(const char*, std::string *, std::string = "");
    2430  virtual void queryDouble(const char*, double*, std::string = "");
    25   virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "");
     31  virtual void queryAtom(const char*,atom**,std::string = "");
     32  virtual void queryMolecule(const char*,molecule**,std::string = "");
    2633  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
     34  virtual void queryBox(const char*,double ** const, std::string = "");
    2735  virtual void queryElement(const char*,const element **, std::string = "");
    2836
     
    3341    EmptyTextQuery(std::string title, std::string _description = NULL);
    3442    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();
    3550    virtual bool handle();
    3651  };
     
    5772  };
    5873
     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
    5981  class MoleculeTextQuery : public Dialog::MoleculeQuery {
    6082  public:
    61     MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = NULL);
     83    MoleculeTextQuery(std::string title, molecule **_target, std::string _description = NULL);
    6284    virtual ~MoleculeTextQuery();
    6385    virtual bool handle();
     
    6890    VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL);
    6991    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();
    7099    virtual bool handle();
    71100  };
  • src/UIElements/TextWindow.cpp

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

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

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

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

    r4917cc4 rdaa714  
    7777#include "Actions/ActionRegistry.hpp"
    7878#include "Actions/ActionHistory.hpp"
     79#include "Actions/MapOfActions.hpp"
    7980#include "Actions/MethodAction.hpp"
    8081#include "Actions/MoleculeAction/ChangeNameAction.hpp"
     
    14801481
    14811482/** 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.
    14821485 * \param argc argument count
    14831486 * \param **argv arguments array
     
    14871490 * \param *ConfigFileName pointer to config file name in **argv
    14881491 * \param *PathToDatabases pointer to db's path in **argv
     1492 * \param &ArgcList list of arguments that we do not parse here
    14891493 * \return exit code (0 - successful, all else - something's wrong)
    14901494 */
    1491 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,\
    1492                                    config& configuration, char *&ConfigFileName)
     1495static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,
     1496                                   config& configuration, char *&ConfigFileName, list<int> &ArgcList)
    14931497{
    14941498  Vector x,y,z,n;  // coordinates for absolute point in cell volume
     
    15081512  molecule *mol = NULL;
    15091513  string BondGraphFileName("\n");
    1510   int verbosity = 0;
    15111514  strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1);
    15121515
     
    15221525          case 'H':
    15231526          case '?':
    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);
     1527            ArgcList.push_back(argptr-1);
     1528            return(1);
    15661529            break;
    15671530          case 'v':
    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);
     1531            ArgcList.push_back(argptr-1);
     1532            return(1);
    15731533            break;
    15741534          case 'V':
    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);
     1535            ArgcList.push_back(argptr-1);
     1536            ArgcList.push_back(argptr);
     1537            argptr++;
    15781538            break;
    15791539          case 'B':
     
    25152475
    25162476void cleanUp(){
    2517   UIFactory::purgeInstance();
    25182477  World::purgeInstance();
    25192478  Log() << Verbose(0) <<  "Maximum of allocated memory: "
     
    25242483  logger::purgeInstance();
    25252484  errorLogger::purgeInstance();
     2485  UIFactory::purgeInstance();
     2486  MapOfActions::purgeInstance();
    25262487  CommandLineParser::purgeInstance();
    25272488  ActionRegistry::purgeInstance();
     
    25362497    ofstream output;
    25372498    string line;
     2499    char **Arguments = NULL;
     2500    int ArgcSize = 0;
     2501    bool ArgumentsCopied = false;
    25382502
    25392503    cout << ESPACKVersion << endl;
     
    25432507    ActionHistory::init();
    25442508
     2509    // Parse command line options and if present create respective UI
    25452510    {
    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())
     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);
    25542533        UIFactory::makeUserInterface(UIFactory::CommandLine);
    2555       else
     2534      } else {
     2535        DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl);
    25562536        UIFactory::makeUserInterface(UIFactory::Text);
     2537      }
    25572538    }
    25582539
     
    25692550        Log() << Verbose(0) << "Saving of elements.db failed." << endl;
    25702551
     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
    25712559  cleanUp();
    2572 
    25732560  Memory::getState();
    25742561  return (0);
  • src/molecule.hpp

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

    r4917cc4 rdaa714  
    6262        #cat stderr
    6363        #cat stdout
    64         diff ${FILENAME}.dat ../@srcdir@/$mol/$2/${FILENAME}-$mol.dat 2>diffstderr >diffstdout || exitcode=$?
     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=$?
    6567        #echo "Diff done with exitcode $exitcode."
    6668        #cat diffstderr
Note: See TracChangeset for help on using the changeset viewer.