- Timestamp:
- May 8, 2010, 6:30:53 PM (15 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:
- 03bb99
- Parents:
- efc3cb
- Location:
- src
- Files:
-
- 8 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
refc3cb ra2ab15 124 124 UISOURCE = \ 125 125 ${ACTIONSSOURCE} \ 126 ${COMMANDLINEUISOURCE} \ 126 127 ${MENUSOURCE} \ 127 128 ${TEXTUISOURCE} \ … … 133 134 UIHEADER = \ 134 135 ${ACTIONSHEADER} \ 136 ${COMMANDLINEUIHEADER} \ 135 137 ${MENUHEADER} \ 136 138 ${TEXTUIHEADER} \ … … 150 152 UIElements/TextUIFactory.hpp \ 151 153 UIElements/TextWindow.hpp 154 155 COMMANDLINEUISOURCE = \ 156 UIElements/CommandLineDialog.cpp \ 157 UIElements/CommandLineStatusIndicator.cpp \ 158 UIElements/CommandLineUIFactory.cpp \ 159 UIElements/CommandLineWindow.cpp 160 COMMANDLINEUIHEADER = \ 161 UIElements/CommandLineDialog.hpp \ 162 UIElements/CommandLineStatusIndicator.hpp \ 163 UIElements/CommandLineUIFactory.hpp \ 164 UIElements/CommandLineWindow.hpp 152 165 153 166 # all these files are only used for legacy reasons while the transition is in progress -
src/UIElements/Dialog.cpp
refc3cb ra2ab15 51 51 52 52 // Base class 53 Dialog::Query::Query(string _title) : 54 title(_title) 53 Dialog::Query::Query(string _title, string _description) : 54 title(_title), 55 description(_description) 55 56 {} 56 57 … … 61 62 } 62 63 64 const std::string Dialog::Query::getDescription() const{ 65 return description; 66 } 63 67 // Int Queries 64 68 65 Dialog::IntQuery::IntQuery(string title,int *_target ) :66 Query(title ), target(_target)69 Dialog::IntQuery::IntQuery(string title,int *_target, std::string description) : 70 Query(title, description), target(_target) 67 71 {} 68 72 … … 75 79 // String Queries 76 80 77 Dialog::StringQuery::StringQuery(string title,string *_target ) :78 Query(title ), target(_target)81 Dialog::StringQuery::StringQuery(string title,string *_target, std::string _description) : 82 Query(title, _description), target(_target) 79 83 {} 80 84 … … 87 91 // Double Queries 88 92 89 Dialog::DoubleQuery::DoubleQuery(string title,double *_target ) :90 Query(title ), target(_target)93 Dialog::DoubleQuery::DoubleQuery(string title,double *_target, std::string _description) : 94 Query(title, _description), target(_target) 91 95 {} 92 96 … … 100 104 // Molecule Queries 101 105 102 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules ) :103 Query(title ),106 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) : 107 Query(title, _description), 104 108 tmp(0), 105 109 molecules(_molecules), … … 116 120 // Vector Queries 117 121 118 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check ) :119 Query(title ),122 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description) : 123 Query(title, _description), 120 124 cellSize(_cellSize), 121 125 check(_check), … … 135 139 136 140 // Element Queries 137 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target ) :138 Query(title ),141 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target, std::string _description) : 142 Query(title, _description), 139 143 tmp(0), 140 144 target(_target) -
src/UIElements/Dialog.hpp
refc3cb ra2ab15 23 23 virtual ~Dialog(); 24 24 25 virtual void queryInt(const char *, int * )=0;26 virtual void queryDouble(const char*,double * )=0;27 virtual void queryString(const char*, std::string * )=0;28 virtual void queryMolecule(const char*,molecule**,MoleculeListClass* )=0;29 virtual void queryVector(const char*,Vector *,const double *const,bool )=0;30 virtual void queryElement(const char*,const element ** )=0;25 virtual void queryInt(const char *, int *, std::string = "")=0; 26 virtual void queryDouble(const char*,double *, std::string = "")=0; 27 virtual void queryString(const char*, std::string *, std::string = "")=0; 28 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = "")=0; 29 virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0; 30 virtual void queryElement(const char*,const element **, std::string = "")=0; 31 31 32 32 virtual bool display(); … … 46 46 class Query { 47 47 public: 48 Query(std::string _title );48 Query(std::string _title, std::string _description = ""); 49 49 virtual ~Query(); 50 50 virtual bool handle()=0; … … 52 52 protected: 53 53 const std::string getTitle() const; 54 const std::string getDescription() const; 54 55 private: 55 std::string title; 56 std::string title; //!< short title of the query 57 std::string description; //!< longer description for tooltips or for help 56 58 }; 57 59 … … 59 61 class IntQuery : public Query { 60 62 public: 61 IntQuery(std::string title,int *_target );63 IntQuery(std::string title,int *_target, std::string _description = ""); 62 64 virtual ~IntQuery(); 63 65 virtual bool handle()=0; … … 71 73 class DoubleQuery : public Query { 72 74 public: 73 DoubleQuery(std::string title,double *_target );75 DoubleQuery(std::string title,double *_target, std::string _description = ""); 74 76 virtual ~DoubleQuery(); 75 77 virtual bool handle()=0; … … 83 85 class StringQuery : public Query { 84 86 public: 85 StringQuery(std::string title,std::string *_target );87 StringQuery(std::string title,std::string *_target, std::string _description = ""); 86 88 virtual ~StringQuery(); 87 89 virtual bool handle()=0; … … 96 98 class MoleculeQuery : public Query { 97 99 public: 98 MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules );100 MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = ""); 99 101 virtual ~MoleculeQuery(); 100 102 virtual bool handle()=0; … … 109 111 class VectorQuery : public Query { 110 112 public: 111 VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check );113 VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = ""); 112 114 virtual ~VectorQuery(); 113 115 virtual bool handle()=0; … … 123 125 class ElementQuery : public Query { 124 126 public: 125 ElementQuery(std::string title, const element**_target );127 ElementQuery(std::string title, const element**_target, std::string _description = ""); 126 128 virtual ~ElementQuery(); 127 129 virtual bool handle()=0; … … 140 142 }; 141 143 144 142 145 #endif /* DIALOG_HPP_ */ -
src/UIElements/TextDialog.cpp
refc3cb ra2ab15 29 29 30 30 31 void TextDialog::queryInt(const char* title, int* target ){32 registerQuery(new IntTextQuery(title,target ));33 } 34 35 void TextDialog::queryDouble(const char* title, double* target ){36 registerQuery(new DoubleTextQuery(title,target ));37 } 38 39 void TextDialog::queryString(const char* title, string* target ){40 registerQuery(new StringTextQuery(title,target ));41 } 42 43 void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules ) {44 registerQuery(new MoleculeTextQuery(title,target,molecules ));45 } 46 47 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check ) {48 registerQuery(new VectorTextQuery(title,target,cellSize,check ));49 } 50 51 void TextDialog::queryElement(const char* title, const element **target ){52 registerQuery(new ElementTextQuery(title,target ));31 void TextDialog::queryInt(const char* title, int* target, string description){ 32 registerQuery(new IntTextQuery(title,target,description)); 33 } 34 35 void TextDialog::queryDouble(const char* title, double* target, string description){ 36 registerQuery(new DoubleTextQuery(title,target,description)); 37 } 38 39 void TextDialog::queryString(const char* title, string* target, string description){ 40 registerQuery(new StringTextQuery(title,target,description)); 41 } 42 43 void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules, string description) { 44 registerQuery(new MoleculeTextQuery(title,target,molecules,description)); 45 } 46 47 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) { 48 registerQuery(new VectorTextQuery(title,target,cellSize,check,description)); 49 } 50 51 void TextDialog::queryElement(const char* title, const element **target, string description){ 52 registerQuery(new ElementTextQuery(title,target,description)); 53 53 } 54 54 55 55 /************************** Query Infrastructure ************************/ 56 56 57 TextDialog::IntTextQuery::IntTextQuery(string title,int *_target ) :58 Dialog::IntQuery(title,_target )57 TextDialog::IntTextQuery::IntTextQuery(string title,int *_target, std::string _description) : 58 Dialog::IntQuery(title,_target,_description) 59 59 {} 60 60 … … 79 79 } 80 80 81 TextDialog::StringTextQuery::StringTextQuery(string title,string *_target ) :82 Dialog::StringQuery(title,_target )81 TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) : 82 Dialog::StringQuery(title,_target,_description) 83 83 {} 84 84 … … 91 91 } 92 92 93 TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target ) :94 Dialog::DoubleQuery(title,_target )93 TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target, std::string _description) : 94 Dialog::DoubleQuery(title,_target,_description) 95 95 {} 96 96 … … 114 114 } 115 115 116 TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules ) :117 Dialog::MoleculeQuery(title,_target,_molecules )116 TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules, std::string _description) : 117 Dialog::MoleculeQuery(title,_target,_molecules,_description) 118 118 {} 119 119 … … 146 146 } 147 147 148 TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check ) :149 Dialog::VectorQuery(title,_target,_cellSize,_check )148 TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check, std::string _description) : 149 Dialog::VectorQuery(title,_target,_cellSize,_check,_description) 150 150 {} 151 151 … … 169 169 170 170 171 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target ) :172 Dialog::ElementQuery(title,target )171 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) : 172 Dialog::ElementQuery(title,target,_description) 173 173 {} 174 174 -
src/UIElements/TextDialog.hpp
refc3cb ra2ab15 19 19 virtual ~TextDialog(); 20 20 21 virtual void queryInt(const char *, int * );22 virtual void queryString(const char*, std::string * );23 virtual void queryDouble(const char*, double* );24 virtual void queryMolecule(const char*,molecule**,MoleculeListClass* );25 virtual void queryVector(const char*,Vector *,const double * const,bool );26 virtual void queryElement(const char*,const element ** );21 virtual void queryInt(const char *, int *, std::string = ""); 22 virtual void queryString(const char*, std::string *, std::string = ""); 23 virtual void queryDouble(const char*, double*, std::string = ""); 24 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*, std::string = ""); 25 virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = ""); 26 virtual void queryElement(const char*,const element **, std::string = ""); 27 27 28 28 protected: … … 30 30 class IntTextQuery : public Dialog::IntQuery { 31 31 public: 32 IntTextQuery(std::string title, int *_target );32 IntTextQuery(std::string title, int *_target, std::string _description = NULL); 33 33 virtual ~IntTextQuery(); 34 34 virtual bool handle(); … … 37 37 class DoubleTextQuery : public Dialog::DoubleQuery { 38 38 public: 39 DoubleTextQuery(std::string title, double *_target );39 DoubleTextQuery(std::string title, double *_target, std::string _description = NULL); 40 40 virtual ~DoubleTextQuery(); 41 41 virtual bool handle(); … … 44 44 class StringTextQuery : public Dialog::StringQuery { 45 45 public: 46 StringTextQuery(std::string title, std::string *_target );46 StringTextQuery(std::string title, std::string *_target, std::string _description = NULL); 47 47 virtual ~StringTextQuery(); 48 48 virtual bool handle(); … … 51 51 class MoleculeTextQuery : public Dialog::MoleculeQuery { 52 52 public: 53 MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules );53 MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules, std::string _description = NULL); 54 54 virtual ~MoleculeTextQuery(); 55 55 virtual bool handle(); … … 58 58 class VectorTextQuery : public Dialog::VectorQuery { 59 59 public: 60 VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check );60 VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL); 61 61 virtual ~VectorTextQuery(); 62 62 virtual bool handle(); … … 65 65 class ElementTextQuery : public Dialog::ElementQuery { 66 66 public: 67 ElementTextQuery(std::string title, const element **_target );67 ElementTextQuery(std::string title, const element **_target, std::string _description = NULL); 68 68 virtual ~ElementTextQuery(); 69 69 virtual bool handle(); -
src/UIElements/UIFactory.cpp
refc3cb ra2ab15 13 13 // all factories that can be used: 14 14 #include "UIElements/TextUIFactory.hpp" 15 #include "UIElements/CommandLineUIFactory.hpp" 15 16 16 17 UIFactory::UIFactory() … … 30 31 setInstance(new TextUIFactory()); 31 32 break; 33 case CommandLine: 34 setInstance(new CommandLineUIFactory()); 35 break; 32 36 33 37 default: -
src/UIElements/UIFactory.hpp
refc3cb ra2ab15 11 11 class MainWindow; 12 12 class Dialog; 13 class DialogDescription; 13 14 14 15 class MoleculeListClass; … … 31 32 32 33 public: 33 enum InterfaceTypes {Text };34 enum InterfaceTypes {Text, CommandLine}; 34 35 virtual ~UIFactory(); 35 36
Note:
See TracChangeset
for help on using the changeset viewer.