Changes in / [4917cc4:daa714]
- Files:
-
- 78 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionRegistry.cpp
r4917cc4 rdaa714 43 43 } 44 44 45 void ActionRegistry::unregisterAction(Action* action){ 46 actionMap.erase(action->getName()); 47 } 48 45 49 std::map<const std::string,Action*>::iterator ActionRegistry::getBeginIter() 46 50 { -
src/Actions/ActionRegistry.hpp
r4917cc4 rdaa714 22 22 Action* getActionByName(const std::string); 23 23 void registerAction(Action*); 24 void unregisterAction(Action*); 24 25 25 26 std::map<const std::string,Action*>::iterator getBeginIter(); -
src/Actions/CmdAction/HelpAction.cpp
r4917cc4 rdaa714 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp" 18 19 19 20 const char CommandLineHelpAction::NAME[] = "help"; -
src/Actions/CmdAction/VersionAction.cpp
r4917cc4 rdaa714 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp" 18 19 19 20 const char CommandLineVersionAction::NAME[] = "version"; -
src/Actions/MoleculeAction/ChangeNameAction.cpp
r4917cc4 rdaa714 15 15 #include "UIElements/UIFactory.hpp" 16 16 #include "UIElements/Dialog.hpp" 17 #include "Actions/MapOfActions.hpp" 17 18 18 19 #include "atom.hpp" … … 35 36 const char MoleculeChangeNameAction::NAME[] = "Change filename of Molecule"; 36 37 37 MoleculeChangeNameAction::MoleculeChangeNameAction(MoleculeListClass *_molecules) : 38 Action(NAME), 39 molecules(_molecules) 38 MoleculeChangeNameAction::MoleculeChangeNameAction() : 39 Action(NAME) 40 40 {} 41 41 … … 48 48 Dialog *dialog = UIFactory::getInstance().makeDialog(); 49 49 50 dialog->queryMolecule( "Enter index of molecule: ",&mol,molecules);50 dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME)); 51 51 dialog->queryString("Enter name: ",&filename); 52 52 -
src/Actions/MoleculeAction/ChangeNameAction.hpp
r4917cc4 rdaa714 16 16 class MoleculeChangeNameAction : public Action { 17 17 public: 18 MoleculeChangeNameAction( MoleculeListClass*);18 MoleculeChangeNameAction(); 19 19 virtual ~MoleculeChangeNameAction(); 20 20 -
src/Actions/ParserAction/LoadXyzAction.cpp
r4917cc4 rdaa714 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp" 18 19 19 20 #include "atom.hpp" -
src/Actions/ParserAction/SaveXyzAction.cpp
r4917cc4 rdaa714 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp" 18 19 19 20 #include "atom.hpp" -
src/CommandLineParser.cpp
r4917cc4 rdaa714 36 36 void CommandLineParser::Parse() 37 37 { 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); 40 39 ifstream input; 41 40 input.open("example.cfg"); … … 45 44 po::notify(vm); 46 45 } 46 47 47 48 48 49 /** States whether there are command line arguments. -
src/CommandLineParser.hpp
r4917cc4 rdaa714 34 34 po::options_description config; 35 35 po::options_description hidden; 36 po::positional_options_description inputfile; 36 37 37 38 po::options_description visible; -
src/Legacy/oldmenu.cpp
r4917cc4 rdaa714 35 35 #include "Menu/DisplayMenuItem.hpp" 36 36 #include "Menu/SubMenuItem.hpp" 37 #include "Actions/MapOfActions.hpp" 37 38 #include "Actions/MethodAction.hpp" 38 39 #include "Actions/ErrorAction.hpp" … … 908 909 molecule *srcmol = NULL, *destmol = NULL; 909 910 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")); 912 913 if(dialog->display()) { 913 914 molecules->SimpleAdd(srcmol, destmol); … … 922 923 molecule *srcmol = NULL, *destmol = NULL; 923 924 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")); 926 927 if(dialog->display()) { 927 928 molecules->EmbedMerge(destmol, srcmol); -
src/Makefile.am
r4917cc4 rdaa714 50 50 51 51 ACTIONSSOURCE = Actions/Action.cpp \ 52 ${ANALYSISACTIONSOURCE} \ 52 53 ${ATOMACTIONSOURCE} \ 53 54 ${CMDACTIONSOURCE} \ … … 56 57 ${PARSERACTIONSOURCE} \ 57 58 ${TESSELATIONACTIONSOURCE} \ 59 ${WORLDACTIONSOURCE} \ 58 60 Actions/ActionHistory.cpp \ 59 61 Actions/ActionRegistry.cpp \ … … 62 64 Actions/MakroAction.cpp \ 63 65 Actions/ManipulateAtomsProcess.cpp \ 66 Actions/MapOfActions.cpp \ 64 67 Actions/MethodAction.cpp \ 65 68 Actions/Process.cpp 66 69 67 70 ACTIONSHEADER = Actions/Action.hpp \ 71 ${ANALYSISACTIONHEADER} \ 68 72 ${ATOMACTIONHEADER} \ 69 73 ${CMDACTIONHEADER} \ … … 72 76 ${PARSERACTIONHEADER} \ 73 77 ${TESSELATIONACTIONHEADER} \ 78 ${WORLDACTIONHEADER} \ 74 79 Actions/ActionHistory.hpp \ 75 80 Actions/ActionRegistry.hpp \ … … 80 85 Actions/MakroAction.hpp \ 81 86 Actions/ManipulateAtomsProcess.hpp \ 87 Actions/MapOfActions.hpp \ 82 88 Actions/MethodAction.hpp \ 83 89 Actions/Process.hpp 84 90 85 ATOMACTIONSOURCE = 86 # Actions/AtomAction/SomeAction.cpp 87 ATOMACTIONHEADER = 88 # Actions/AtomAction/SomeAction.hpp 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 89 112 90 113 CMDACTIONSOURCE = \ 114 Actions/CmdAction/BondLengthTableAction.cpp \ 115 Actions/CmdAction/ElementDbAction.cpp \ 116 Actions/CmdAction/FastParsingAction.cpp \ 91 117 Actions/CmdAction/HelpAction.cpp \ 118 Actions/CmdAction/VerboseAction.cpp \ 92 119 Actions/CmdAction/VersionAction.cpp 93 120 CMDACTIONHEADER = \ 121 Actions/CmdAction/BondLengthTableAction.hpp \ 122 Actions/CmdAction/ElementDbAction.hpp \ 123 Actions/CmdAction/FastParsingAction.hpp \ 94 124 Actions/CmdAction/HelpAction.hpp \ 125 Actions/CmdAction/VerboseAction.hpp \ 95 126 Actions/CmdAction/VersionAction.hpp 96 127 97 FRAGMENTATIONACTIONSOURCE = 98 # Actions/FragmentationAction/SomeAction.cpp 99 FRAGMENTATIONACTIONHEADER = 100 # Actions/FragmentationAction/SomeAction.hpp 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 101 136 102 137 MOLECULEACTIONSOURCE = \ 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 104 149 MOLECULEACTIONHEADER = \ 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 106 161 107 162 PARSERACTIONSOURCE = \ … … 112 167 Actions/ParserAction/SaveXyzAction.hpp 113 168 114 TESSELATIONACTIONSOURCE = 115 # Actions/TesselationAction/SomeAction.cpp 116 TESSELATIONACTIONHEADER = 117 # Actions/TesselationAction/SomeAction.hpp 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 118 200 119 201 PARSERSOURCE = \ -
src/Parser/XyzParser.cpp
r4917cc4 rdaa714 59 59 60 60 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++) { 62 62 *file << fixed << (*it)->getType()->symbol << "\t" << (*it)->x[0] << "\t" << (*it)->x[1] << "\t" << (*it)->x[2] << endl; 63 63 } -
src/UIElements/CommandLineDialog.cpp
r4917cc4 rdaa714 10 10 #include <iostream> 11 11 12 #include <Descriptors/AtomDescriptor.hpp> 13 #include <Descriptors/AtomIdDescriptor.hpp> 12 14 #include <Descriptors/MoleculeDescriptor.hpp> 13 15 #include <Descriptors/MoleculeIdDescriptor.hpp> 14 16 #include "UIElements/CommandLineDialog.hpp" 15 17 18 #include "element.hpp" 16 19 #include "periodentafel.hpp" 17 #include "atom.hpp"18 20 #include "CommandLineParser.hpp" 19 21 #include "defs.hpp" 20 #include "molecule.hpp"21 22 #include "log.hpp" 23 #include "periodentafel.hpp" 22 24 #include "verbose.hpp" 23 25 #include "World.hpp" 24 26 27 #include "atom.hpp" 28 #include "element.hpp" 29 #include "molecule.hpp" 30 #include "vector.hpp" 31 25 32 using namespace std; 26 33 … … 43 50 } 44 51 52 void CommandLineDialog::queryBoolean(const char* title, bool* target, string _description){ 53 registerQuery(new BooleanCommandLineQuery(title,target, _description)); 54 } 55 45 56 void CommandLineDialog::queryDouble(const char* title, double* target, string _description){ 46 57 registerQuery(new DoubleCommandLineQuery(title,target, _description)); … … 51 62 } 52 63 53 void CommandLineDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string _description) { 54 registerQuery(new MoleculeCommandLineQuery(title,target,molecules, _description)); 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)); 55 70 } 56 71 57 72 void CommandLineDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string _description) { 58 73 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)); 59 78 } 60 79 … … 90 109 } 91 110 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 92 140 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title,string *_target, string _description) : 93 141 Dialog::StringQuery(title,_target, _description) … … 118 166 } 119 167 120 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, MoleculeListClass *_molecules, string _description) : 121 Dialog::MoleculeQuery(title,_target,_molecules, _description) 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) 122 186 {} 123 187 … … 146 210 temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >(); 147 211 assert((temp.size() == 3) && "Vector from command line does not have three components."); 148 tmp = new Vector;149 212 for (int i=0;i<NDIM;i++) 150 213 tmp->at(i) = temp[i]; … … 155 218 156 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 } 238 157 239 CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, const element **target, string _description) : 158 240 Dialog::ElementQuery(title,target, _description) … … 163 245 164 246 bool 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); 168 255 tmp = World::getInstance().getPeriode()->FindElement(Z); 169 256 return true; -
src/UIElements/CommandLineDialog.hpp
r4917cc4 rdaa714 10 10 11 11 #include <string> 12 13 class atom; 14 class element; 15 class molecule; 16 class Vector; 12 17 13 18 #include "UIElements/Dialog.hpp" … … 24 29 virtual void queryEmpty(const char *, std::string = ""); 25 30 virtual void queryInt(const char *, int *, std::string = ""); 31 virtual void queryBoolean(const char *, bool *, std::string = ""); 26 32 virtual void queryString(const char*, std::string *, std::string = ""); 27 33 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 = ""); 29 36 virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = ""); 37 virtual void queryBox(const char*,double ** const, std::string = ""); 30 38 virtual void queryElement(const char*,const element **, std::string = ""); 31 39 … … 46 54 }; 47 55 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 48 63 class DoubleCommandLineQuery : public Dialog::DoubleQuery { 49 64 public: … … 60 75 }; 61 76 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 62 84 class MoleculeCommandLineQuery : public Dialog::MoleculeQuery { 63 85 public: 64 MoleculeCommandLineQuery(std::string title, molecule **_target, MoleculeListClass *_molecules,std::string _description = "");86 MoleculeCommandLineQuery(std::string title, molecule **_target, std::string _description = ""); 65 87 virtual ~MoleculeCommandLineQuery(); 66 88 virtual bool handle(); … … 71 93 VectorCommandLineQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = ""); 72 94 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(); 73 102 virtual bool handle(); 74 103 }; -
src/UIElements/CommandLineWindow.cpp
r4917cc4 rdaa714 12 12 13 13 #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" 14 23 #include "Actions/CmdAction/HelpAction.hpp" 24 #include "Actions/CmdAction/VerboseAction.hpp" 15 25 #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" 16 36 #include "Actions/ParserAction/LoadXyzAction.hpp" 17 37 #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" 18 50 #include "CommandLineParser.hpp" 19 51 … … 26 58 { 27 59 // create and register all command line callable actions 60 populateAnalysisActions(); 28 61 populateAtomActions(); 29 62 populateCmdActions(); … … 32 65 populateParserActions(); 33 66 populateTesselationActions(); 67 populateWorldActions(); 34 68 35 69 // Add status indicators etc... … … 39 73 CommandLineWindow::~CommandLineWindow() 40 74 { 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 41 81 delete statusIndicator; 42 82 } … … 52 92 } 53 93 94 void CommandLineWindow::populateAnalysisActions() 95 { 96 new AnalysisPairCorrelationAction(); 97 new AnalysisPairCorrelationToPointAction(); 98 new AnalysisPairCorrelationToSurfaceAction(); 99 } 100 54 101 void CommandLineWindow::populateAtomActions() 55 102 { 103 new AtomAddAction(); 104 new AtomChangeElementAction(); 105 new AtomRemoveAction(); 56 106 } 57 107 58 108 void CommandLineWindow::populateCmdActions() 59 109 { 110 new CommandLineBondLengthTableAction(); 111 new CommandLineElementDbAction(); 112 new CommandLineFastParsingAction(); 60 113 new CommandLineHelpAction(); 114 new CommandLineVerboseAction(); 61 115 new CommandLineVersionAction(); 62 116 } … … 64 118 void CommandLineWindow::populateFragmentationActions() 65 119 { 120 new FragmentationDepthFirstSearchAction(); 66 121 } 67 122 68 123 void CommandLineWindow::populateMoleculeActions() 69 124 { 125 new MoleculeBondFileAction(); 126 new MoleculeChangeNameAction(); 127 new MoleculeFillWithMoleculeAction(); 128 new MoleculeLinearInterpolationofTrajectoriesAction(); 129 new MoleculeSaveAdjacencyAction(); 130 new MoleculeSaveBondsAction(); 131 new MoleculeSaveTemperatureAction(); 132 new MoleculeVerletIntegrationAction(); 70 133 } 71 134 … … 78 141 void CommandLineWindow::populateTesselationActions() 79 142 { 143 new TesselationConvexEnvelopeAction(); 144 new TesselationNonConvexEnvelopeAction(); 80 145 } 81 146 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
r4917cc4 rdaa714 23 23 private: 24 24 // populaters 25 void populateAnalysisActions(); 25 26 void populateAtomActions(); 26 27 void populateCmdActions(); … … 29 30 void populateParserActions(); 30 31 void populateTesselationActions(); 32 void populateWorldActions(); 31 33 32 34 CommandLineStatusIndicator *statusIndicator; -
src/UIElements/Dialog.cpp
r4917cc4 rdaa714 10 10 #include "UIElements/Dialog.hpp" 11 11 12 #include "atom.hpp" 13 #include "element.hpp" 14 #include "molecule.hpp" 12 15 #include "vector.hpp" 13 16 … … 88 91 } 89 92 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 90 105 // String Queries 91 106 … … 113 128 114 129 115 // MoleculeQueries116 117 Dialog:: MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) :130 // Atom Queries 131 132 Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) : 118 133 Query(title, _description), 119 134 tmp(0), 120 molecules(_molecules), 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), 121 150 target(_target) 122 151 … … 147 176 void Dialog::VectorQuery::setResult() { 148 177 *target = *tmp; 178 } 179 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]; 149 197 } 150 198 -
src/UIElements/Dialog.hpp
r4917cc4 rdaa714 12 12 #include<list> 13 13 14 class MoleculeListClass; 14 class atom; 15 class element; 15 16 class molecule; 16 17 class Vector; 17 class element;18 18 19 19 class Dialog … … 24 24 25 25 virtual void queryEmpty(const char *, std::string = "")=0; 26 virtual void queryBoolean(const char *, bool *, std::string = "")=0; 26 27 virtual void queryInt(const char *, int *, std::string = "")=0; 27 28 virtual void queryDouble(const char*,double *, std::string = "")=0; 28 29 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; 30 32 virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0; 33 virtual void queryBox(const char*,double ** const, std::string = "")=0; 31 34 virtual void queryElement(const char*,const element **, std::string = "")=0; 32 35 … … 69 72 70 73 //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 71 86 class IntQuery : public Query { 72 87 public: … … 105 120 }; 106 121 107 108 122 class MoleculeQuery : public Query { 109 123 public: 110 MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules,std::string _description = "");124 MoleculeQuery(std::string title, molecule **_target, std::string _description = ""); 111 125 virtual ~MoleculeQuery(); 112 126 virtual bool handle()=0; … … 114 128 protected: 115 129 molecule *tmp; 116 MoleculeListClass *molecules;117 130 private: 118 131 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; 119 144 }; 120 145 … … 131 156 private: 132 157 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; 133 170 }; 134 171 -
src/UIElements/TextDialog.cpp
r4917cc4 rdaa714 8 8 #include <iostream> 9 9 10 #include <Descriptors/AtomDescriptor.hpp> 11 #include <Descriptors/AtomIdDescriptor.hpp> 12 #include <Descriptors/MoleculeDescriptor.hpp> 13 #include <Descriptors/MoleculeIdDescriptor.hpp> 10 14 #include "UIElements/TextDialog.hpp" 11 15 12 16 #include "World.hpp" 13 17 #include "periodentafel.hpp" 14 #include "atom.hpp"15 #include "molecule.hpp"16 18 #include "log.hpp" 17 19 #include "verbose.hpp" 18 20 21 #include "atom.hpp" 22 #include "element.hpp" 23 #include "molecule.hpp" 24 #include "vector.hpp" 25 19 26 using namespace std; 20 27 … … 33 40 } 34 41 42 void TextDialog::queryBoolean(const char* title, bool* target, string description){ 43 registerQuery(new BooleanTextQuery(title,target,description)); 44 } 45 35 46 void TextDialog::queryInt(const char* title, int* target, string description){ 36 47 registerQuery(new IntTextQuery(title,target,description)); … … 45 56 } 46 57 47 void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string description) { 48 registerQuery(new MoleculeTextQuery(title,target,molecules,description)); 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)); 49 64 } 50 65 51 66 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) { 52 67 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)); 53 72 } 54 73 … … 94 113 } 95 114 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 96 144 TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) : 97 145 Dialog::StringQuery(title,_target,_description) … … 129 177 } 130 178 131 TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) : 132 Dialog::MoleculeQuery(title,_target,_molecules,_description) 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) 133 213 {} 134 214 … … 150 230 } 151 231 152 tmp = molecules->ReturnIndex(idxOfMol);232 tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 153 233 if(!tmp && idxOfMol!=-1){ 154 234 Log() << Verbose(0) << "Invalid Molecule Index" << endl; … … 183 263 } 184 264 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 } 185 282 186 283 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) : -
src/UIElements/TextDialog.hpp
r4917cc4 rdaa714 13 13 #include "UIElements/Dialog.hpp" 14 14 15 class atom; 16 class element; 17 class molecule; 18 class Vector; 19 15 20 class TextDialog : public Dialog 16 21 { … … 20 25 21 26 virtual void queryEmpty(const char *, std::string = ""); 27 virtual void queryBoolean(const char *, bool *, std::string = ""); 22 28 virtual void queryInt(const char *, int *, std::string = ""); 23 29 virtual void queryString(const char*, std::string *, std::string = ""); 24 30 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 = ""); 26 33 virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = ""); 34 virtual void queryBox(const char*,double ** const, std::string = ""); 27 35 virtual void queryElement(const char*,const element **, std::string = ""); 28 36 … … 33 41 EmptyTextQuery(std::string title, std::string _description = NULL); 34 42 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(); 35 50 virtual bool handle(); 36 51 }; … … 57 72 }; 58 73 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 59 81 class MoleculeTextQuery : public Dialog::MoleculeQuery { 60 82 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); 62 84 virtual ~MoleculeTextQuery(); 63 85 virtual bool handle(); … … 68 90 VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL); 69 91 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(); 70 99 virtual bool handle(); 71 100 }; -
src/UIElements/TextWindow.cpp
r4917cc4 rdaa714 144 144 new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction); 145 145 146 Action *changeFilenameAction = new MoleculeChangeNameAction( molecules);146 Action *changeFilenameAction = new MoleculeChangeNameAction(); 147 147 new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction); 148 148 -
src/World.cpp
r4917cc4 rdaa714 58 58 std::vector<molecule*> World::getAllMolecules(MoleculeDescriptor descriptor){ 59 59 return descriptor.findAll(); 60 } 61 62 std::vector<molecule*> World::getAllMolecules(){ 63 return getAllMolecules(AllMolecules()); 60 64 } 61 65 -
src/World.hpp
r4917cc4 rdaa714 115 115 */ 116 116 std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor); 117 std::vector<molecule*> getAllMolecules(); 117 118 118 119 /** -
src/bondgraph.hpp
r4917cc4 rdaa714 27 27 28 28 class molecule; 29 class periodentafel;29 class BondedParticle; 30 30 class MatrixContainer; 31 31 -
src/builder.cpp
r4917cc4 rdaa714 77 77 #include "Actions/ActionRegistry.hpp" 78 78 #include "Actions/ActionHistory.hpp" 79 #include "Actions/MapOfActions.hpp" 79 80 #include "Actions/MethodAction.hpp" 80 81 #include "Actions/MoleculeAction/ChangeNameAction.hpp" … … 1480 1481 1481 1482 /** 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. 1482 1485 * \param argc argument count 1483 1486 * \param **argv arguments array … … 1487 1490 * \param *ConfigFileName pointer to config file name in **argv 1488 1491 * \param *PathToDatabases pointer to db's path in **argv 1492 * \param &ArgcList list of arguments that we do not parse here 1489 1493 * \return exit code (0 - successful, all else - something's wrong) 1490 1494 */ 1491 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, \1492 config& configuration, char *&ConfigFileName )1495 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, 1496 config& configuration, char *&ConfigFileName, list<int> &ArgcList) 1493 1497 { 1494 1498 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1508 1512 molecule *mol = NULL; 1509 1513 string BondGraphFileName("\n"); 1510 int verbosity = 0;1511 1514 strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1); 1512 1515 … … 1522 1525 case 'H': 1523 1526 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); 1566 1529 break; 1567 1530 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); 1573 1533 break; 1574 1534 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++; 1578 1538 break; 1579 1539 case 'B': … … 2515 2475 2516 2476 void cleanUp(){ 2517 UIFactory::purgeInstance();2518 2477 World::purgeInstance(); 2519 2478 Log() << Verbose(0) << "Maximum of allocated memory: " … … 2524 2483 logger::purgeInstance(); 2525 2484 errorLogger::purgeInstance(); 2485 UIFactory::purgeInstance(); 2486 MapOfActions::purgeInstance(); 2526 2487 CommandLineParser::purgeInstance(); 2527 2488 ActionRegistry::purgeInstance(); … … 2536 2497 ofstream output; 2537 2498 string line; 2499 char **Arguments = NULL; 2500 int ArgcSize = 0; 2501 bool ArgumentsCopied = false; 2538 2502 2539 2503 cout << ESPACKVersion << endl; … … 2543 2507 ActionHistory::init(); 2544 2508 2509 // Parse command line options and if present create respective UI 2545 2510 { 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); 2554 2533 UIFactory::makeUserInterface(UIFactory::CommandLine); 2555 else 2534 } else { 2535 DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl); 2556 2536 UIFactory::makeUserInterface(UIFactory::Text); 2537 } 2557 2538 } 2558 2539 … … 2569 2550 Log() << Verbose(0) << "Saving of elements.db failed." << endl; 2570 2551 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 2571 2559 cleanUp(); 2572 2573 2560 Memory::getState(); 2574 2561 return (0); -
src/molecule.hpp
r4917cc4 rdaa714 35 35 #include "Patterns/Observer.hpp" 36 36 #include "Patterns/Cacheable.hpp" 37 38 #include "Descriptors/MoleculeDescriptor_impl.hpp" 37 39 38 40 /****************************************** forward declarations *****************************/ -
tests/Tesselations/defs.in
r4917cc4 rdaa714 62 62 #cat stderr 63 63 #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=$? 65 67 #echo "Diff done with exitcode $exitcode." 66 68 #cat diffstderr
Note:
See TracChangeset
for help on using the changeset viewer.