Changes in / [12872d:f941b1]
- Files:
-
- 108 added
- 2 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r12872d rf941b1 28 28 # Boost libraries 29 29 AX_BOOST_BASE([1.33.1]) 30 #AX_BOOST_PROGRAM_OPTIONS30 AX_BOOST_PROGRAM_OPTIONS 31 31 #AX_BOOST_FOREACH 32 32 #AX_BOOST_FILESYSTEM -
src/Actions/ActionRegistry.cpp
r12872d rf941b1 43 43 } 44 44 45 void ActionRegistry::unregisterAction(Action* action){ 46 actionMap.erase(action->getName()); 47 } 48 49 std::map<const std::string,Action*>::iterator ActionRegistry::getBeginIter() 50 { 51 return actionMap.begin(); 52 } 53 54 std::map<const std::string,Action*>::iterator ActionRegistry::getEndIter() 55 { 56 return actionMap.end(); 57 } 58 45 59 CONSTRUCT_SINGLETON(ActionRegistry) -
src/Actions/ActionRegistry.hpp
r12872d rf941b1 22 22 Action* getActionByName(const std::string); 23 23 void registerAction(Action*); 24 void unregisterAction(Action*); 25 26 std::map<const std::string,Action*>::iterator getBeginIter(); 27 std::map<const std::string,Action*>::iterator getEndIter(); 24 28 25 29 private: -
src/Legacy/oldmenu.cpp
r12872d rf941b1 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
r12872d rf941b1 1 # PLEASE adhere to the alphabetical ordering in this Makefile! 2 # Also indentation by a single tab 3 1 4 # this includes source files that need to be present at multiple points 2 HELPERSOURCE = Helpers/Assert.cpp \ 3 Helpers/MemDebug.cpp 5 HELPERSOURCE = \ 6 Helpers/Assert.cpp \ 7 Helpers/MemDebug.cpp 4 8 5 ATOMSOURCE = atom.cpp atom_atominfo.cpp atom_bondedparticle.cpp atom_bondedparticleinfo.cpp atom_graphnode.cpp atom_graphnodeinfo.cpp atom_particleinfo.cpp atom_trajectoryparticle.cpp atom_trajectoryparticleinfo.cpp 6 ATOMHEADER = atom.hpp atom_atominfo.hpp atom_bondedparticle.hpp atom_bondedparticleinfo.hpp atom_graphnode.hpp atom_graphnodeinfo.hpp atom_particleinfo.hpp atom_trajectoryparticle.hpp atom_trajectoryparticleinfo.hpp 7 8 LINALGSOURCE = ${HELPERSOURCE} \ 9 gslmatrix.cpp \ 10 gslvector.cpp \ 11 linearsystemofequations.cpp \ 12 Space.cpp \ 13 vector.cpp 9 ATOMSOURCE = \ 10 atom.cpp \ 11 atom_atominfo.cpp \ 12 atom_bondedparticle.cpp \ 13 atom_bondedparticleinfo.cpp \ 14 atom_graphnode.cpp \ 15 atom_graphnodeinfo.cpp \ 16 atom_particleinfo.cpp \ 17 atom_trajectoryparticle.cpp \ 18 atom_trajectoryparticleinfo.cpp 19 ATOMHEADER = \ 20 atom.hpp \ 21 atom_atominfo.hpp \ 22 atom_bondedparticle.hpp \ 23 atom_bondedparticleinfo.hpp \ 24 atom_graphnode.hpp \ 25 atom_graphnodeinfo.hpp \ 26 atom_particleinfo.hpp \ 27 atom_trajectoryparticle.hpp \ 28 atom_trajectoryparticleinfo.hpp 29 30 LINALGSOURCE = \ 31 ${HELPERSOURCE} \ 32 gslmatrix.cpp \ 33 gslvector.cpp \ 34 linearsystemofequations.cpp \ 35 Space.cpp \ 36 vector.cpp 14 37 15 38 LINALGHEADER = gslmatrix.hpp \ 16 17 18 19 39 gslvector.hpp \ 40 linearsystemofequations.hpp \ 41 Space.hpp \ 42 vector.hpp 20 43 21 22 ANALYSISSOURCE = analysis_bonds.cpp analysis_correlation.cpp 23 ANALYSISHEADER = analysis_bonds.hpp analysis_correlation.hpp 44 ANALYSISSOURCE = \ 45 analysis_bonds.cpp \ 46 analysis_correlation.cpp 47 ANALYSISHEADER = \ 48 analysis_bonds.hpp \ 49 analysis_correlation.hpp 24 50 25 51 ACTIONSSOURCE = Actions/Action.cpp \ 26 Actions/ActionHistory.cpp \ 27 Actions/ActionRegistry.cpp \ 28 Actions/ActionSequence.cpp \ 29 Actions/ErrorAction.cpp \ 30 Actions/MakroAction.cpp \ 31 Actions/ManipulateAtomsProcess.cpp \ 32 Actions/MethodAction.cpp \ 33 Actions/Process.cpp \ 34 Actions/small_actions.cpp 35 52 ${ANALYSISACTIONSOURCE} \ 53 ${ATOMACTIONSOURCE} \ 54 ${CMDACTIONSOURCE} \ 55 ${FRAGMENTATIONACTIONSOURCE} \ 56 ${MOLECULEACTIONSOURCE} \ 57 ${PARSERACTIONSOURCE} \ 58 ${TESSELATIONACTIONSOURCE} \ 59 ${WORLDACTIONSOURCE} \ 60 Actions/ActionHistory.cpp \ 61 Actions/ActionRegistry.cpp \ 62 Actions/ActionSequence.cpp \ 63 Actions/ErrorAction.cpp \ 64 Actions/MakroAction.cpp \ 65 Actions/ManipulateAtomsProcess.cpp \ 66 Actions/MapOfActions.cpp \ 67 Actions/MethodAction.cpp \ 68 Actions/Process.cpp 69 70 ACTIONSHEADER = Actions/Action.hpp \ 71 ${ANALYSISACTIONHEADER} \ 72 ${ATOMACTIONHEADER} \ 73 ${CMDACTIONHEADER} \ 74 ${FRAGMENTATIONACTIONHEADER} \ 75 ${MOLECULEACTIONHEADER} \ 76 ${PARSERACTIONHEADER} \ 77 ${TESSELATIONACTIONHEADER} \ 78 ${WORLDACTIONHEADER} \ 79 Actions/ActionHistory.hpp \ 80 Actions/ActionRegistry.hpp \ 81 Actions/ActionSequence.hpp \ 82 Actions/Calculation.hpp \ 83 Actions/Calculation_impl.hpp \ 84 Actions/ErrorAction.hpp \ 85 Actions/MakroAction.hpp \ 86 Actions/ManipulateAtomsProcess.hpp \ 87 Actions/MapOfActions.hpp \ 88 Actions/MethodAction.hpp \ 89 Actions/Process.hpp 90 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 112 113 CMDACTIONSOURCE = \ 114 Actions/CmdAction/BondLengthTableAction.cpp \ 115 Actions/CmdAction/ElementDbAction.cpp \ 116 Actions/CmdAction/FastParsingAction.cpp \ 117 Actions/CmdAction/HelpAction.cpp \ 118 Actions/CmdAction/VerboseAction.cpp \ 119 Actions/CmdAction/VersionAction.cpp 120 CMDACTIONHEADER = \ 121 Actions/CmdAction/BondLengthTableAction.hpp \ 122 Actions/CmdAction/ElementDbAction.hpp \ 123 Actions/CmdAction/FastParsingAction.hpp \ 124 Actions/CmdAction/HelpAction.hpp \ 125 Actions/CmdAction/VerboseAction.hpp \ 126 Actions/CmdAction/VersionAction.hpp 127 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 136 137 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 149 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 36 161 37 ACTIONSHEADER = Actions/Action.hpp \ 38 Actions/ActionHistory.hpp \ 39 Actions/ActionRegistry.hpp \ 40 Actions/ActionSequence.hpp \ 41 Actions/Calculation.hpp \ 42 Actions/Calculation_impl.hpp \ 43 Actions/ErrorAction.hpp \ 44 Actions/MakroAction.hpp \ 45 Actions/ManipulateAtomsProcess.hpp \ 46 Actions/MethodAction.hpp \ 47 Actions/Process.hpp \ 48 Actions/small_actions.hpp 49 50 51 52 PATTERNSOURCE = Patterns/Observer.cpp 53 PATTERNHEADER = Patterns/Cacheable.hpp \ 54 Patterns/Observer.hpp \ 55 Patterns/Singleton.hpp 56 57 VIEWSOURCE = Views/View.cpp Views/StringView.cpp Views/MethodStringView.cpp Views/StreamStringView.cpp 58 VIEWHEADER = Views/View.hpp Views/StringView.hpp Views/MethodStringView.hpp Views/StreamStringView.hpp 59 60 MENUSOURCE = Menu/Menu.cpp Menu/TextMenu.cpp Menu/MenuItem.cpp Menu/SubMenuItem.cpp Menu/ActionMenuItem.cpp Menu/SeperatorItem.cpp Menu/DisplayMenuItem.cpp 61 MENUHEADER = Menu/Menu.hpp Menu/TextMenu.hpp Menu/MenuItem.hpp Menu/SubMenuItem.hpp Menu/ActionMenuItem.hpp Menu/SeperatorItem.hpp Menu/DisplayMenuItem.hpp 62 63 UISOURCE = ${ACTIONSSOURCE} ${VIEWSOURCE} ${MENUSOURCE} UIElements/UIFactory.cpp UIElements/TextUIFactory.cpp UIElements/MainWindow.cpp UIElements/TextWindow.cpp UIElements/TextStatusIndicator.cpp UIElements/Dialog.cpp UIElements/TextDialog.cpp 64 UIHEADER = ${ACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/UIFactory.hpp UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/TextStatusIndicator.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp 162 PARSERACTIONSOURCE = \ 163 Actions/ParserAction/LoadXyzAction.cpp \ 164 Actions/ParserAction/SaveXyzAction.cpp 165 PARSERACTIONHEADER = \ 166 Actions/ParserAction/LoadXyzAction.hpp \ 167 Actions/ParserAction/SaveXyzAction.hpp 168 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 200 201 PARSERSOURCE = \ 202 Parser/ChangeTracker.cpp \ 203 Parser/FormatParser.cpp \ 204 Parser/TremoloParser.cpp \ 205 Parser/XyzParser.cpp 206 PARSERHEADER = \ 207 Parser/ChangeTracker.hpp \ 208 Parser/FormatParser.hpp \ 209 Parser/TremoloParser.hpp \ 210 Parser/XyzParser.hpp 211 212 PATTERNSOURCE = \ 213 Patterns/Observer.cpp 214 PATTERNHEADER = \ 215 Patterns/Cacheable.hpp \ 216 Patterns/Observer.hpp \ 217 Patterns/Singleton.hpp 218 219 # Below is all for the User Interface 220 221 VIEWSOURCE = \ 222 Views/View.cpp \ 223 Views/StringView.cpp \ 224 Views/MethodStringView.cpp \ 225 Views/StreamStringView.cpp 226 VIEWHEADER = \ 227 Views/View.hpp \ 228 Views/StringView.hpp \ 229 Views/MethodStringView.hpp \ 230 Views/StreamStringView.hpp 231 232 MENUSOURCE = \ 233 Menu/Menu.cpp \ 234 Menu/TextMenu.cpp \ 235 Menu/MenuItem.cpp \ 236 Menu/SubMenuItem.cpp \ 237 Menu/ActionMenuItem.cpp \ 238 Menu/SeperatorItem.cpp \ 239 Menu/DisplayMenuItem.cpp 240 241 MENUHEADER = \ 242 Menu/Menu.hpp \ 243 Menu/TextMenu.hpp \ 244 Menu/MenuItem.hpp \ 245 Menu/SubMenuItem.hpp \ 246 Menu/ActionMenuItem.hpp \ 247 Menu/SeperatorItem.hpp \ 248 Menu/DisplayMenuItem.hpp 249 250 UISOURCE = \ 251 ${ACTIONSSOURCE} \ 252 ${COMMANDLINEUISOURCE} \ 253 ${MENUSOURCE} \ 254 ${TEXTUISOURCE} \ 255 ${VIEWSOURCE} \ 256 UIElements/Dialog.cpp \ 257 UIElements/MainWindow.cpp \ 258 UIElements/UIFactory.cpp 259 260 UIHEADER = \ 261 ${ACTIONSHEADER} \ 262 ${COMMANDLINEUIHEADER} \ 263 ${MENUHEADER} \ 264 ${TEXTUIHEADER} \ 265 ${VIEWHEADER} \ 266 UIElements/Dialog.hpp \ 267 UIElements/MainWindow.hpp \ 268 UIElements/UIFactory.hpp 269 270 TEXTUISOURCE = \ 271 UIElements/TextDialog.cpp \ 272 UIElements/TextStatusIndicator.cpp \ 273 UIElements/TextUIFactory.cpp \ 274 UIElements/TextWindow.cpp 275 TEXTUIHEADER = \ 276 UIElements/TextDialog.hpp \ 277 UIElements/TextStatusIndicator.hpp \ 278 UIElements/TextUIFactory.hpp \ 279 UIElements/TextWindow.hpp 280 281 COMMANDLINEUISOURCE = \ 282 UIElements/CommandLineDialog.cpp \ 283 UIElements/CommandLineStatusIndicator.cpp \ 284 UIElements/CommandLineUIFactory.cpp \ 285 UIElements/CommandLineWindow.cpp 286 COMMANDLINEUIHEADER = \ 287 UIElements/CommandLineDialog.hpp \ 288 UIElements/CommandLineStatusIndicator.hpp \ 289 UIElements/CommandLineUIFactory.hpp \ 290 UIElements/CommandLineWindow.hpp 65 291 66 292 # all these files are only used for legacy reasons while the transition is in progress … … 71 297 72 298 DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \ 73 74 75 76 299 Descriptors/AtomIdDescriptor.cpp \ 300 Descriptors/AtomTypeDescriptor.cpp \ 301 Descriptors/MoleculeDescriptor.cpp \ 302 Descriptors/MoleculeIdDescriptor.cpp 77 303 78 304 79 305 DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp \ 80 81 82 83 306 Descriptors/AtomIdDescriptor.hpp \ 307 Descriptors/AtomTypeDescriptor.hpp \ 308 Descriptors/MoleculeDescriptor.hpp \ 309 Descriptors/MoleculeIdDescriptor.hpp 84 310 85 86 87 311 EXCEPTIONSOURCE = Exceptions/CustomException.cpp \ 88 89 90 312 Exceptions/LinearDependenceException.cpp \ 313 Exceptions/MathException.cpp \ 314 Exceptions/ZeroVectorException.cpp 91 315 92 316 EXCEPTIONHEADER = Exceptions/CustomException.hpp \ 93 Exceptions/LinearDependenceException.hpp \ 94 Exceptions/MathException.hpp \ 95 Exceptions/ZeroVectorException.hpp 96 97 SOURCE = ${ANALYSISSOURCE} \ 98 ${ATOMSOURCE} \ 99 ${PATTERNSOURCE} \ 100 ${UISOURCE} \ 101 ${DESCRIPTORSOURCE} \ 102 ${HELPERSOURCE} \ 103 ${LEGACYSOURCE} \ 104 ${EXCEPTIONSOURCE} \ 105 bond.cpp \ 106 bondgraph.cpp \ 107 boundary.cpp \ 108 config.cpp \ 109 element.cpp \ 110 ellipsoid.cpp \ 111 errorlogger.cpp \ 112 graph.cpp \ 113 helpers.cpp \ 114 info.cpp \ 115 leastsquaremin.cpp \ 116 Line.cpp \ 117 linkedcell.cpp \ 118 lists.cpp \ 119 log.cpp \ 120 logger.cpp \ 121 memoryusageobserver.cpp \ 122 moleculelist.cpp \ 123 molecule.cpp \ 124 molecule_dynamics.cpp \ 125 molecule_fragmentation.cpp \ 126 molecule_geometry.cpp \ 127 molecule_graph.cpp \ 128 molecule_pointcloud.cpp \ 129 parser.cpp \ 130 periodentafel.cpp \ 131 Plane.cpp \ 132 tesselation.cpp \ 133 tesselationhelpers.cpp \ 134 triangleintersectionlist.cpp \ 135 verbose.cpp \ 136 vector_ops.cpp \ 137 World.cpp 317 Exceptions/LinearDependenceException.hpp \ 318 Exceptions/MathException.hpp \ 319 Exceptions/ZeroVectorException.hpp 320 321 SOURCE = \ 322 ${ANALYSISSOURCE} \ 323 ${ATOMSOURCE} \ 324 ${PATTERNSOURCE} \ 325 ${PARSERSOURCE} \ 326 ${UISOURCE} \ 327 ${DESCRIPTORSOURCE} \ 328 ${HELPERSOURCE} \ 329 ${LEGACYSOURCE} \ 330 ${EXCEPTIONSOURCE} \ 331 bond.cpp \ 332 bondgraph.cpp \ 333 boundary.cpp \ 334 CommandLineParser.cpp \ 335 config.cpp \ 336 element.cpp \ 337 ellipsoid.cpp \ 338 errorlogger.cpp \ 339 graph.cpp \ 340 helpers.cpp \ 341 info.cpp \ 342 leastsquaremin.cpp \ 343 Line.cpp \ 344 linkedcell.cpp \ 345 lists.cpp \ 346 log.cpp \ 347 logger.cpp \ 348 memoryusageobserver.cpp \ 349 moleculelist.cpp \ 350 molecule.cpp \ 351 molecule_dynamics.cpp \ 352 molecule_fragmentation.cpp \ 353 molecule_geometry.cpp \ 354 molecule_graph.cpp \ 355 molecule_pointcloud.cpp \ 356 parser.cpp \ 357 periodentafel.cpp \ 358 Plane.cpp \ 359 tesselation.cpp \ 360 tesselationhelpers.cpp \ 361 triangleintersectionlist.cpp \ 362 verbose.cpp \ 363 vector_ops.cpp \ 364 World.cpp 138 365 139 366 HEADER = \ 140 ${ANALYSISHEADER} \ 141 ${ATOMHEADER} \ 142 ${PATTERNHEADER} \ 143 ${UIHEADER} \ 144 ${DESCRIPTORHEADER} \ 145 ${EXCEPTIONHEADER} \ 146 ${LEGACYHEADER} \ 147 bond.hpp \ 148 bondgraph.hpp \ 149 boundary.hpp \ 150 config.hpp \ 151 defs.hpp \ 152 element.hpp \ 153 ellipsoid.hpp \ 154 errorlogger.hpp \ 155 graph.hpp \ 156 helpers.hpp \ 157 info.hpp \ 158 leastsquaremin.hpp \ 159 Line.hpp \ 160 linkedcell.hpp \ 161 lists.hpp \ 162 log.hpp \ 163 logger.hpp \ 164 memoryallocator.hpp \ 165 memoryusageobserver.hpp \ 166 molecule.hpp \ 167 molecule_template.hpp \ 168 parser.hpp \ 169 periodentafel.hpp \ 170 Plane.hpp \ 171 stackclass.hpp \ 172 tesselation.hpp \ 173 tesselationhelpers.hpp \ 174 triangleintersectionlist.hpp \ 175 verbose.hpp \ 176 vector_ops.hpp \ 177 World.hpp 367 ${ANALYSISHEADER} \ 368 ${ATOMHEADER} \ 369 ${PARSERHEADER} \ 370 ${PATTERNHEADER} \ 371 ${UIHEADER} \ 372 ${DESCRIPTORHEADER} \ 373 ${EXCEPTIONHEADER} \ 374 ${LEGACYHEADER} \ 375 bond.hpp \ 376 bondgraph.hpp \ 377 boundary.hpp \ 378 CommandLineParser.hpp \ 379 config.hpp \ 380 defs.hpp \ 381 element.hpp \ 382 ellipsoid.hpp \ 383 errorlogger.hpp \ 384 graph.hpp \ 385 helpers.hpp \ 386 info.hpp \ 387 leastsquaremin.hpp \ 388 Line.hpp \ 389 linkedcell.hpp \ 390 lists.hpp \ 391 log.hpp \ 392 logger.hpp \ 393 memoryallocator.hpp \ 394 memoryusageobserver.hpp \ 395 molecule.hpp \ 396 molecule_template.hpp \ 397 parser.hpp \ 398 periodentafel.hpp \ 399 Plane.hpp \ 400 stackclass.hpp \ 401 tesselation.hpp \ 402 tesselationhelpers.hpp \ 403 triangleintersectionlist.hpp \ 404 verbose.hpp \ 405 vector_ops.hpp \ 406 World.hpp 178 407 179 408 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) … … 188 417 molecuilder_LDFLAGS = $(BOOST_LDFLAGS) 189 418 molecuilder_SOURCES = builder.cpp 190 molecuilder_LDADD = libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 419 molecuilder_LDADD = libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} 191 420 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp 192 421 joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 193 422 analyzer_SOURCES = analyzer.cpp datacreator.cpp parser.cpp helpers.hpp periodentafel.hpp parser.hpp datacreator.hpp 194 423 analyzer_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 195 196 #EXTRA_DIST = ${molecuilder_DATA}197 424 198 425 FORCE: -
src/UIElements/Dialog.cpp
r12872d rf941b1 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 … … 51 54 52 55 // Base class 53 Dialog::Query::Query(string _title) : 54 title(_title) 56 Dialog::Query::Query(string _title, string _description) : 57 title(_title), 58 description(_description) 55 59 {} 56 60 … … 61 65 } 62 66 67 const std::string Dialog::Query::getDescription() const{ 68 return description; 69 } 70 // empty Queries 71 72 Dialog::EmptyQuery::EmptyQuery(string title, std::string description) : 73 Query(title, description) 74 {} 75 76 Dialog::EmptyQuery::~EmptyQuery() {} 77 78 void Dialog::EmptyQuery::setResult() { 79 } 80 63 81 // Int Queries 64 82 65 Dialog::IntQuery::IntQuery(string title,int *_target ) :66 Query(title ), target(_target)83 Dialog::IntQuery::IntQuery(string title,int *_target, std::string description) : 84 Query(title, description), target(_target) 67 85 {} 68 86 … … 73 91 } 74 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 75 105 // String Queries 76 106 77 Dialog::StringQuery::StringQuery(string title,string *_target ) :78 Query(title ), target(_target)107 Dialog::StringQuery::StringQuery(string title,string *_target, std::string _description) : 108 Query(title, _description), target(_target) 79 109 {} 80 110 … … 87 117 // Double Queries 88 118 89 Dialog::DoubleQuery::DoubleQuery(string title,double *_target ) :90 Query(title ), target(_target)119 Dialog::DoubleQuery::DoubleQuery(string title,double *_target, std::string _description) : 120 Query(title, _description), target(_target) 91 121 {} 92 122 … … 98 128 99 129 130 // Atom Queries 131 132 Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) : 133 Query(title, _description), 134 tmp(0), 135 target(_target) 136 137 {} 138 139 Dialog::AtomQuery::~AtomQuery() {} 140 141 void Dialog::AtomQuery::setResult() { 142 *target = tmp; 143 } 144 100 145 // Molecule Queries 101 146 102 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules) :103 Query(title ),147 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) : 148 Query(title, _description), 104 149 tmp(0), 105 molecules(_molecules),106 150 target(_target) 107 151 … … 116 160 // Vector Queries 117 161 118 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check ) :119 Query(title ),162 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description) : 163 Query(title, _description), 120 164 cellSize(_cellSize), 121 165 check(_check), … … 134 178 } 135 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]; 197 } 198 136 199 // Element Queries 137 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target ) :138 Query(title ),200 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target, std::string _description) : 201 Query(title, _description), 139 202 tmp(0), 140 203 target(_target) -
src/UIElements/Dialog.hpp
r12872d rf941b1 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 … … 23 23 virtual ~Dialog(); 24 24 25 virtual void queryInt(const char *, int *)=0; 26 virtual void queryDouble(const char*,double *)=0; 27 virtual void queryString(const char*, std::string *)=0; 28 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*)=0; 29 virtual void queryVector(const char*,Vector *,const double *const,bool)=0; 30 virtual void queryElement(const char*,const element **)=0; 25 virtual void queryEmpty(const char *, std::string = "")=0; 26 virtual void queryBoolean(const char *, bool *, std::string = "")=0; 27 virtual void queryInt(const char *, int *, std::string = "")=0; 28 virtual void queryDouble(const char*,double *, std::string = "")=0; 29 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; 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; 34 virtual void queryElement(const char*,const element **, std::string = "")=0; 31 35 32 36 virtual bool display(); … … 46 50 class Query { 47 51 public: 48 Query(std::string _title );52 Query(std::string _title, std::string _description = ""); 49 53 virtual ~Query(); 50 54 virtual bool handle()=0; … … 52 56 protected: 53 57 const std::string getTitle() const; 58 const std::string getDescription() const; 54 59 private: 55 std::string title; 60 std::string title; //!< short title of the query 61 std::string description; //!< longer description for tooltips or for help 62 }; 63 64 // Empty Query is just meant for showing text, such as version, help, initial message or alike 65 class EmptyQuery : public Query { 66 public: 67 EmptyQuery(std::string title, std::string _description = ""); 68 virtual ~EmptyQuery(); 69 virtual bool handle()=0; 70 virtual void setResult(); 56 71 }; 57 72 58 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 59 86 class IntQuery : public Query { 60 87 public: 61 IntQuery(std::string title,int *_target );88 IntQuery(std::string title,int *_target, std::string _description = ""); 62 89 virtual ~IntQuery(); 63 90 virtual bool handle()=0; … … 71 98 class DoubleQuery : public Query { 72 99 public: 73 DoubleQuery(std::string title,double *_target );100 DoubleQuery(std::string title,double *_target, std::string _description = ""); 74 101 virtual ~DoubleQuery(); 75 102 virtual bool handle()=0; … … 83 110 class StringQuery : public Query { 84 111 public: 85 StringQuery(std::string title,std::string *_target );112 StringQuery(std::string title,std::string *_target, std::string _description = ""); 86 113 virtual ~StringQuery(); 87 114 virtual bool handle()=0; … … 93 120 }; 94 121 95 96 122 class MoleculeQuery : public Query { 97 123 public: 98 MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);124 MoleculeQuery(std::string title, molecule **_target, std::string _description = ""); 99 125 virtual ~MoleculeQuery(); 100 126 virtual bool handle()=0; … … 102 128 protected: 103 129 molecule *tmp; 104 MoleculeListClass *molecules;105 130 private: 106 131 molecule **target; 107 132 }; 108 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 }; 145 109 146 class VectorQuery : public Query { 110 147 public: 111 VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check );148 VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = ""); 112 149 virtual ~VectorQuery(); 113 150 virtual bool handle()=0; … … 121 158 }; 122 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 }; 171 123 172 class ElementQuery : public Query { 124 173 public: 125 ElementQuery(std::string title, const element**_target );174 ElementQuery(std::string title, const element**_target, std::string _description = ""); 126 175 virtual ~ElementQuery(); 127 176 virtual bool handle()=0; … … 140 189 }; 141 190 191 142 192 #endif /* DIALOG_HPP_ */ -
src/UIElements/MainWindow.hpp
r12872d rf941b1 25 25 }; 26 26 27 /**28 * The type of menuPopulators29 */30 typedef void (*MenuMaker)(Menu*,MoleculeListClass*, config*, periodentafel*);31 32 /**33 * This contains all Functions that are used to create the menus.34 * Needs a specific funtion for each menu. All populators will be called35 * by the UIFactory upon creation of the main menu. Thus the actuall construction36 * of the Menus can be kept independent of the concrete type of UI that is being37 * built.38 */39 struct menuPopulaters{40 MenuMaker MakeEditMoleculesMenu;41 };42 27 43 28 #endif /* MAINWINDOW_HPP_ */ -
src/UIElements/TextDialog.cpp
r12872d rf941b1 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 … … 29 36 30 37 31 void TextDialog::queryInt(const char* title, int* target){ 32 registerQuery(new IntTextQuery(title,target)); 33 } 34 35 void TextDialog::queryDouble(const char* title, double* target){ 36 registerQuery(new DoubleTextQuery(title,target)); 37 } 38 39 void TextDialog::queryString(const char* title, string* target){ 40 registerQuery(new StringTextQuery(title,target)); 41 } 42 43 void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules) { 44 registerQuery(new MoleculeTextQuery(title,target,molecules)); 45 } 46 47 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check) { 48 registerQuery(new VectorTextQuery(title,target,cellSize,check)); 49 } 50 51 void TextDialog::queryElement(const char* title, const element **target){ 52 registerQuery(new ElementTextQuery(title,target)); 38 void TextDialog::queryEmpty(const char* title, string description){ 39 registerQuery(new EmptyTextQuery(title,description)); 40 } 41 42 void TextDialog::queryBoolean(const char* title, bool* target, string description){ 43 registerQuery(new BooleanTextQuery(title,target,description)); 44 } 45 46 void TextDialog::queryInt(const char* title, int* target, string description){ 47 registerQuery(new IntTextQuery(title,target,description)); 48 } 49 50 void TextDialog::queryDouble(const char* title, double* target, string description){ 51 registerQuery(new DoubleTextQuery(title,target,description)); 52 } 53 54 void TextDialog::queryString(const char* title, string* target, string description){ 55 registerQuery(new StringTextQuery(title,target,description)); 56 } 57 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)); 64 } 65 66 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) { 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)); 72 } 73 74 void TextDialog::queryElement(const char* title, const element **target, string description){ 75 registerQuery(new ElementTextQuery(title,target,description)); 53 76 } 54 77 55 78 /************************** Query Infrastructure ************************/ 56 79 57 TextDialog::IntTextQuery::IntTextQuery(string title,int *_target) : 58 Dialog::IntQuery(title,_target) 80 TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) : 81 Dialog::EmptyQuery(title,_description) 82 {} 83 84 TextDialog::EmptyTextQuery::~EmptyTextQuery() {} 85 86 bool TextDialog::EmptyTextQuery::handle() { 87 cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n"; 88 return true; 89 } 90 91 TextDialog::IntTextQuery::IntTextQuery(string title, int * _target, std::string _description) : 92 Dialog::IntQuery(title,_target,_description) 59 93 {} 60 94 … … 79 113 } 80 114 81 TextDialog::StringTextQuery::StringTextQuery(string title,string *_target) : 82 Dialog::StringQuery(title,_target) 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 144 TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) : 145 Dialog::StringQuery(title,_target,_description) 83 146 {} 84 147 … … 91 154 } 92 155 93 TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target ) :94 Dialog::DoubleQuery(title,_target )156 TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target, std::string _description) : 157 Dialog::DoubleQuery(title,_target,_description) 95 158 {} 96 159 … … 114 177 } 115 178 116 TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules) : 117 Dialog::MoleculeQuery(title,_target,_molecules) 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) 118 213 {} 119 214 … … 135 230 } 136 231 137 tmp = molecules->ReturnIndex(idxOfMol);232 tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 138 233 if(!tmp && idxOfMol!=-1){ 139 234 Log() << Verbose(0) << "Invalid Molecule Index" << endl; … … 146 241 } 147 242 148 TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check ) :149 Dialog::VectorQuery(title,_target,_cellSize,_check )243 TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check, std::string _description) : 244 Dialog::VectorQuery(title,_target,_cellSize,_check,_description) 150 245 {} 151 246 … … 168 263 } 169 264 170 171 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target) : 172 Dialog::ElementQuery(title,target) 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 283 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) : 284 Dialog::ElementQuery(title,target,_description) 173 285 {} 174 286 -
src/UIElements/TextDialog.hpp
r12872d rf941b1 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 { … … 19 24 virtual ~TextDialog(); 20 25 21 virtual void queryInt(const char *, int *); 22 virtual void queryString(const char*, std::string *); 23 virtual void queryDouble(const char*, double*); 24 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*); 25 virtual void queryVector(const char*,Vector *,const double * const,bool); 26 virtual void queryElement(const char*,const element **); 26 virtual void queryEmpty(const char *, std::string = ""); 27 virtual void queryBoolean(const char *, bool *, std::string = ""); 28 virtual void queryInt(const char *, int *, std::string = ""); 29 virtual void queryString(const char*, std::string *, std::string = ""); 30 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 = ""); 33 virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = ""); 34 virtual void queryBox(const char*,double ** const, std::string = ""); 35 virtual void queryElement(const char*,const element **, std::string = ""); 27 36 28 37 protected: 29 38 // specialized stuff for text queries 39 class EmptyTextQuery : public Dialog::EmptyQuery { 40 public: 41 EmptyTextQuery(std::string title, std::string _description = NULL); 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(); 50 virtual bool handle(); 51 }; 52 30 53 class IntTextQuery : public Dialog::IntQuery { 31 54 public: 32 IntTextQuery(std::string title, int *_target );55 IntTextQuery(std::string title, int *_target, std::string _description = NULL); 33 56 virtual ~IntTextQuery(); 34 57 virtual bool handle(); … … 37 60 class DoubleTextQuery : public Dialog::DoubleQuery { 38 61 public: 39 DoubleTextQuery(std::string title, double *_target );62 DoubleTextQuery(std::string title, double *_target, std::string _description = NULL); 40 63 virtual ~DoubleTextQuery(); 41 64 virtual bool handle(); … … 44 67 class StringTextQuery : public Dialog::StringQuery { 45 68 public: 46 StringTextQuery(std::string title, std::string *_target );69 StringTextQuery(std::string title, std::string *_target, std::string _description = NULL); 47 70 virtual ~StringTextQuery(); 71 virtual bool handle(); 72 }; 73 74 class AtomTextQuery : public Dialog::AtomQuery { 75 public: 76 AtomTextQuery(std::string title, atom **_target, std::string _description = NULL); 77 virtual ~AtomTextQuery(); 48 78 virtual bool handle(); 49 79 }; … … 51 81 class MoleculeTextQuery : public Dialog::MoleculeQuery { 52 82 public: 53 MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);83 MoleculeTextQuery(std::string title, molecule **_target, std::string _description = NULL); 54 84 virtual ~MoleculeTextQuery(); 55 85 virtual bool handle(); … … 58 88 class VectorTextQuery : public Dialog::VectorQuery { 59 89 public: 60 VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check );90 VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL); 61 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(); 62 99 virtual bool handle(); 63 100 }; … … 65 102 class ElementTextQuery : public Dialog::ElementQuery { 66 103 public: 67 ElementTextQuery(std::string title, const element **_target );104 ElementTextQuery(std::string title, const element **_target, std::string _description = NULL); 68 105 virtual ~ElementTextQuery(); 69 106 virtual bool handle(); -
src/UIElements/TextUIFactory.cpp
r12872d rf941b1 27 27 } 28 28 29 MainWindow* TextUIFactory::makeMainWindow( menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName) {30 return new TextWindow( populaters,molecules,configuration,periode,ConfigFileName);29 MainWindow* TextUIFactory::makeMainWindow() { 30 return new TextWindow(); 31 31 } 32 32 -
src/UIElements/TextUIFactory.hpp
r12872d rf941b1 19 19 20 20 virtual Dialog* makeDialog(); 21 virtual MainWindow* makeMainWindow( menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);21 virtual MainWindow* makeMainWindow(); 22 22 23 23 protected: -
src/UIElements/TextWindow.cpp
r12872d rf941b1 27 27 #include "molecule.hpp" 28 28 #include "periodentafel.hpp" 29 #include "World.hpp" 29 30 30 31 #include "Legacy/oldmenu.hpp" … … 38 39 #include "UIElements/TextStatusIndicator.hpp" 39 40 #include "Actions/MethodAction.hpp" 41 #include "Actions/MoleculeAction/ChangeNameAction.hpp" 40 42 #include "Actions/ErrorAction.hpp" 41 43 #include "Actions/ActionRegistry.hpp" … … 48 50 49 51 // TODO: see what code can be moved to a base class for Graphic and Text Windows 50 TextWindow::TextWindow( menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName)52 TextWindow::TextWindow() 51 53 { 54 MoleculeListClass *molecules = World::getInstance().getMolecules(); 55 config *configuration = World::getInstance().getConfig(); 56 periodentafel *periode = World::getInstance().getPeriode(); 57 char *ConfigFileName = NULL; 52 58 old_menu = new oldmenu; 53 59 … … 101 107 // call all functions used to build the submenus 102 108 103 populate rs.MakeEditMoleculesMenu(editMoleculesMenu,molecules,configuration,periode);109 populateEditMoleculesMenu(editMoleculesMenu); 104 110 105 111 Action *returnFromEditMoleculeAction = new TextMenu::LeaveAction(editMoleculesMenu); … … 125 131 main_menu->display(); 126 132 } 133 134 void TextWindow::populateEditMoleculesMenu(Menu* editMoleculesMenu) 135 { 136 MoleculeListClass *molecules = World::getInstance().getMolecules(); 137 periodentafel *periode = World::getInstance().getPeriode(); 138 139 // build the EditMoleculesMenu 140 Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode)); 141 new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction); 142 143 Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode)); 144 new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction); 145 146 Action *changeFilenameAction = new MoleculeChangeNameAction(); 147 new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction); 148 149 Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules)); 150 new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction); 151 152 Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules)); 153 new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction); 154 155 Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules)); 156 new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction); 157 158 } -
src/UIElements/TextWindow.hpp
r12872d rf941b1 17 17 class TextStatusIndicator; 18 18 19 19 20 class TextWindow : public MainWindow 20 21 { 21 22 public: 22 TextWindow( menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);23 TextWindow(); 23 24 virtual ~TextWindow(); 24 25 25 26 virtual void display(); 26 27 private: 28 // populaters 29 void populateEditMoleculesMenu(Menu* editMoleculesMenu); 30 27 31 TextMenu *main_menu; 28 32 -
src/UIElements/UIFactory.cpp
r12872d rf941b1 13 13 // all factories that can be used: 14 14 #include "UIElements/TextUIFactory.hpp" 15 #include "UIElements/CommandLineUIFactory.hpp" 15 16 16 17 UIFactory::UIFactory() … … 30 31 setInstance(new TextUIFactory()); 31 32 break; 33 case CommandLine: 34 setInstance(new CommandLineUIFactory()); 35 break; 32 36 33 37 default: -
src/UIElements/UIFactory.hpp
r12872d rf941b1 11 11 class MainWindow; 12 12 class Dialog; 13 14 class MoleculeListClass; 15 class config; 16 class periodentafel; 17 18 struct menuPopulaters; 13 class DialogDescription; 19 14 20 15 #include "Patterns/Singleton.hpp" … … 31 26 32 27 public: 33 enum InterfaceTypes {Text };28 enum InterfaceTypes {Text, CommandLine}; 34 29 virtual ~UIFactory(); 35 30 … … 37 32 * Produce some kind of main window, of whichever type was chosen when the factory was created 38 33 */ 39 virtual MainWindow* makeMainWindow( menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *)=0;34 virtual MainWindow* makeMainWindow()=0; 40 35 41 36 /** -
src/World.cpp
r12872d rf941b1 9 9 10 10 #include "atom.hpp" 11 #include "config.hpp" 11 12 #include "molecule.hpp" 12 13 #include "periodentafel.hpp" … … 27 28 } 28 29 30 config *&World::getConfig(){ 31 return configuration; 32 } 33 29 34 // Atoms 30 35 … … 53 58 std::vector<molecule*> World::getAllMolecules(MoleculeDescriptor descriptor){ 54 59 return descriptor.findAll(); 60 } 61 62 std::vector<molecule*> World::getAllMolecules(){ 63 return getAllMolecules(AllMolecules()); 55 64 } 56 65 … … 267 276 World::World() : 268 277 periode(new periodentafel), 278 configuration(new config), 269 279 atoms(), 270 280 currAtomId(0), … … 292 302 delete molecules_deprecated; 293 303 delete periode; 304 delete configuration; 294 305 MoleculeSet::iterator molIter; 295 306 for(molIter=molecules.begin();molIter!=molecules.end();++molIter){ -
src/World.hpp
r12872d rf941b1 30 30 31 31 // forward declarations 32 class config; 32 33 class periodentafel; 33 34 class MoleculeListClass; … … 75 76 76 77 /** 78 * returns the configuration for the world. 79 */ 80 config *&getConfig(); 81 82 /** 77 83 * returns the first atom that matches a given descriptor. 78 84 * Do not rely on ordering for descriptors that match more than one atom. … … 109 115 */ 110 116 std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor); 117 std::vector<molecule*> getAllMolecules(); 111 118 112 119 /** … … 234 241 235 242 periodentafel *periode; 243 config *configuration; 236 244 static double *cell_size; 237 245 static char *defaultName; -
src/atom_bondedparticle.cpp
r12872d rf941b1 74 74 *BondFile << nr << "\t" << (*Runner)->GetOtherAtom(this)->nr << "\n"; 75 75 }; 76 77 /** 78 * Adds a bond between this bonded particle and another. Does nothing if this 79 * bond already exists. 80 * 81 * \param bonding partner 82 */ 83 void BondedParticle::addBond(BondedParticle* Partner) { 84 if (IsBondedTo(Partner)) { 85 return; 86 } 87 88 bond* newBond = new bond((atom*) this, (atom*) Partner, 1, 0); 89 RegisterBond(newBond); 90 Partner->RegisterBond(newBond); 91 } 76 92 77 93 /** Puts a given bond into atom::ListOfBonds. -
src/atom_bondedparticle.hpp
r12872d rf941b1 37 37 virtual ~BondedParticle(); 38 38 39 void addBond(BondedParticle* Partner); 39 40 bool RegisterBond(bond *Binder); 40 41 bool UnregisterBond(bond *Binder); -
src/atom_particleinfo.cpp
r12872d rf941b1 16 16 nr(pointer->nr), 17 17 Name(pointer->Name) 18 {} 18 { 19 if (Name == NULL) 20 Name = " "; 21 } 19 22 20 23 -
src/bond.cpp
r12872d rf941b1 15 15 /** Empty Constructor for class bond. 16 16 */ 17 bond::bond() : leftatom(NULL), rightatom(NULL), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(0), nr(-1), Cyclic(false), Type(Undetermined), Used(white) 17 bond::bond() 18 : leftatom(NULL), rightatom(NULL), previous(NULL), next(NULL), HydrogenBond(0), 19 BondDegree(0), nr(-1), Cyclic(false), Type(Undetermined), Used(white) 18 20 { 19 21 }; … … 25 27 * \param number increasing index 26 28 */ 27 bond::bond(atom *left, atom *right, const int degree, const int number) : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white) 29 bond::bond(atom *left, atom *right, const int degree, const int number) 30 : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), 31 BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white) 28 32 { 29 33 if ((left != NULL) && (right != NULL)) { -
src/bondgraph.hpp
r12872d rf941b1 27 27 28 28 class molecule; 29 class periodentafel;29 class BondedParticle; 30 30 class MatrixContainer; 31 31 -
src/builder.cpp
r12872d rf941b1 60 60 #include "bondgraph.hpp" 61 61 #include "boundary.hpp" 62 #include "CommandLineParser.hpp" 62 63 #include "config.hpp" 63 64 #include "element.hpp" … … 76 77 #include "Actions/ActionRegistry.hpp" 77 78 #include "Actions/ActionHistory.hpp" 79 #include "Actions/MapOfActions.hpp" 78 80 #include "Actions/MethodAction.hpp" 79 #include "Actions/ small_actions.hpp"81 #include "Actions/MoleculeAction/ChangeNameAction.hpp" 80 82 #include "World.hpp" 81 83 #include "version.h" … … 1479 1481 1480 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. 1481 1485 * \param argc argument count 1482 1486 * \param **argv arguments array … … 1486 1490 * \param *ConfigFileName pointer to config file name in **argv 1487 1491 * \param *PathToDatabases pointer to db's path in **argv 1492 * \param &ArgcList list of arguments that we do not parse here 1488 1493 * \return exit code (0 - successful, all else - something's wrong) 1489 1494 */ 1490 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, \1491 config& configuration, char *&ConfigFileName )1495 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, 1496 config& configuration, char *&ConfigFileName, list<int> &ArgcList) 1492 1497 { 1493 1498 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1507 1512 molecule *mol = NULL; 1508 1513 string BondGraphFileName("\n"); 1509 int verbosity = 0;1510 1514 strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1); 1511 1515 … … 1521 1525 case 'H': 1522 1526 case '?': 1523 DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl); 1524 DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl); 1525 DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl); 1526 DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl); 1527 DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl); 1528 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); 1529 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); 1530 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); 1531 DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl); 1532 DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl); 1533 DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl); 1534 DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl); 1535 DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl); 1536 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); 1537 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); 1538 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); 1539 DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl); 1540 DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl); 1541 DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl); 1542 DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl); 1543 DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl); 1544 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); 1545 DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl); 1546 DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl); 1547 DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl); 1548 DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl); 1549 DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl); 1550 DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl); 1551 DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl); 1552 DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl); 1553 DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl); 1554 DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl); 1555 DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl); 1556 DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl); 1557 DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl); 1558 DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl); 1559 DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl); 1560 DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl); 1561 DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl); 1562 DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl); 1563 DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl); 1564 return (1); 1527 ArgcList.push_back(argptr-1); 1528 return(1); 1565 1529 break; 1566 1530 case 'v': 1567 while (argv[argptr-1][verbosity+1] == 'v') { 1568 verbosity++; 1569 } 1570 setVerbosity(verbosity); 1571 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl); 1531 ArgcList.push_back(argptr-1); 1532 return(1); 1572 1533 break; 1573 1534 case 'V': 1574 DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl);1575 DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl);1576 return (1);1535 ArgcList.push_back(argptr-1); 1536 ArgcList.push_back(argptr); 1537 argptr++; 1577 1538 break; 1578 1539 case 'B': … … 2511 2472 }; 2512 2473 2513 /***************************************** Functions used to build all menus **********************/2514 2515 void populateEditMoleculesMenu(Menu* editMoleculesMenu,MoleculeListClass *molecules, config *configuration, periodentafel *periode){2516 // build the EditMoleculesMenu2517 Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode));2518 new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction);2519 2520 Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode));2521 new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);2522 2523 Action *changeFilenameAction = new ChangeMoleculeNameAction(molecules);2524 new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);2525 2526 Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules));2527 new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction);2528 2529 Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules));2530 new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction);2531 2532 Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));2533 new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);2534 2535 }2536 2537 2538 2474 /********************************************** Main routine **************************************/ 2539 2475 2540 void cleanUp(config *configuration){ 2541 UIFactory::purgeInstance(); 2476 void cleanUp(){ 2542 2477 World::purgeInstance(); 2543 delete(configuration);2544 2478 Log() << Verbose(0) << "Maximum of allocated memory: " 2545 2479 << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl; … … 2549 2483 logger::purgeInstance(); 2550 2484 errorLogger::purgeInstance(); 2485 UIFactory::purgeInstance(); 2486 MapOfActions::purgeInstance(); 2487 CommandLineParser::purgeInstance(); 2551 2488 ActionRegistry::purgeInstance(); 2552 2489 ActionHistory::purgeInstance(); … … 2555 2492 int main(int argc, char **argv) 2556 2493 { 2557 molecule *mol = NULL; 2558 config *configuration = new config; 2494 config *configuration = World::getInstance().getConfig(); 2559 2495 Vector x, y, z, n; 2560 2496 ifstream test; 2561 2497 ofstream output; 2562 2498 string line; 2563 char *ConfigFileName = NULL; 2564 int j; 2499 char **Arguments = NULL; 2500 int ArgcSize = 0; 2501 bool ArgumentsCopied = false; 2565 2502 2566 2503 cout << ESPACKVersion << endl; … … 2569 2506 // need to init the history before any action is created 2570 2507 ActionHistory::init(); 2571 /* structure of ParseCommandLineOptions will be refactored later */ 2572 j = ParseCommandLineOptions(argc, argv, World::getInstance().getMolecules(), World::getInstance().getPeriode(), *configuration, ConfigFileName); 2573 switch (j){ 2574 case 255: 2575 case 2: 2576 case 1: 2577 cleanUp(configuration); 2578 return (j == 1 ? 0 : j); 2579 default: 2580 break; 2508 2509 // Parse command line options and if present create respective UI 2510 { 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); 2533 UIFactory::makeUserInterface(UIFactory::CommandLine); 2534 } else { 2535 DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl); 2536 UIFactory::makeUserInterface(UIFactory::Text); 2537 } 2581 2538 } 2582 if(World::getInstance().numMolecules() == 0){2583 mol = World::getInstance().createMolecule();2584 World::getInstance().getMolecules()->insert(mol);2585 cout << "Molecule created" << endl;2586 if(World::getInstance().getDomain()[0] == 0.){2587 Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;2588 for(int i = 0;i < 6;i++){2589 Log() << Verbose(1) << "Cell size" << i << ": ";2590 cin >> World::getInstance().getDomain()[i];2591 }2592 }2593 mol->ActiveFlag = true;2594 }2595 2539 2596 2540 { 2597 cout << ESPACKVersion << endl; 2598 2599 setVerbosity(0); 2600 2601 menuPopulaters populaters; 2602 populaters.MakeEditMoleculesMenu = populateEditMoleculesMenu; 2603 2604 UIFactory::makeUserInterface(UIFactory::Text); 2605 MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(populaters,World::getInstance().getMolecules(), configuration, World::getInstance().getPeriode(), ConfigFileName); 2541 MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(); 2606 2542 mainWindow->display(); 2607 2543 delete mainWindow; … … 2614 2550 Log() << Verbose(0) << "Saving of elements.db failed." << endl; 2615 2551 2616 cleanUp(configuration); 2617 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 2559 cleanUp(); 2618 2560 Memory::getState(); 2619 2561 return (0); -
src/molecule.hpp
r12872d rf941b1 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 *****************************/ -
src/unittests/Makefile.am
r12872d rf941b1 1 # PLEASE adhere to the alphabetical ordering in this Makefile! 2 # Also indentation by a single tab 3 1 4 INCLUDES = -I$(top_srcdir)/src 2 5 … … 32 35 PlaneUnittest \ 33 36 ObserverTest \ 37 ParserUnitTest \ 34 38 SingletonTest \ 35 39 StackClassUnitTest \ … … 73 77 PlaneUnittest.cpp \ 74 78 ObserverTest.cpp \ 79 ParserUnitTest.cpp \ 75 80 SingletonTest.cpp \ 76 81 stackclassunittest.cpp \ … … 114 119 115 120 121 ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp 122 ActionSequenceTest_LDADD = ${ALLLIBS} 123 116 124 ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp 117 125 ActOnAllUnitTest_LDADD = ${ALLLIBS} … … 132 140 atomsCalculationTest_LDADD = ${ALLLIBS} 133 141 142 AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp 143 AtomDescriptorTest_LDADD = ${ALLLIBS} 144 134 145 BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp 135 146 BondGraphUnitTest_LDADD = ${ALLLIBS} 136 147 148 CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp 149 CacheableTest_LDADD = ${ALLLIBS} 150 137 151 CountBondsUnitTest_SOURCES = UnitTestMain.cpp CountBondsUnitTest.cpp CountBondsUnitTest.hpp 138 152 CountBondsUnitTest_LDADD = ${ALLLIBS} … … 162 176 LogUnitTest_LDADD = ${ALLLIBS} 163 177 178 manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp 179 manipulateAtomsTest_LDADD = ${ALLLIBS} 180 164 181 MemoryAllocatorUnitTest_SOURCES = UnitTestMain.cpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp 165 182 MemoryAllocatorUnitTest_LDADD = ${ALLLIBS} … … 171 188 MoleculeDescriptorTest_LDADD = ${ALLLIBS} 172 189 190 ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp 191 ObserverTest_LDADD = ${ALLLIBS} 192 193 ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp 194 ParserUnitTest_LDADD = ${ALLLIBS} 195 173 196 PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp 174 197 PlaneUnittest_LDADD = ${ALLLIBS} … … 189 212 Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS} 190 213 214 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS) 215 TestRunner_LDADD = ${ALLLIBS} 216 191 217 VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp 192 218 VectorUnitTest_LDADD = ${ALLLIBS} 193 219 194 ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp195 ActionSequenceTest_LDADD = ${ALLLIBS}196 197 ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp198 ObserverTest_LDADD = ${ALLLIBS}199 200 CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp201 CacheableTest_LDADD = ${ALLLIBS}202 203 AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp204 AtomDescriptorTest_LDADD = ${ALLLIBS}205 206 manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp207 manipulateAtomsTest_LDADD = ${ALLLIBS}208 209 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)210 TestRunner_LDADD = ${ALLLIBS}211 212 220 #AUTOMAKE_OPTIONS = parallel-tests 213 -
src/unittests/SingletonTest.cpp
r12872d rf941b1 52 52 count1++; 53 53 } 54 // explicit copy constructor to catch if th siis ever called54 // explicit copy constructor to catch if this is ever called 55 55 SingletonStub2(const SingletonStub2&){ 56 56 CPPUNIT_FAIL ( "Copy constructor of Singleton called" ); -
src/unittests/TestRunnerMain.cpp
r12872d rf941b1 6 6 */ 7 7 8 // include config.h 9 #ifdef HAVE_CONFIG_H 10 #include <config.h> 11 #endif 12 13 #ifdef HAVE_ECUT 8 14 // give the main function its correct name 9 15 #define CPPUNIT_MAIN main 10 11 16 // include the TestRunnerClient file containing the main class 12 17 #include "../../../TestRunnerClient.h" 13 18 #include "../../../TestRunnerClient.cpp" 19 #else 20 #include "UnitTestMain.cpp" 21 #endif 22
Note:
See TracChangeset
for help on using the changeset viewer.