- Timestamp:
- May 8, 2017, 2:00:47 PM (8 years ago)
- Branches:
- ForceAnnealing_goodresults, ForceAnnealing_tocheck
- Children:
- c8165c
- Parents:
- ce254c (diff), cb6357 (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. - Location:
- src
- Files:
-
- 30 added
- 35 edited
-
Actions/Action_impl_pre.hpp (modified) (1 diff)
-
Actions/CommandAction/HelpAction.cpp (modified) (1 diff)
-
Actions/GeometryAction/GeometryDistanceToVectorAction.cpp (added)
-
Actions/GeometryAction/GeometryDistanceToVectorAction.def (added)
-
Actions/GeometryAction/GeometryDistanceToVectorAction.hpp (added)
-
Actions/GeometryAction/GeometryInputToVectorAction.cpp (added)
-
Actions/GeometryAction/GeometryInputToVectorAction.def (added)
-
Actions/GeometryAction/GeometryInputToVectorAction.hpp (added)
-
Actions/GeometryAction/GeometryPlaneToVectorAction.cpp (added)
-
Actions/GeometryAction/GeometryPlaneToVectorAction.def (added)
-
Actions/GeometryAction/GeometryPlaneToVectorAction.hpp (added)
-
Actions/GeometryAction/GeometryPositionToVectorAction.cpp (added)
-
Actions/GeometryAction/GeometryPositionToVectorAction.def (added)
-
Actions/GeometryAction/GeometryPositionToVectorAction.hpp (added)
-
Actions/GeometryAction/GeometryRemoveAction.cpp (added)
-
Actions/GeometryAction/GeometryRemoveAction.def (added)
-
Actions/GeometryAction/GeometryRemoveAction.hpp (added)
-
Actions/GlobalListOfActions.hpp (modified) (1 diff)
-
Actions/Makefile.am (modified) (4 diffs)
-
Actions/MakroAction_impl_pre.hpp (modified) (1 diff)
-
Actions/Values.cpp (modified) (3 diffs)
-
Actions/Values.hpp (modified) (1 diff)
-
Geometry/GeometryObject.cpp (added)
-
Geometry/GeometryObject.hpp (added)
-
Geometry/GeometryRegistry.cpp (added)
-
Geometry/GeometryRegistry.hpp (added)
-
Geometry/Makefile.am (added)
-
Makefile.am (modified) (1 diff)
-
Parameters/Makefile.am (modified) (6 diffs)
-
Parameters/Parameter.hpp (modified) (3 diffs)
-
Parameters/Parameter_impl.hpp (modified) (4 diffs)
-
Parameters/Specifics/Parameter_vector.cpp (added)
-
Parameters/Specifics/Parameter_vector.hpp (added)
-
Parameters/Specifics/Value_vector.cpp (added)
-
Parameters/Specifics/Value_vector.hpp (added)
-
Parameters/Validators/Specific/GeometryNameValidator.cpp (added)
-
Parameters/Validators/Specific/GeometryNameValidator.hpp (added)
-
Parameters/Validators/Specific/PresentGeometryNameValidator.cpp (added)
-
Parameters/Validators/Specific/PresentGeometryNameValidator.hpp (added)
-
Parameters/Value.hpp (modified) (3 diffs)
-
Parameters/Value_impl.hpp (modified) (2 diffs)
-
Parameters/unittests/Makefile.am (modified) (2 diffs)
-
UIElements/CommandLineUI/CommandLineDialog.hpp (modified) (2 diffs)
-
UIElements/CommandLineUI/CommandLineParser_validate.cpp (modified) (2 diffs)
-
UIElements/CommandLineUI/Query/CommandLineQuery.hpp (modified) (1 diff)
-
UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp (modified) (1 diff)
-
UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp (modified) (2 diffs)
-
UIElements/Dialog.cpp (modified) (1 diff)
-
UIElements/Dialog.hpp (modified) (3 diffs)
-
UIElements/GlobalListOfParameterQueries.hpp (modified) (2 diffs)
-
UIElements/Makefile.am (modified) (3 diffs)
-
UIElements/Menu/MenuDescription.cpp (modified) (3 diffs)
-
UIElements/Qt4/QtDialog.hpp (modified) (2 diffs)
-
UIElements/Qt4/QtMainWindow.cpp (modified) (3 diffs)
-
UIElements/Qt4/QtMainWindow.hpp (modified) (2 diffs)
-
UIElements/Qt4/Query/QtQuery.hpp (modified) (2 diffs)
-
UIElements/Qt4/Query/QtQueryList.hpp (modified) (1 diff)
-
UIElements/Qt4/Query/VectorQtQuery.cpp (modified) (7 diffs)
-
UIElements/TextUI/Query/TextQuery.hpp (modified) (1 diff)
-
UIElements/TextUI/Query/VectorTextQuery.cpp (modified) (1 diff)
-
UIElements/TextUI/Query/VectorsTextQuery.cpp (modified) (2 diffs)
-
UIElements/TextUI/TextDialog.hpp (modified) (2 diffs)
-
UIElements/Views/Qt4/QtGeometryList.cpp (added)
-
UIElements/Views/Qt4/QtGeometryList.hpp (added)
-
cleanUp.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action_impl_pre.hpp
rce254c r73faf4 173 173 output << \ 174 174 BOOST_PP_IF(n, ", ", "") \ 175 << "\"" << toPythonString(params. \175 << "\"" << params. \ 176 176 BOOST_PP_SEQ_ELEM(n, paramreferences) \ 177 .get Unvalidated()) \177 .getAsStringUnvalidated() \ 178 178 << "\""; 179 179 -
src/Actions/CommandAction/HelpAction.cpp
rce254c r73faf4 73 73 std::cout << "\t - List/vector of strings: gives as \"first\" \"second\" \"third\"." << std::endl; 74 74 std::cout << "\t - Vector: give as \"x,y,z\", i.e. its 3 components." << std::endl; 75 std::cout << "\t - or give as \"<name>\", where <name> is a stored geometry name." << std::endl; 75 76 std::cout << "\t - Domain: give as \"xx,yx,yy,zx,zy,zz\", i.e. symmetric 3x3 matrix." << std::endl; 76 77 std::cout << "\t - Path/filename: give as \"<path/filename>\"." << std::endl; -
src/Actions/GlobalListOfActions.hpp
rce254c r73faf4 69 69 (FragmentationStoreSaturatedFragment) \ 70 70 (FragmentationStructuralOptimization) \ 71 (GeometryDistanceToVector) \ 72 (GeometryInputToVector) \ 73 (GeometryPlaneToVector) \ 74 (GeometryPositionToVector) \ 75 (GeometryRemove) \ 71 76 (GraphUpdateMolecules) \ 72 77 (GraphCorrectBondDegree) \ -
src/Actions/Makefile.am
rce254c r73faf4 64 64 ${FILLACTIONSOURCE} \ 65 65 ${FRAGMENTATIONACTIONSOURCE} \ 66 ${GEOMETRYACTIONSOURCE} \ 66 67 ${GRAPHACTIONSOURCE} \ 67 68 ${MOLECULEACTIONSOURCE} \ … … 84 85 ${FILLACTIONHEADER} \ 85 86 ${FRAGMENTATIONACTIONHEADER} \ 87 ${GEOMETRYACTIONHEADER} \ 86 88 ${GRAPHACTIONHEADER} \ 87 89 ${MOLECULEACTIONHEADER} \ … … 104 106 ${FILLACTIONDEFS} \ 105 107 ${FRAGMENTATIONACTIONDEFS} \ 108 ${GEOMETRYACTIONDEFS} \ 106 109 ${GRAPHACTIONDEFS} \ 107 110 ${MOLECULEACTIONDEFS} \ … … 285 288 Actions/FragmentationAction/StoreSaturatedFragmentAction.def \ 286 289 Actions/FragmentationAction/StructuralOptimizationAction.def 290 291 GEOMETRYACTIONSOURCE = \ 292 Actions/GeometryAction/GeometryDistanceToVectorAction.cpp \ 293 Actions/GeometryAction/GeometryInputToVectorAction.cpp \ 294 Actions/GeometryAction/GeometryPlaneToVectorAction.cpp \ 295 Actions/GeometryAction/GeometryPositionToVectorAction.cpp \ 296 Actions/GeometryAction/GeometryRemoveAction.cpp 297 GEOMETRYACTIONHEADER = \ 298 Actions/GeometryAction/GeometryDistanceToVectorAction.hpp \ 299 Actions/GeometryAction/GeometryInputToVectorAction.hpp \ 300 Actions/GeometryAction/GeometryPlaneToVectorAction.hpp \ 301 Actions/GeometryAction/GeometryPositionToVectorAction.hpp \ 302 Actions/GeometryAction/GeometryRemoveAction.hpp 303 GEOMETRYACTIONDEFS = \ 304 Actions/GeometryAction/GeometryDistanceToVectorAction.def \ 305 Actions/GeometryAction/GeometryInputToVectorAction.def \ 306 Actions/GeometryAction/GeometryPlaneToVectorAction.def \ 307 Actions/GeometryAction/GeometryPositionToVectorAction.def \ 308 Actions/GeometryAction/GeometryRemoveAction.def 287 309 288 310 GRAPHACTIONSOURCE = \ -
src/Actions/MakroAction_impl_pre.hpp
rce254c r73faf4 165 165 output << \ 166 166 BOOST_PP_IF(n, ", ", "") \ 167 << "\"" << toPythonString(params. \167 << "\"" << params. \ 168 168 BOOST_PP_SEQ_ELEM(n, paramreferences) \ 169 .get ()) \169 .getAsStringUnvalidated() \ 170 170 << "\""; 171 171 -
src/Actions/Values.cpp
rce254c r73faf4 37 37 #include "CodePatterns/Assert.hpp" 38 38 39 #include <boost/lexical_cast.hpp> 40 #include <boost/tokenizer.hpp> 41 39 42 #include "Box.hpp" 40 43 #include "LinearAlgebra/BoxVector.hpp" … … 44 47 #include "Values.hpp" 45 48 49 static const Vector parseAsVector(const std::string &_string) 50 { 51 Vector temp; 52 // dissect by "," 53 typedef boost::tokenizer<boost::char_separator<char> > tokenizer; 54 boost::char_separator<char> value_separator(",)("); 55 56 bool status = true; 57 tokenizer tokens(_string, value_separator); 58 if (!_string.empty()) { 59 tokenizer::iterator tok_iter = tokens.begin(); 60 for (size_t i=0;i<NDIM;++i) { 61 if (tok_iter == tokens.end()) { 62 status = false; 63 break; 64 } 65 temp[i] = boost::lexical_cast<double>(*(tok_iter++)); 66 } 67 } 68 if (!status) 69 temp.Zero(); 70 71 return temp; 72 } 73 46 74 Vector VectorValue::toVector() const 47 75 { 48 Vector returnVector (vector);76 Vector returnVector = parseAsVector(vectorstring); 49 77 50 78 return returnVector; … … 54 82 { 55 83 BoxVector returnVector; 56 static_cast<Vector>(returnVector) = Vector(vector); // under its hood it's still a Vector84 static_cast<Vector>(returnVector) = parseAsVector(vectorstring); // under its hood it's still a Vector 57 85 58 86 ASSERT(_box.isValid(returnVector), -
src/Actions/Values.hpp
rce254c r73faf4 27 27 * are registered as VectorValue and lateron inside the CommandLineQuery placed 28 28 * into the real vector. 29 * 30 * We use this abstraction also for Geometry Objects, i.e. string names 31 * referencing vectors in the GeomtryRegistry. 29 32 */ 30 33 struct VectorValue 31 34 { 32 double vector[NDIM];35 std::string vectorstring; 33 36 34 37 Vector toVector() const; -
src/Makefile.am
rce254c r73faf4 11 11 # libMolecuilder.la requires the libraries listed below 12 12 13 include Geometry/Makefile.am 13 14 include Helpers/Makefile.am 14 15 include Shapes/Makefile.am -
src/Parameters/Makefile.am
rce254c r73faf4 4 4 5 5 PARAMETERSOURCE = \ 6 Parameters/Specifics/Parameter_vector.cpp \ 6 7 Parameters/Specifics/Value_atom.cpp \ 7 8 Parameters/Specifics/Value_element.cpp \ … … 9 10 Parameters/Specifics/Value_molecule.cpp \ 10 11 Parameters/Specifics/Value_string.cpp \ 12 Parameters/Specifics/Value_vector.cpp \ 11 13 Parameters/Validators/Specific/ActionNameValidator.cpp \ 12 14 Parameters/Validators/Specific/AtomDataValidator.cpp \ … … 17 19 Parameters/Validators/Specific/FileSuffixValidator.cpp \ 18 20 Parameters/Validators/Specific/FormulaValidator.cpp \ 21 Parameters/Validators/Specific/GeometryNameValidator.cpp \ 19 22 Parameters/Validators/Specific/KeyValueValidator.cpp \ 20 23 Parameters/Validators/Specific/MoleculeIdValidator.cpp \ 21 24 Parameters/Validators/Specific/ParserFileValidator.cpp \ 22 25 Parameters/Validators/Specific/ParserTypeValidator.cpp \ 26 Parameters/Validators/Specific/PresentGeometryNameValidator.cpp \ 23 27 Parameters/Validators/Specific/RandomNumberValidators.cpp \ 24 28 Parameters/Validators/Specific/RealSpaceMatrixInvertibleValidator.cpp \ … … 45 49 Parameters/ValueInterface.hpp \ 46 50 Parameters/Specifics/KeyValuePair.hpp \ 51 Parameters/Specifics/Parameter_vector.hpp \ 47 52 Parameters/Specifics/Value_atom.hpp \ 48 53 Parameters/Specifics/Value_element.hpp \ … … 50 55 Parameters/Specifics/Value_molecule.hpp \ 51 56 Parameters/Specifics/Value_string.hpp \ 57 Parameters/Specifics/Value_vector.hpp \ 52 58 Parameters/Validators/DiscreteValidator.hpp \ 53 59 Parameters/Validators/DiscreteValidator_impl.hpp \ … … 74 80 Parameters/Validators/Specific/FileSuffixValidator.hpp \ 75 81 Parameters/Validators/Specific/FormulaValidator.hpp \ 82 Parameters/Validators/Specific/GeometryNameValidator.hpp \ 76 83 Parameters/Validators/Specific/KeyValueValidator.hpp \ 77 84 Parameters/Validators/Specific/MoleculeIdValidator.hpp \ 78 85 Parameters/Validators/Specific/ParserFileValidator.hpp \ 79 86 Parameters/Validators/Specific/ParserTypeValidator.hpp \ 87 Parameters/Validators/Specific/PresentGeometryNameValidator.hpp \ 80 88 Parameters/Validators/Specific/RandomNumberValidators.hpp \ 81 89 Parameters/Validators/Specific/RealSpaceMatrixInvertibleValidator.hpp \ -
src/Parameters/Parameter.hpp
rce254c r73faf4 25 25 class ParameterValueException; 26 26 27 /** This class encapsulates a clon able, continuous value.27 /** This class encapsulates a cloneable, continuous value. 28 28 * 29 29 */ … … 48 48 bool isValidAsString(const std::string &_value) const throw(ParameterValidatorException); 49 49 const std::string getAsString() const throw(ParameterValueException); 50 const std::string getAsStringUnvalidated() const throw(ParameterValueException); 50 51 void setAsString(const std::string &_value) throw(ParameterValueException); 51 52 … … 78 79 }; 79 80 81 #include "Parameters/Specifics/Parameter_vector.hpp" 82 80 83 #include "Parameter_impl.hpp" 81 84 -
src/Parameters/Parameter_impl.hpp
rce254c r73faf4 23 23 value(instance.value.getValidator()) 24 24 { 25 value.set(instance.value. value);25 value.set(instance.value.getUnvalidated()); 26 26 } 27 27 … … 171 171 } 172 172 173 /** Catch call to value.getAsStringUnvalidated() to add exception information. 174 * 175 * @return parameter value as string 176 */ 177 template<typename T> 178 inline const std::string Parameter<T>::getAsStringUnvalidated() const throw(ParameterValueException) 179 { 180 try { 181 return value.getAsStringUnvalidated(); 182 } catch(ParameterException &e) { 183 e << ParameterName(ParameterInterface::getName()); 184 throw; 185 } 186 } 187 173 188 /** Catch call to value.isValid() to add exception information. 174 189 * … … 258 273 try { 259 274 status = status && 260 ( value == _instance.value);275 (getUnvalidated() == _instance.getUnvalidated()); 261 276 status = status && (ParameterInterface::getName() == _instance.ParameterInterface::getName()); 262 277 } catch(ParameterException &e) { … … 276 291 Parameter<T> *instance = new Parameter<T>(ParameterInterface::getName(), value.getValidator()); 277 292 // do not use get, we do not check for validity here 278 if (value. ValueSet)279 instance->set(value. value);293 if (value.isSet()) 294 instance->set(value.getUnvalidated()); 280 295 return instance; 281 296 } -
src/Parameters/Value.hpp
rce254c r73faf4 67 67 friend class ValueTest; 68 68 friend class ContinuousValueTest; 69 friend class Parameter<T>;69 // friend class Parameter<T>; 70 70 public: 71 71 Value(); … … 85 85 bool isValidAsString(const std::string &_value) const throw(ParameterValidatorException); 86 86 const std::string getAsString() const throw(ParameterValueException); 87 const std::string getAsStringUnvalidated() const throw(ParameterValueException); 87 88 void setAsString(const std::string &_value) throw(ParameterException); 88 89 … … 123 124 #include "Specifics/Value_molecule.hpp" 124 125 #include "Specifics/Value_string.hpp" 126 #include "Specifics/Value_vector.hpp" 125 127 126 128 #include "Value_impl.hpp" -
src/Parameters/Value_impl.hpp
rce254c r73faf4 22 22 #include "CodePatterns/Log.hpp" 23 23 24 #include "Actions/toPythonString.hpp" 24 25 #include "Validators/DummyValidator.hpp" 25 26 #include "Validators/DiscreteValidator.hpp" … … 184 185 { 185 186 return toString(get()); 187 } 188 189 /** Getter of unvalidated value, returning string. 190 * 191 * @return string value 192 */ 193 template <class T> 194 inline const std::string Value<T>::getAsStringUnvalidated() const throw(ParameterValueException) 195 { 196 return toPythonString(getUnvalidated()); 186 197 } 187 198 -
src/Parameters/unittests/Makefile.am
rce254c r73faf4 31 31 libUnitTest.la \ 32 32 ../libMolecuilder.la \ 33 ../libMolecuilderParameters.la \ 34 ../libMolecuilderGeometry.la \ 33 35 $(top_builddir)/ThirdParty/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \ 34 36 ${CodePatterns_LIBS} \ … … 47 49 ../Parameters/ValueInterface.hpp 48 50 ContinuousValueTest_LDADD = \ 51 ../libMolecuilderParameters.la \ 52 ../libMolecuilderGeometry.la \ 49 53 $(PARAMETERSLIBS) 50 54 -
src/UIElements/CommandLineUI/CommandLineDialog.hpp
rce254c r73faf4 48 48 #include <boost/preprocessor/facilities/empty.hpp> 49 49 50 virtual void queryVector(Parameter<Vector> &, const std::string ="", const std::string = ""); 51 virtual void queryVectors(Parameter< std::vector<Vector> > &, const std::string ="", const std::string = ""); 52 50 53 // iterate over all parameter query types for query declarations 51 54 #if defined GLOBALLISTOFPARAMETERQUERIES_Token && defined GLOBALLISTOFPARAMETERQUERIES_Type … … 57 60 #undef SUFFIX 58 61 #endif 62 63 class VectorCommandLineQuery; 64 class VectorsCommandLineQuery; 59 65 60 66 // iterate over all parameter query types for forward declarations -
src/UIElements/CommandLineUI/CommandLineParser_validate.cpp
rce254c r73faf4 66 66 std::string("value"), 67 67 std::string("VectorValue") 68 ); 69 #endif 70 } 71 VV.vectorstring = values.at(0); 72 v = boost::any(VectorValue(VV)); 73 } 74 75 void validate(boost::any& v, const std::vector<std::string>& values, RealSpaceMatrixValue *, int) 76 { 77 RealSpaceMatrixValue RSMV; 78 std::vector<std::string> components; 79 80 // split comma-separated values 81 if (values.size() != 1) { 82 std::cerr << "Not one vector but " << values.size() << " given " << std::endl; 83 #if BOOST_VERSION < 104200 84 throw boost::program_options::validation_error("Unequal to one vector given"); 85 #else 86 throw boost::program_options::validation_error( 87 boost::program_options::validation_error::invalid_option_value, 88 std::string("value"), 89 std::string("BoxValue") 68 90 ); 69 91 #endif … … 83 105 components.push_back(std::string(Biter,argument.end())); 84 106 85 if (components.size() != 3) {86 std::cerr << "Specified vector does not have three components but " << components.size() << std::endl;87 #if BOOST_VERSION < 10420088 throw boost::program_options::validation_error("Specified vector does not have three components");89 #else90 throw boost::program_options::validation_error(91 boost::program_options::validation_error::invalid_option_value,92 std::string("value"),93 std::string("VectorValue")94 );95 #endif96 }97 for (size_t i=0;i<NDIM;++i)98 VV.vector[i] = boost::lexical_cast<double>(components.at(i));99 v = boost::any(VectorValue(VV));100 }101 102 void validate(boost::any& v, const std::vector<std::string>& values, RealSpaceMatrixValue *, int)103 {104 RealSpaceMatrixValue RSMV;105 std::vector<std::string> components;106 107 // split comma-separated values108 if (values.size() != 1) {109 std::cerr << "Not one vector but " << values.size() << " given " << std::endl;110 #if BOOST_VERSION < 104200111 throw boost::program_options::validation_error("Unequal to one vector given");112 #else113 throw boost::program_options::validation_error(114 boost::program_options::validation_error::invalid_option_value,115 std::string("value"),116 std::string("BoxValue")117 );118 #endif119 }120 std::string argument(values.at(0));121 std::string::iterator Aiter = argument.begin();122 std::string::iterator Biter = argument.begin();123 for (; Aiter != argument.end(); ++Aiter) {124 if (*Aiter == ',') {125 components.push_back(std::string(Biter,Aiter));126 do {127 Aiter++;128 } while (*Aiter == ' ' || *Aiter == '\t');129 Biter = Aiter;130 }131 }132 components.push_back(std::string(Biter,argument.end()));133 134 107 if (components.size() != 6) { 135 108 std::cerr << "Specified vector does not have three components but " << components.size() << std::endl; -
src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp
rce254c r73faf4 24 24 }; 25 25 26 class CommandLineDialog::VectorCommandLineQuery : public Dialog::TQuery<Vector> { 27 public: 28 VectorCommandLineQuery(Parameter<Vector> &_param, const std::string &_title, const std::string &_description = ""); 29 virtual ~VectorCommandLineQuery(); 30 virtual bool handle(); 31 }; 32 33 class CommandLineDialog::VectorsCommandLineQuery : public Dialog::TQuery< std::vector<Vector> > { 34 public: 35 VectorsCommandLineQuery(Parameter< std::vector<Vector> > &_param, const std::string &_title, const std::string &_description = ""); 36 virtual ~VectorsCommandLineQuery(); 37 virtual bool handle(); 38 }; 39 26 40 /** With the following boost::preprocessor code we generate forward declarations 27 41 * of query class for all desired query types in the Qt specialization class of -
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
rce254c r73faf4 53 53 54 54 bool CommandLineDialog::VectorCommandLineQuery::handle() { 55 VectorValue _temp;55 VectorValue temporary; 56 56 if (CommandLineParser::getInstance().vm.count(getTitle())) { 57 try { 58 _temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 59 } catch(boost::bad_any_cast &e) { 60 for (size_t i=0;i<NDIM;++i) 61 _temp.vector[i] = 0.; 62 return false; 63 } 64 temp = _temp.toVector(); 57 temporary = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 58 temp = temporary.vectorstring; 65 59 return true; 66 60 } -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
rce254c r73faf4 46 46 47 47 CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(Parameter<std::vector<Vector> > &_param, const std::string &_title, const std::string &_description) : 48 Dialog::TQuery< std::vector<Vector> >(_param, _title, _description)48 Dialog::TQuery< std::vector<Vector> >(_param, _title, _description) 49 49 {} 50 50 … … 53 53 54 54 bool CommandLineDialog::VectorsCommandLineQuery::handle() { 55 std::vector<VectorValue> temporary; 55 std::vector<std::string> temporary; 56 std::stringstream output; 56 57 if (CommandLineParser::getInstance().vm.count(getTitle())) { 57 try { 58 temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >(); 59 } catch(boost::bad_any_cast &e) { 60 temporary.clear(); 61 return false; 62 } 63 for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) { 64 Vector temp_element = (*iter).toVector(); 65 temp.push_back(temp_element); 66 } 58 temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >(); 67 59 return true; 68 60 } -
src/UIElements/Dialog.cpp
rce254c r73faf4 134 134 queryEmpty(param, title, description); 135 135 }*/ 136 template <> 137 void Dialog::query<Vector>(Parameter<Vector> ¶m, const std::string title, const std::string description) 138 { 139 queryVector(param, title, description); 140 } 141 template <> 142 void Dialog::query< std::vector<Vector> >(Parameter< std::vector<Vector> > ¶m, const std::string title, const std::string description) 143 { 144 queryVectors(param, title, description); 145 } 146 147 static const std::string concatenateStrings(const std::vector<std::string> &_strings) 148 { 149 std::stringstream output; 150 for (std::vector<std::string>::const_iterator iter = _strings.begin(); 151 iter != _strings.end(); ++iter) 152 output << *iter << " "; 153 return output.str(); 154 } 155 156 bool Dialog::TQuery< std::vector<Vector> >::isValid() 157 { 158 return param.isValidAsString(concatenateStrings(temp)); 159 } 160 void Dialog::TQuery< std::vector<Vector> >::setResult() 161 { 162 param.setAsString(concatenateStrings(temp)); 163 } 136 164 137 165 /** With the following boost::preprocessor code we generate template -
src/UIElements/Dialog.hpp
rce254c r73faf4 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_ */ -
src/UIElements/GlobalListOfParameterQueries.hpp
rce254c r73faf4 28 28 (Molecule) \ 29 29 (Molecules) \ 30 (Vector) \31 (Vectors) \32 30 (RealSpaceMatrix) \ 33 31 (Element) \ … … 52 50 (const molecule *) \ 53 51 (std::vector<const molecule *> ) \ 54 (Vector) \55 (std::vector<Vector> ) \56 52 (RealSpaceMatrix) \ 57 53 (const element *) \ -
src/UIElements/Makefile.am
rce254c r73faf4 190 190 UIElements/Menu/Qt4/QtMenuPipe.cpp \ 191 191 UIElements/Views/Qt4/QtFragmentList.cpp \ 192 UIElements/Views/Qt4/QtGeometryList.cpp \ 192 193 UIElements/Views/Qt4/QtHomologyList.cpp \ 193 194 UIElements/Views/Qt4/QtInfoBox.cpp \ … … 225 226 UIElements/Views/Qt4/MoleculeList/QtObservedMoleculeObserver.hpp \ 226 227 UIElements/Views/Qt4/QtFragmentList.hpp \ 228 UIElements/Views/Qt4/QtGeometryList.hpp \ 227 229 UIElements/Views/Qt4/QtHomologyList.hpp \ 228 230 UIElements/Views/Qt4/QtInfoBox.hpp \ … … 308 310 libMolecuilderParser.la \ 309 311 libMolecuilderParameters.la \ 312 libMolecuilderGeometry.la \ 310 313 libMolecuilderShapes.la \ 311 314 libMolecuilderLinkedCell.la \ -
src/UIElements/Menu/MenuDescription.cpp
rce254c r73faf4 61 61 // put each menu into its place, "" means top level 62 62 MenuPositionMap->insert(std::make_pair("analysis",TopPosition("tools",1))); 63 MenuPositionMap->insert(std::make_pair("atom",TopPosition("edit", 1)));64 MenuPositionMap->insert(std::make_pair("bond",TopPosition("edit", 2)));63 MenuPositionMap->insert(std::make_pair("atom",TopPosition("edit",2))); 64 MenuPositionMap->insert(std::make_pair("bond",TopPosition("edit",3))); 65 65 MenuPositionMap->insert(std::make_pair("command",TopPosition("",3))); 66 66 MenuPositionMap->insert(std::make_pair("edit",TopPosition("",2))); 67 67 MenuPositionMap->insert(std::make_pair("fill",TopPosition("tools",5))); 68 68 MenuPositionMap->insert(std::make_pair("fragmentation",TopPosition("tools",3))); 69 MenuPositionMap->insert(std::make_pair("geometry",TopPosition("edit",5))); 69 70 MenuPositionMap->insert(std::make_pair("graph",TopPosition("tools",4))); 70 MenuPositionMap->insert(std::make_pair("molecule",TopPosition("edit", 3)));71 MenuPositionMap->insert(std::make_pair("molecule",TopPosition("edit",4))); 71 72 MenuPositionMap->insert(std::make_pair("potential",TopPosition("tools",7))); 72 MenuPositionMap->insert(std::make_pair("parser",TopPosition("edit", 4)));73 MenuPositionMap->insert(std::make_pair("selection",TopPosition("edit", 5)));73 MenuPositionMap->insert(std::make_pair("parser",TopPosition("edit",6))); 74 MenuPositionMap->insert(std::make_pair("selection",TopPosition("edit",1))); 74 75 MenuPositionMap->insert(std::make_pair("tesselation",TopPosition("tools",2))); 75 76 MenuPositionMap->insert(std::make_pair("shape",TopPosition("tools",6))); … … 85 86 MenuDescriptionsMap->insert(std::make_pair("fill","Fill")); 86 87 MenuDescriptionsMap->insert(std::make_pair("fragmentation","Fragmentation")); 88 MenuDescriptionsMap->insert(std::make_pair("geometry","Geometry")); 87 89 MenuDescriptionsMap->insert(std::make_pair("graph","Graph")); 88 90 MenuDescriptionsMap->insert(std::make_pair("molecule","Parse files into system")); … … 103 105 MenuNameMap->insert(std::make_pair("fill","Fill")); 104 106 MenuNameMap->insert(std::make_pair("fragmentation","Fragmentation")); 107 MenuNameMap->insert(std::make_pair("geometry","Geometry")); 105 108 MenuNameMap->insert(std::make_pair("graph","Graph")); 106 109 MenuNameMap->insert(std::make_pair("molecule","Molecules")); -
src/UIElements/Qt4/QtDialog.hpp
rce254c r73faf4 36 36 virtual void queryEmpty(const std::string ="", const std::string = ""); 37 37 38 virtual void queryVector(Parameter<Vector> &, const std::string ="", const std::string = ""); 39 virtual void queryVectors(Parameter< std::vector<Vector> > &, const std::string ="", const std::string = ""); 40 38 41 /** With the following boost::preprocessor code we generate virtual function 39 42 * definitions for all desired query types in the abstract class Dialog. … … 64 67 65 68 class EmptyQtQuery; 69 70 class VectorQtQuery; 71 class VectorsQtQuery; 66 72 67 73 /** With the following boost::preprocessor code we generate forward declarations -
src/UIElements/Qt4/QtMainWindow.cpp
rce254c r73faf4 59 59 #include "Views/Qt4/QtHomologyList.hpp" 60 60 #include "UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp" 61 #include "Views/Qt4/QtGeometryList.hpp" 61 62 #include "Views/Qt4/QtLogBox.hpp" 62 63 #include "Views/Qt4/QtShapeController.hpp" … … 112 113 homologyList = new QtHomologyList(worldTab); 113 114 fragmentList = new QtFragmentList(worldTab); 115 geometryList = new QtGeometryList(worldTab); 114 116 logBox = new QtLogBox(std::cout, worldTab); 115 117 errorlogBox = new QtLogBox(std::cerr, worldTab); … … 147 149 worldTab->addTab(fragmentList, "All Fragments"); 148 150 worldTab->addTab(homologyList, "All Homologies"); 151 worldTab->addTab(geometryList, "All Geometries"); 149 152 worldTab->addTab(logBox, "Log"); 150 153 worldTab->addTab(errorlogBox, "Errors"); -
src/UIElements/Qt4/QtMainWindow.hpp
rce254c r73faf4 27 27 class QtElementList; 28 28 class QtFragmentList; 29 class QtGeometryList; 29 30 class QtHomologyList; 30 31 class QtLogBox; … … 60 61 QtMoleculeList *moleculeList; 61 62 QtElementList *elementList; 63 QtGeometryList *geometryList; 62 64 QtHomologyList *homologyList; 63 65 QtFragmentList *fragmentList; -
src/UIElements/Qt4/Query/QtQuery.hpp
rce254c r73faf4 414 414 415 415 public slots: 416 void pageChanged(int); 417 void onUpdateName(int); 416 418 void onUpdateX(double); 417 419 void onUpdateY(double); … … 424 426 QBoxLayout *subLayout; 425 427 QBoxLayout *coordLayout; 426 QLabel *coordLabel;427 428 QDoubleSpinBox *coordInputX; 428 429 QDoubleSpinBox *coordInputY; 429 430 QDoubleSpinBox *coordInputZ; 430 431 Dialog *dialog; 431 }; 432 433 class QtDialog::VectorsQtQuery : public QWidget, public QtQuery<std::vector<Vector> >, public QtQueryList<Vector> { 432 QBoxLayout *nameLayout; 433 QComboBox *nameComboBox; 434 }; 435 436 class QtDialog::VectorsQtQuery : 437 public QWidget, 438 public QtQuery<std::vector<Vector> >, 439 public QtQueryList<Vector> { 434 440 Q_OBJECT 435 441 public: -
src/UIElements/Qt4/Query/QtQueryList.hpp
rce254c r73faf4 100 100 std::vector<T> &tempRef; 101 101 Parameter<T> *subParam; 102 }; 103 104 template<> 105 class QtQueryList<Vector> : public QtQueryListUntyped { 106 public: 107 QtQueryList(Parameter<std::vector<Vector> > &parentParam, QBoxLayout *parent, Dialog *_dialog, std::vector<std::string> &_temp) : QtQueryListUntyped(parent, _dialog), tempRef(_temp) 108 { 109 // do we have an STLVectorValidator? 110 Validator<std::vector<Vector> > *val = &parentParam.getValidator(); 111 STLVectorValidator<std::vector<Vector> > *vector_val = NULL; 112 113 // might be hidden inside an And_Validator 114 And_Validator<std::vector<Vector> > * and_val = dynamic_cast<And_Validator<std::vector<Vector> > *>(val); 115 if (and_val){ 116 if (dynamic_cast<STLVectorValidator<std::vector<Vector> > *>(and_val->getA())) 117 vector_val = dynamic_cast<STLVectorValidator<std::vector<Vector> > *>(and_val->getA()); 118 else if (dynamic_cast<STLVectorValidator<std::vector<Vector> > *>(and_val->getB())) 119 vector_val = dynamic_cast<STLVectorValidator<std::vector<Vector> > *>(and_val->getB()); 120 }else{ 121 vector_val = dynamic_cast<STLVectorValidator<std::vector<Vector> > *>(val); 122 } 123 124 if (vector_val){ 125 // if so, try to use its ElementwiseValidator 126 subParam = new Parameter<Vector>("sub-param", *(vector_val->getElementwiseValidator())); 127 }else{ 128 subParam = new Parameter<Vector>("sub-param"); 129 } 130 } 131 virtual ~QtQueryList() 132 { 133 delete(subParam); 134 } 135 136 void addElement() { 137 // add item to both 138 addElementToListWidget(subParam->getAsString()); 139 tempRef.push_back(subParam->getAsString()); 140 onUpdate(); 141 } 142 void removeElements() 143 { 144 std::vector<int> rows = getSelectedRows(); 145 removeSelectedRows(rows); 146 for (int i = rows.size() - 1; i >= 0; i --){ 147 ASSERT((size_t)(rows[i]) < tempRef.size(), "QtQueryList<Vector>::removeElements() trying to remove invalid element."); 148 tempRef.erase(tempRef.begin() + rows[i]); 149 } 150 onUpdate(); 151 } 152 protected: 153 std::vector<std::string> &tempRef; 154 Parameter<Vector> *subParam; 102 155 }; 103 156 -
src/UIElements/Qt4/Query/VectorQtQuery.cpp
rce254c r73faf4 37 37 #include <Qt/qcombobox.h> 38 38 #include <Qt/qlabel.h> 39 #include <Qt/qstackedwidget.h> 39 40 40 41 //#include "CodePatterns/MemDebug.hpp" … … 42 43 #include "UIElements/Qt4/Query/QtQuery.hpp" 43 44 45 #include "CodePatterns/toString.hpp" 46 47 #include "Geometry/GeometryRegistry.hpp" 48 #include "Parameters/Specifics/Value_vector.hpp" 44 49 45 50 QtDialog::VectorQtQuery::VectorQtQuery(Parameter<Vector> &_param, const std::string &_title, const std::string &_description, QBoxLayout *_parent,Dialog *_dialog) : … … 48 53 dialog(_dialog) 49 54 { 50 temp = Vector(0, 0, 0); 51 if (param.isSet()) 52 temp = param.get(); 55 Vector temporary(0, 0, 0); 56 temp = "0, 0, 0"; 57 if (param.isSet()) { 58 temporary = param.get(); 59 temp = param.getAsString(); 60 } 53 61 mainLayout= new QHBoxLayout(); 54 62 titleLabel = new QLabel(QString(getTitle().c_str())); 55 63 titleLabel->setToolTip(QString(getDescription().c_str())); 56 64 mainLayout->addWidget(titleLabel); 57 subLayout = new Q VBoxLayout();65 subLayout = new QHBoxLayout(); 58 66 mainLayout->addLayout(subLayout); 59 67 // QComboBox* inputBox = new QComboBox(); 68 69 QWidget *firstPageWidget = new QWidget; 70 QWidget *secondPageWidget = new QWidget; 71 72 QStackedWidget *stackedWidget = new QStackedWidget; 73 stackedWidget->addWidget(firstPageWidget); 74 stackedWidget->addWidget(secondPageWidget); 75 76 QComboBox *pageComboBox = new QComboBox; 77 pageComboBox->addItem(tr("x,y,z")); 78 pageComboBox->addItem(tr("vector name")); 79 connect(pageComboBox, SIGNAL(activated(int)), 80 stackedWidget, SLOT(setCurrentIndex(int))); 81 connect(pageComboBox, SIGNAL(activated(int)), 82 this, SLOT(pageChanged(int))); 83 subLayout->addWidget(pageComboBox); 84 subLayout->addWidget(stackedWidget); 85 86 // first widget with coordinates 60 87 coordLayout = new QHBoxLayout(); 61 subLayout->addLayout(coordLayout);62 coordLabel = new QLabel(QString("x,y,z"));63 coordLayout->addWidget(coordLabel);64 88 coordInputX = new QDoubleSpinBox(); 65 89 coordInputX->setRange(-std::numeric_limits<double>::max(),std::numeric_limits<double>::max()); 66 coordInputX->setValue(temp [0]);90 coordInputX->setValue(temporary[0]); 67 91 // coordInputX->setRange(0,M.at(i,i)); 68 92 coordInputX->setDecimals(3); … … 70 94 coordInputY = new QDoubleSpinBox(); 71 95 coordInputY->setRange(-std::numeric_limits<double>::max(),std::numeric_limits<double>::max()); 72 coordInputY->setValue(temp [1]);96 coordInputY->setValue(temporary[1]); 73 97 // coordInputY->setRange(0,M.at(i,i)); 74 98 coordInputY->setDecimals(3); … … 76 100 coordInputZ = new QDoubleSpinBox(); 77 101 coordInputZ->setRange(-std::numeric_limits<double>::max(),std::numeric_limits<double>::max()); 78 coordInputZ->setValue(temp [2]);102 coordInputZ->setValue(temporary[2]); 79 103 // coordInputZ->setRange(0,M.at(i,i)); 80 104 coordInputZ->setDecimals(3); … … 83 107 connect(coordInputY,SIGNAL(valueChanged(double)),this,SLOT(onUpdateY(double))); 84 108 connect(coordInputZ,SIGNAL(valueChanged(double)),this,SLOT(onUpdateZ(double))); 109 firstPageWidget->setLayout(coordLayout); 110 111 // second widget with string field 112 nameLayout = new QHBoxLayout(); 113 nameComboBox = new QComboBox; 114 GeometryRegistry ® = GeometryRegistry::getInstance(); 115 // nameComboBox->setEditable(true); 116 GeometryRegistry::const_iterator iter; 117 for (iter = reg.getBeginIter(); iter != reg.getEndIter(); iter ++){ 118 GeometryObject *v = iter->second; 119 nameComboBox->addItem(tr(v->getName().c_str())); 120 nameComboBox->setItemData(nameComboBox->count()-1, tr(toString<Vector>(v->getVector()).c_str()), Qt::ToolTipRole); 121 } 122 connect(nameComboBox, SIGNAL(activated(int)), 123 this, SLOT(onUpdateName(int))); 124 nameLayout->addWidget(nameComboBox); 125 secondPageWidget->setLayout(nameLayout); 126 85 127 parent->addLayout(mainLayout); 86 128 } … … 89 131 {} 90 132 133 static void updateVectorString(std::string &_temp, const double newDouble, int component) 134 { 135 //!> Internal converter from string to internal type 136 Vector vec = Value<Vector>::parseAsVector(_temp); 137 vec[component] = newDouble; 138 _temp = Value<Vector>::setFromVector(vec); 139 } 140 141 void QtDialog::VectorQtQuery::pageChanged(int pagenr) { 142 if (pagenr == 1) { 143 // change from x,y,z input 144 onUpdateName(nameComboBox->currentIndex()); 145 dialog->update(); 146 } else if (pagenr == 0) { 147 // change from name input 148 if (GeometryRegistry::getInstance().isPresentByName(temp)) { 149 const GeometryObject * const v = GeometryRegistry::getInstance().getByName(temp); 150 coordInputX->setValue(v->getVector()[0]); 151 coordInputY->setValue(v->getVector()[1]); 152 coordInputZ->setValue(v->getVector()[2]); 153 } else { 154 coordInputX->setValue(0.); 155 coordInputY->setValue(0.); 156 coordInputZ->setValue(0.); 157 } 158 dialog->update(); 159 } else { 160 ASSERT(0, "VectorQtQuery::pageChanged() - unknown page for pageComboBox."); 161 } 162 } 163 164 void QtDialog::VectorQtQuery::onUpdateName(int index) { 165 const QString itemtext = nameComboBox->itemText(index); 166 temp = itemtext.toStdString(); 167 dialog->update(); 168 } 169 91 170 void QtDialog::VectorQtQuery::onUpdateX(double newDouble) { 92 temp[0] = newDouble;171 updateVectorString(temp, newDouble, 0); 93 172 dialog->update(); 94 173 } 95 174 96 175 void QtDialog::VectorQtQuery::onUpdateY(double newDouble) { 97 temp[1] = newDouble;176 updateVectorString(temp, newDouble, 1); 98 177 dialog->update(); 99 178 } 100 179 101 180 void QtDialog::VectorQtQuery::onUpdateZ(double newDouble) { 102 temp[2] = newDouble;181 updateVectorString(temp, newDouble, 2); 103 182 dialog->update(); 104 183 } -
src/UIElements/TextUI/Query/TextQuery.hpp
rce254c r73faf4 24 24 }; 25 25 26 class TextDialog::VectorTextQuery : public Dialog::TQuery<Vector> { 27 public: 28 VectorTextQuery(Parameter<Vector> &_param, const std::string &_title, const std::string &_description = ""); 29 virtual ~VectorTextQuery(); 30 virtual bool handle(); 31 }; 32 33 class TextDialog::VectorsTextQuery : public Dialog::TQuery< std::vector<Vector> > { 34 public: 35 VectorsTextQuery(Parameter< std::vector<Vector> > &_param, const std::string &_title, const std::string &_description = ""); 36 virtual ~VectorsTextQuery(); 37 virtual bool handle(); 38 }; 26 39 27 40 /** With the following boost::preprocessor code we generate forward declarations -
src/UIElements/TextUI/Query/VectorTextQuery.cpp
rce254c r73faf4 83 83 84 84 // check vector 85 return World::getInstance().getDomain().isValid(temp);85 return true; 86 86 } 87 87 -
src/UIElements/TextUI/Query/VectorsTextQuery.cpp
rce254c r73faf4 41 41 #include "CodePatterns/Log.hpp" 42 42 #include "CodePatterns/Verbose.hpp" 43 #include "Geometry/GeometryRegistry.hpp" 43 44 #include "LinearAlgebra/Vector.hpp" 44 45 #include "LinearAlgebra/RealSpaceMatrix.hpp" … … 54 55 55 56 bool TextDialog::VectorsTextQuery::handle() { 57 std::stringstream output; 56 58 std::cout << getDescription() << std::endl; 57 59 char coords[3] = {'x', 'y', 'z'}; 58 60 const RealSpaceMatrix &M = World::getInstance().getDomain().getM(); 59 for (int i=0;i<3;i++) 60 std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: "); 61 std::cout << "Enter three comma-separated coordinates, vector name, ? for list or empty for end." << std::endl; 62 while (true) { 63 for (int i=0;i<3;i++) 64 std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: "); 61 65 62 std::string line;63 getline(std::cin,line);66 std::string line; 67 getline(std::cin,line); 64 68 65 // dissect by "," 66 double coord = 0.; 67 std::string::iterator olditerspace = line.begin(); 68 std::string::iterator olditercomma = line.begin(); 69 int counter = 0; 70 Vector temp_element; 71 for(std::string::iterator vectoriter = line.begin(); vectoriter != line.end(); ++vectoriter) { 72 if (*vectoriter == ',') 73 counter++; 74 if ((*vectoriter == ' ') && (counter == 2)) { 75 counter = 0; 76 for(std::string::iterator componentiter = olditerspace; (componentiter != vectoriter) && (counter !=3); ++componentiter) { 77 if (*componentiter == ',') { 78 std::istringstream stream(std::string(componentiter, olditercomma)); 79 stream >> coord; 80 temp_element[counter++] = coord; 81 olditercomma = componentiter; 82 } 69 if (line == "?") { 70 GeometryRegistry ® = GeometryRegistry::getInstance(); 71 72 GeometryRegistry::const_iterator iter; 73 for (iter = reg.getBeginIter(); iter != reg.getEndIter(); iter ++){ 74 GeometryObject *v = iter->second; 75 std::cout << "\t" << *v << std::endl; 83 76 } 84 if ((olditercomma != line.begin()) && (counter != 3)) { // insert last part also 85 std::istringstream stream(std::string(olditercomma, vectoriter)); 86 stream >> coord; 87 temp_element[counter++] = coord; 88 } 89 if (World::getInstance().getDomain().isValid(temp_element)) 90 temp.push_back(temp_element); 91 olditerspace = vectoriter; 77 } else if (line.empty()) { 78 break; 79 } else { 80 // simply append with white-space delimiter 81 temp.push_back(line); 92 82 } 93 83 } -
src/UIElements/TextUI/TextDialog.hpp
rce254c r73faf4 34 34 virtual void queryEmpty(const std::string ="", const std::string = ""); 35 35 36 virtual void queryVector(Parameter<Vector> &, const std::string ="", const std::string = ""); 37 virtual void queryVectors(Parameter< std::vector<Vector> > &, const std::string ="", const std::string = ""); 38 36 39 /** With the following boost::preprocessor code we generate virtual function 37 40 * definitions for all desired query types in the abstract class Dialog. … … 59 62 class EmptyTextQuery; 60 63 64 class VectorTextQuery; 65 class VectorsTextQuery; 66 61 67 /** With the following boost::preprocessor code we generate forward declarations 62 68 * of query class for all desired query types in the Qt specialization class of -
src/cleanUp.cpp
rce254c r73faf4 54 54 #include "Fragmentation/Summation/Containers/FragmentationResultContainer.hpp" 55 55 56 #include "Geometry/GeometryRegistry.hpp" 57 56 58 #include "MoleculeObserver.hpp" 57 59 … … 95 97 // make sure that ActionQueue is already purged! 96 98 FragmentationResultContainer::purgeInstance(); 99 GeometryRegistry::purgeInstance(); 97 100 Chronos::purgeInstance(); 98 101 PotentialFactory::purgeInstance();
Note:
See TracChangeset
for help on using the changeset viewer.
