Changeset be848d for src/UIElements/Dialog.hpp
- Timestamp:
- Jun 21, 2017, 10:02:14 PM (9 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, Candidate_v1.7.0, Candidate_v1.7.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, 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, stable
- Children:
- 78ea3c
- Parents:
- 9a9f847 (diff), 6116df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/UIElements/Dialog.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Dialog.hpp
r9a9f847 rbe848d 158 158 virtual void queryEmpty(const std::string ="", const std::string = "")=0; 159 159 160 virtual void queryVector(Parameter<Vector> &, const std::string ="", const std::string = "")=0; 161 virtual void queryVectors(Parameter< std::vector<Vector> > &, const std::string ="", const std::string = "")=0; 162 160 163 /** With the following boost::preprocessor code we generate virtual function 161 164 * definitions for all desired query types in the abstract class Dialog. … … 250 253 }; 251 254 252 253 255 template<class T> 254 256 class TQuery : public Query { … … 282 284 }; 283 285 286 // we have specialization of Vector to allow internal storing as string 287 template <> 288 void Dialog::query<Vector>(Parameter<Vector> &, const std::string, const std::string); 289 template <> 290 void Dialog::query< std::vector<Vector> >(Parameter< std::vector<Vector> > &, const std::string, const std::string); 291 292 /** Template specialization for Query<Vector> to allow internal storing of a 293 * string instead of a Vector. 294 * 295 * Because we need to evaluate the string as a possible GeometryRegistry key 296 * and we may do this only when the Action (whose options we are querying) 297 * is executed, not before. 298 */ 299 template <> 300 class Dialog::TQuery<Vector> : public Query { 301 public: 302 TQuery(Parameter<Vector> &_param, const std::string title, const std::string _description = "") : 303 Query(title, _description), param(_param) {} 304 virtual ~TQuery(){} 305 virtual bool handle()=0; 306 virtual bool isValid(){ return param.isValidAsString(temp); } 307 virtual void setResult(){ param.setAsString(temp); } 308 protected: 309 std::string temp; 310 Parameter<Vector> ¶m; 311 }; 312 313 template <> 314 class Dialog::TQuery< std::vector<Vector> > : public Query { 315 public: 316 TQuery(Parameter< std::vector<Vector> > &_param, const std::string title, const std::string _description = "") : 317 Query(title, _description), param(_param) {} 318 virtual ~TQuery(){} 319 virtual bool handle()=0; 320 virtual bool isValid(); 321 virtual void setResult(); 322 protected: 323 std::vector<std::string> temp; 324 Parameter< std::vector<Vector> > ¶m; 325 }; 326 327 284 328 #endif /* DIALOG_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.
