Changeset 9d5531 for src/UIElements/CommandLineUI/Query
- Timestamp:
- Jul 18, 2012, 2:02:13 PM (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:
- b3a54d
- Parents:
- 30cd0d
- git-author:
- Michael Ankele <ankele@…> (07/04/12 13:49:18)
- git-committer:
- Michael Ankele <ankele@…> (07/18/12 14:02:13)
- Location:
- src/UIElements/CommandLineUI/Query
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
r30cd0d r9d5531 33 33 using namespace std; 34 34 35 CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(Parameter<const atom *> & param, std::string title, std::string _description) :36 Dialog::AtomQuery( param, title, _description)35 CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(Parameter<const atom *> &_param, 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.set(World::getInstance().getAtom(AtomById(IdxOfAtom)));45 param.set(World::getInstance().getAtom(AtomById(IdxOfAtom))); 46 46 return true; 47 47 } else { -
src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
r30cd0d r9d5531 28 28 #include "World.hpp" 29 29 30 CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(Parameter<std::vector<const atom *> > & param, std::string title, std::string _description) :31 Dialog::AtomsQuery( param, title, _description)30 CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(Parameter<std::vector<const atom *> > &_param, 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;41 40 for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) { 42 temp = World::getInstance().getAtom(AtomById(*iter));43 if (temp )44 temp _atoms.push_back(temp);41 temp_element = World::getInstance().getAtom(AtomById(*iter)); 42 if (temp_element) 43 temp.push_back(temp_element); 45 44 } 46 tmp.set(temp_atoms);45 param.set(temp); 47 46 return true; 48 47 } else { -
src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(Parameter<bool> & param, std::string title, std::string _description) :28 Dialog::BooleanQuery( param, title, _description)27 CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(Parameter<bool> &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as<bool>());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as<bool>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp
r30cd0d r9d5531 26 26 class CommandLineDialog::IntCommandLineQuery : public Dialog::IntQuery { 27 27 public: 28 IntCommandLineQuery(Parameter<int> & param, std::string title, std::string _description = "");28 IntCommandLineQuery(Parameter<int> &_param, 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(Parameter<std::vector<int> > & param, std::string title, std::string _description = "");35 IntsCommandLineQuery(Parameter<std::vector<int> > &_param, 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(Parameter<unsigned int> & param, std::string title, std::string _description = "");42 UnsignedIntCommandLineQuery(Parameter<unsigned int> &_param, 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(Parameter<std::vector<unsigned int> > & param, std::string title, std::string _description = "");49 UnsignedIntsCommandLineQuery(Parameter<std::vector<unsigned int> > &_param, 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(Parameter<bool> & param, std::string title, std::string _description = "");56 BooleanCommandLineQuery(Parameter<bool> &_param, 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(Parameter<double> & param, std::string title, std::string _description = "");63 DoubleCommandLineQuery(Parameter<double> &_param, 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(Parameter<std::vector<double> > & param, std::string title, std::string _description = "");70 DoublesCommandLineQuery(Parameter<std::vector<double> > &_param, 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(Parameter<std::string> & param, std::string title, std::string _description = "");77 StringCommandLineQuery(Parameter<std::string> &_param, 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(Parameter<std::vector<std::string> > & param, std::string title, std::string _description = "");84 StringsCommandLineQuery(Parameter<std::vector<std::string> > &_param, 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(Parameter<const atom *> & param, std::string title, std::string _description = "");91 AtomCommandLineQuery(Parameter<const atom *> &_param, 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(Parameter<std::vector<const atom *> > & param, std::string title, std::string _description = "");98 AtomsCommandLineQuery(Parameter<std::vector<const atom *> > &_param, 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(Parameter<const molecule *> & param, std::string title, std::string _description = "");105 MoleculeCommandLineQuery(Parameter<const molecule *> &_param, 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(Parameter<std::vector<const molecule *> > & param, std::string title, std::string _description = "");112 MoleculesCommandLineQuery(Parameter<std::vector<const molecule *> > &_param, 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(Parameter<Vector> & param, std::string title,bool _check, std::string _description = "");119 VectorCommandLineQuery(Parameter<Vector> &_param, std::string title, 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(Parameter<std::vector<Vector> > & param, std::string title,bool _check, std::string _description = "");126 VectorsCommandLineQuery(Parameter<std::vector<Vector> > &_param, std::string title, std::string _description = ""); 127 127 virtual ~VectorsCommandLineQuery(); 128 128 virtual bool handle(); … … 131 131 class CommandLineDialog::RealSpaceMatrixCommandLineQuery : public Dialog::RealSpaceMatrixQuery { 132 132 public: 133 RealSpaceMatrixCommandLineQuery(Parameter<RealSpaceMatrix> & param, std::string title, std::string _description = "");133 RealSpaceMatrixCommandLineQuery(Parameter<RealSpaceMatrix> &_param, std::string title, std::string _description = ""); 134 134 virtual ~RealSpaceMatrixCommandLineQuery(); 135 135 virtual bool handle(); … … 138 138 class CommandLineDialog::ElementCommandLineQuery : public Dialog::ElementQuery { 139 139 public: 140 ElementCommandLineQuery(Parameter<const element *> & param, std::string title, std::string _description = "");140 ElementCommandLineQuery(Parameter<const element *> &_param, 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(Parameter<std::vector<const element *> > & param, std::string title, std::string _description = "");147 ElementsCommandLineQuery(Parameter<std::vector<const element *> > &_param, 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(Parameter<boost::filesystem::path> & param, std::string title, std::string _description = "");154 FileCommandLineQuery(Parameter<boost::filesystem::path> &_param, std::string title, std::string _description = ""); 155 155 virtual ~FileCommandLineQuery(); 156 156 virtual bool handle(); … … 166 166 class CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery : public Dialog::RandomNumberDistribution_ParametersQuery { 167 167 public: 168 RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> & param, std::string title, std::string _description = "");168 RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> &_param, std::string title, std::string _description = ""); 169 169 virtual ~RandomNumberDistribution_ParametersCommandLineQuery(); 170 170 virtual bool handle(); -
src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
r30cd0d r9d5531 26 26 27 27 28 CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(Parameter<double> & param, std::string title, std::string _description) :29 Dialog::DoubleQuery( param, title, _description)28 CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(Parameter<double> &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as<double>());36 param.set(CommandLineParser::getInstance().vm[getTitle()].as<double>()); 37 37 return true; 38 38 } else { -
src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(Parameter<std::vector<double> > & param, std::string title, std::string _description) :28 Dialog::DoublesQuery( param, title, _description)27 CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(Parameter<std::vector<double> > &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
r30cd0d r9d5531 28 28 #include "World.hpp" 29 29 30 CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(Parameter<const element*> & param, std::string title, std::string _description) :31 Dialog::ElementQuery( param, title, _description)30 CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(Parameter<const element*> &_param, 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.set(periode->FindElement(Z));43 ASSERT( tmp.get() != NULL, "Invalid element specified in ElementCommandLineQuery");42 param.set(periode->FindElement(Z)); 43 ASSERT(param.get() != NULL, "Invalid element specified in ElementCommandLineQuery"); 44 44 return true; 45 45 } else { -
src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
r30cd0d r9d5531 28 28 #include "World.hpp" 29 29 30 CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(Parameter<std::vector<const element*> > & param, std::string title, std::string _description) :31 Dialog::ElementsQuery( param, title, _description)30 CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(Parameter<std::vector<const element*> > &_param, 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;43 42 for (vector<int>::iterator ZRunner = AllElements.begin(); ZRunner != AllElements.end(); ++ZRunner) { 44 temp = periode->FindElement(*ZRunner);45 ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery");46 temp _elements.push_back(temp);43 temp_element = periode->FindElement(*ZRunner); 44 ASSERT(temp_element != NULL, "Invalid element specified in ElementCommandLineQuery"); 45 temp.push_back(temp_element); 47 46 } 48 tmp.set(temp_elements);47 param.set(temp); 49 48 return true; 50 49 } else { -
src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(Parameter<boost::filesystem::path> & param, std::string title, std::string _description) :28 Dialog::FileQuery( param, title, _description)27 CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(Parameter<boost::filesystem::path> &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/FilesCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::FilesCommandLineQuery::FilesCommandLineQuery(Parameter<std::vector< boost::filesystem::path> > & param, std::string title, std::string _description) :28 Dialog::FilesQuery( param, title, _description)27 CommandLineDialog::FilesCommandLineQuery::FilesCommandLineQuery(Parameter<std::vector< boost::filesystem::path> > &_param, std::string title, std::string _description) : 28 Dialog::FilesQuery(_param, title, _description) 29 29 {} 30 30 … … 33 33 bool CommandLineDialog::FilesCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<boost::filesystem::path> >());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<boost::filesystem::path> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(Parameter<int> & param, std::string title, std::string _description) :28 Dialog::IntQuery( param, title, _description)27 CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(Parameter<int> &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as<int>());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as<int>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(Parameter<std::vector<int> > & param, std::string title, std::string _description) :28 Dialog::IntsQuery( param, title, _description)27 CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(Parameter<std::vector<int> > &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
r30cd0d r9d5531 28 28 #include "CodePatterns/Verbose.hpp" 29 29 30 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(Parameter<const molecule *> & param, std::string title, std::string _description) :31 Dialog::MoleculeQuery( param, title, _description)30 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(Parameter<const molecule *> &_param, 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.set(World::getInstance().getMolecule(MoleculeById(IdxOfMol)));40 param.set(World::getInstance().getMolecule(MoleculeById(IdxOfMol))); 41 41 return true; 42 42 } else { -
src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
r30cd0d r9d5531 29 29 #include "World.hpp" 30 30 31 CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(Parameter<std::vector<const molecule *> > & param, std::string title, std::string _description) :32 Dialog::MoleculesQuery( param, title, _description)31 CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(Parameter<std::vector<const molecule *> > &_param, 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;42 41 for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) { 43 temp = World::getInstance().getMolecule(MoleculeById(*iter));44 if (temp )45 temp _molecules.push_back(temp);42 temp_element = World::getInstance().getMolecule(MoleculeById(*iter)); 43 if (temp_element) 44 temp.push_back(temp_element); 46 45 } 47 tmp.set(temp_molecules);46 param.set(temp); 48 47 return true; 49 48 } else { -
src/UIElements/CommandLineUI/Query/RandomNumberDistribution_ParametersCommandLineQuery.cpp
r30cd0d r9d5531 31 31 #include "RandomNumbers/RandomNumberDistribution_Parameters.hpp" 32 32 33 CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery::RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> & param, std::string title, std::string _description) :34 Dialog::RandomNumberDistribution_ParametersQuery( param, title, _description)33 CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery::RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> &_param, 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 RandomNumberDistribution_Parameters temp_params; 45 text >> temp_params; 46 tmp.set(temp_params); 44 text >> temp; 45 param.set(temp); 47 46 return true; 48 47 } else { -
src/UIElements/CommandLineUI/Query/RealSpaceMatrixCommandLineQuery.cpp
r30cd0d r9d5531 27 27 #include "LinearAlgebra/RealSpaceMatrix.hpp" 28 28 29 CommandLineDialog::RealSpaceMatrixCommandLineQuery::RealSpaceMatrixCommandLineQuery(Parameter<RealSpaceMatrix> & param, std::string title, std::string _description) :30 Dialog::RealSpaceMatrixQuery( param, title, _description)29 CommandLineDialog::RealSpaceMatrixCommandLineQuery::RealSpaceMatrixCommandLineQuery(Parameter<RealSpaceMatrix> &_param, std::string title, std::string _description) : 30 Dialog::RealSpaceMatrixQuery(_param, title, _description) 31 31 {} 32 32 … … 35 35 36 36 bool CommandLineDialog::RealSpaceMatrixCommandLineQuery::handle() { 37 RealSpaceMatrixValue temp;37 RealSpaceMatrixValue _temp; 38 38 if (CommandLineParser::getInstance().vm.count(getTitle())) { 39 temp = CommandLineParser::getInstance().vm[getTitle()].as< RealSpaceMatrixValue >();40 tmp.set(temp.toRealSpaceMatrix());39 _temp = CommandLineParser::getInstance().vm[getTitle()].as< RealSpaceMatrixValue >(); 40 param.set(_temp.toRealSpaceMatrix()); 41 41 return true; 42 42 } else { -
src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(Parameter<std::string> & param, std::string title, std::string _description) :28 Dialog::StringQuery( param, title, _description)27 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(Parameter<std::string> &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as<string>());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as<string>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(Parameter<std::vector<std::string> > & param, std::string title, std::string _description) :28 Dialog::StringsQuery( param, title, _description)27 CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(Parameter<std::vector<std::string> > &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::UnsignedIntCommandLineQuery::UnsignedIntCommandLineQuery(Parameter<unsigned int> & param, std::string title, std::string _description) :28 Dialog::UnsignedIntQuery( param, title, _description)27 CommandLineDialog::UnsignedIntCommandLineQuery::UnsignedIntCommandLineQuery(Parameter<unsigned int> &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp
r30cd0d r9d5531 25 25 #include "CodePatterns/Verbose.hpp" 26 26 27 CommandLineDialog::UnsignedIntsCommandLineQuery::UnsignedIntsCommandLineQuery(Parameter<std::vector<unsigned int> > & param, std::string title, std::string _description) :28 Dialog::UnsignedIntsQuery( param, title, _description)27 CommandLineDialog::UnsignedIntsCommandLineQuery::UnsignedIntsCommandLineQuery(Parameter<std::vector<unsigned int> > &_param, 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.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >());35 param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >()); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
r30cd0d r9d5531 29 29 #include "World.hpp" 30 30 31 CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(Parameter<Vector> & param, std::string title, bool _check, std::string _description) :32 Dialog::VectorQuery( param, title,_check, _description)31 CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(Parameter<Vector> &_param, std::string title, std::string _description) : 32 Dialog::VectorQuery(_param, title, _description) 33 33 {} 34 34 … … 37 37 38 38 bool CommandLineDialog::VectorCommandLineQuery::handle() { 39 VectorValue temp;39 VectorValue _temp; 40 40 if (CommandLineParser::getInstance().vm.count(getTitle())) { 41 temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 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 return false; 46 } 47 tmp.set(temp_vector); 41 _temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 42 temp = _temp.toVector(); 43 param.set(temp); 48 44 return true; 49 45 } else { -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
r30cd0d r9d5531 29 29 #include "World.hpp" 30 30 31 CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(Parameter<std::vector<Vector> > & param, std::string title, bool _check, std::string _description) :32 Dialog::VectorsQuery( param, title,_check, _description)31 CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(Parameter<std::vector<Vector> > &_param, std::string title, std::string _description) : 32 Dialog::VectorsQuery(_param, title, _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;43 42 for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) { 44 temp = (*iter).toVector(); 45 if ((!check) || (World::getInstance().getDomain().isValid(temp))) 46 temp_vectors.push_back(temp); 47 else 48 ELOG(1, "Vector " << temp << " would be outside of box domain."); 43 temp_element = (*iter).toVector(); 44 temp.push_back(temp_element); 49 45 } 50 tmp.set(temp_vectors);46 param.set(temp); 51 47 return true; 52 48 } else {
Note:
See TracChangeset
for help on using the changeset viewer.