Changeset f10b0c for src/UIElements/CommandLineUI
- Timestamp:
- Jun 11, 2012, 9:53:19 AM (13 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 95f965
- Parents:
- b9c69d
- git-author:
- Michael Ankele <ankele@…> (04/24/12 13:55:16)
- git-committer:
- Frederik Heber <heber@…> (06/11/12 09:53:19)
- Location:
- src/UIElements/CommandLineUI
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/CommandLineDialog.cpp
rb9c69d rf10b0c 40 40 } 41 41 42 void CommandLineDialog::queryInt( const char* title, std::string _description){43 registerQuery(new IntCommandLineQuery( title, _description));42 void CommandLineDialog::queryInt(Parameter<int> ¶m, const char* title, std::string _description){ 43 registerQuery(new IntCommandLineQuery(param, title, _description)); 44 44 } 45 45 46 void CommandLineDialog::queryInts( const char* title, std::string _description){47 registerQuery(new IntsCommandLineQuery( title, _description));46 void CommandLineDialog::queryInts(Parameter<std::vector<int> > ¶m, const char* title, std::string _description){ 47 registerQuery(new IntsCommandLineQuery(param, title, _description)); 48 48 } 49 49 50 void CommandLineDialog::queryUnsignedInt( const char* title, std::string _description){51 registerQuery(new UnsignedIntCommandLineQuery( title, _description));50 void CommandLineDialog::queryUnsignedInt(Parameter<unsigned int> ¶m, const char* title, std::string _description){ 51 registerQuery(new UnsignedIntCommandLineQuery(param, title, _description)); 52 52 } 53 53 54 void CommandLineDialog::queryUnsignedInts( const char* title, std::string _description){55 registerQuery(new UnsignedIntsCommandLineQuery( title, _description));54 void CommandLineDialog::queryUnsignedInts(Parameter<std::vector<unsigned int> > ¶m, const char* title, std::string _description){ 55 registerQuery(new UnsignedIntsCommandLineQuery(param, title, _description)); 56 56 } 57 57 58 void CommandLineDialog::queryBoolean( const char* title, std::string _description){59 registerQuery(new BooleanCommandLineQuery( title, _description));58 void CommandLineDialog::queryBoolean(Parameter<bool> ¶m, const char* title, std::string _description){ 59 registerQuery(new BooleanCommandLineQuery(param, title, _description)); 60 60 } 61 61 62 void CommandLineDialog::queryDouble( const char* title, std::string _description){63 registerQuery(new DoubleCommandLineQuery( title, _description));62 void CommandLineDialog::queryDouble(Parameter<double> ¶m, const char* title, std::string _description){ 63 registerQuery(new DoubleCommandLineQuery(param, title, _description)); 64 64 } 65 65 66 void CommandLineDialog::queryDoubles( const char* title, std::string _description){67 registerQuery(new DoublesCommandLineQuery( title, _description));66 void CommandLineDialog::queryDoubles(Parameter<std::vector<double> > ¶m, const char* title, std::string _description){ 67 registerQuery(new DoublesCommandLineQuery(param, title, _description)); 68 68 } 69 69 70 void CommandLineDialog::queryString( const char* title, std::string _description){71 registerQuery(new StringCommandLineQuery( title, _description));70 void CommandLineDialog::queryString(Parameter<std::string> ¶m, const char* title, std::string _description){ 71 registerQuery(new StringCommandLineQuery(param, title, _description)); 72 72 } 73 73 74 void CommandLineDialog::queryStrings( const char* title, std::string _description){75 registerQuery(new StringsCommandLineQuery( title, _description));74 void CommandLineDialog::queryStrings(Parameter<std::vector<std::string> > ¶m, const char* title, std::string _description){ 75 registerQuery(new StringsCommandLineQuery(param, title, _description)); 76 76 } 77 77 78 void CommandLineDialog::queryAtom( const char* title, std::string _description) {79 registerQuery(new AtomCommandLineQuery( title, _description));78 void CommandLineDialog::queryAtom(Parameter<const atom *> ¶m, const char* title, std::string _description) { 79 registerQuery(new AtomCommandLineQuery(param, title, _description)); 80 80 } 81 81 82 void CommandLineDialog::queryAtoms( const char* title, std::string _description) {83 registerQuery(new AtomsCommandLineQuery( title, _description));82 void CommandLineDialog::queryAtoms(Parameter<std::vector<const atom *> > ¶m, const char* title, std::string _description) { 83 registerQuery(new AtomsCommandLineQuery(param, title, _description)); 84 84 } 85 85 86 void CommandLineDialog::queryMolecule( const char* title, std::string _description) {87 registerQuery(new MoleculeCommandLineQuery( title, _description));86 void CommandLineDialog::queryMolecule(Parameter<const molecule *> ¶m, const char* title, std::string _description) { 87 registerQuery(new MoleculeCommandLineQuery(param, title, _description)); 88 88 } 89 89 90 void CommandLineDialog::queryMolecules( const char* title, std::string _description) {91 registerQuery(new MoleculesCommandLineQuery( title, _description));90 void CommandLineDialog::queryMolecules(Parameter<std::vector<const molecule *> > ¶m, const char* title, std::string _description) { 91 registerQuery(new MoleculesCommandLineQuery(param, title, _description)); 92 92 } 93 93 94 void CommandLineDialog::queryVector( const char* title, bool check, std::string _description) {95 registerQuery(new VectorCommandLineQuery( title,check, _description));94 void CommandLineDialog::queryVector(Parameter<Vector> ¶m, const char* title, bool check, std::string _description) { 95 registerQuery(new VectorCommandLineQuery(param, title,check, _description)); 96 96 } 97 97 98 void CommandLineDialog::queryVectors( const char* title, bool check, std::string _description) {99 registerQuery(new VectorsCommandLineQuery( title,check, _description));98 void CommandLineDialog::queryVectors(Parameter<std::vector<Vector> > ¶m, const char* title, bool check, std::string _description) { 99 registerQuery(new VectorsCommandLineQuery(param, title,check, _description)); 100 100 } 101 101 102 void CommandLineDialog::queryBox( const char* title, std::string _description) {103 registerQuery(new BoxCommandLineQuery( title,_description));102 void CommandLineDialog::queryBox(Parameter<Box> ¶m, const char* title, std::string _description) { 103 registerQuery(new BoxCommandLineQuery(param, title,_description)); 104 104 } 105 105 106 void CommandLineDialog::queryElement( const char* title, std::string _description){107 registerQuery(new ElementCommandLineQuery( title, _description));106 void CommandLineDialog::queryElement(Parameter<const element *> ¶m, const char* title, std::string _description){ 107 registerQuery(new ElementCommandLineQuery(param, title, _description)); 108 108 } 109 109 110 void CommandLineDialog::queryElements( const char* title, std::string _description){111 registerQuery(new ElementsCommandLineQuery( title, _description));110 void CommandLineDialog::queryElements(Parameter<std::vector<const element *> > ¶m, const char* title, std::string _description){ 111 registerQuery(new ElementsCommandLineQuery(param, title, _description)); 112 112 } 113 113 114 void CommandLineDialog::queryFile( const char* title, std::string _description){115 registerQuery(new FileCommandLineQuery( title, _description));114 void CommandLineDialog::queryFile(Parameter<boost::filesystem::path> ¶m, const char* title, std::string _description){ 115 registerQuery(new FileCommandLineQuery(param, title, _description)); 116 116 } 117 117 118 void CommandLineDialog::queryRandomNumberDistribution_Parameters( const char* title, std::string _description){119 registerQuery(new RandomNumberDistribution_ParametersCommandLineQuery( title, _description));118 void CommandLineDialog::queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> ¶m, const char* title, std::string _description){ 119 registerQuery(new RandomNumberDistribution_ParametersCommandLineQuery(param, title, _description)); 120 120 } 121 121 -
src/UIElements/CommandLineUI/CommandLineDialog.hpp
rb9c69d rf10b0c 34 34 35 35 virtual void queryEmpty(const char *, std::string = ""); 36 virtual void queryInt( const char *, std::string = "");37 virtual void queryInts( const char *, std::string = "");38 virtual void queryUnsignedInt( const char *, std::string = "");39 virtual void queryUnsignedInts( const char *, std::string = "");40 virtual void queryBoolean( const char *, std::string = "");41 virtual void queryString( const char*, std::string = "");42 virtual void queryStrings( const char*, std::string = "");43 virtual void queryDouble( const char*, std::string = "");44 virtual void queryDoubles( const char*, std::string = "");45 virtual void queryAtom( const char*, std::string = "");46 virtual void queryAtoms( const char*, std::string = "");47 virtual void queryMolecule( const char*, std::string = "");48 virtual void queryMolecules( const char*, std::string = "");49 virtual void queryVector( const char*, bool, std::string = "");50 virtual void queryVectors( const char*, bool, std::string = "");51 virtual void queryBox( const char*, std::string = "");52 virtual void queryElement( const char*, std::string = "");53 virtual void queryElements( const char*, std::string = "");54 virtual void queryFile( const char*, std::string = "");55 virtual void queryRandomNumberDistribution_Parameters( const char*, std::string = "");36 virtual void queryInt(Parameter<int> &, const char *, std::string = ""); 37 virtual void queryInts(Parameter<std::vector<int> > &, const char *, std::string = ""); 38 virtual void queryUnsignedInt(Parameter<unsigned int> &, const char *, std::string = ""); 39 virtual void queryUnsignedInts(Parameter<std::vector<unsigned int> > &, const char *, std::string = ""); 40 virtual void queryBoolean(Parameter<bool> &, const char *, std::string = ""); 41 virtual void queryString(Parameter<std::string> &, const char*, std::string = ""); 42 virtual void queryStrings(Parameter<std::vector<std::string> > &, const char*, std::string = ""); 43 virtual void queryDouble(Parameter<double> &, const char*, std::string = ""); 44 virtual void queryDoubles(Parameter<std::vector<double> > &, const char*, std::string = ""); 45 virtual void queryAtom(Parameter<const atom *> &, const char*, std::string = ""); 46 virtual void queryAtoms(Parameter<std::vector<const atom *> > &, const char*, std::string = ""); 47 virtual void queryMolecule(Parameter<const molecule *> &, const char*, std::string = ""); 48 virtual void queryMolecules(Parameter<std::vector<const molecule *> > &, const char*, std::string = ""); 49 virtual void queryVector(Parameter<Vector> &, const char*, bool, std::string = ""); 50 virtual void queryVectors(Parameter<std::vector<Vector> > &, const char*, bool, std::string = ""); 51 virtual void queryBox(Parameter<Box> &, const char*, std::string = ""); 52 virtual void queryElement(Parameter<const element *> &, const char*, std::string = ""); 53 virtual void queryElements(Parameter<std::vector<const element *> > &, const char*, std::string = ""); 54 virtual void queryFile(Parameter<boost::filesystem::path> &, const char*, std::string = ""); 55 virtual void queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &, const char*, std::string = ""); 56 56 protected: 57 57 // specialized stuff for command line queries -
src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
rb9c69d rf10b0c 33 33 using namespace std; 34 34 35 CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery( std::string title, std::string _description) :36 Dialog::AtomQuery( title, _description)35 CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(Parameter<const atom *> ¶m, std::string title, std::string _description) : 36 Dialog::AtomQuery(param, title, _description) 37 37 {} 38 38 … … 43 43 if (CommandLineParser::getInstance().vm.count(getTitle())) { 44 44 IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>(); 45 tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));45 tmp.set(World::getInstance().getAtom(AtomById(IdxOfAtom))); 46 46 return true; 47 47 } else { -
src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
rb9c69d rf10b0c 28 28 #include "World.hpp" 29 29 30 CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery( std::string title, std::string _description) :31 Dialog::AtomsQuery( title, _description)30 CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(Parameter<std::vector<const atom *> > ¶m, std::string title, std::string _description) : 31 Dialog::AtomsQuery(param, title, _description) 32 32 {} 33 33 … … 38 38 if (CommandLineParser::getInstance().vm.count(getTitle())) { 39 39 IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >(); 40 std::vector<const atom *> temp_atoms; 40 41 for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) { 41 42 temp = World::getInstance().getAtom(AtomById(*iter)); 42 43 if (temp) 43 t mp.push_back(temp);44 temp_atoms.push_back(temp); 44 45 } 46 tmp.set(temp_atoms); 45 47 return true; 46 48 } else { -
src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery( std::string title, std::string _description) :28 Dialog::BooleanQuery( title, _description)27 CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(Parameter<bool> ¶m, std::string title, std::string _description) : 28 Dialog::BooleanQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::BooleanCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as<bool>();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<bool>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
rb9c69d rf10b0c 27 27 #include "LinearAlgebra/RealSpaceMatrix.hpp" 28 28 29 CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery( std::string title, std::string _description) :30 Dialog::BoxQuery( title, _description)29 CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(Parameter<Box> ¶m, std::string title, std::string _description) : 30 Dialog::BoxQuery(param, title, _description) 31 31 {} 32 32 … … 38 38 if (CommandLineParser::getInstance().vm.count(getTitle())) { 39 39 temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >(); 40 tmp = temp.toBox();40 tmp.set(temp.toBox()); 41 41 return true; 42 42 } else { -
src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp
rb9c69d rf10b0c 26 26 class CommandLineDialog::IntCommandLineQuery : public Dialog::IntQuery { 27 27 public: 28 IntCommandLineQuery( std::string title, std::string _description = "");28 IntCommandLineQuery(Parameter<int> ¶m, std::string title, std::string _description = ""); 29 29 virtual ~IntCommandLineQuery(); 30 30 virtual bool handle(); … … 33 33 class CommandLineDialog::IntsCommandLineQuery : public Dialog::IntsQuery { 34 34 public: 35 IntsCommandLineQuery( std::string title, std::string _description = "");35 IntsCommandLineQuery(Parameter<std::vector<int> > ¶m, std::string title, std::string _description = ""); 36 36 virtual ~IntsCommandLineQuery(); 37 37 virtual bool handle(); … … 40 40 class CommandLineDialog::UnsignedIntCommandLineQuery : public Dialog::UnsignedIntQuery { 41 41 public: 42 UnsignedIntCommandLineQuery( std::string title, std::string _description = "");42 UnsignedIntCommandLineQuery(Parameter<unsigned int> ¶m, std::string title, std::string _description = ""); 43 43 virtual ~UnsignedIntCommandLineQuery(); 44 44 virtual bool handle(); … … 47 47 class CommandLineDialog::UnsignedIntsCommandLineQuery : public Dialog::UnsignedIntsQuery { 48 48 public: 49 UnsignedIntsCommandLineQuery( std::string title, std::string _description = "");49 UnsignedIntsCommandLineQuery(Parameter<std::vector<unsigned int> > ¶m, std::string title, std::string _description = ""); 50 50 virtual ~UnsignedIntsCommandLineQuery(); 51 51 virtual bool handle(); … … 54 54 class CommandLineDialog::BooleanCommandLineQuery : public Dialog::BooleanQuery { 55 55 public: 56 BooleanCommandLineQuery( std::string title, std::string _description = "");56 BooleanCommandLineQuery(Parameter<bool> ¶m, std::string title, std::string _description = ""); 57 57 virtual ~BooleanCommandLineQuery(); 58 58 virtual bool handle(); … … 61 61 class CommandLineDialog::DoubleCommandLineQuery : public Dialog::DoubleQuery { 62 62 public: 63 DoubleCommandLineQuery( std::string title, std::string _description = "");63 DoubleCommandLineQuery(Parameter<double> ¶m, std::string title, std::string _description = ""); 64 64 virtual ~DoubleCommandLineQuery(); 65 65 virtual bool handle(); … … 68 68 class CommandLineDialog::DoublesCommandLineQuery : public Dialog::DoublesQuery { 69 69 public: 70 DoublesCommandLineQuery( std::string title, std::string _description = "");70 DoublesCommandLineQuery(Parameter<std::vector<double> > ¶m, std::string title, std::string _description = ""); 71 71 virtual ~DoublesCommandLineQuery(); 72 72 virtual bool handle(); … … 75 75 class CommandLineDialog::StringCommandLineQuery : public Dialog::StringQuery { 76 76 public: 77 StringCommandLineQuery( std::string title, std::string _description = "");77 StringCommandLineQuery(Parameter<std::string> ¶m, std::string title, std::string _description = ""); 78 78 virtual ~StringCommandLineQuery(); 79 79 virtual bool handle(); … … 82 82 class CommandLineDialog::StringsCommandLineQuery : public Dialog::StringsQuery { 83 83 public: 84 StringsCommandLineQuery( std::string title, std::string _description = "");84 StringsCommandLineQuery(Parameter<std::vector<std::string> > ¶m, std::string title, std::string _description = ""); 85 85 virtual ~StringsCommandLineQuery(); 86 86 virtual bool handle(); … … 89 89 class CommandLineDialog::AtomCommandLineQuery : public Dialog::AtomQuery { 90 90 public: 91 AtomCommandLineQuery( std::string title, std::string _description = "");91 AtomCommandLineQuery(Parameter<const atom *> ¶m, std::string title, std::string _description = ""); 92 92 virtual ~AtomCommandLineQuery(); 93 93 virtual bool handle(); … … 96 96 class CommandLineDialog::AtomsCommandLineQuery : public Dialog::AtomsQuery { 97 97 public: 98 AtomsCommandLineQuery( std::string title, std::string _description = "");98 AtomsCommandLineQuery(Parameter<std::vector<const atom *> > ¶m, std::string title, std::string _description = ""); 99 99 virtual ~AtomsCommandLineQuery(); 100 100 virtual bool handle(); … … 103 103 class CommandLineDialog::MoleculeCommandLineQuery : public Dialog::MoleculeQuery { 104 104 public: 105 MoleculeCommandLineQuery( std::string title, std::string _description = "");105 MoleculeCommandLineQuery(Parameter<const molecule *> ¶m, std::string title, std::string _description = ""); 106 106 virtual ~MoleculeCommandLineQuery(); 107 107 virtual bool handle(); … … 110 110 class CommandLineDialog::MoleculesCommandLineQuery : public Dialog::MoleculesQuery { 111 111 public: 112 MoleculesCommandLineQuery( std::string title, std::string _description = "");112 MoleculesCommandLineQuery(Parameter<std::vector<const molecule *> > ¶m, std::string title, std::string _description = ""); 113 113 virtual ~MoleculesCommandLineQuery(); 114 114 virtual bool handle(); … … 117 117 class CommandLineDialog::VectorCommandLineQuery : public Dialog::VectorQuery { 118 118 public: 119 VectorCommandLineQuery( std::string title,bool _check, std::string _description = "");119 VectorCommandLineQuery(Parameter<Vector> ¶m, std::string title,bool _check, std::string _description = ""); 120 120 virtual ~VectorCommandLineQuery(); 121 121 virtual bool handle(); … … 124 124 class CommandLineDialog::VectorsCommandLineQuery : public Dialog::VectorsQuery { 125 125 public: 126 VectorsCommandLineQuery( std::string title,bool _check, std::string _description = "");126 VectorsCommandLineQuery(Parameter<std::vector<Vector> > ¶m, std::string title,bool _check, std::string _description = ""); 127 127 virtual ~VectorsCommandLineQuery(); 128 128 virtual bool handle(); … … 131 131 class CommandLineDialog::BoxCommandLineQuery : public Dialog::BoxQuery { 132 132 public: 133 BoxCommandLineQuery( std::string title, std::string _description = "");133 BoxCommandLineQuery(Parameter<Box> ¶m, std::string title, std::string _description = ""); 134 134 virtual ~BoxCommandLineQuery(); 135 135 virtual bool handle(); … … 138 138 class CommandLineDialog::ElementCommandLineQuery : public Dialog::ElementQuery { 139 139 public: 140 ElementCommandLineQuery( std::string title, std::string _description = "");140 ElementCommandLineQuery(Parameter<const element *> ¶m, std::string title, std::string _description = ""); 141 141 virtual ~ElementCommandLineQuery(); 142 142 virtual bool handle(); … … 145 145 class CommandLineDialog::ElementsCommandLineQuery : public Dialog::ElementsQuery { 146 146 public: 147 ElementsCommandLineQuery( std::string title, std::string _description = "");147 ElementsCommandLineQuery(Parameter<std::vector<const element *> > ¶m, std::string title, std::string _description = ""); 148 148 virtual ~ElementsCommandLineQuery(); 149 149 virtual bool handle(); … … 152 152 class CommandLineDialog::FileCommandLineQuery : public Dialog::FileQuery { 153 153 public: 154 FileCommandLineQuery( std::string title, std::string _description = "");154 FileCommandLineQuery(Parameter<boost::filesystem::path> ¶m, std::string title, std::string _description = ""); 155 155 virtual ~FileCommandLineQuery(); 156 156 virtual bool handle(); … … 159 159 class CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery : public Dialog::RandomNumberDistribution_ParametersQuery { 160 160 public: 161 RandomNumberDistribution_ParametersCommandLineQuery( std::string title, std::string _description = "");161 RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> ¶m, std::string title, std::string _description = ""); 162 162 virtual ~RandomNumberDistribution_ParametersCommandLineQuery(); 163 163 virtual bool handle(); -
src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
rb9c69d rf10b0c 26 26 27 27 28 CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery( std::string title, std::string _description) :29 Dialog::DoubleQuery( title, _description)28 CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(Parameter<double> ¶m, std::string title, std::string _description) : 29 Dialog::DoubleQuery(param, title, _description) 30 30 {} 31 31 … … 34 34 bool CommandLineDialog::DoubleCommandLineQuery::handle() { 35 35 if (CommandLineParser::getInstance().vm.count(getTitle())) { 36 tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();36 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<double>()); 37 37 return true; 38 38 } else { -
src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery( std::string title, std::string _description) :28 Dialog::DoublesQuery( title, _description)27 CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(Parameter<std::vector<double> > ¶m, std::string title, std::string _description) : 28 Dialog::DoublesQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::DoublesCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
rb9c69d rf10b0c 28 28 #include "World.hpp" 29 29 30 CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery( std::string title, std::string _description) :31 Dialog::ElementQuery( title, _description)30 CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(Parameter<const element*> ¶m, std::string title, std::string _description) : 31 Dialog::ElementQuery(param, title, _description) 32 32 {} 33 33 … … 40 40 if (CommandLineParser::getInstance().vm.count(getTitle())) { 41 41 int Z = CommandLineParser::getInstance().vm[getTitle()].as< int >(); 42 tmp = periode->FindElement(Z);43 ASSERT(tmp != NULL, "Invalid element specified in ElementCommandLineQuery");42 tmp.set(periode->FindElement(Z)); 43 ASSERT(tmp.get() != NULL, "Invalid element specified in ElementCommandLineQuery"); 44 44 return true; 45 45 } else { -
src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
rb9c69d rf10b0c 28 28 #include "World.hpp" 29 29 30 CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery( std::string title, std::string _description) :31 Dialog::ElementsQuery( title, _description)30 CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(Parameter<std::vector<const element*> > ¶m, std::string title, std::string _description) : 31 Dialog::ElementsQuery(param, title, _description) 32 32 {} 33 33 … … 40 40 if (CommandLineParser::getInstance().vm.count(getTitle())) { 41 41 vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >(); 42 vector<const element *> temp_elements; 42 43 for (vector<int>::iterator ZRunner = AllElements.begin(); ZRunner != AllElements.end(); ++ZRunner) { 43 44 temp = periode->FindElement(*ZRunner); 44 45 ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery"); 45 t mp.push_back(temp);46 temp_elements.push_back(temp); 46 47 } 48 tmp.set(temp_elements); 47 49 return true; 48 50 } else { -
src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery( std::string title, std::string _description) :28 Dialog::FileQuery( title, _description)27 CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(Parameter<boost::filesystem::path> ¶m, std::string title, std::string _description) : 28 Dialog::FileQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::FileCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery( std::string title, std::string _description) :28 Dialog::IntQuery( title, _description)27 CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(Parameter<int> ¶m, std::string title, std::string _description) : 28 Dialog::IntQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::IntCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<int>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery( std::string title, std::string _description) :28 Dialog::IntsQuery( title, _description)27 CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(Parameter<std::vector<int> > ¶m, std::string title, std::string _description) : 28 Dialog::IntsQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::IntsCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
rb9c69d rf10b0c 28 28 #include "CodePatterns/Verbose.hpp" 29 29 30 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery( std::string title, std::string _description) :31 Dialog::MoleculeQuery( title, _description)30 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(Parameter<const molecule *> ¶m, std::string title, std::string _description) : 31 Dialog::MoleculeQuery(param, title, _description) 32 32 {} 33 33 … … 38 38 if (CommandLineParser::getInstance().vm.count(getTitle())) { 39 39 IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>(); 40 tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));40 tmp.set(World::getInstance().getMolecule(MoleculeById(IdxOfMol))); 41 41 return true; 42 42 } else { -
src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
rb9c69d rf10b0c 29 29 #include "World.hpp" 30 30 31 CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery( std::string title, std::string _description) :32 Dialog::MoleculesQuery( title, _description)31 CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(Parameter<std::vector<const molecule *> > ¶m, std::string title, std::string _description) : 32 Dialog::MoleculesQuery(param, title, _description) 33 33 {} 34 34 … … 39 39 if (CommandLineParser::getInstance().vm.count(getTitle())) { 40 40 IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >(); 41 std::vector<const molecule *> temp_molecules; 41 42 for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) { 42 43 temp = World::getInstance().getMolecule(MoleculeById(*iter)); 43 44 if (temp) 44 t mp.push_back(temp);45 temp_molecules.push_back(temp); 45 46 } 47 tmp.set(temp_molecules); 46 48 return true; 47 49 } else { -
src/UIElements/CommandLineUI/Query/RandomNumberDistribution_ParametersCommandLineQuery.cpp
rb9c69d rf10b0c 31 31 #include "RandomNumbers/RandomNumberDistribution_Parameters.hpp" 32 32 33 CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery::RandomNumberDistribution_ParametersCommandLineQuery( std::string title, std::string _description) :34 Dialog::RandomNumberDistribution_ParametersQuery( title, _description)33 CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery::RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> ¶m, std::string title, std::string _description) : 34 Dialog::RandomNumberDistribution_ParametersQuery(param, title, _description) 35 35 {} 36 36 … … 42 42 std::stringstream text(stringtext); 43 43 // LOG(1, "INFO: Parameter set from CommandLine is '" << text.str() << "'"); 44 text >> tmp; 44 RandomNumberDistribution_Parameters temp_params; 45 text >> temp_params; 46 tmp.set(temp_params); 45 47 return true; 46 48 } else { -
src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery( std::string title, std::string _description) :28 Dialog::StringQuery( title, _description)27 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(Parameter<std::string> ¶m, std::string title, std::string _description) : 28 Dialog::StringQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::StringCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<string>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery( std::string title, std::string _description) :28 Dialog::StringsQuery( title, _description)27 CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(Parameter<std::vector<std::string> > ¶m, std::string title, std::string _description) : 28 Dialog::StringsQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::StringsCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::UnsignedIntCommandLineQuery::UnsignedIntCommandLineQuery( std::string title, std::string _description) :28 Dialog::UnsignedIntQuery( title, _description)27 CommandLineDialog::UnsignedIntCommandLineQuery::UnsignedIntCommandLineQuery(Parameter<unsigned int> ¶m, std::string title, std::string _description) : 28 Dialog::UnsignedIntQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::UnsignedIntCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp
rb9c69d rf10b0c 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::UnsignedIntsCommandLineQuery::UnsignedIntsCommandLineQuery( std::string title, std::string _description) :28 Dialog::UnsignedIntsQuery( title, _description)27 CommandLineDialog::UnsignedIntsCommandLineQuery::UnsignedIntsCommandLineQuery(Parameter<std::vector<unsigned int> > ¶m, std::string title, std::string _description) : 28 Dialog::UnsignedIntsQuery(param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::UnsignedIntsCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >();35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
rb9c69d rf10b0c 29 29 #include "World.hpp" 30 30 31 CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery( std::string title, bool _check, std::string _description) :32 Dialog::VectorQuery( title,_check, _description)31 CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(Parameter<Vector> ¶m, std::string title, bool _check, std::string _description) : 32 Dialog::VectorQuery(param, title,_check, _description) 33 33 {} 34 34 … … 40 40 if (CommandLineParser::getInstance().vm.count(getTitle())) { 41 41 temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 42 tmp= temp.toVector();43 if ((check) && (!World::getInstance().getDomain().isValid(t mp))) {44 ELOG(1, "Vector " << t mp<< " would be outside of box domain.");42 Vector temp_vector = temp.toVector(); 43 if ((check) && (!World::getInstance().getDomain().isValid(temp_vector))) { 44 ELOG(1, "Vector " << temp_vector << " would be outside of box domain."); 45 45 return false; 46 46 } 47 tmp.set(temp_vector); 47 48 return true; 48 49 } else { -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
rb9c69d rf10b0c 29 29 #include "World.hpp" 30 30 31 CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery( std::string title, bool _check, std::string _description) :32 Dialog::VectorsQuery( title,_check, _description)31 CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(Parameter<std::vector<Vector> > ¶m, std::string title, bool _check, std::string _description) : 32 Dialog::VectorsQuery(param, title,_check, _description) 33 33 {} 34 34 … … 40 40 if (CommandLineParser::getInstance().vm.count(getTitle())) { 41 41 temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >(); 42 std::vector<Vector> temp_vectors; 42 43 for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) { 43 44 temp = (*iter).toVector(); 44 45 if ((!check) || (World::getInstance().getDomain().isValid(temp))) 45 t mp.push_back(temp);46 temp_vectors.push_back(temp); 46 47 else 47 48 ELOG(1, "Vector " << temp << " would be outside of box domain."); 48 49 } 50 tmp.set(temp_vectors); 49 51 return true; 50 52 } else {
Note:
See TracChangeset
for help on using the changeset viewer.