Changeset f79d65 for src/UIElements/CommandLineUI/Query
- Timestamp:
- Jun 19, 2017, 8:24:16 AM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChangeBugEmailaddress, ChemicalSpaceEvaluator, EmpiricalPotential_contain_HomologyGraph_documentation, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_oldresults, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps
- Children:
- 1ba51c
- Parents:
- 2eded3e
- git-author:
- Frederik Heber <heber@…> (03/30/17 21:59:00)
- git-committer:
- Frederik Heber <frederik.heber@…> (06/19/17 08:24:16)
- Location:
- src/UIElements/CommandLineUI/Query
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
r2eded3e rf79d65 53 53 54 54 bool CommandLineDialog::VectorCommandLineQuery::handle() { 55 VectorValue _temp;55 VectorValue temporary; 56 56 if (CommandLineParser::getInstance().vm.count(getTitle())) { 57 try { 58 _temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 59 } catch(boost::bad_any_cast &e) { 60 for (size_t i=0;i<NDIM;++i) 61 _temp.vector[i] = 0.; 62 return false; 63 } 64 temp = _temp.toVector(); 57 temporary = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 58 temp = temporary.vectorstring; 65 59 return true; 66 60 } -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
r2eded3e rf79d65 46 46 47 47 CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(Parameter<std::vector<Vector> > &_param, const std::string &_title, const std::string &_description) : 48 Dialog::TQuery< std::vector<Vector> >(_param, _title, _description)48 Dialog::TQuery< std::vector<Vector> >(_param, _title, _description) 49 49 {} 50 50 … … 53 53 54 54 bool CommandLineDialog::VectorsCommandLineQuery::handle() { 55 std::vector<VectorValue> temporary; 55 std::vector<std::string> temporary; 56 std::stringstream output; 56 57 if (CommandLineParser::getInstance().vm.count(getTitle())) { 57 try { 58 temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >(); 59 } catch(boost::bad_any_cast &e) { 60 temporary.clear(); 61 return false; 62 } 63 for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) { 64 Vector temp_element = (*iter).toVector(); 65 temp.push_back(temp_element); 66 } 58 temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >(); 67 59 return true; 68 60 }
Note:
See TracChangeset
for help on using the changeset viewer.