Changeset f10b0c for src/UIElements/TextUI/Query
- 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/TextUI/Query
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/TextUI/Query/AtomTextQuery.cpp
rb9c69d rf10b0c 30 30 #include "World.hpp" 31 31 32 TextDialog::AtomTextQuery::AtomTextQuery( std::string title, std::string _description) :33 Dialog::AtomQuery( title,_description)32 TextDialog::AtomTextQuery::AtomTextQuery(Parameter<const atom *> ¶m, std::string title, std::string _description) : 33 Dialog::AtomQuery(param, title,_description) 34 34 {} 35 35 … … 51 51 } 52 52 53 tmp= World::getInstance().getAtom(AtomById(idxOfAtom));54 if(!t mp&& idxOfAtom!=-1){53 const atom * temp_atom = World::getInstance().getAtom(AtomById(idxOfAtom)); 54 if(!temp_atom && idxOfAtom!=-1){ 55 55 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; 56 56 badInput = true; 57 57 } 58 tmp.set(temp_atom); 58 59 59 60 } while(badInput); -
src/UIElements/TextUI/Query/AtomsTextQuery.cpp
rb9c69d rf10b0c 31 31 32 32 33 TextDialog::AtomsTextQuery::AtomsTextQuery( std::string title, std::string _description) :34 Dialog::AtomsQuery( title,_description)33 TextDialog::AtomsTextQuery::AtomsTextQuery(Parameter<std::vector<const atom *> > ¶m, std::string title, std::string _description) : 34 Dialog::AtomsQuery(param, title,_description) 35 35 {} 36 36 … … 44 44 // dissect by " " 45 45 std::string::iterator olditer = line.begin(); 46 std::vector<const atom *> temp_atoms; 46 47 for(std::string::iterator iter = line.begin(); iter != line.end(); ++iter) { 47 48 if (*iter == ' ') { … … 53 54 break; 54 55 } 55 t mp.push_back(temp);56 temp_atoms.push_back(temp); 56 57 olditer = iter; 57 58 } … … 63 64 if(!temp && idxOfAtom!=-1) { 64 65 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; 65 t mp.push_back(temp);66 temp_atoms.push_back(temp); 66 67 } 67 68 } 69 tmp.set(temp_atoms); 68 70 69 71 return (idxOfAtom!=-1); -
src/UIElements/TextUI/Query/BooleanTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::BooleanTextQuery::BooleanTextQuery( std::string title, std::string _description) :31 Dialog::BooleanQuery( title,_description)30 TextDialog::BooleanTextQuery::BooleanTextQuery(Parameter<bool> ¶m, std::string title, std::string _description) : 31 Dialog::BooleanQuery(param, title,_description) 32 32 {} 33 33 … … 42 42 std::cin >> input; 43 43 if ((input == 'y' ) || (input == 'Y')) { 44 tmp = true;44 tmp.set(true); 45 45 } else if ((input == 'n' ) || (input == 'N')) { 46 tmp = false;46 tmp.set(false); 47 47 } else { 48 48 badInput=true; -
src/UIElements/TextUI/Query/BoxTextQuery.cpp
rb9c69d rf10b0c 29 29 30 30 31 TextDialog::BoxTextQuery::BoxTextQuery( std::string title, std::string _description) :32 Dialog::BoxQuery( title,_description)31 TextDialog::BoxTextQuery::BoxTextQuery(Parameter<Box> ¶m, std::string title, std::string _description) : 32 Dialog::BoxQuery(param, title,_description) 33 33 {} 34 34 … … 56 56 M.set(2,1, temp[4]); 57 57 M.set(2,2, temp[5]); 58 tmp.setM(M); 58 Box temp_box; 59 temp_box.setM(M); 60 tmp.set(temp_box); 59 61 return true; 60 62 } -
src/UIElements/TextUI/Query/DoubleTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::DoubleTextQuery::DoubleTextQuery( std::string title, std::string _description) :31 Dialog::DoubleQuery( title,_description)30 TextDialog::DoubleTextQuery::DoubleTextQuery(Parameter<double> ¶m, std::string title, std::string _description) : 31 Dialog::DoubleQuery(param, title,_description) 32 32 {} 33 33 … … 38 38 do{ 39 39 badInput = false; 40 std::cout << getDescription() << ": "; 41 std::cin >> tmp; 40 std::cout << getDescription() << ": ";\ 41 double temp_double; 42 std::cin >> temp_double; 42 43 if(std::cin.fail()){ 43 44 badInput = true; … … 46 47 std::cout << "Input was not a number!" << std::endl; 47 48 } 49 tmp.set(temp_double); 48 50 }while(badInput); 49 51 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); -
src/UIElements/TextUI/Query/DoublesTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::DoublesTextQuery::DoublesTextQuery( std::string title, std::string _description) :31 Dialog::DoublesQuery( title,_description)30 TextDialog::DoublesTextQuery::DoublesTextQuery(Parameter<std::vector<double> > ¶m, std::string title, std::string _description) : 31 Dialog::DoublesQuery(param, title,_description) 32 32 {} 33 33 … … 40 40 // dissect by " " 41 41 std::string::iterator olditer = line.begin(); 42 std::vector<double> temp_doubles; 42 43 for(std::string::iterator iter = line.begin(); iter != line.end(); ++iter) { 43 44 if (*iter == ' ') { 44 45 std::istringstream stream(std::string(iter, olditer)); 45 46 stream >> temp; 46 t mp.push_back(temp);47 temp_doubles.push_back(temp); 47 48 olditer = iter; 48 49 } … … 51 52 std::istringstream stream(std::string(olditer, line.end())); 52 53 stream >> temp; 53 t mp.push_back(temp);54 temp_doubles.push_back(temp); 54 55 } 56 tmp.set(temp_doubles); 55 57 56 58 return true; -
src/UIElements/TextUI/Query/ElementTextQuery.cpp
rb9c69d rf10b0c 31 31 32 32 33 TextDialog::ElementTextQuery::ElementTextQuery( std::string title, std::string _description) :34 Dialog::ElementQuery( title,_description)33 TextDialog::ElementTextQuery::ElementTextQuery(Parameter<const element *> ¶m, std::string title, std::string _description) : 34 Dialog::ElementQuery(param, title,_description) 35 35 {} 36 36 -
src/UIElements/TextUI/Query/ElementsTextQuery.cpp
rb9c69d rf10b0c 35 35 36 36 37 TextDialog::ElementsTextQuery::ElementsTextQuery( std::string title, std::string _description) :38 Dialog::ElementsQuery( title,_description)37 TextDialog::ElementsTextQuery::ElementsTextQuery(Parameter<std::vector<const element *> > ¶m, std::string title, std::string _description) : 38 Dialog::ElementsQuery(param, title,_description) 39 39 {} 40 40 … … 50 50 // dissect by " " 51 51 std::string::iterator olditer = line.begin(); 52 std::vector<const element *> temp_elements; 52 53 for(std::string::iterator iter = line.begin(); iter != line.end(); ++iter) { 53 54 if (*iter == ' ') { … … 64 65 break; 65 66 } 66 t mp.push_back(temp);67 temp_elements.push_back(temp); 67 68 olditer = iter; 68 69 } … … 79 80 if(!temp && Z!=-1) { 80 81 std::cout << "Invalid Element" << shorthand << std::endl; 81 t mp.push_back(temp);82 temp_elements.push_back(temp); 82 83 } 83 84 } 85 tmp.set(temp_elements); 84 86 85 87 return (Z!=-1); -
src/UIElements/TextUI/Query/FileTextQuery.cpp
rb9c69d rf10b0c 31 31 32 32 33 TextDialog::FileTextQuery::FileTextQuery( std::string title, std::string _description) :34 Dialog::FileQuery( title,_description)33 TextDialog::FileTextQuery::FileTextQuery(Parameter<boost::filesystem::path> ¶m, std::string title, std::string _description) : 34 Dialog::FileQuery(param, title,_description) 35 35 {} 36 36 … … 53 53 } while(badInput); 54 54 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 55 tmp = tempstring;55 tmp.set(tempstring); 56 56 return true; 57 57 } -
src/UIElements/TextUI/Query/IntTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::IntTextQuery::IntTextQuery( std::string title, std::string _description) :31 Dialog::IntQuery( title,_description)30 TextDialog::IntTextQuery::IntTextQuery(Parameter<int> ¶m, std::string title, std::string _description) : 31 Dialog::IntQuery(param, title,_description) 32 32 {} 33 33 … … 39 39 badInput = false; 40 40 std::cout << getDescription() << ": "; 41 std::cin >> tmp; 41 int temp_int; 42 std::cin >> temp_int; 43 tmp.set(temp_int); 42 44 if(std::cin.fail()){ 43 45 badInput=true; -
src/UIElements/TextUI/Query/IntsTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::IntsTextQuery::IntsTextQuery( std::string title, std::string _description) :31 Dialog::IntsQuery( title,_description)30 TextDialog::IntsTextQuery::IntsTextQuery(Parameter<std::vector<int> > ¶m, std::string title, std::string _description) : 31 Dialog::IntsQuery(param, title,_description) 32 32 {} 33 33 … … 39 39 getline(std::cin,line); 40 40 // dissect by " " 41 std::vector<int> temp_int; 41 42 std::string::iterator olditer = line.begin(); 42 43 for(std::string::iterator iter = line.begin(); iter != line.end(); ++iter) { … … 44 45 std::istringstream stream(std::string(iter, olditer)); 45 46 stream >> temp; 46 t mp.push_back(temp);47 temp_int.push_back(temp); 47 48 olditer = iter; 48 49 } … … 51 52 std::istringstream stream(std::string(olditer, line.end())); 52 53 stream >> temp; 53 t mp.push_back(temp);54 temp_int.push_back(temp); 54 55 } 56 tmp.set(temp_int); 55 57 56 58 return true; -
src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
rb9c69d rf10b0c 31 31 32 32 33 TextDialog::MoleculeTextQuery::MoleculeTextQuery( std::string title, std::string _description) :34 Dialog::MoleculeQuery( title,_description)33 TextDialog::MoleculeTextQuery::MoleculeTextQuery(Parameter<const molecule *> ¶m, std::string title, std::string _description) : 34 Dialog::MoleculeQuery(param, title,_description) 35 35 {} 36 36 … … 52 52 } 53 53 54 tmp= World::getInstance().getMolecule(MoleculeById(idxOfMol));55 if(!t mp&& idxOfMol!=-1){54 const molecule *temp_mol = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 55 if(!temp_mol && idxOfMol!=-1){ 56 56 std::cout << "Invalid Molecule Index" << std::endl; 57 57 badInput = true; 58 58 } 59 tmp.set(temp_mol); 59 60 60 61 } while(badInput); -
src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
rb9c69d rf10b0c 31 31 32 32 33 TextDialog::MoleculesTextQuery::MoleculesTextQuery( std::string title, std::string _description) :34 Dialog::MoleculesQuery( title,_description)33 TextDialog::MoleculesTextQuery::MoleculesTextQuery(Parameter<std::vector<const molecule *> > ¶m, std::string title, std::string _description) : 34 Dialog::MoleculesQuery(param, title,_description) 35 35 {} 36 36 … … 43 43 getline(std::cin,line); 44 44 // dissect by " " 45 std::vector<const molecule *> temp_mols; 45 46 std::string::iterator olditer = line.begin(); 46 47 for(std::string::iterator iter = line.begin(); iter != line.end(); ++iter) { … … 53 54 break; 54 55 } 55 t mp.push_back(temp);56 temp_mols.push_back(temp); 56 57 olditer = iter; 57 58 } … … 63 64 if(!temp && idxOfMol!=-1){ 64 65 std::cout << "Invalid Molecule Index" << idxOfMol << std::endl; 65 t mp.push_back(temp);66 temp_mols.push_back(temp); 66 67 } 67 68 } 69 tmp.set(temp_mols); 68 70 69 71 return (idxOfMol!=-1); -
src/UIElements/TextUI/Query/RandomNumberDistribution_ParametersTextQuery.cpp
rb9c69d rf10b0c 30 30 #include "RandomNumbers/RandomNumberDistribution_Parameters.hpp" 31 31 32 TextDialog::RandomNumberDistribution_ParametersTextQuery::RandomNumberDistribution_ParametersTextQuery( std::string title, std::string _description) :33 Dialog::RandomNumberDistribution_ParametersQuery( title,_description)32 TextDialog::RandomNumberDistribution_ParametersTextQuery::RandomNumberDistribution_ParametersTextQuery(Parameter<RandomNumberDistribution_Parameters> ¶m, std::string title, std::string _description) : 33 Dialog::RandomNumberDistribution_ParametersQuery(param, title,_description) 34 34 {} 35 35 … … 43 43 std::cout << "Please enter parameters as follows: 'p=0.5;'"; 44 44 std::cout << "Empty line terminates." << std::endl; 45 std::cin >> tmp; 45 RandomNumberDistribution_Parameters temp_params; 46 std::cin >> temp_params; 47 tmp.set(temp_params); 46 48 if(std::cin.fail()){ 47 49 badInput = true; -
src/UIElements/TextUI/Query/StringTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::StringTextQuery::StringTextQuery( std::string title, std::string _description) :31 Dialog::StringQuery( title,_description)30 TextDialog::StringTextQuery::StringTextQuery(Parameter<std::string> ¶m, std::string title, std::string _description) : 31 Dialog::StringQuery(param, title,_description) 32 32 {} 33 33 … … 36 36 bool TextDialog::StringTextQuery::handle() { 37 37 std::cout << getDescription() << ": "; 38 getline(std::cin,tmp); 38 std::string temp_string; 39 getline(std::cin,temp_string); 40 tmp.set(temp_string); 39 41 return true; 40 42 } -
src/UIElements/TextUI/Query/StringsTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::StringsTextQuery::StringsTextQuery( std::string title, std::string _description) :31 Dialog::StringsQuery( title,_description)30 TextDialog::StringsTextQuery::StringsTextQuery(Parameter<std::vector<std::string> > ¶m, std::string title, std::string _description) : 31 Dialog::StringsQuery(param, title,_description) 32 32 {} 33 33 … … 38 38 getline(std::cin,temp); 39 39 // dissect by " " 40 std::vector<std::string> temp_strings; 40 41 std::string::iterator olditer = temp.begin(); 41 42 for(std::string::iterator iter = temp.begin(); iter != temp.end(); ++iter) { 42 43 if (*iter == ' ') { 43 t mp.push_back(std::string(iter, olditer));44 temp_strings.push_back(std::string(iter, olditer)); 44 45 olditer = iter; 45 46 } 46 47 } 47 48 if (olditer != temp.begin()) // insert last part also 48 tmp.push_back(std::string(olditer, temp.end())); 49 temp_strings.push_back(std::string(olditer, temp.end())); 50 tmp.set(temp_strings); 49 51 50 52 return true; -
src/UIElements/TextUI/Query/TextQuery.hpp
rb9c69d rf10b0c 19 19 class TextDialog::AtomTextQuery : public Dialog::AtomQuery { 20 20 public: 21 AtomTextQuery( std::string title, std::string _description = NULL);21 AtomTextQuery(Parameter<const atom *> &, std::string title, std::string _description = NULL); 22 22 virtual ~AtomTextQuery(); 23 23 virtual bool handle(); … … 26 26 class TextDialog::AtomsTextQuery : public Dialog::AtomsQuery { 27 27 public: 28 AtomsTextQuery( std::string title, std::string _description = NULL);28 AtomsTextQuery(Parameter<std::vector<const atom *> > &, std::string title, std::string _description = NULL); 29 29 virtual ~AtomsTextQuery(); 30 30 virtual bool handle(); … … 33 33 class TextDialog::BooleanTextQuery : public Dialog::BooleanQuery { 34 34 public: 35 BooleanTextQuery( std::string title, std::string _description = NULL);35 BooleanTextQuery(Parameter<bool> &, std::string title, std::string _description = NULL); 36 36 virtual ~BooleanTextQuery(); 37 37 virtual bool handle(); … … 40 40 class TextDialog::BoxTextQuery : public Dialog::BoxQuery { 41 41 public: 42 BoxTextQuery( std::string title, std::string _description = NULL);42 BoxTextQuery(Parameter<Box> &, std::string title, std::string _description = NULL); 43 43 virtual ~BoxTextQuery(); 44 44 virtual bool handle(); … … 47 47 class TextDialog::DoubleTextQuery : public Dialog::DoubleQuery { 48 48 public: 49 DoubleTextQuery( std::string title, std::string _description = NULL);49 DoubleTextQuery(Parameter<double> &, std::string title, std::string _description = NULL); 50 50 virtual ~DoubleTextQuery(); 51 51 virtual bool handle(); … … 54 54 class TextDialog::DoublesTextQuery : public Dialog::DoublesQuery { 55 55 public: 56 DoublesTextQuery( std::string title, std::string _description = NULL);56 DoublesTextQuery(Parameter<std::vector<double> > &, std::string title, std::string _description = NULL); 57 57 virtual ~DoublesTextQuery(); 58 58 virtual bool handle(); … … 61 61 class TextDialog::ElementTextQuery : public Dialog::ElementQuery { 62 62 public: 63 ElementTextQuery( std::string title, std::string _description = NULL);63 ElementTextQuery(Parameter<const element *> &, std::string title, std::string _description = NULL); 64 64 virtual ~ElementTextQuery(); 65 65 virtual bool handle(); … … 68 68 class TextDialog::ElementsTextQuery : public Dialog::ElementsQuery { 69 69 public: 70 ElementsTextQuery( std::string title, std::string _description = NULL);70 ElementsTextQuery(Parameter<std::vector<const element *> > &, std::string title, std::string _description = NULL); 71 71 virtual ~ElementsTextQuery(); 72 72 virtual bool handle(); … … 82 82 class TextDialog::FileTextQuery : public Dialog::FileQuery { 83 83 public: 84 FileTextQuery( std::string title, std::string _description = NULL);84 FileTextQuery(Parameter<boost::filesystem::path> &, std::string title, std::string _description = NULL); 85 85 virtual ~FileTextQuery(); 86 86 virtual bool handle(); … … 89 89 class TextDialog::IntTextQuery : public Dialog::IntQuery { 90 90 public: 91 IntTextQuery( std::string title, std::string _description = NULL);91 IntTextQuery(Parameter<int> &, std::string title, std::string _description = NULL); 92 92 virtual ~IntTextQuery(); 93 93 virtual bool handle(); … … 96 96 class TextDialog::IntsTextQuery : public Dialog::IntsQuery { 97 97 public: 98 IntsTextQuery( std::string title, std::string _description = NULL);98 IntsTextQuery(Parameter<std::vector<int> > &, std::string title, std::string _description = NULL); 99 99 virtual ~IntsTextQuery(); 100 100 virtual bool handle(); … … 103 103 class TextDialog::MoleculeTextQuery : public Dialog::MoleculeQuery { 104 104 public: 105 MoleculeTextQuery( std::string title, std::string _description = NULL);105 MoleculeTextQuery(Parameter<const molecule *> &, std::string title, std::string _description = NULL); 106 106 virtual ~MoleculeTextQuery(); 107 107 virtual bool handle(); … … 110 110 class TextDialog::MoleculesTextQuery : public Dialog::MoleculesQuery { 111 111 public: 112 MoleculesTextQuery( std::string title, std::string _description = NULL);112 MoleculesTextQuery(Parameter<std::vector<const molecule *> > &, std::string title, std::string _description = NULL); 113 113 virtual ~MoleculesTextQuery(); 114 114 virtual bool handle(); … … 117 117 class TextDialog::StringTextQuery : public Dialog::StringQuery { 118 118 public: 119 StringTextQuery( std::string title, std::string _description = NULL);119 StringTextQuery(Parameter<std::string> &, std::string title, std::string _description = NULL); 120 120 virtual ~StringTextQuery(); 121 121 virtual bool handle(); … … 124 124 class TextDialog::StringsTextQuery : public Dialog::StringsQuery { 125 125 public: 126 StringsTextQuery( std::string title, std::string _description = NULL);126 StringsTextQuery(Parameter<std::vector<std::string> > &, std::string title, std::string _description = NULL); 127 127 virtual ~StringsTextQuery(); 128 128 virtual bool handle(); … … 131 131 class TextDialog::UnsignedIntTextQuery : public Dialog::UnsignedIntQuery { 132 132 public: 133 UnsignedIntTextQuery( std::string title, std::string _description = NULL);133 UnsignedIntTextQuery(Parameter<unsigned int> &, std::string title, std::string _description = NULL); 134 134 virtual ~UnsignedIntTextQuery(); 135 135 virtual bool handle(); … … 138 138 class TextDialog::UnsignedIntsTextQuery : public Dialog::UnsignedIntsQuery { 139 139 public: 140 UnsignedIntsTextQuery( std::string title, std::string _description = NULL);140 UnsignedIntsTextQuery(Parameter<std::vector<unsigned int> > &, std::string title, std::string _description = NULL); 141 141 virtual ~UnsignedIntsTextQuery(); 142 142 virtual bool handle(); … … 145 145 class TextDialog::VectorTextQuery : public Dialog::VectorQuery { 146 146 public: 147 VectorTextQuery( std::string title,bool _check, std::string _description = NULL);147 VectorTextQuery(Parameter<Vector> &, std::string title,bool _check, std::string _description = NULL); 148 148 virtual ~VectorTextQuery(); 149 149 virtual bool handle(); … … 152 152 class TextDialog::VectorsTextQuery : public Dialog::VectorsQuery { 153 153 public: 154 VectorsTextQuery( std::string title,bool _check, std::string _description = NULL);154 VectorsTextQuery(Parameter<std::vector<Vector> > &, std::string title,bool _check, std::string _description = NULL); 155 155 virtual ~VectorsTextQuery(); 156 156 virtual bool handle(); … … 159 159 class TextDialog::RandomNumberDistribution_ParametersTextQuery : public Dialog::RandomNumberDistribution_ParametersQuery { 160 160 public: 161 RandomNumberDistribution_ParametersTextQuery( std::string title, std::string _description = NULL);161 RandomNumberDistribution_ParametersTextQuery(Parameter<RandomNumberDistribution_Parameters> &, std::string title, std::string _description = NULL); 162 162 virtual ~RandomNumberDistribution_ParametersTextQuery(); 163 163 virtual bool handle(); -
src/UIElements/TextUI/Query/UnsignedIntTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::UnsignedIntTextQuery::UnsignedIntTextQuery( std::string title, std::string _description) :31 Dialog::UnsignedIntQuery( title,_description)30 TextDialog::UnsignedIntTextQuery::UnsignedIntTextQuery(Parameter<unsigned int> ¶m, std::string title, std::string _description) : 31 Dialog::UnsignedIntQuery(param, title,_description) 32 32 {} 33 33 … … 39 39 badInput = false; 40 40 std::cout << getDescription() << ": "; 41 std::cin >> tmp; 41 unsigned int temp_uint; 42 std::cin >> temp_uint; 42 43 if(std::cin.fail()){ 43 44 badInput=true; … … 46 47 std::cout << "Input was not a number!" << std::endl; 47 48 } 49 tmp.set(temp_uint); 48 50 } while(badInput); 49 51 // clear the input buffer of anything still in the line -
src/UIElements/TextUI/Query/UnsignedIntsTextQuery.cpp
rb9c69d rf10b0c 28 28 29 29 30 TextDialog::UnsignedIntsTextQuery::UnsignedIntsTextQuery( std::string title, std::string _description) :31 Dialog::UnsignedIntsQuery( title,_description)30 TextDialog::UnsignedIntsTextQuery::UnsignedIntsTextQuery(Parameter<std::vector<unsigned int> > ¶m, std::string title, std::string _description) : 31 Dialog::UnsignedIntsQuery(param, title,_description) 32 32 {} 33 33 … … 39 39 getline(std::cin,line); 40 40 // dissect by " " 41 std::vector<unsigned int> temp_uints; 41 42 std::string::iterator olditer = line.begin(); 42 43 for(std::string::iterator iter = line.begin(); iter != line.end(); ++iter) { … … 44 45 std::istringstream stream(std::string(iter, olditer)); 45 46 stream >> temp; 46 t mp.push_back(temp);47 temp_uints.push_back(temp); 47 48 olditer = iter; 48 49 } … … 51 52 std::istringstream stream(std::string(olditer, line.end())); 52 53 stream >> temp; 53 t mp.push_back(temp);54 temp_uints.push_back(temp); 54 55 } 56 tmp.set(temp_uints); 55 57 56 58 return true; -
src/UIElements/TextUI/Query/VectorTextQuery.cpp
rb9c69d rf10b0c 31 31 32 32 33 TextDialog::VectorTextQuery::VectorTextQuery( std::string title, bool _check, std::string _description) :34 Dialog::VectorQuery( title,_check,_description)33 TextDialog::VectorTextQuery::VectorTextQuery(Parameter<Vector> ¶m, std::string title, bool _check, std::string _description) : 34 Dialog::VectorQuery(param, title,_check,_description) 35 35 {} 36 36 … … 48 48 getline(std::cin,line); 49 49 50 Vector temp_vector; 51 50 52 // dissect by "," 51 53 double coord = 0.; … … 56 58 std::istringstream stream(std::string(iter, olditer)); 57 59 stream >> coord; 58 t mp[counter++] = coord;60 temp_vector[counter++] = coord; 59 61 olditer = iter; 60 62 } … … 63 65 std::istringstream stream(std::string(olditer, line.end())); 64 66 stream >> coord; 65 t mp[counter++] = coord;67 temp_vector[counter++] = coord; 66 68 } 69 tmp.set(temp_vector); 67 70 68 71 // check vector 69 return World::getInstance().getDomain().isValid(t mp);72 return World::getInstance().getDomain().isValid(temp_vector); 70 73 } 71 74 -
src/UIElements/TextUI/Query/VectorsTextQuery.cpp
rb9c69d rf10b0c 31 31 32 32 33 TextDialog::VectorsTextQuery::VectorsTextQuery( std::string title, bool _check, std::string _description) :34 Dialog::VectorsQuery( title,_check,_description)33 TextDialog::VectorsTextQuery::VectorsTextQuery(Parameter<std::vector<Vector> > ¶m, std::string title, bool _check, std::string _description) : 34 Dialog::VectorsQuery(param, title,_check,_description) 35 35 {} 36 36 … … 50 50 // dissect by "," 51 51 double coord = 0.; 52 std::vector<Vector> temp_vectors; 52 53 std::string::iterator olditerspace = line.begin(); 53 54 std::string::iterator olditercomma = line.begin(); … … 72 73 } 73 74 if (World::getInstance().getDomain().isValid(temp)) 74 t mp.push_back(temp);75 temp_vectors.push_back(temp); 75 76 olditerspace = vectoriter; 76 77 } 77 78 } 79 tmp.set(temp_vectors); 78 80 79 81 return true;
Note:
See TracChangeset
for help on using the changeset viewer.