Changes in / [daa714:4917cc4]
- Files:
-
- 78 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionRegistry.cpp
rdaa714 r4917cc4 43 43 } 44 44 45 void ActionRegistry::unregisterAction(Action* action){46 actionMap.erase(action->getName());47 }48 49 45 std::map<const std::string,Action*>::iterator ActionRegistry::getBeginIter() 50 46 { -
src/Actions/ActionRegistry.hpp
rdaa714 r4917cc4 22 22 Action* getActionByName(const std::string); 23 23 void registerAction(Action*); 24 void unregisterAction(Action*);25 24 26 25 std::map<const std::string,Action*>::iterator getBeginIter(); -
src/Actions/CmdAction/HelpAction.cpp
rdaa714 r4917cc4 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp"19 18 20 19 const char CommandLineHelpAction::NAME[] = "help"; -
src/Actions/CmdAction/VersionAction.cpp
rdaa714 r4917cc4 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp"19 18 20 19 const char CommandLineVersionAction::NAME[] = "version"; -
src/Actions/MoleculeAction/ChangeNameAction.cpp
rdaa714 r4917cc4 15 15 #include "UIElements/UIFactory.hpp" 16 16 #include "UIElements/Dialog.hpp" 17 #include "Actions/MapOfActions.hpp"18 17 19 18 #include "atom.hpp" … … 36 35 const char MoleculeChangeNameAction::NAME[] = "Change filename of Molecule"; 37 36 38 MoleculeChangeNameAction::MoleculeChangeNameAction() : 39 Action(NAME) 37 MoleculeChangeNameAction::MoleculeChangeNameAction(MoleculeListClass *_molecules) : 38 Action(NAME), 39 molecules(_molecules) 40 40 {} 41 41 … … 48 48 Dialog *dialog = UIFactory::getInstance().makeDialog(); 49 49 50 dialog->queryMolecule( NAME, &mol, MapOfActions::getInstance().getDescription(NAME));50 dialog->queryMolecule("Enter index of molecule: ",&mol,molecules); 51 51 dialog->queryString("Enter name: ",&filename); 52 52 -
src/Actions/MoleculeAction/ChangeNameAction.hpp
rdaa714 r4917cc4 16 16 class MoleculeChangeNameAction : public Action { 17 17 public: 18 MoleculeChangeNameAction( );18 MoleculeChangeNameAction(MoleculeListClass*); 19 19 virtual ~MoleculeChangeNameAction(); 20 20 -
src/Actions/ParserAction/LoadXyzAction.cpp
rdaa714 r4917cc4 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp"19 18 20 19 #include "atom.hpp" -
src/Actions/ParserAction/SaveXyzAction.cpp
rdaa714 r4917cc4 16 16 #include "UIElements/UIFactory.hpp" 17 17 #include "UIElements/Dialog.hpp" 18 #include "Actions/MapOfActions.hpp"19 18 20 19 #include "atom.hpp" -
src/CommandLineParser.cpp
rdaa714 r4917cc4 36 36 void CommandLineParser::Parse() 37 37 { 38 po::store(po::command_line_parser(argc,argv).options(cmdline_options).options(visible).positional(inputfile).run(), vm); 38 po::store(po::command_line_parser(argc,argv).options(cmdline_options).run(), vm); 39 po::store(po::command_line_parser(argc,argv).options(visible).run(), vm); 39 40 ifstream input; 40 41 input.open("example.cfg"); … … 44 45 po::notify(vm); 45 46 } 46 47 48 47 49 48 /** States whether there are command line arguments. -
src/CommandLineParser.hpp
rdaa714 r4917cc4 34 34 po::options_description config; 35 35 po::options_description hidden; 36 po::positional_options_description inputfile;37 36 38 37 po::options_description visible; -
src/Legacy/oldmenu.cpp
rdaa714 r4917cc4 35 35 #include "Menu/DisplayMenuItem.hpp" 36 36 #include "Menu/SubMenuItem.hpp" 37 #include "Actions/MapOfActions.hpp"38 37 #include "Actions/MethodAction.hpp" 39 38 #include "Actions/ErrorAction.hpp" … … 909 908 molecule *srcmol = NULL, *destmol = NULL; 910 909 Dialog *dialog = UIFactory::getInstance().makeDialog(); 911 dialog->queryMolecule(" molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));912 dialog->queryMolecule(" molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));910 dialog->queryMolecule("Enter index of destination molecule: ",&destmol, molecules); 911 dialog->queryMolecule("Enter index of source molecule to add from: ",&srcmol, molecules); 913 912 if(dialog->display()) { 914 913 molecules->SimpleAdd(srcmol, destmol); … … 923 922 molecule *srcmol = NULL, *destmol = NULL; 924 923 Dialog *dialog = UIFactory::getInstance().makeDialog(); 925 dialog->queryMolecule(" molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));926 dialog->queryMolecule(" molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));924 dialog->queryMolecule("Enter index of matrix molecule (the variable one): ",&srcmol,molecules); 925 dialog->queryMolecule("Enter index of molecule to merge into (the fixed one): ",&destmol,molecules); 927 926 if(dialog->display()) { 928 927 molecules->EmbedMerge(destmol, srcmol); -
src/Makefile.am
rdaa714 r4917cc4 50 50 51 51 ACTIONSSOURCE = Actions/Action.cpp \ 52 ${ANALYSISACTIONSOURCE} \53 52 ${ATOMACTIONSOURCE} \ 54 53 ${CMDACTIONSOURCE} \ … … 57 56 ${PARSERACTIONSOURCE} \ 58 57 ${TESSELATIONACTIONSOURCE} \ 59 ${WORLDACTIONSOURCE} \60 58 Actions/ActionHistory.cpp \ 61 59 Actions/ActionRegistry.cpp \ … … 64 62 Actions/MakroAction.cpp \ 65 63 Actions/ManipulateAtomsProcess.cpp \ 66 Actions/MapOfActions.cpp \67 64 Actions/MethodAction.cpp \ 68 65 Actions/Process.cpp 69 66 70 67 ACTIONSHEADER = Actions/Action.hpp \ 71 ${ANALYSISACTIONHEADER} \72 68 ${ATOMACTIONHEADER} \ 73 69 ${CMDACTIONHEADER} \ … … 76 72 ${PARSERACTIONHEADER} \ 77 73 ${TESSELATIONACTIONHEADER} \ 78 ${WORLDACTIONHEADER} \79 74 Actions/ActionHistory.hpp \ 80 75 Actions/ActionRegistry.hpp \ … … 85 80 Actions/MakroAction.hpp \ 86 81 Actions/ManipulateAtomsProcess.hpp \ 87 Actions/MapOfActions.hpp \88 82 Actions/MethodAction.hpp \ 89 83 Actions/Process.hpp 90 84 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 85 ATOMACTIONSOURCE = 86 # Actions/AtomAction/SomeAction.cpp 87 ATOMACTIONHEADER = 88 # Actions/AtomAction/SomeAction.hpp 112 89 113 90 CMDACTIONSOURCE = \ 114 Actions/CmdAction/BondLengthTableAction.cpp \115 Actions/CmdAction/ElementDbAction.cpp \116 Actions/CmdAction/FastParsingAction.cpp \117 91 Actions/CmdAction/HelpAction.cpp \ 118 Actions/CmdAction/VerboseAction.cpp \119 92 Actions/CmdAction/VersionAction.cpp 120 93 CMDACTIONHEADER = \ 121 Actions/CmdAction/BondLengthTableAction.hpp \122 Actions/CmdAction/ElementDbAction.hpp \123 Actions/CmdAction/FastParsingAction.hpp \124 94 Actions/CmdAction/HelpAction.hpp \ 125 Actions/CmdAction/VerboseAction.hpp \126 95 Actions/CmdAction/VersionAction.hpp 127 96 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 97 FRAGMENTATIONACTIONSOURCE = 98 # Actions/FragmentationAction/SomeAction.cpp 99 FRAGMENTATIONACTIONHEADER = 100 # Actions/FragmentationAction/SomeAction.hpp 136 101 137 102 MOLECULEACTIONSOURCE = \ 138 Actions/MoleculeAction/BondFileAction.cpp \ 139 Actions/MoleculeAction/ChangeNameAction.cpp \ 140 Actions/MoleculeAction/FillWithMoleculeAction.cpp \ 141 Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \ 142 Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \ 143 Actions/MoleculeAction/SaveAdjacencyAction.cpp \ 144 Actions/MoleculeAction/SaveBondsAction.cpp \ 145 Actions/MoleculeAction/SaveTemperatureAction.cpp \ 146 Actions/MoleculeAction/SuspendInWaterAction.cpp \ 147 Actions/MoleculeAction/TranslateAction.cpp \ 148 Actions/MoleculeAction/VerletIntegrationAction.cpp 103 Actions/MoleculeAction/ChangeNameAction.cpp 149 104 MOLECULEACTIONHEADER = \ 150 Actions/MoleculeAction/BondFileAction.hpp \ 151 Actions/MoleculeAction/ChangeNameAction.hpp \ 152 Actions/MoleculeAction/FillWithMoleculeAction.hpp \ 153 Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \ 154 Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \ 155 Actions/MoleculeAction/SaveAdjacencyAction.hpp \ 156 Actions/MoleculeAction/SaveBondsAction.hpp \ 157 Actions/MoleculeAction/SaveTemperatureAction.hpp \ 158 Actions/MoleculeAction/SuspendInWaterAction.hpp \ 159 Actions/MoleculeAction/TranslateAction.hpp \ 160 Actions/MoleculeAction/VerletIntegrationAction.hpp 105 Actions/MoleculeAction/ChangeNameAction.hpp 161 106 162 107 PARSERACTIONSOURCE = \ … … 167 112 Actions/ParserAction/SaveXyzAction.hpp 168 113 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 114 TESSELATIONACTIONSOURCE = 115 # Actions/TesselationAction/SomeAction.cpp 116 TESSELATIONACTIONHEADER = 117 # Actions/TesselationAction/SomeAction.hpp 200 118 201 119 PARSERSOURCE = \ -
src/Parser/XyzParser.cpp
rdaa714 r4917cc4 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
rdaa714 r4917cc4 10 10 #include <iostream> 11 11 12 #include <Descriptors/AtomDescriptor.hpp>13 #include <Descriptors/AtomIdDescriptor.hpp>14 12 #include <Descriptors/MoleculeDescriptor.hpp> 15 13 #include <Descriptors/MoleculeIdDescriptor.hpp> 16 14 #include "UIElements/CommandLineDialog.hpp" 17 15 18 #include "element.hpp"19 16 #include "periodentafel.hpp" 17 #include "atom.hpp" 20 18 #include "CommandLineParser.hpp" 21 19 #include "defs.hpp" 20 #include "molecule.hpp" 22 21 #include "log.hpp" 23 #include "periodentafel.hpp"24 22 #include "verbose.hpp" 25 23 #include "World.hpp" 26 27 #include "atom.hpp"28 #include "element.hpp"29 #include "molecule.hpp"30 #include "vector.hpp"31 24 32 25 using namespace std; … … 50 43 } 51 44 52 void CommandLineDialog::queryBoolean(const char* title, bool* target, string _description){53 registerQuery(new BooleanCommandLineQuery(title,target, _description));54 }55 56 45 void CommandLineDialog::queryDouble(const char* title, double* target, string _description){ 57 46 registerQuery(new DoubleCommandLineQuery(title,target, _description)); … … 62 51 } 63 52 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)); 53 void CommandLineDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string _description) { 54 registerQuery(new MoleculeCommandLineQuery(title,target,molecules, _description)); 70 55 } 71 56 72 57 void CommandLineDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string _description) { 73 58 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));78 59 } 79 60 … … 109 90 } 110 91 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 line136 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');137 return true;138 }139 140 92 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title,string *_target, string _description) : 141 93 Dialog::StringQuery(title,_target, _description) … … 166 118 } 167 119 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) 120 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, MoleculeListClass *_molecules, string _description) : 121 Dialog::MoleculeQuery(title,_target,_molecules, _description) 186 122 {} 187 123 … … 210 146 temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >(); 211 147 assert((temp.size() == 3) && "Vector from command line does not have three components."); 148 tmp = new Vector; 212 149 for (int i=0;i<NDIM;i++) 213 150 tmp->at(i) = temp[i]; … … 217 154 } 218 155 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 } else236 return false;237 }238 156 239 157 CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, const element **target, string _description) : … … 245 163 246 164 bool CommandLineDialog::ElementCommandLineQuery::handle() { 247 // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector? 248 int Z; 165 int Z = -1; 249 166 if (CommandLineParser::getInstance().vm.count(getTitle())) { 250 vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >(); 251 vector<int>::iterator ElementRunner = AllElements.begin(); 252 Z = *ElementRunner; 253 // TODO: So far, this does not really erase the element in the parsed list. 254 AllElements.erase(ElementRunner); 167 Z = CommandLineParser::getInstance().vm[getTitle()].as<int>(); 255 168 tmp = World::getInstance().getPeriode()->FindElement(Z); 256 169 return true; -
src/UIElements/CommandLineDialog.hpp
rdaa714 r4917cc4 10 10 11 11 #include <string> 12 13 class atom;14 class element;15 class molecule;16 class Vector;17 12 18 13 #include "UIElements/Dialog.hpp" … … 29 24 virtual void queryEmpty(const char *, std::string = ""); 30 25 virtual void queryInt(const char *, int *, std::string = ""); 31 virtual void queryBoolean(const char *, bool *, std::string = "");32 26 virtual void queryString(const char*, std::string *, std::string = ""); 33 27 virtual void queryDouble(const char*, double*, std::string = ""); 34 virtual void queryAtom(const char*,atom**, std::string = ""); 35 virtual void queryMolecule(const char*,molecule**,std::string = ""); 28 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = ""); 36 29 virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = ""); 37 virtual void queryBox(const char*,double ** const, std::string = "");38 30 virtual void queryElement(const char*,const element **, std::string = ""); 39 31 … … 54 46 }; 55 47 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 63 48 class DoubleCommandLineQuery : public Dialog::DoubleQuery { 64 49 public: … … 75 60 }; 76 61 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 84 62 class MoleculeCommandLineQuery : public Dialog::MoleculeQuery { 85 63 public: 86 MoleculeCommandLineQuery(std::string title, molecule **_target, std::string _description = "");64 MoleculeCommandLineQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = ""); 87 65 virtual ~MoleculeCommandLineQuery(); 88 66 virtual bool handle(); … … 93 71 VectorCommandLineQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = ""); 94 72 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();102 73 virtual bool handle(); 103 74 }; -
src/UIElements/CommandLineWindow.cpp
rdaa714 r4917cc4 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"23 14 #include "Actions/CmdAction/HelpAction.hpp" 24 #include "Actions/CmdAction/VerboseAction.hpp"25 15 #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"36 16 #include "Actions/ParserAction/LoadXyzAction.hpp" 37 17 #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"50 18 #include "CommandLineParser.hpp" 51 19 … … 58 26 { 59 27 // create and register all command line callable actions 60 populateAnalysisActions();61 28 populateAtomActions(); 62 29 populateCmdActions(); … … 65 32 populateParserActions(); 66 33 populateTesselationActions(); 67 populateWorldActions();68 34 69 35 // Add status indicators etc... … … 73 39 CommandLineWindow::~CommandLineWindow() 74 40 { 75 // go through all possible actions76 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 81 41 delete statusIndicator; 82 42 } … … 92 52 } 93 53 94 void CommandLineWindow::populateAnalysisActions()95 {96 new AnalysisPairCorrelationAction();97 new AnalysisPairCorrelationToPointAction();98 new AnalysisPairCorrelationToSurfaceAction();99 }100 101 54 void CommandLineWindow::populateAtomActions() 102 55 { 103 new AtomAddAction();104 new AtomChangeElementAction();105 new AtomRemoveAction();106 56 } 107 57 108 58 void CommandLineWindow::populateCmdActions() 109 59 { 110 new CommandLineBondLengthTableAction();111 new CommandLineElementDbAction();112 new CommandLineFastParsingAction();113 60 new CommandLineHelpAction(); 114 new CommandLineVerboseAction();115 61 new CommandLineVersionAction(); 116 62 } … … 118 64 void CommandLineWindow::populateFragmentationActions() 119 65 { 120 new FragmentationDepthFirstSearchAction();121 66 } 122 67 123 68 void CommandLineWindow::populateMoleculeActions() 124 69 { 125 new MoleculeBondFileAction();126 new MoleculeChangeNameAction();127 new MoleculeFillWithMoleculeAction();128 new MoleculeLinearInterpolationofTrajectoriesAction();129 new MoleculeSaveAdjacencyAction();130 new MoleculeSaveBondsAction();131 new MoleculeSaveTemperatureAction();132 new MoleculeVerletIntegrationAction();133 70 } 134 71 … … 141 78 void CommandLineWindow::populateTesselationActions() 142 79 { 143 new TesselationConvexEnvelopeAction();144 new TesselationNonConvexEnvelopeAction();145 80 } 146 81 147 void CommandLineWindow::populateWorldActions()148 {149 new WorldAddEmptyBoundaryAction();150 new WorldBoundInBoxAction();151 new WorldCenterInBoxAction();152 new WorldCenterOnEdgeAction();153 new WorldChangeBoxAction();154 new WorldRemoveSphereOfAtomsAction();155 new WorldRepeatBoxAction();156 new WorldScaleBoxAction();157 new WorldSetDefaultNameAction();158 new WorldSetGaussianBasisAction();159 } -
src/UIElements/CommandLineWindow.hpp
rdaa714 r4917cc4 23 23 private: 24 24 // populaters 25 void populateAnalysisActions();26 25 void populateAtomActions(); 27 26 void populateCmdActions(); … … 30 29 void populateParserActions(); 31 30 void populateTesselationActions(); 32 void populateWorldActions();33 31 34 32 CommandLineStatusIndicator *statusIndicator; -
src/UIElements/Dialog.cpp
rdaa714 r4917cc4 10 10 #include "UIElements/Dialog.hpp" 11 11 12 #include "atom.hpp"13 #include "element.hpp"14 #include "molecule.hpp"15 12 #include "vector.hpp" 16 13 … … 91 88 } 92 89 93 // Int Queries94 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 105 90 // String Queries 106 91 … … 128 113 129 114 130 // AtomQueries115 // Molecule Queries 131 116 132 Dialog:: AtomQuery::AtomQuery(string title, atom **_target, std::string _description) :117 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) : 133 118 Query(title, _description), 134 119 tmp(0), 135 target(_target) 136 137 {} 138 139 Dialog::AtomQuery::~AtomQuery() {} 140 141 void Dialog::AtomQuery::setResult() { 142 *target = tmp; 143 } 144 145 // Molecule Queries 146 147 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) : 148 Query(title, _description), 149 tmp(0), 120 molecules(_molecules), 150 121 target(_target) 151 122 … … 178 149 } 179 150 180 // Box Queries181 182 Dialog::BoxQuery::BoxQuery(std::string title, double ** const _cellSize, std::string _description) :183 Query(title, _description),184 target(_cellSize)185 {186 tmp = new double[6];187 }188 189 Dialog::BoxQuery::~BoxQuery()190 {191 delete[] tmp;192 }193 194 void Dialog::BoxQuery::setResult() {195 for (int i=0;i<6;i++)196 *target[i] = tmp[i];197 }198 199 151 // Element Queries 200 152 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target, std::string _description) : -
src/UIElements/Dialog.hpp
rdaa714 r4917cc4 12 12 #include<list> 13 13 14 class atom; 15 class element; 14 class MoleculeListClass; 16 15 class molecule; 17 16 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;27 26 virtual void queryInt(const char *, int *, std::string = "")=0; 28 27 virtual void queryDouble(const char*,double *, std::string = "")=0; 29 28 virtual void queryString(const char*, std::string *, std::string = "")=0; 30 virtual void queryAtom(const char*,atom**,std::string = "")=0; 31 virtual void queryMolecule(const char*,molecule**, std::string = "")=0; 29 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "")=0; 32 30 virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0; 33 virtual void queryBox(const char*,double ** const, std::string = "")=0;34 31 virtual void queryElement(const char*,const element **, std::string = "")=0; 35 32 … … 72 69 73 70 //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 86 71 class IntQuery : public Query { 87 72 public: … … 120 105 }; 121 106 107 122 108 class MoleculeQuery : public Query { 123 109 public: 124 MoleculeQuery(std::string title, molecule **_target, std::string _description = "");110 MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = ""); 125 111 virtual ~MoleculeQuery(); 126 112 virtual bool handle()=0; … … 128 114 protected: 129 115 molecule *tmp; 116 MoleculeListClass *molecules; 130 117 private: 131 118 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;144 119 }; 145 120 … … 156 131 private: 157 132 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;170 133 }; 171 134 -
src/UIElements/TextDialog.cpp
rdaa714 r4917cc4 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>14 10 #include "UIElements/TextDialog.hpp" 15 11 16 12 #include "World.hpp" 17 13 #include "periodentafel.hpp" 14 #include "atom.hpp" 15 #include "molecule.hpp" 18 16 #include "log.hpp" 19 17 #include "verbose.hpp" 20 18 21 #include "atom.hpp"22 #include "element.hpp"23 #include "molecule.hpp"24 #include "vector.hpp"25 26 19 using namespace std; 27 20 … … 40 33 } 41 34 42 void TextDialog::queryBoolean(const char* title, bool* target, string description){43 registerQuery(new BooleanTextQuery(title,target,description));44 }45 46 35 void TextDialog::queryInt(const char* title, int* target, string description){ 47 36 registerQuery(new IntTextQuery(title,target,description)); … … 56 45 } 57 46 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)); 47 void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string description) { 48 registerQuery(new MoleculeTextQuery(title,target,molecules,description)); 64 49 } 65 50 66 51 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) { 67 52 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));72 53 } 73 54 … … 113 94 } 114 95 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 line140 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');141 return true;142 }143 144 96 TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) : 145 97 Dialog::StringQuery(title,_target,_description) … … 177 129 } 178 130 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) 131 TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) : 132 Dialog::MoleculeQuery(title,_target,_molecules,_description) 213 133 {} 214 134 … … 230 150 } 231 151 232 tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));152 tmp = molecules->ReturnIndex(idxOfMol); 233 153 if(!tmp && idxOfMol!=-1){ 234 154 Log() << Verbose(0) << "Invalid Molecule Index" << endl; … … 263 183 } 264 184 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 }282 185 283 186 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) : -
src/UIElements/TextDialog.hpp
rdaa714 r4917cc4 13 13 #include "UIElements/Dialog.hpp" 14 14 15 class atom;16 class element;17 class molecule;18 class Vector;19 20 15 class TextDialog : public Dialog 21 16 { … … 25 20 26 21 virtual void queryEmpty(const char *, std::string = ""); 27 virtual void queryBoolean(const char *, bool *, std::string = "");28 22 virtual void queryInt(const char *, int *, std::string = ""); 29 23 virtual void queryString(const char*, std::string *, std::string = ""); 30 24 virtual void queryDouble(const char*, double*, std::string = ""); 31 virtual void queryAtom(const char*,atom**,std::string = ""); 32 virtual void queryMolecule(const char*,molecule**,std::string = ""); 25 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = ""); 33 26 virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = ""); 34 virtual void queryBox(const char*,double ** const, std::string = "");35 27 virtual void queryElement(const char*,const element **, std::string = ""); 36 28 … … 41 33 EmptyTextQuery(std::string title, std::string _description = NULL); 42 34 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();50 35 virtual bool handle(); 51 36 }; … … 72 57 }; 73 58 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 81 59 class MoleculeTextQuery : public Dialog::MoleculeQuery { 82 60 public: 83 MoleculeTextQuery(std::string title, molecule **_target, std::string _description = NULL);61 MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = NULL); 84 62 virtual ~MoleculeTextQuery(); 85 63 virtual bool handle(); … … 90 68 VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL); 91 69 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();99 70 virtual bool handle(); 100 71 }; -
src/UIElements/TextWindow.cpp
rdaa714 r4917cc4 144 144 new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction); 145 145 146 Action *changeFilenameAction = new MoleculeChangeNameAction( );146 Action *changeFilenameAction = new MoleculeChangeNameAction(molecules); 147 147 new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction); 148 148 -
src/World.cpp
rdaa714 r4917cc4 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());64 60 } 65 61 -
src/World.hpp
rdaa714 r4917cc4 115 115 */ 116 116 std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor); 117 std::vector<molecule*> getAllMolecules();118 117 119 118 /** -
src/bondgraph.hpp
rdaa714 r4917cc4 27 27 28 28 class molecule; 29 class BondedParticle;29 class periodentafel; 30 30 class MatrixContainer; 31 31 -
src/builder.cpp
rdaa714 r4917cc4 77 77 #include "Actions/ActionRegistry.hpp" 78 78 #include "Actions/ActionHistory.hpp" 79 #include "Actions/MapOfActions.hpp"80 79 #include "Actions/MethodAction.hpp" 81 80 #include "Actions/MoleculeAction/ChangeNameAction.hpp" … … 1481 1480 1482 1481 /** Parses the command line options. 1483 * Note that this function is from now on transitional. All commands that are not passed1484 * here are handled by CommandLineParser and the actions of CommandLineUIFactory.1485 1482 * \param argc argument count 1486 1483 * \param **argv arguments array … … 1490 1487 * \param *ConfigFileName pointer to config file name in **argv 1491 1488 * \param *PathToDatabases pointer to db's path in **argv 1492 * \param &ArgcList list of arguments that we do not parse here1493 1489 * \return exit code (0 - successful, all else - something's wrong) 1494 1490 */ 1495 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, 1496 config& configuration, char *&ConfigFileName , list<int> &ArgcList)1491 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,\ 1492 config& configuration, char *&ConfigFileName) 1497 1493 { 1498 1494 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1512 1508 molecule *mol = NULL; 1513 1509 string BondGraphFileName("\n"); 1510 int verbosity = 0; 1514 1511 strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1); 1515 1512 … … 1525 1522 case 'H': 1526 1523 case '?': 1527 ArgcList.push_back(argptr-1); 1528 return(1); 1524 DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl); 1525 DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl); 1526 DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl); 1527 DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl); 1528 DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl); 1529 DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl); 1530 DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl); 1531 DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl); 1532 DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl); 1533 DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl); 1534 DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl); 1535 DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl); 1536 DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl); 1537 DoLog(0) && (Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl); 1538 DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl); 1539 DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl); 1540 DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl); 1541 DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl); 1542 DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl); 1543 DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl); 1544 DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl); 1545 DoLog(0) && (Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl); 1546 DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl); 1547 DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl); 1548 DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl); 1549 DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl); 1550 DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl); 1551 DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl); 1552 DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl); 1553 DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl); 1554 DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl); 1555 DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl); 1556 DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl); 1557 DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl); 1558 DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl); 1559 DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl); 1560 DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl); 1561 DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl); 1562 DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl); 1563 DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl); 1564 DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl); 1565 return (1); 1529 1566 break; 1530 1567 case 'v': 1531 ArgcList.push_back(argptr-1); 1532 return(1); 1568 while (argv[argptr-1][verbosity+1] == 'v') { 1569 verbosity++; 1570 } 1571 setVerbosity(verbosity); 1572 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl); 1533 1573 break; 1534 1574 case 'V': 1535 ArgcList.push_back(argptr-1);1536 ArgcList.push_back(argptr);1537 argptr++;1575 DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl); 1576 DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl); 1577 return (1); 1538 1578 break; 1539 1579 case 'B': … … 2475 2515 2476 2516 void cleanUp(){ 2517 UIFactory::purgeInstance(); 2477 2518 World::purgeInstance(); 2478 2519 Log() << Verbose(0) << "Maximum of allocated memory: " … … 2483 2524 logger::purgeInstance(); 2484 2525 errorLogger::purgeInstance(); 2485 UIFactory::purgeInstance();2486 MapOfActions::purgeInstance();2487 2526 CommandLineParser::purgeInstance(); 2488 2527 ActionRegistry::purgeInstance(); … … 2497 2536 ofstream output; 2498 2537 string line; 2499 char **Arguments = NULL;2500 int ArgcSize = 0;2501 bool ArgumentsCopied = false;2502 2538 2503 2539 cout << ESPACKVersion << endl; … … 2507 2543 ActionHistory::init(); 2508 2544 2509 // Parse command line options and if present create respective UI2510 2545 { 2511 list<int> ArgcList; 2512 ArgcList.push_back(0); // push back program! 2513 ArgcList.push_back(1); // push back config file name 2514 char ConfigFileName[MAXSTRINGSIZE]; 2515 // handle arguments by ParseCommandLineOptions() 2516 ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), (char *&)ConfigFileName, ArgcList); 2517 // copy all remaining arguments to a new argv 2518 Arguments = Malloc<char *>(ArgcList.size(), "main - **Arguments"); 2519 cout << "The following arguments are handled by CommandLineParser: "; 2520 for (list<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) { 2521 Arguments[ArgcSize] = Malloc<char>(strlen(argv[*ArgcRunner])+2, "main - *Arguments[]"); 2522 strcpy(Arguments[ArgcSize], argv[*ArgcRunner]); 2523 cout << " " << argv[*ArgcRunner]; 2524 ArgcSize++; 2525 } 2526 cout << endl; 2527 ArgumentsCopied = true; 2528 // handle remaining arguments by CommandLineParser 2529 MapOfActions::getInstance().AddOptionsToParser(); 2530 CommandLineParser::getInstance().Run(ArgcSize,Arguments); 2531 if (!CommandLineParser::getInstance().isEmpty()) { 2532 DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl); 2546 // Parse command line options and if present create respective UI 2547 CommandLineParser::getInstance().generic.add_options() 2548 ("help,h", "produce help message") 2549 ("version,v", "show version") 2550 ("parse-xyz,p", po::value< vector<string> >(), "parse xyz file into World") 2551 ; 2552 CommandLineParser::getInstance().Run(argc,argv); 2553 if (!CommandLineParser::getInstance().isEmpty()) 2533 2554 UIFactory::makeUserInterface(UIFactory::CommandLine); 2534 } else { 2535 DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl); 2555 else 2536 2556 UIFactory::makeUserInterface(UIFactory::Text); 2537 }2538 2557 } 2539 2558 … … 2550 2569 Log() << Verbose(0) << "Saving of elements.db failed." << endl; 2551 2570 2552 // free the new argv2553 if (ArgumentsCopied) {2554 for (int i=0; i<ArgcSize;i++)2555 Free(&Arguments[i]);2556 Free(&Arguments);2557 }2558 2559 2571 cleanUp(); 2572 2560 2573 Memory::getState(); 2561 2574 return (0); -
src/molecule.hpp
rdaa714 r4917cc4 35 35 #include "Patterns/Observer.hpp" 36 36 #include "Patterns/Cacheable.hpp" 37 38 #include "Descriptors/MoleculeDescriptor_impl.hpp"39 37 40 38 /****************************************** forward declarations *****************************/ -
tests/Tesselations/defs.in
rdaa714 r4917cc4 62 62 #cat stderr 63 63 #cat stdout 64 grep -E "^[0-9]* [0-9]* [0-9]*$" ../../../../../molecuilder/tests/Tesselations/$mol/$2/${FILENAME}-$mol.dat | sort -n >reference-triangles.dat 65 grep -E "^[0-9]* [0-9]* [0-9]*$" ${FILENAME}.dat | sort -n >new-triangles.dat 66 diff reference-triangles.dat new-triangles.dat 2>diffstderr >diffstdout || exitcode=$? 64 diff ${FILENAME}.dat ../@srcdir@/$mol/$2/${FILENAME}-$mol.dat 2>diffstderr >diffstdout || exitcode=$? 67 65 #echo "Diff done with exitcode $exitcode." 68 66 #cat diffstderr
Note:
See TracChangeset
for help on using the changeset viewer.