Changeset 9ee38b
- Timestamp:
- Aug 28, 2010, 12:52:58 AM (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:
- b4fa106
- Parents:
- 0b2ce9
- git-author:
- Frederik Heber <heber@…> (08/25/10 17:20:37)
- git-committer:
- Frederik Heber <heber@…> (08/28/10 00:52:58)
- Location:
- src
- Files:
-
- 5 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action_impl_header.hpp
r0b2ce9 r9ee38b 18 18 #include <boost/preprocessor/seq/seq.hpp> 19 19 #include <boost/preprocessor/seq/size.hpp> 20 #include <boost/preprocessor/seq/transform.hpp> 20 21 21 22 // some derived names … … 24 25 #define STATE BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, State)) 25 26 #define PARAMS BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters)) 26 27 #define PARAMSDOT BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters)) 27 28 28 29 // check if no lists given … … 79 80 #define value_print(z,n,command) \ 80 81 ValueStorage::getInstance(). command (\ 82 BOOST_PP_SEQ_ELEM(n, tokens)\ 83 , \ 84 params.\ 81 85 BOOST_PP_SEQ_ELEM(n, references)\ 82 , \83 BOOST_PP_SEQ_ELEM(n, tokens)\84 86 ); 85 87 … … 106 108 virtual const std::string getName(); 107 109 108 struct PARAMS; 110 struct PARAMS : ActionParameters { 111 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0) 112 #define BOOST_PP_LOCAL_MACRO(n) type_print(~, n, ;) 113 #define BOOST_PP_LOCAL_LIMITS (0, MAXNOTOKENS-1) 114 #include BOOST_PP_LOCAL_ITERATE() 115 #undef BOOST_PP_LOCAL_MACRO 116 #undef BOOST_PP_LOCAL_LIMITS 117 #endif 118 } params; 109 119 110 120 protected: … … 119 129 }; 120 130 131 #undef types 132 #undef tokens 133 #undef references 134 #undef MAXNOTOKENS 135 136 #undef ACTION 137 #undef ACTIONNAME 138 #undef CATEGORY 139 #undef COMMAND 140 #undef COMMANDFULL 141 #undef PARAMS 142 #undef STATE 143 #undef TOKEN -
src/Actions/Action_impl_pre.hpp
r0b2ce9 r9ee38b 23 23 */ 24 24 25 26 #include <boost/preprocessor/cat.hpp> 27 #include <boost/preprocessor/comparison/equal.hpp> 28 #include <boost/preprocessor/comparison/not_equal.hpp> 29 #include <boost/preprocessor/control/if.hpp> 30 #include <boost/preprocessor/debug/assert.hpp> 31 #include <boost/preprocessor/iteration/local.hpp> 32 #include <boost/preprocessor/punctuation/comma_if.hpp> 33 #include <boost/preprocessor/repetition/repeat.hpp> 34 #include <boost/preprocessor/seq/elem.hpp> 35 #include <boost/preprocessor/seq/push_back.hpp> 36 #include <boost/preprocessor/seq/seq.hpp> 37 #include <boost/preprocessor/seq/size.hpp> 38 #include <boost/preprocessor/seq/transform.hpp> 39 40 // some derived names 41 #define ACTION BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Action)) 42 #define COMMAND BOOST_PP_CAT(CATEGORY, ACTIONNAME) 43 #define STATE BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, State)) 44 #define PARAMS BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters)) 45 #define PARAMSDOT BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters)) 46 47 // check if no lists given 48 #ifndef types 49 #define MAXNOTOKENS 0 50 #else 51 #define MAXNOTOKENS BOOST_PP_SEQ_SIZE(types) 52 #endif 53 54 // check user has given name and category 55 #ifndef CATEGORY 56 ERROR: No "CATEGORY" defined in: __FILE__ 57 #endif 58 59 #ifndef ACTIONNAME 60 ERROR: No "ACTIONNAME" defined in: __FILE__ 61 #endif 62 63 // calculate numbers and check whether all have same size 64 #ifdef tokens 65 BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXNOTOKENS, BOOST_PP_SEQ_SIZE(tokens)),\ 66 ERROR: There are not the same number of "tokens" and "types" in: __FILE__ \ 67 ) 68 #endif 69 #ifdef references 70 BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXNOTOKENS, BOOST_PP_SEQ_SIZE(references)),\ 71 ERROR: There are not the same number of "tokens" and "references" in: __FILE__ \ 72 ) 73 #endif 74 75 // print a list of type ref followed by a separator, i.e. "int i;" 76 #define type_print(z,n,separator) \ 77 BOOST_PP_SEQ_ELEM(n, types) \ 78 BOOST_PP_SEQ_ELEM(n, references)\ 79 separator 80 81 // print a list of type ref followed, i.e. "int i, double position" 82 #define type_list(z,n,unused) \ 83 BOOST_PP_COMMA_IF(n)\ 84 BOOST_PP_SEQ_ELEM(n, types) \ 85 BOOST_PP_SEQ_ELEM(n, references) 86 87 // prints dialog->query calls for types with tokens 88 #define dialog_print(z,n,unused) \ 89 dialog->query<\ 90 BOOST_PP_SEQ_ELEM(n, types)\ 91 >(\ 92 BOOST_PP_SEQ_ELEM(n, tokens)\ 93 , ValueStorage::getInstance().getDescription(\ 94 BOOST_PP_SEQ_ELEM(n, tokens)\ 95 )); 96 97 // prints set/queryCurrentValue (command) for paramreferences and paramtokens 98 #define value_print(z,n,command, prefix) \ 99 ValueStorage::getInstance(). command (\ 100 BOOST_PP_SEQ_ELEM(n, tokens)\ 101 , \ 102 prefix\ 103 BOOST_PP_SEQ_ELEM(n, references)\ 104 ); 105 106 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0) 107 #define COMMANDFULL \ 108 void COMMAND( \ 109 BOOST_PP_REPEAT(MAXNOTOKENS, type_list, ~) \ 110 ) 111 # else 112 #define COMMANDFULL void COMMAND() 113 #endif 114 25 115 #include "Actions/ActionRegistry.hpp" 26 116 #include "UIElements/Dialog.hpp" 27 117 #include "Actions/ValueStorage.hpp" 118 28 119 29 120 const char ACTION::NAME[] = TOKEN; … … 52 143 }; 53 144 54 struct PARAMS : ActionParameters { 145 COMMANDFULL 146 { 147 ACTION::PARAMS params; 148 Action *ToCall = ActionRegistry::getInstance().getActionByName( ACTION::NAME ); //->clone(params); 55 149 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0) 56 #define BOOST_PP_LOCAL_MACRO(n) type_print(~, n, ;)150 #define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, setCurrentValue, ) 57 151 #define BOOST_PP_LOCAL_LIMITS (0, MAXNOTOKENS-1) 58 152 #include BOOST_PP_LOCAL_ITERATE() … … 60 154 #undef BOOST_PP_LOCAL_LIMITS 61 155 #endif 156 ToCall->call(Action::NonInteractive); 62 157 }; 63 158 64 COMMANDFULL 65 { 159 void ACTION::getParametersfromValueStorage() { 66 160 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0) 67 #define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, setCurrentValue) 68 #define BOOST_PP_LOCAL_LIMITS (0, MAXNOTOKENS-1) 69 #include BOOST_PP_LOCAL_ITERATE() 70 #undef BOOST_PP_LOCAL_MACRO 71 #undef BOOST_PP_LOCAL_LIMITS 72 #endif 73 ActionRegistry::getInstance().getActionByName( ACTION::NAME )->call(Action::NonInteractive); 74 }; 75 76 void AnalysisMolecularVolumeAction::getParametersfromValueStorage() { 77 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0) 78 #define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, queryCurrentValue) 161 #define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, queryCurrentValue, params.) 79 162 #define BOOST_PP_LOCAL_LIMITS (0, MAXNOTOKENS-1) 80 163 #include BOOST_PP_LOCAL_ITERATE() … … 89 172 #undef MAXNOTOKENS 90 173 174 #undef ACTION 175 #undef ACTIONNAME 176 #undef CATEGORY 177 #undef COMMAND 178 #undef COMMANDFULL 179 #undef PARAMS 180 #undef STATE 181 #undef TOKEN -
src/Actions/AnalysisAction/MolecularVolumeAction.cpp
r0b2ce9 r9ee38b 37 37 38 38 // and construct the stuff 39 #include "MolecularVolumeAction.def" 39 40 #include "Action_impl_pre.hpp" 40 41 41 42 /** =========== define the function ====================== */ 42 Action::state_ptr A CTION::performCall() {43 Action::state_ptr AnalysisMolecularVolumeAction::performCall() { 43 44 // obtain information 44 45 getParametersfromValueStorage(); … … 66 67 } 67 68 68 Action::state_ptr A CTION::performUndo(Action::state_ptr _state) {69 Action::state_ptr AnalysisMolecularVolumeAction::performUndo(Action::state_ptr _state) { 69 70 return Action::success; 70 71 } 71 72 72 Action::state_ptr A CTION::performRedo(Action::state_ptr _state){73 Action::state_ptr AnalysisMolecularVolumeAction::performRedo(Action::state_ptr _state){ 73 74 return Action::success; 74 75 } 75 76 76 bool A CTION::canUndo() {77 bool AnalysisMolecularVolumeAction::canUndo() { 77 78 return true; 78 79 } 79 80 80 bool A CTION::shouldUndo() {81 bool AnalysisMolecularVolumeAction::shouldUndo() { 81 82 return true; 82 83 } 83 84 84 const string A CTION::getName() {85 const string AnalysisMolecularVolumeAction::getName() { 85 86 return NAME; 86 87 } 87 88 /** =========== end of function ====================== */ 88 89 // and clean the stuff90 #include "Action_impl_post.hpp" -
src/Actions/AnalysisAction/MolecularVolumeAction.hpp
r0b2ce9 r9ee38b 16 16 #include "Actions/Action.hpp" 17 17 18 // i.e. there is an integer with variable name Z that can be found in 19 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 20 // "undefine" if no parameters are required 21 //#define types (int) 22 //#define references (molID) 23 //#define tokens (NAME) 24 // some defines for all the names, you may use ACTION, STATE and PARAMS 25 #define CATEGORY Analysis 26 #define ACTIONNAME MolecularVolume 27 #define TOKEN "molecular-volume" 28 29 #include "Action_impl_header.hpp" 18 #include "MolecularVolumeAction.def" 19 #include "Actions/Action_impl_header.hpp" 30 20 31 21 #endif /* MOLECULARVOLUMEACTION_HPP_ */ -
src/Actions/AnalysisAction/PairCorrelationAction.cpp
r0b2ce9 r9ee38b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/AnalysisAction/PairCorrelationAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "analysis_correlation.hpp" 25 23 #include "boundary.hpp" … … 38 36 using namespace std; 39 37 40 #include "UIElements/UIFactory.hpp" 41 #include "UIElements/Dialog.hpp" 42 #include "Actions/ValueStorage.hpp" 38 #include "Actions/AnalysisAction/PairCorrelationAction.hpp" 43 39 44 const char AnalysisPairCorrelationAction::NAME[] = "pair-correlation"; 40 // and construct the stuff 41 #include "PairCorrelationAction.def" 42 #include "Action_impl_pre.hpp" 45 43 46 AnalysisPairCorrelationAction::AnalysisPairCorrelationAction() : 47 Action(NAME) 48 {} 49 50 AnalysisPairCorrelationAction::~AnalysisPairCorrelationAction() 51 {} 52 53 void AnalysisPairCorrelation(std::vector< element *> &elements, double BinStart, double BinWidth, double BinEnd, string &outputname, string &binoutputname, bool periodic) { 54 ValueStorage::getInstance().setCurrentValue("elements", elements); 55 ValueStorage::getInstance().setCurrentValue("bin-start", BinStart); 56 ValueStorage::getInstance().setCurrentValue("bin-width", BinWidth); 57 ValueStorage::getInstance().setCurrentValue("bin-end", BinEnd); 58 ValueStorage::getInstance().setCurrentValue("output-file", outputname); 59 ValueStorage::getInstance().setCurrentValue("bin-output-file", binoutputname); 60 ValueStorage::getInstance().setCurrentValue("periodic", periodic); 61 ActionRegistry::getInstance().getActionByName(AnalysisPairCorrelationAction::NAME)->call(Action::NonInteractive); 62 }; 63 64 65 void AnalysisPairCorrelationAction::getParametersfromValueStorage() 66 {}; 67 68 Dialog* AnalysisPairCorrelationAction::fillDialog(Dialog* dialog) { 69 ASSERT(dialog,"No Dialog given when filling action dialog"); 70 71 dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements")); 72 dialog->queryDouble("bin-start", ValueStorage::getInstance().getDescription("bin-start")); 73 dialog->queryDouble("bin-width", ValueStorage::getInstance().getDescription("bin-width")); 74 dialog->queryDouble("bin-end", ValueStorage::getInstance().getDescription("bin-end")); 75 dialog->queryString("output-file", ValueStorage::getInstance().getDescription("output-file")); 76 dialog->queryString("bin-output-file", ValueStorage::getInstance().getDescription("bin-output-file")); 77 dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic")); 78 79 return dialog; 80 } 81 44 /** =========== define the function ====================== */ 82 45 Action::state_ptr AnalysisPairCorrelationAction::performCall() { 83 46 int ranges[3] = {1, 1, 1}; 84 double BinEnd = 0.;85 double BinStart = 0.;86 double BinWidth = 0.;87 string outputname;88 string binoutputname;89 bool periodic;90 47 ofstream output; 91 48 ofstream binoutput; 92 std::vector<const element *> elements;93 49 string type; 94 Vector Point;95 50 BinPairMap *binmap = NULL; 96 51 97 52 // obtain information 98 ValueStorage::getInstance().queryCurrentValue("elements", elements); 99 ValueStorage::getInstance().queryCurrentValue("bin-start", BinStart); 100 ValueStorage::getInstance().queryCurrentValue("bin-width", BinWidth); 101 ValueStorage::getInstance().queryCurrentValue("bin-end", BinEnd); 102 ValueStorage::getInstance().queryCurrentValue("output-file", outputname); 103 ValueStorage::getInstance().queryCurrentValue("bin-output-file", binoutputname); 104 ValueStorage::getInstance().queryCurrentValue("periodic", periodic); 53 getParametersfromValueStorage(); 105 54 106 55 // execute action 107 output.open( outputname.c_str());108 binoutput.open( binoutputname.c_str());56 output.open(params.outputname.c_str()); 57 binoutput.open(params.binoutputname.c_str()); 109 58 PairCorrelationMap *correlationmap = NULL; 110 59 std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules(); 111 if (p eriodic)112 correlationmap = PeriodicPairCorrelation(molecules, elements, ranges);60 if (params.periodic) 61 correlationmap = PeriodicPairCorrelation(molecules, params.elements, ranges); 113 62 else 114 correlationmap = PairCorrelation(molecules, elements);63 correlationmap = PairCorrelation(molecules, params.elements); 115 64 OutputPairCorrelation(&output, correlationmap); 116 binmap = BinData( correlationmap, BinWidth, BinStart,BinEnd );65 binmap = BinData( correlationmap, params.BinWidth, params.BinStart, params.BinEnd ); 117 66 OutputCorrelation ( &binoutput, binmap ); 118 67 delete(binmap); … … 142 91 return NAME; 143 92 } 93 /** =========== end of function ====================== */ -
src/Actions/AnalysisAction/PairCorrelationAction.hpp
r0b2ce9 r9ee38b 15 15 16 16 #include "Actions/Action.hpp" 17 #include <string>18 #include <vector>19 17 20 class element; 21 22 void AnalysisPairCorrelation(std::vector< element *> &elements, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic); 23 24 class AnalysisPairCorrelationAction : public Action { 25 friend void AnalysisPairCorrelation(std::vector< element *> &elements, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic); 26 public: 27 AnalysisPairCorrelationAction(); 28 virtual ~AnalysisPairCorrelationAction(); 29 30 bool canUndo(); 31 bool shouldUndo(); 32 33 virtual const std::string getName(); 34 protected: 35 virtual Dialog * fillDialog(Dialog*); 36 private: 37 virtual void getParametersfromValueStorage(); 38 virtual Action::state_ptr performCall(); 39 virtual Action::state_ptr performUndo(Action::state_ptr); 40 virtual Action::state_ptr performRedo(Action::state_ptr); 41 42 static const char NAME[]; 43 }; 18 #include "PairCorrelationAction.def" 19 #include "Action_impl_header.hpp" 44 20 45 21 #endif /* PAIRCORRELATIONACTION_HPP_ */ -
src/Actions/AnalysisAction/PointCorrelationAction.cpp
r0b2ce9 r9ee38b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/AnalysisAction/PointCorrelationAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "analysis_correlation.hpp" 25 23 #include "boundary.hpp" … … 39 37 using namespace std; 40 38 41 #include "UIElements/UIFactory.hpp" 42 #include "UIElements/Dialog.hpp" 43 #include "Actions/ValueStorage.hpp" 39 #include "Actions/AnalysisAction/PointCorrelationAction.hpp" 44 40 45 const char AnalysisPointCorrelationAction::NAME[] = "point-correlation";46 41 47 AnalysisPointCorrelationAction::AnalysisPointCorrelationAction() : 48 Action(NAME) 49 {} 42 // and construct the stuff 43 #include "PointCorrelationAction.def" 44 #include "Action_impl_pre.hpp" 50 45 51 AnalysisPointCorrelationAction::~AnalysisPointCorrelationAction() 52 {} 53 54 void AnalysisPointCorrelation(std::vector< element *> &elements, Vector &position, double BinStart, double BinWidth, double BinEnd, string &outputname, string &binoutputname, bool periodic) { 55 ValueStorage::getInstance().setCurrentValue("elements", elements); 56 ValueStorage::getInstance().setCurrentValue("position", position); 57 ValueStorage::getInstance().setCurrentValue("bin-start", BinStart); 58 ValueStorage::getInstance().setCurrentValue("bin-width", BinWidth); 59 ValueStorage::getInstance().setCurrentValue("bin-end", BinEnd); 60 ValueStorage::getInstance().setCurrentValue("output-file", outputname); 61 ValueStorage::getInstance().setCurrentValue("bin-output-file", binoutputname); 62 ValueStorage::getInstance().setCurrentValue("periodic", periodic); 63 ActionRegistry::getInstance().getActionByName(AnalysisPointCorrelationAction::NAME)->call(Action::NonInteractive); 64 }; 65 66 void AnalysisPointCorrelationAction::getParametersfromValueStorage() 67 {}; 68 69 Dialog* AnalysisPointCorrelationAction::fillDialog(Dialog *dialog) { 70 ASSERT(dialog,"No Dialog given when filling action dialog"); 71 72 dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position")); 73 dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements")); 74 dialog->queryDouble("bin-start", ValueStorage::getInstance().getDescription("bin-start")); 75 dialog->queryDouble("bin-width", ValueStorage::getInstance().getDescription("bin-width")); 76 dialog->queryDouble("bin-end", ValueStorage::getInstance().getDescription("bin-end")); 77 dialog->queryString("output-file", ValueStorage::getInstance().getDescription("output-file")); 78 dialog->queryString("bin-output-file", ValueStorage::getInstance().getDescription("bin-output-file")); 79 dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic")); 80 81 return dialog; 82 } 83 46 /** =========== define the function ====================== */ 84 47 Action::state_ptr AnalysisPointCorrelationAction::performCall() { 85 48 int ranges[3] = {1, 1, 1}; 86 double BinEnd = 0.;87 double BinStart = 0.;88 double BinWidth = 0.;89 string outputname;90 string binoutputname;91 bool periodic;92 49 ofstream output; 93 50 ofstream binoutput; 94 std::vector<const element *> elements;95 51 string type; 96 Vector Point;97 52 BinPairMap *binmap = NULL; 98 53 99 54 // obtain information 100 ValueStorage::getInstance().queryCurrentValue("position", Point); 101 ValueStorage::getInstance().queryCurrentValue("elements", elements); 102 ValueStorage::getInstance().queryCurrentValue("bin-start", BinStart); 103 ValueStorage::getInstance().queryCurrentValue("bin-width", BinWidth); 104 ValueStorage::getInstance().queryCurrentValue("bin-end", BinEnd); 105 ValueStorage::getInstance().queryCurrentValue("output-file", outputname); 106 ValueStorage::getInstance().queryCurrentValue("bin-output-file", binoutputname); 107 ValueStorage::getInstance().queryCurrentValue("periodic", periodic); 55 getParametersfromValueStorage(); 108 56 109 57 // execute action 110 output.open( outputname.c_str());111 binoutput.open( binoutputname.c_str());112 cout << "Point to correlate to is " << Point << endl;58 output.open(params.outputname.c_str()); 59 binoutput.open(params.binoutputname.c_str()); 60 cout << "Point to correlate to is " << params.Point << endl; 113 61 CorrelationToPointMap *correlationmap = NULL; 114 for(std::vector<const element *>::iterator iter = elements.begin(); iter !=elements.end(); ++iter)62 for(std::vector<const element *>::iterator iter = params.elements.begin(); iter != params.elements.end(); ++iter) 115 63 cout << "element is " << (*iter)->getSymbol() << endl; 116 64 std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules(); 117 if (p eriodic)118 correlationmap = PeriodicCorrelationToPoint(molecules, elements, &Point, ranges);65 if (params.periodic) 66 correlationmap = PeriodicCorrelationToPoint(molecules, params.elements, ¶ms.Point, ranges); 119 67 else 120 correlationmap = CorrelationToPoint(molecules, elements, &Point);68 correlationmap = CorrelationToPoint(molecules, params.elements, ¶ms.Point); 121 69 OutputCorrelationToPoint(&output, correlationmap); 122 binmap = BinData( correlationmap, BinWidth, BinStart,BinEnd );70 binmap = BinData( correlationmap, params.BinWidth, params.BinStart, params.BinEnd ); 123 71 OutputCorrelation ( &binoutput, binmap ); 124 72 delete(binmap); … … 148 96 return NAME; 149 97 } 98 /** =========== end of function ====================== */ -
src/Actions/AnalysisAction/PointCorrelationAction.hpp
r0b2ce9 r9ee38b 15 15 16 16 #include "Actions/Action.hpp" 17 #include "LinearAlgebra/Vector.hpp"18 #include <vector>19 #include <string>20 17 21 class element; 22 23 void AnalysisPointCorrelation(std::vector< element *> &elements, Vector &position, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic); 24 25 class AnalysisPointCorrelationAction : public Action { 26 friend void AnalysisPointCorrelation(std::vector< element *> &elements, Vector &position, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic); 27 28 public: 29 AnalysisPointCorrelationAction(); 30 virtual ~AnalysisPointCorrelationAction(); 31 32 bool canUndo(); 33 bool shouldUndo(); 34 35 virtual const std::string getName(); 36 protected: 37 virtual Dialog * fillDialog(Dialog*); 38 private: 39 virtual void getParametersfromValueStorage(); 40 virtual Action::state_ptr performCall(); 41 virtual Action::state_ptr performUndo(Action::state_ptr); 42 virtual Action::state_ptr performRedo(Action::state_ptr); 43 44 static const char NAME[]; 45 }; 18 #include "PointCorrelationAction.def" 19 #include "Action_impl_header.hpp" 46 20 47 21 #endif /* POINTCORRELATIONACTION_HPP_ */ -
src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
r0b2ce9 r9ee38b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "Helpers/Log.hpp" 25 23 #include "Helpers/Verbose.hpp" … … 34 32 using namespace std; 35 33 36 #include "UIElements/UIFactory.hpp" 37 #include "UIElements/Dialog.hpp" 38 #include "Actions/ValueStorage.hpp" 34 #include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp" 39 35 40 const char AnalysisPrincipalAxisSystemAction::NAME[] = "principal-axis-system"; 36 // and construct the stuff 37 #include "PrincipalAxisSystemAction.def" 38 #include "Action_impl_pre.hpp" 41 39 42 AnalysisPrincipalAxisSystemAction::AnalysisPrincipalAxisSystemAction() : 43 Action(NAME) 44 {} 45 46 AnalysisPrincipalAxisSystemAction::~AnalysisPrincipalAxisSystemAction() 47 {} 48 49 void AnalysisPrincipalAxisSystem() { 50 ActionRegistry::getInstance().getActionByName(AnalysisPrincipalAxisSystemAction::NAME)->call(Action::NonInteractive); 51 }; 52 53 void AnalysisPrincipalAxisSystemAction::getParametersfromValueStorage() 54 {}; 55 56 Dialog* AnalysisPrincipalAxisSystemAction::fillDialog(Dialog *dialog) { 57 ASSERT(dialog,"No Dialog given when filling action dialog"); 58 59 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); 60 61 return dialog; 62 } 63 40 /** =========== define the function ====================== */ 64 41 Action::state_ptr AnalysisPrincipalAxisSystemAction::performCall() { 65 molecule *mol = NULL;66 42 Matrix InertiaTensor; 67 43 68 ValueStorage::getInstance().queryCurrentValue(NAME, mol);69 44 DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl); 70 45 for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) { … … 115 90 return NAME; 116 91 } 92 /** =========== end of function ====================== */ -
src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
r0b2ce9 r9ee38b 11 11 #include "Actions/Action.hpp" 12 12 13 void AnalysisPrincipalAxisSystem(); 14 15 class AnalysisPrincipalAxisSystemAction : public Action { 16 friend void AnalysisPrincipalAxisSystem(); 17 18 public: 19 AnalysisPrincipalAxisSystemAction(); 20 virtual ~AnalysisPrincipalAxisSystemAction(); 21 22 bool canUndo(); 23 bool shouldUndo(); 24 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *); 28 private: 29 virtual void getParametersfromValueStorage(); 30 virtual Action::state_ptr performCall(); 31 virtual Action::state_ptr performUndo(Action::state_ptr); 32 virtual Action::state_ptr performRedo(Action::state_ptr); 33 34 static const char NAME[]; 35 }; 13 #include "PrincipalAxisSystemAction.def" 14 #include "Action_impl_header.hpp" 36 15 37 16 #endif /* PRINCIPALAXISSYSTEMACTION_HPP_ */ -
src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp
r0b2ce9 r9ee38b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/AnalysisAction/SurfaceCorrelationAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "analysis_correlation.hpp" 25 23 #include "boundary.hpp" … … 39 37 using namespace std; 40 38 41 #include "UIElements/UIFactory.hpp" 42 #include "UIElements/Dialog.hpp" 43 #include "Actions/ValueStorage.hpp" 39 #include "Actions/AnalysisAction/SurfaceCorrelationAction.hpp" 44 40 45 const char AnalysisSurfaceCorrelationAction::NAME[] = "surface-correlation"; 41 // and construct the stuff 42 #include "SurfaceCorrelationAction.def" 43 #include "Action_impl_pre.hpp" 46 44 47 AnalysisSurfaceCorrelationAction::AnalysisSurfaceCorrelationAction() : 48 Action(NAME) 49 {} 50 51 AnalysisSurfaceCorrelationAction::~AnalysisSurfaceCorrelationAction() 52 {} 53 54 void AnalysisSurfaceCorrelation(std::vector< element *> &elements, molecule *mol, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic) { 55 ValueStorage::getInstance().setCurrentValue("elements", elements); 56 ValueStorage::getInstance().setCurrentValue("molecule-by-id", mol); 57 ValueStorage::getInstance().setCurrentValue("bin-start", BinStart); 58 ValueStorage::getInstance().setCurrentValue("bin-width", BinWidth); 59 ValueStorage::getInstance().setCurrentValue("bin-end", BinEnd); 60 ValueStorage::getInstance().setCurrentValue("output-file", outputname); 61 ValueStorage::getInstance().setCurrentValue("bin-output-file", binoutputname); 62 ValueStorage::getInstance().setCurrentValue("periodic", periodic); 63 ActionRegistry::getInstance().getActionByName(AnalysisSurfaceCorrelationAction::NAME)->call(Action::NonInteractive); 64 }; 65 66 67 void AnalysisSurfaceCorrelationAction::getParametersfromValueStorage() 68 {}; 69 70 Dialog* AnalysisSurfaceCorrelationAction::fillDialog(Dialog *dialog) { 71 ASSERT(dialog,"No Dialog given when filling action dialog"); 72 73 dialog->queryMolecule("molecule-by-id", ValueStorage::getInstance().getDescription("molecule-by-id")); 74 dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements")); 75 dialog->queryDouble("bin-start", ValueStorage::getInstance().getDescription("bin-start")); 76 dialog->queryDouble("bin-width", ValueStorage::getInstance().getDescription("bin-width")); 77 dialog->queryDouble("bin-end", ValueStorage::getInstance().getDescription("bin-end")); 78 dialog->queryString("output-file", ValueStorage::getInstance().getDescription("output-file")); 79 dialog->queryString("bin-output-file", ValueStorage::getInstance().getDescription("bin-output-file")); 80 dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic")); 81 82 return dialog; 83 } 84 45 /** =========== define the function ====================== */ 85 46 Action::state_ptr AnalysisSurfaceCorrelationAction::performCall() { 86 47 int ranges[3] = {1, 1, 1}; 87 double BinEnd = 0.;88 double BinStart = 0.;89 double BinWidth = 0.;90 molecule *Boundary = NULL;91 string outputname;92 string binoutputname;93 bool periodic;94 48 ofstream output; 95 49 ofstream binoutput; 96 std::vector<const element *> elements;97 50 string type; 98 Vector Point;99 51 BinPairMap *binmap = NULL; 100 52 101 53 // obtain information 102 ValueStorage::getInstance().queryCurrentValue("molecule-by-id", Boundary); 103 ValueStorage::getInstance().queryCurrentValue("elements", elements); 104 ValueStorage::getInstance().queryCurrentValue("bin-start", BinStart); 105 ValueStorage::getInstance().queryCurrentValue("bin-width", BinWidth); 106 ValueStorage::getInstance().queryCurrentValue("bin-end", BinEnd); 107 ValueStorage::getInstance().queryCurrentValue("output-file", outputname); 108 ValueStorage::getInstance().queryCurrentValue("bin-output-file", binoutputname); 109 ValueStorage::getInstance().queryCurrentValue("periodic", periodic); 54 getParametersfromValueStorage(); 110 55 111 56 // execute action 112 output.open( outputname.c_str());113 binoutput.open( binoutputname.c_str());114 ASSERT( Boundary != NULL, "No molecule specified for SurfaceCorrelation.");57 output.open(params.outputname.c_str()); 58 binoutput.open(params.binoutputname.c_str()); 59 ASSERT(params.Boundary != NULL, "No molecule specified for SurfaceCorrelation."); 115 60 const double radius = 4.; 116 61 double LCWidth = 20.; 117 if ( BinEnd > 0) {118 if ( BinEnd > 2.*radius)119 LCWidth = BinEnd;62 if (params.BinEnd > 0) { 63 if (params.BinEnd > 2.*radius) 64 LCWidth = params.BinEnd; 120 65 else 121 66 LCWidth = 2.*radius; … … 128 73 std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules(); 129 74 std::cout << "There are " << molecules.size() << " selected molecules." << std::endl; 130 LCList = new LinkedCell( Boundary, LCWidth);131 FindNonConvexBorder( Boundary, TesselStruct, LCList, radius, NULL);75 LCList = new LinkedCell(params.Boundary, LCWidth); 76 FindNonConvexBorder(params.Boundary, TesselStruct, LCList, radius, NULL); 132 77 CorrelationToSurfaceMap *surfacemap = NULL; 133 if (p eriodic)134 surfacemap = PeriodicCorrelationToSurface( molecules, elements, TesselStruct, LCList, ranges);78 if (params.periodic) 79 surfacemap = PeriodicCorrelationToSurface( molecules, params.elements, TesselStruct, LCList, ranges); 135 80 else 136 surfacemap = CorrelationToSurface( molecules, elements, TesselStruct, LCList);81 surfacemap = CorrelationToSurface( molecules, params.elements, TesselStruct, LCList); 137 82 delete LCList; 138 83 OutputCorrelationToSurface(&output, surfacemap); … … 144 89 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl); 145 90 } 146 binmap = BinData( surfacemap, BinWidth, BinStart,BinEnd );91 binmap = BinData( surfacemap, params.BinWidth, params.BinStart, params.BinEnd ); 147 92 OutputCorrelation ( &binoutput, binmap ); 148 93 delete TesselStruct; // surfacemap contains refs to triangles! delete here, not earlier! … … 173 118 return NAME; 174 119 } 120 /** =========== end of function ====================== */ -
src/Actions/AnalysisAction/SurfaceCorrelationAction.hpp
r0b2ce9 r9ee38b 10 10 11 11 #include "Actions/Action.hpp" 12 #include <string>13 #include <vector>14 12 15 class element; 16 class molecule; 17 18 void AnalysisSurfaceCorrelation(std::vector< element *> &elements, molecule *mol, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic); 19 20 class AnalysisSurfaceCorrelationAction : public Action { 21 friend void AnalysisSurfaceCorrelation(std::vector< element *> &elements, molecule *mol, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic); 22 public: 23 AnalysisSurfaceCorrelationAction(); 24 virtual ~AnalysisSurfaceCorrelationAction(); 25 26 bool canUndo(); 27 bool shouldUndo(); 28 29 virtual const std::string getName(); 30 protected: 31 virtual Dialog * fillDialog(Dialog*); 32 private: 33 virtual void getParametersfromValueStorage(); 34 virtual Action::state_ptr performCall(); 35 virtual Action::state_ptr performUndo(Action::state_ptr); 36 virtual Action::state_ptr performRedo(Action::state_ptr); 37 38 static const char NAME[]; 39 }; 13 #include "SurfaceCorrelationAction.def" 14 #include "Action_impl_header.hpp" 40 15 41 16 #endif /* SURFACECORRELATIONACTION_HPP_ */ -
src/Actions/Makefile.am
r0b2ce9 r9ee38b 200 200 lib_LTLIBRARIES = libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 201 201 libMolecuilderActions_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 202 libMolecuilderActions_libs = ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la 202 libMolecuilderActions_libs = \ 203 ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \ 204 ../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la 203 205 nobase_libMolecuilderActions_include_HEADERS = ${ACTIONSHEADER} 204 206 -
src/Makefile.am
r0b2ce9 r9ee38b 324 324 joiner_SOURCES = joiner.cpp datacreator.cpp datacreator.hpp periodentafel.hpp 325 325 joiner_LDADD = \ 326 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 326 327 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 327 328 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ … … 336 337 analyzer_SOURCES = analyzer.cpp datacreator.cpp periodentafel.hpp datacreator.hpp 337 338 analyzer_LDADD = \ 339 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 338 340 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 339 341 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ -
src/UIElements/Dialog.cpp
r0b2ce9 r9ee38b 25 25 #include "Helpers/Verbose.hpp" 26 26 #include "atom.hpp" 27 #include "Box.hpp" 27 28 #include "element.hpp" 28 29 #include "molecule.hpp" 29 30 #include "LinearAlgebra/Vector.hpp" 30 31 #include "LinearAlgebra/Matrix.hpp" 31 #include "Box.hpp"32 32 33 33 using namespace std; … … 84 84 } 85 85 86 template <> void Dialog::query<void *>(const char *token, std::string description) 87 { 88 queryEmpty(token, description); 89 } 90 91 template <> void Dialog::query<bool>(const char *token, std::string description) 92 { 93 queryBoolean(token, description); 94 } 95 96 template <> void Dialog::query<int>(const char *token, std::string description) 97 { 98 queryInt(token, description); 99 } 100 101 template <> void Dialog::query< std::vector<int> >(const char *token, std::string description) 102 { 103 queryInts(token, description); 104 } 105 106 template <> void Dialog::query<double>(const char *token, std::string description) 107 { 108 queryDouble(token, description); 109 } 110 111 template <> void Dialog::query< std::vector<double> >(const char *token, std::string description) 112 { 113 queryDoubles(token, description); 114 } 115 116 template <> void Dialog::query<std::string>(const char *token, std::string description) 117 { 118 queryString(token, description); 119 } 120 121 template <> void Dialog::query< std::vector<std::string> >(const char *token, std::string description) 122 { 123 queryStrings(token, description); 124 } 125 126 template <> void Dialog::query<atom *>(const char *token, std::string description) 127 { 128 queryAtom(token, description); 129 } 130 131 template <> void Dialog::query< std::vector<atom *> >(const char *token, std::string description) 132 { 133 queryAtoms(token, description); 134 } 135 136 template <> void Dialog::query<molecule *>(const char *token, std::string description) 137 { 138 queryMolecule(token, description); 139 } 140 141 template <> void Dialog::query< std::vector<molecule *> >(const char *token, std::string description) 142 { 143 queryMolecules(token, description); 144 } 145 146 template <> void Dialog::query<Vector>(const char *token, std::string description) 147 { 148 queryVector(token, false, description); 149 } 150 151 template <> void Dialog::query< std::vector<Vector> >(const char *token, std::string description) 152 { 153 queryVectors(token, false, description); 154 } 155 156 template <> void Dialog::query<Box>(const char *token, std::string description) 157 { 158 queryBox(token, description); 159 } 160 161 template <> void Dialog::query<const element *>(const char *token, std::string description) 162 { 163 queryElement(token, description); 164 } 165 166 template <> void Dialog::query< std::vector<const element *> >(const char *token, std::string description) 167 { 168 queryElements(token, description); 169 } 170 86 171 /****************** Query types Infrastructure **************************/ 87 172 -
src/UIElements/Dialog.hpp
r0b2ce9 r9ee38b 37 37 Dialog(); 38 38 virtual ~Dialog(); 39 40 template <class T> void query(const char *, std::string = ""); 39 41 40 42 virtual void queryEmpty(const char *, std::string = "")=0; -
src/UIElements/QT4/QTDialog.cpp
r0b2ce9 r9ee38b 98 98 /************************** Query Infrastructure ************************/ 99 99 100 void QTDialog::queryEmpty(c har const*,string){100 void QTDialog::queryEmpty(const char*, std::string){ 101 101 // TODO 102 102 ASSERT(false, "Not implemented yet"); 103 103 } 104 104 105 void QTDialog::queryBoolean(c har const*,string){105 void QTDialog::queryBoolean(const char*,string){ 106 106 // TODO 107 107 ASSERT(false, "Not implemented yet"); 108 108 } 109 109 110 void QTDialog::queryAtom(c har const*,string){110 void QTDialog::queryAtom(const char*, std::string){ 111 111 // TODO 112 112 ASSERT(false, "Not implemented yet"); 113 113 } 114 114 115 void QTDialog::queryAtoms(c har const*,string){115 void QTDialog::queryAtoms(const char*, std::string){ 116 116 // TODO 117 117 ASSERT(false, "Not implemented yet"); 118 118 } 119 119 120 void QTDialog::queryBox(c har const*,string){120 void QTDialog::queryBox(const char*, std::string){ 121 121 // TODO 122 122 ASSERT(false, "Not implemented yet"); … … 172 172 } 173 173 174 void QTDialog::queryElement(const char* title, st ring){174 void QTDialog::queryElement(const char* title, std::string){ 175 175 registerQuery(new ElementQTQuery(title,inputLayout,this)); 176 176 } 177 177 178 void QTDialog::queryElements(const char* title, st ring){178 void QTDialog::queryElements(const char* title, std::string){ 179 179 // TODO 180 180 ASSERT(false, "Not implemented yet"); … … 353 353 } 354 354 355 // All values besides the empty st ring are valid355 // All values besides the empty std::string are valid 356 356 bool QTDialog::StringQTQuery::handle() 357 357 { … … 400 400 } 401 401 402 // All values besides the empty st ring are valid402 // All values besides the empty std::string are valid 403 403 bool QTDialog::StringsQTQuery::handle() 404 404 { 405 405 // dissect by "," 406 st ring::iterator olditer = temp.begin();406 std::string::iterator olditer = temp.begin(); 407 407 for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) { 408 408 if (*iter == ' ') { … … 429 429 iter != molecules.end(); 430 430 ++iter) { 431 st ringstream sstr;431 std::stringstream sstr; 432 432 sstr << (*iter)->IndexNr << "\t" << (*iter)->getName(); 433 433 inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr)); … … 465 465 iter != molecules.end(); 466 466 ++iter) { 467 st ringstream sstr;467 std::stringstream sstr; 468 468 sstr << (*iter)->IndexNr << "\t" << (*iter)->getName(); 469 469 inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr)); … … 565 565 ++iter) 566 566 { 567 st ringstream sstr;567 std::stringstream sstr; 568 568 sstr << (*iter).first << "\t" << (*iter).second->getName(); 569 569 inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first)); … … 600 600 ++iter) 601 601 { 602 st ringstream sstr;602 std::stringstream sstr; 603 603 sstr << (*iter).first << "\t" << (*iter).second->getName(); 604 604 inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first)); -
src/UIElements/TextUI/TextDialog.cpp
r0b2ce9 r9ee38b 57 57 } 58 58 59 60 void TextDialog::queryEmpty(const char* title, string description){ 59 void TextDialog::queryEmpty(const char* title, std::string description){ 61 60 registerQuery(new EmptyTextQuery(title,description)); 62 61 } 63 62 64 void TextDialog::queryBoolean(const char* title, st ring description){63 void TextDialog::queryBoolean(const char* title, std::string description){ 65 64 registerQuery(new BooleanTextQuery(title,description)); 66 65 } 67 66 68 void TextDialog::queryInt(const char* title, st ring description){67 void TextDialog::queryInt(const char* title, std::string description){ 69 68 registerQuery(new IntTextQuery(title,description)); 70 69 } 71 70 72 void TextDialog::queryInts(const char* title, st ring description){71 void TextDialog::queryInts(const char* title, std::string description){ 73 72 registerQuery(new IntsTextQuery(title,description)); 74 73 } 75 74 76 void TextDialog::queryDouble(const char* title, st ring description){75 void TextDialog::queryDouble(const char* title, std::string description){ 77 76 registerQuery(new DoubleTextQuery(title,description)); 78 77 } 79 78 80 void TextDialog::queryDoubles(const char* title, st ring description){79 void TextDialog::queryDoubles(const char* title, std::string description){ 81 80 registerQuery(new DoublesTextQuery(title,description)); 82 81 } 83 82 84 void TextDialog::queryString(const char* title, st ring description){83 void TextDialog::queryString(const char* title, std::string description){ 85 84 registerQuery(new StringTextQuery(title,description)); 86 85 } 87 86 88 void TextDialog::queryStrings(const char* title, st ring description){87 void TextDialog::queryStrings(const char* title, std::string description){ 89 88 registerQuery(new StringsTextQuery(title,description)); 90 89 } 91 90 92 void TextDialog::queryAtom(const char* title, st ring description) {91 void TextDialog::queryAtom(const char* title, std::string description) { 93 92 registerQuery(new AtomTextQuery(title,description)); 94 93 } 95 94 96 void TextDialog::queryAtoms(const char* title, st ring description) {95 void TextDialog::queryAtoms(const char* title, std::string description) { 97 96 registerQuery(new AtomsTextQuery(title,description)); 98 97 } 99 98 100 void TextDialog::queryMolecule(const char* title, st ring description) {99 void TextDialog::queryMolecule(const char* title, std::string description) { 101 100 registerQuery(new MoleculeTextQuery(title,description)); 102 101 } 103 102 104 void TextDialog::queryMolecules(const char* title, st ring description) {103 void TextDialog::queryMolecules(const char* title, std::string description) { 105 104 registerQuery(new MoleculesTextQuery(title,description)); 106 105 } 107 106 108 void TextDialog::queryVector(const char* title, bool check, st ring description) {107 void TextDialog::queryVector(const char* title, bool check, std::string description) { 109 108 registerQuery(new VectorTextQuery(title,check,description)); 110 109 } 111 110 112 void TextDialog::queryVectors(const char* title, bool check, st ring description) {111 void TextDialog::queryVectors(const char* title, bool check, std::string description) { 113 112 registerQuery(new VectorsTextQuery(title,check,description)); 114 113 } 115 114 116 void TextDialog::queryBox(const char* title, st ring description) {115 void TextDialog::queryBox(const char* title, std::string description) { 117 116 registerQuery(new BoxTextQuery(title,description)); 118 117 } 119 118 120 void TextDialog::queryElement(const char* title, st ring description){119 void TextDialog::queryElement(const char* title, std::string description){ 121 120 registerQuery(new ElementTextQuery(title,description)); 122 121 } 123 122 124 void TextDialog::queryElements(const char* title, st ring description){123 void TextDialog::queryElements(const char* title, std::string description){ 125 124 registerQuery(new ElementsTextQuery(title,description)); 126 125 } … … 174 173 getline(cin,line); 175 174 // dissect by " " 176 st ring::iterator olditer = line.begin();175 std::string::iterator olditer = line.begin(); 177 176 for(string::iterator iter = line.begin(); iter != line.end(); ++iter) { 178 177 if (*iter == ' ') { … … 243 242 getline(cin,temp); 244 243 // dissect by " " 245 st ring::iterator olditer = temp.begin();244 std::string::iterator olditer = temp.begin(); 246 245 for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) { 247 246 if (*iter == ' ') { … … 291 290 getline(cin,line); 292 291 // dissect by " " 293 st ring::iterator olditer = line.begin();292 std::string::iterator olditer = line.begin(); 294 293 for(string::iterator iter = line.begin(); iter != line.end(); ++iter) { 295 294 if (*iter == ' ') { … … 354 353 getline(cin,line); 355 354 // dissect by " " 356 st ring::iterator olditer = line.begin();355 std::string::iterator olditer = line.begin(); 357 356 for(string::iterator iter = line.begin(); iter != line.end(); ++iter) { 358 357 if (*iter == ' ') { … … 426 425 getline(cin,line); 427 426 // dissect by " " 428 st ring::iterator olditer = line.begin();427 std::string::iterator olditer = line.begin(); 429 428 for(string::iterator iter = line.begin(); iter != line.end(); ++iter) { 430 429 if (*iter == ' ') { … … 473 472 double coord = 0.; 474 473 int counter = 0; 475 st ring::iterator olditer = line.begin();474 std::string::iterator olditer = line.begin(); 476 475 for(string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) { 477 476 if (*iter == ',') { … … 511 510 // dissect by "," 512 511 double coord = 0.; 513 st ring::iterator olditerspace = line.begin();514 st ring::iterator olditercomma = line.begin();512 std::string::iterator olditerspace = line.begin(); 513 std::string::iterator olditercomma = line.begin(); 515 514 int counter = 0; 516 515 for(string::iterator vectoriter = line.begin(); vectoriter != line.end(); ++vectoriter) { … … 608 607 // Try to read as shorthand 609 608 // the last buffer content was not removed, so we read the 610 // same thing again, this time as a st ring611 st ring shorthand;609 // same thing again, this time as a std::string 610 std::string shorthand; 612 611 cin >> shorthand; 613 612 if(!cin.fail()){ … … 649 648 getline(cin,line); 650 649 // dissect by " " 651 st ring::iterator olditer = line.begin();650 std::string::iterator olditer = line.begin(); 652 651 for(string::iterator iter = line.begin(); iter != line.end(); ++iter) { 653 652 if (*iter == ' ') { -
src/unittests/Makefile.am
r0b2ce9 r9ee38b 57 57 ${BOOST_THREAD_LIB} 58 58 ALLLIBS = \ 59 ../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 59 60 ../Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 60 61 ${PARSERLIBS} \
Note:
See TracChangeset
for help on using the changeset viewer.