Changes in / [41e15b:5d4b73]
- Location:
- src
- Files:
-
- 25 added
- 2 deleted
- 84 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
r41e15b r5d4b73 124 124 Thermostats/Thermostat.hpp \ 125 125 Thermostats/Woodcock.hpp 126 127 QTUIMOC_HEADER = UIElements/Qt4/QtDialog.hpp \128 UIElements/Qt4/QtMainWindow.hpp \129 UIElements/Menu/Qt4/QtMenu.hpp \130 UIElements/Menu/Qt4/QtMenuPipe.hpp \131 UIElements/Views/Qt4/QtWorldView.hpp \132 UIElements/Views/Qt4/GLMoleculeView.hpp \133 UIElements/Views/Qt4/QtMoleculeView.hpp \134 UIElements/Views/Qt4/QtStatusBar.hpp135 136 QTUISOURCE = allmocs.moc.cpp \137 UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp \138 UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp \139 UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp \140 UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp \141 UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp \142 UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp \143 UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp \144 UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp \145 UIElements/Qt4/Pipe/FileQtQueryPipe.cpp \146 UIElements/Qt4/Pipe/IntQtQueryPipe.cpp \147 UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp \148 UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp \149 UIElements/Qt4/Pipe/StringQtQueryPipe.cpp \150 UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp \151 UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp \152 UIElements/Qt4/Query/AtomQtQuery.cpp \153 UIElements/Qt4/Query/AtomsQtQuery.cpp \154 UIElements/Qt4/Query/BooleanQtQuery.cpp \155 UIElements/Qt4/Query/BoxQtQuery.cpp \156 UIElements/Qt4/Query/DoubleQtQuery.cpp \157 UIElements/Qt4/Query/DoublesQtQuery.cpp \158 UIElements/Qt4/Query/ElementQtQuery.cpp \159 UIElements/Qt4/Query/ElementsQtQuery.cpp \160 UIElements/Qt4/Query/EmptyQtQuery.cpp \161 UIElements/Qt4/Query/FileQtQuery.cpp \162 UIElements/Qt4/Query/IntQtQuery.cpp \163 UIElements/Qt4/Query/IntsQtQuery.cpp \164 UIElements/Qt4/Query/MoleculeQtQuery.cpp \165 UIElements/Qt4/Query/MoleculesQtQuery.cpp \166 UIElements/Qt4/Query/StringQtQuery.cpp \167 UIElements/Qt4/Query/StringsQtQuery.cpp \168 UIElements/Qt4/Query/VectorQtQuery.cpp \169 UIElements/Qt4/Query/VectorsQtQuery.cpp \170 UIElements/Qt4/QtMainWindow.cpp \171 UIElements/Qt4/QtDialog.cpp \172 UIElements/Qt4/QtUIFactory.cpp \173 UIElements/Menu/Qt4/QtMenuPipe.cpp \174 UIElements/Views/Qt4/QtWorldView.cpp \175 UIElements/Views/Qt4/GLMoleculeView.cpp \176 UIElements/Views/Qt4/QtMoleculeView.cpp \177 UIElements/Views/Qt4/QtStatusBar.cpp178 179 QTUIHEADER = \180 ${QTUIMOC_HEADER} \181 UIElements/Qt4/Pipe/QtQueryListPipe.hpp \182 UIElements/Qt4/QtUIFactory.hpp183 184 QTUI_DEFS =185 126 186 127 TESSELATIONSOURCE = \ … … 358 299 359 300 #Stuff for building the GUI using Qt 360 molecuildergui_SOURCES = ${QTUISOURCE}builder.cpp301 molecuildergui_SOURCES = builder.cpp 361 302 molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT 362 303 molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS} ${GLU_LDFLAGS} … … 367 308 molecuildergui_LDADD = \ 368 309 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 310 UIElements/libMolecuilderQtUI-@MOLECUILDER_API_VERSION@.la \ 369 311 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 370 312 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ … … 397 339 Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 398 340 $(BOOST_LIB) 399 400 #Rules needed for Qt4401 # UI-Files are scattered throughout several subdirectories402 # Therfore `%'-rules do not seem to work403 #Quick fix to get it done otherwise404 allmocs.moc.cpp: ${QTUIMOC_HEADER}405 echo "" > allmocs.moc.cpp;\406 list='$(QTUIMOC_HEADER)'; for header in $$list; do \407 echo "Making mocfile for $$header"; \408 target=`basename $$header | sed "s/\(.*\)\..*/\1.moc.cpp/"`;\409 $(MOC) $(srcdir)/$$header -o $$target \410 || eval $$failcom; \411 echo "#include \"$$target\"" >> allmocs.moc.cpp; \412 done;413 341 414 342 #EXTRA_DIST = ${molecuilder_DATA} -
src/UIElements/CommandLineUI/CommandLineDialog.cpp
r41e15b r5d4b73 21 21 22 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 #include "CommandLineUI/Query/CommandLineQuery.hpp" 23 24 24 25 -
src/UIElements/CommandLineUI/CommandLineDialog.hpp
r41e15b r5d4b73 48 48 protected: 49 49 // specialized stuff for text queries 50 class EmptyCommandLineQuery : public Dialog::EmptyQuery { 51 public: 52 EmptyCommandLineQuery(std::string title, std::string _description = ""); 53 virtual ~EmptyCommandLineQuery(); 54 virtual bool handle(); 55 }; 56 57 class IntCommandLineQuery : public Dialog::IntQuery { 58 public: 59 IntCommandLineQuery(std::string title, std::string _description = ""); 60 virtual ~IntCommandLineQuery(); 61 virtual bool handle(); 62 }; 63 64 class IntsCommandLineQuery : public Dialog::IntsQuery { 65 public: 66 IntsCommandLineQuery(std::string title, std::string _description = ""); 67 virtual ~IntsCommandLineQuery(); 68 virtual bool handle(); 69 }; 70 71 class BooleanCommandLineQuery : public Dialog::BooleanQuery { 72 public: 73 BooleanCommandLineQuery(std::string title, std::string _description = ""); 74 virtual ~BooleanCommandLineQuery(); 75 virtual bool handle(); 76 }; 77 78 class DoubleCommandLineQuery : public Dialog::DoubleQuery { 79 public: 80 DoubleCommandLineQuery(std::string title, std::string _description = ""); 81 virtual ~DoubleCommandLineQuery(); 82 virtual bool handle(); 83 }; 84 85 class DoublesCommandLineQuery : public Dialog::DoublesQuery { 86 public: 87 DoublesCommandLineQuery(std::string title, std::string _description = ""); 88 virtual ~DoublesCommandLineQuery(); 89 virtual bool handle(); 90 }; 91 92 class StringCommandLineQuery : public Dialog::StringQuery { 93 public: 94 StringCommandLineQuery(std::string title, std::string _description = ""); 95 virtual ~StringCommandLineQuery(); 96 virtual bool handle(); 97 }; 98 99 class StringsCommandLineQuery : public Dialog::StringsQuery { 100 public: 101 StringsCommandLineQuery(std::string title, std::string _description = ""); 102 virtual ~StringsCommandLineQuery(); 103 virtual bool handle(); 104 }; 105 106 class AtomCommandLineQuery : public Dialog::AtomQuery { 107 public: 108 AtomCommandLineQuery(std::string title, std::string _description = ""); 109 virtual ~AtomCommandLineQuery(); 110 virtual bool handle(); 111 }; 112 113 class AtomsCommandLineQuery : public Dialog::AtomsQuery { 114 public: 115 AtomsCommandLineQuery(std::string title, std::string _description = ""); 116 virtual ~AtomsCommandLineQuery(); 117 virtual bool handle(); 118 }; 119 120 class MoleculeCommandLineQuery : public Dialog::MoleculeQuery { 121 public: 122 MoleculeCommandLineQuery(std::string title, std::string _description = ""); 123 virtual ~MoleculeCommandLineQuery(); 124 virtual bool handle(); 125 }; 126 127 class MoleculesCommandLineQuery : public Dialog::MoleculesQuery { 128 public: 129 MoleculesCommandLineQuery(std::string title, std::string _description = ""); 130 virtual ~MoleculesCommandLineQuery(); 131 virtual bool handle(); 132 }; 133 134 class VectorCommandLineQuery : public Dialog::VectorQuery { 135 public: 136 VectorCommandLineQuery(std::string title,bool _check, std::string _description = ""); 137 virtual ~VectorCommandLineQuery(); 138 virtual bool handle(); 139 }; 140 141 class VectorsCommandLineQuery : public Dialog::VectorsQuery { 142 public: 143 VectorsCommandLineQuery(std::string title,bool _check, std::string _description = ""); 144 virtual ~VectorsCommandLineQuery(); 145 virtual bool handle(); 146 }; 147 148 class BoxCommandLineQuery : public Dialog::BoxQuery { 149 public: 150 BoxCommandLineQuery(std::string title, std::string _description = ""); 151 virtual ~BoxCommandLineQuery(); 152 virtual bool handle(); 153 }; 154 155 class ElementCommandLineQuery : public Dialog::ElementQuery { 156 public: 157 ElementCommandLineQuery(std::string title, std::string _description = ""); 158 virtual ~ElementCommandLineQuery(); 159 virtual bool handle(); 160 }; 161 162 class ElementsCommandLineQuery : public Dialog::ElementsQuery { 163 public: 164 ElementsCommandLineQuery(std::string title, std::string _description = ""); 165 virtual ~ElementsCommandLineQuery(); 166 virtual bool handle(); 167 }; 168 169 class FileCommandLineQuery : public Dialog::FileQuery { 170 public: 171 FileCommandLineQuery(std::string title, std::string _description = ""); 172 virtual ~FileCommandLineQuery(); 173 virtual bool handle(); 174 }; 50 class AtomCommandLineQuery; 51 class AtomsCommandLineQuery; 52 class BooleanCommandLineQuery; 53 class BoxCommandLineQuery; 54 class DoubleCommandLineQuery; 55 class DoublesCommandLineQuery; 56 class ElementCommandLineQuery; 57 class ElementsCommandLineQuery; 58 class EmptyCommandLineQuery; 59 class FileCommandLineQuery; 60 class IntCommandLineQuery; 61 class IntsCommandLineQuery; 62 class MoleculeCommandLineQuery; 63 class MoleculesCommandLineQuery; 64 class StringCommandLineQuery; 65 class StringsCommandLineQuery; 66 class VectorCommandLineQuery; 67 class VectorsCommandLineQuery; 175 68 }; 176 69 -
src/UIElements/CommandLineUI/CommandLineParser.cpp
r41e15b r5d4b73 21 21 22 22 #include <boost/filesystem.hpp> 23 #include <boost/lexical_cast.hpp>24 23 #include <boost/program_options.hpp> 25 24 #include <fstream> 26 25 #include <iostream> 27 26 #include <map> 28 #include <vector>29 27 30 28 #include "Actions/Action.hpp" … … 34 32 #include "Actions/OptionTrait.hpp" 35 33 #include "Actions/Values.hpp" 36 #include "Helpers/Assert.hpp"37 34 #include "Helpers/Log.hpp" 38 35 #include "Helpers/Verbose.hpp" 39 36 #include "CommandLineParser.hpp" 37 #include "CommandLineParser_validate.hpp" 40 38 41 39 #include "Patterns/Singleton_impl.hpp" 42 40 43 41 class element; 44 45 using namespace std;46 47 /** boost::program_options validator specialization for VectorValue.48 * \param &v reference for return value49 * \param &values string vector of scanned options50 * \param *51 * \param52 *53 */54 void validate(boost::any& v, const std::vector<std::string>& values, VectorValue *, int)55 {56 VectorValue VV;57 std::vector<std::string> components;58 59 // split comma-separated values60 if (values.size() != 1) {61 cerr << "Not one vector but " << values.size() << " given " << endl;62 throw boost::program_options::validation_error("Unequal to one vector given");63 }64 std::string argument(values.at(0));65 std::string::iterator Aiter = argument.begin();66 std::string::iterator Biter = argument.begin();67 for (; Aiter != argument.end(); ++Aiter) {68 if (*Aiter == ',') {69 components.push_back(string(Biter,Aiter));70 do {71 Aiter++;72 } while (*Aiter == ' ' || *Aiter == '\t');73 Biter = Aiter;74 }75 }76 components.push_back(string(Biter,argument.end()));77 78 if (components.size() != 3) {79 cerr << "Specified vector does not have three components but " << components.size() << endl;80 throw boost::program_options::validation_error("Specified vector does not have three components");81 }82 VV.x = boost::lexical_cast<double>(components.at(0));83 VV.y = boost::lexical_cast<double>(components.at(1));84 VV.z = boost::lexical_cast<double>(components.at(2));85 v = boost::any(VectorValue(VV));86 }87 88 void validate(boost::any& v, const std::vector<std::string>& values, BoxValue *, int)89 {90 BoxValue BV;91 std::vector<std::string> components;92 93 // split comma-separated values94 if (values.size() != 1) {95 cerr << "Not one vector but " << values.size() << " given " << endl;96 throw boost::program_options::validation_error("Unequal to one vector given");97 }98 std::string argument(values.at(0));99 std::string::iterator Aiter = argument.begin();100 std::string::iterator Biter = argument.begin();101 for (; Aiter != argument.end(); ++Aiter) {102 if (*Aiter == ',') {103 components.push_back(string(Biter,Aiter));104 do {105 Aiter++;106 } while (*Aiter == ' ' || *Aiter == '\t');107 Biter = Aiter;108 }109 }110 components.push_back(string(Biter,argument.end()));111 112 if (components.size() != 6) {113 cerr << "Specified vector does not have three components but " << components.size() << endl;114 throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components");115 }116 BV.xx = boost::lexical_cast<double>(components.at(0));117 BV.yx = boost::lexical_cast<double>(components.at(1));118 BV.yy = boost::lexical_cast<double>(components.at(2));119 BV.zx = boost::lexical_cast<double>(components.at(3));120 BV.zy = boost::lexical_cast<double>(components.at(4));121 BV.zz = boost::lexical_cast<double>(components.at(5));122 v = boost::any(BoxValue(BV));123 }124 125 /** boost::program_options validator specialization for boost::filesystem::path.126 * \param &v reference for return value127 * \param &values string vector of scanned options128 * \param *129 * \param130 *131 */132 void validate(boost::any& v, const std::vector<std::string>& values, boost::filesystem::path *, int)133 {134 boost::filesystem::path filename;135 136 std::cout << "boost::filesystem::path validator used." << std::endl;137 138 // split comma-separated values139 if (values.size() != 1) {140 cerr << "Not one file but " << values.size() << " given " << endl;141 throw boost::program_options::validation_error("Unequal to one file given");142 }143 filename = values.at(0);144 v = boost::any(boost::filesystem::path(filename));145 }146 147 42 148 43 /** Constructor of class CommandLineParser. … … 461 356 { 462 357 po::store(po::command_line_parser(argc,argv).options(cmdline_options).run(), vm); 463 ifstream input;358 std::ifstream input; 464 359 input.open("example.cfg"); 465 360 if (!input.fail()) … … 473 368 void CommandLineParser::scanforSequenceOfArguments() 474 369 { 475 map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();370 std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap(); 476 371 // go through all arguments 477 372 for (int i=1;i<argc;i++) { 478 ( cout << Verbose(1) << "Checking on " << argv[i] <<endl);373 (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl); 479 374 // check whether they 480 375 if (argv[i][0] == '-') { // .. begin with - … … 485 380 // .. and check that next letter is not numeric, if so insert 486 381 } else if (((argv[i][1] < '0') || (argv[i][1] > '9')) && ((argv[i][1] != '.'))) { 487 map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));382 std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1])); 488 383 if (iter != ShortFormToActionMap.end()) { 489 384 (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl); … … 511 406 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() 512 407 { 513 map <std::string, std::string> result;408 std::map <std::string, std::string> result; 514 409 515 410 ActionRegistry &AR = ActionRegistry::getInstance(); -
src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
r41e15b r5d4b73 24 24 #include <Descriptors/AtomDescriptor.hpp> 25 25 #include <Descriptors/AtomIdDescriptor.hpp> 26 #include "CommandLineUI/CommandLineDialog.hpp"27 26 27 #include "CommandLineUI/Query/CommandLineQuery.hpp" 28 28 #include "CommandLineUI/CommandLineParser.hpp" 29 29 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
r41e15b r5d4b73 22 22 #include <Descriptors/AtomDescriptor.hpp> 23 23 #include <Descriptors/AtomIdDescriptor.hpp> 24 #include "CommandLineUI/CommandLineDialog.hpp" 25 24 #include "CommandLineUI/Query/CommandLineQuery.hpp" 26 25 #include "CommandLineUI/CommandLineParser.hpp" 27 26 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp"23 24 22 #include "Actions/Values.hpp" 23 #include "CommandLineUI/Query/CommandLineQuery.hpp" 25 24 #include "CommandLineUI/CommandLineParser.hpp" 26 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "CommandLineUI/CommandLineDialog.hpp" 25 24 #include "CommandLineUI/Query/CommandLineQuery.hpp" 26 25 #include "CommandLineUI/CommandLineParser.hpp" 27 26 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
r41e15b r5d4b73 22 22 #include <Descriptors/MoleculeDescriptor.hpp> 23 23 #include <Descriptors/MoleculeIdDescriptor.hpp> 24 #include "CommandLineUI/CommandLineDialog.hpp"25 24 25 #include "CommandLineUI/Query/CommandLineQuery.hpp" 26 26 #include "CommandLineUI/CommandLineParser.hpp" 27 27 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
r41e15b r5d4b73 22 22 #include <Descriptors/MoleculeDescriptor.hpp> 23 23 #include <Descriptors/MoleculeIdDescriptor.hpp> 24 #include "CommandLineUI/CommandLineDialog.hpp"25 24 25 #include "CommandLineUI/Query/CommandLineQuery.hpp" 26 26 #include "CommandLineUI/CommandLineParser.hpp" 27 27 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 23 #include "CommandLineUI/CommandLineParser.hpp" 25 24 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
r41e15b r5d4b73 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp"23 24 22 #include "Actions/Values.hpp" 23 #include "CommandLineUI/Query/CommandLineQuery.hpp" 25 24 #include "CommandLineUI/CommandLineParser.hpp" 26 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
r41e15b r5d4b73 22 22 #include <vector> 23 23 24 #include "CommandLineUI/CommandLineDialog.hpp"25 26 24 #include "Actions/Values.hpp" 25 #include "CommandLineUI/Query/CommandLineQuery.hpp" 27 26 #include "CommandLineUI/CommandLineParser.hpp" 28 27 #include "Helpers/Log.hpp" -
src/UIElements/Makefile.am
r41e15b r5d4b73 3 3 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/UIElements 4 4 5 AM_LDFLAGS = $(CPPUNIT_LIBS)-ldl6 AM_CXXFLAGS = $ (CPPUNIT_CFLAGS)5 AM_LDFLAGS = -ldl 6 AM_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} 7 7 8 8 VIEWSOURCE = \ … … 28 28 29 29 TEXTMENUSOURCE = \ 30 Menu/TextMenu/TxMenuLeaveAction.cpp \ 30 31 Menu/TextMenu/TxMenu.cpp \ 31 32 Menu/TextMenu/MenuItem.cpp \ 32 33 Menu/TextMenu/SubMenuItem.cpp \ 33 34 Menu/TextMenu/ActionMenuItem.cpp \ 34 Menu/TextMenu/Sep eratorItem.cpp \35 Menu/TextMenu/SeparatorMenuItem.cpp \ 35 36 Menu/TextMenu/DisplayMenuItem.cpp 36 37 … … 41 42 Menu/TextMenu/SubMenuItem.hpp \ 42 43 Menu/TextMenu/ActionMenuItem.hpp \ 43 Menu/TextMenu/Sep eratorItem.hpp \44 Menu/TextMenu/SeparatorMenuItem.hpp \ 44 45 Menu/TextMenu/DisplayMenuItem.hpp 45 46 … … 107 108 TextUI/TextWindow.cpp 108 109 TEXTUIHEADER = \ 110 TextUI/Query/TextQuery.hpp \ 109 111 TextUI/TextDialog.hpp \ 110 112 TextUI/TextStatusIndicator.hpp \ … … 133 135 CommandLineUI/CommandLineDialog.cpp \ 134 136 CommandLineUI/CommandLineParser.cpp \ 137 CommandLineUI/CommandLineParser_validate.cpp \ 135 138 CommandLineUI/CommandLineStatusIndicator.cpp \ 136 139 CommandLineUI/CommandLineUIFactory.cpp \ … … 139 142 140 143 COMMANDLINEUIHEADER = \ 144 CommandLineUI/Query/CommandLineQuery.hpp \ 141 145 CommandLineUI/CommandLineDialog.hpp \ 142 146 CommandLineUI/CommandLineParser.hpp \ 147 CommandLineUI/CommandLineParser_validate.hpp \ 143 148 CommandLineUI/CommandLineStatusIndicator.hpp \ 144 149 CommandLineUI/CommandLineUIFactory.hpp \ … … 146 151 CommandLineUI/TypeEnumContainer.cpp 147 152 148 lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la 153 QTUIMOC_HEADER = \ 154 Qt4/QtDialog.hpp \ 155 Qt4/QtMainWindow.hpp \ 156 Qt4/Pipe/AtomQtQueryPipe.hpp \ 157 Qt4/Pipe/AtomsQtQueryPipe.hpp \ 158 Qt4/Pipe/BooleanQtQueryPipe.hpp \ 159 Qt4/Pipe/BoxQtQueryPipe.hpp \ 160 Qt4/Pipe/DoubleQtQueryPipe.hpp \ 161 Qt4/Pipe/ElementsQtQueryPipe.hpp \ 162 Qt4/Pipe/EmptyQtQueryPipe.hpp \ 163 Qt4/Pipe/ElementQtQueryPipe.hpp \ 164 Qt4/Pipe/FileQtQueryPipe.hpp \ 165 Qt4/Pipe/IntQtQueryPipe.hpp \ 166 Qt4/Pipe/MoleculeQtQueryPipe.hpp \ 167 Qt4/Pipe/MoleculesQtQueryPipe.hpp \ 168 Qt4/Pipe/StringQtQueryPipe.hpp \ 169 Qt4/Pipe/VectorQtQueryPipe.hpp \ 170 Qt4/Pipe/VectorsQtQueryPipe.hpp \ 171 Menu/Qt4/QtMenuPipe.hpp \ 172 Views/Qt4/QtWorldView.hpp \ 173 Views/Qt4/GLMoleculeView.hpp \ 174 Views/Qt4/QtMoleculeView.hpp \ 175 Views/Qt4/QtStatusBar.hpp 176 177 QTUISOURCE = allmocs.moc.cpp \ 178 Qt4/Pipe/AtomQtQueryPipe.cpp \ 179 Qt4/Pipe/AtomsQtQueryPipe.cpp \ 180 Qt4/Pipe/BooleanQtQueryPipe.cpp \ 181 Qt4/Pipe/BoxQtQueryPipe.cpp \ 182 Qt4/Pipe/DoubleQtQueryPipe.cpp \ 183 Qt4/Pipe/ElementsQtQueryPipe.cpp \ 184 Qt4/Pipe/EmptyQtQueryPipe.cpp \ 185 Qt4/Pipe/ElementQtQueryPipe.cpp \ 186 Qt4/Pipe/FileQtQueryPipe.cpp \ 187 Qt4/Pipe/IntQtQueryPipe.cpp \ 188 Qt4/Pipe/MoleculeQtQueryPipe.cpp \ 189 Qt4/Pipe/MoleculesQtQueryPipe.cpp \ 190 Qt4/Pipe/StringQtQueryPipe.cpp \ 191 Qt4/Pipe/VectorQtQueryPipe.cpp \ 192 Qt4/Pipe/VectorsQtQueryPipe.cpp \ 193 Qt4/Query/AtomQtQuery.cpp \ 194 Qt4/Query/AtomsQtQuery.cpp \ 195 Qt4/Query/BooleanQtQuery.cpp \ 196 Qt4/Query/BoxQtQuery.cpp \ 197 Qt4/Query/DoubleQtQuery.cpp \ 198 Qt4/Query/DoublesQtQuery.cpp \ 199 Qt4/Query/ElementQtQuery.cpp \ 200 Qt4/Query/ElementsQtQuery.cpp \ 201 Qt4/Query/EmptyQtQuery.cpp \ 202 Qt4/Query/FileQtQuery.cpp \ 203 Qt4/Query/IntQtQuery.cpp \ 204 Qt4/Query/IntsQtQuery.cpp \ 205 Qt4/Query/MoleculeQtQuery.cpp \ 206 Qt4/Query/MoleculesQtQuery.cpp \ 207 Qt4/Query/StringQtQuery.cpp \ 208 Qt4/Query/StringsQtQuery.cpp \ 209 Qt4/Query/VectorQtQuery.cpp \ 210 Qt4/Query/VectorsQtQuery.cpp \ 211 Qt4/QtMainWindow.cpp \ 212 Qt4/QtDialog.cpp \ 213 Qt4/QtUIFactory.cpp \ 214 Menu/Qt4/QtMenuPipe.cpp \ 215 Views/Qt4/QtWorldView.cpp \ 216 Views/Qt4/GLMoleculeView.cpp \ 217 Views/Qt4/QtMoleculeView.cpp \ 218 Views/Qt4/QtStatusBar.cpp 219 220 QTUIHEADER = \ 221 ${QTUIMOC_HEADER} \ 222 Menu/Qt4/QtMenu.hpp \ 223 Qt4/Query/QtQuery.hpp \ 224 Qt4/QtUIFactory.hpp \ 225 Qt4/Pipe/QtQueryListPipe.hpp 226 227 QTUI_DEFS = 228 229 230 231 lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 232 libMolecuilderQtUI-@MOLECUILDER_API_VERSION@.la 149 233 libMolecuilderUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 234 libMolecuilderQtUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 150 235 libMolecuilderUI_LIBS = \ 151 236 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 237 libMolecuilderQtUI_LIBS = \ 238 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 152 239 153 240 nobase_libMolecuilderUI_include_HEADERS = ${UIHEADER} 241 nobase_libMolecuilderQtUI_include_HEADERS = ${QTUIHEADER} 154 242 155 243 ## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la" … … 162 250 ## which are already listed elsewhere in a _HEADERS variable assignment. 163 251 libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${UISOURCE} 252 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${QTUISOURCE} 164 253 165 254 ## Instruct libtool to include ABI version information in the generated shared … … 167 256 ## that all version information is kept in one place. 168 257 libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION) 258 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION) 169 259 170 260 ## The generated configuration header is installed in its own subdirectory of … … 180 270 ## shipped with the source tarball. 181 271 libMolecuilderUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include 272 libMolecuilderQtUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include 182 273 nodist_libMolecuilderUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h 274 nodist_libMolecuilderQtUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h 183 275 184 276 ## Install the generated pkg-config file (.pc) into the expected location for … … 195 287 done; 196 288 289 #Rules needed for Qt4 290 # UI-Files are scattered throughout several subdirectories 291 # Therfore `%'-rules do not seem to work 292 #Quick fix to get it done otherwise 293 allmocs.moc.cpp: ${QTUIMOC_HEADER} 294 echo "" > allmocs.moc.cpp;\ 295 list='$(QTUIMOC_HEADER)'; for header in $$list; do \ 296 echo "Making mocfile for $$header"; \ 297 target=`basename $$header | sed "s/\(.*\)\..*/\1.moc.cpp/"`;\ 298 $(MOC) $(srcdir)/$$header -o $$target \ 299 || eval $$failcom; \ 300 echo "#include \"$$target\"" >> allmocs.moc.cpp; \ 301 done; 302 303 197 304 MOSTLYCLEANFILES = unity.cpp -
src/UIElements/Menu/Menu.hpp
r41e15b r5d4b73 21 21 * Note that this Class is never to be used directly but only via derived 22 22 * specializations. 23 * 24 * Note that we do not call member function init() directly in the constructor 25 * to allow for something to be add to the menu beforehand which is necessary 26 * for the TextMenu for example. 27 * 28 * <h1>Howto</h1> 29 * 30 * First, derive your own menu class, see QtMenu or TextMenu for example. These 31 * have been templated because of the two Qt classes QMenu and QMenuBar to be 32 * addressable in a unified manner. TextMenu does not actually need to be a 33 * template but it does not hurt either. 34 * 35 * Basically, the structure is as follows: 36 * -# Menu implements the initialization: it goes through MenuDescription's and 37 * ActionRegistry's contents and adds MenuItem's and Action's as requested. 38 * -# It does so by calling virtual functions defined in MenuInterface. These 39 * allow for adding of specific type of items: separators, Actions, menus 40 * -# Your derived Menu implements add these specific adders, basically just as 41 * wrappers. If you really have another UI type, implement its Menu 42 * functionality separately, such as TxMenu does. 43 * -# It also inherits both Menu and virtually MenuInterface such that it 44 * contains initializing and adding functionality 45 * 46 * Note that MenuInterface is inherited by both Menu and your class and hence has 47 * to be declared as a "virtual" base class for both. 23 48 */ 24 49 class Menu : virtual public MenuInterface -
src/UIElements/Menu/TextMenu/TextMenu.hpp
r41e15b r5d4b73 12 12 #include <string> 13 13 14 #include "Helpers/MemDebug.hpp" 15 14 16 #include "Helpers/Log.hpp" 15 17 #include "Helpers/Verbose.hpp" … … 19 21 #include "Actions/ActionRegistry.hpp" 20 22 #include "Actions/ActionTraits.hpp" 21 #include "Menu/TextMenu/TxMenu .hpp"23 #include "Menu/TextMenu/TxMenuLeaveAction.hpp" 22 24 #include "Menu/TextMenu/ActionMenuItem.hpp" 23 #include "Menu/TextMenu/Sep eratorItem.hpp"25 #include "Menu/TextMenu/SeparatorMenuItem.hpp" 24 26 #include "Menu/TextMenu/SubMenuItem.hpp" 25 27 26 28 /** TextMenu is a specialization of MenuInterface to access TxMenu-like menus. 29 * 30 * Basically, this class is to be used in the MainWindow class of the TextUI. 31 * There, we simply instantiate the class and call init() in order to add all 32 * MenuItem's from MenuDescriptions and Action's ActionRegistry. 33 * 27 34 * \sa QtMenu. 28 35 */ … … 31 38 { 32 39 public: 40 /** Constructor for class TextMenu. 41 * Initializes outputter and token and takes note whether to delete the 42 * MenuInstance or not. 43 */ 33 44 TextMenu(std::ostream &_outputter, const std::string &_token) : 34 45 MenuInterface(_token), … … 46 57 {} 47 58 59 /** Destructor of MenuInstance. 60 * 61 */ 48 62 virtual ~TextMenu() 49 63 { … … 52 66 } 53 67 68 /** Display this MenuInstance. 69 * 70 */ 54 71 void display() 55 72 { … … 57 74 } 58 75 76 /** Returns a pointer to the contained/wrapped MenuInstance. 77 * \return pointer to template class pointer 78 */ 59 79 T * const getMenuInstance() 60 80 { … … 62 82 } 63 83 84 /** Reserves a specific trigger key such that it is not used during init(). 85 * \param trigger trigger key 86 * \param &name token given for reference. 87 */ 64 88 void reserveShortcut(char trigger, const std::string &name) 65 89 { … … 78 102 MenuShortcutMap ShortcutMap; 79 103 104 /** Adds an ActionItem by simply creating a new one. 105 * \param &token token of Action (token in ActionRegistry) 106 * \param &description descriptive text to be shown 107 */ 80 108 virtual void addActionItem(const std::string &token, const std::string &description) 81 109 { … … 83 111 } 84 112 113 /** Adds a (dead) separator item. 114 * 115 */ 85 116 virtual void addSeparatorItem() 86 117 { 87 new Sep eratorItem(MenuInstance);118 new SeparatorMenuItem(MenuInstance); 88 119 } 89 120 121 /** Adds a Menu to this current Menu. 122 * We also create here a leave action for this submenu to be able to return 123 * to the current one again 124 * \param &token token of the menu 125 * \param &description descriptive text 126 */ 90 127 virtual void addSubmenuItem(const std::string &token, const std::string &description) 91 128 { … … 102 139 } 103 140 141 /** Return the next available trigger key suitable to this name. 142 * This function is used internally to make sure that each key is unique to 143 * each Action/Menu. The chosen trigger key is also stored in an internal ShortcutMap. 144 * \param &name text shown in menu 145 * \return trigger key 146 */ 104 147 char getSuitableShortForm(const std::string &name) 105 148 { -
src/UIElements/Menu/TextMenu/TxMenu.cpp
r41e15b r5d4b73 24 24 #include <iostream> 25 25 #include <cmath> 26 #include "Actions/Action.hpp"27 #include "Actions/ActionTraits.hpp"28 26 #include "Menu/TextMenu/TxMenu.hpp" 29 27 #include "Menu/TextMenu/MenuItem.hpp" 30 #include "Helpers/Assert.hpp"31 28 32 29 33 /** 30 /** Constructor for class TxMenu. 31 * 34 32 * produce a text menu with a given title. 35 33 * The text will later be displayed using the stream passed to the constructor. 34 * \param &_outputter output stream to use for displaying the text 35 * \param _title title of this menu 36 * \param _spacer key to separate trigger key from descriptive text shown 37 * \param _length maximum length of the descriptive text 36 38 */ 37 39 TxMenu::TxMenu(std::ostream& _outputter, const std::string _title, char _spacer,int _length) : … … 45 47 } 46 48 49 /** Destructor for class TxMenu. 50 * 51 */ 47 52 TxMenu::~TxMenu() 48 53 { … … 51 56 } 52 57 58 /** Adds an MenuItem to the internal list. 59 * \param *item item to add 60 */ 53 61 void TxMenu::addItem(MenuItem* item) { 54 62 items.push_back(item); 55 63 } 56 64 65 /** Removes an MenuItem to the internal list. 66 * \param *item item to remove 67 */ 57 68 void TxMenu::removeItem(MenuItem* item) { 58 69 items.remove(item); 59 70 } 60 71 72 /** Function to quit this TxMenu. 73 */ 61 74 void TxMenu::doQuit(){ 62 75 quit = true; 63 76 } 64 77 78 /** Return the current state of quitting. 79 * \return quit boolean 80 */ 65 81 bool TxMenu::hasQuit(){ 66 82 return quit; 67 83 } 68 84 85 /** Display in a formatted manner a given entry of this menu. 86 * \param *entry MenuItem to show 87 */ 69 88 void TxMenu::showEntry(MenuItem* entry){ 70 89 if(entry->isActive()==false){ … … 78 97 } 79 98 99 /** Display this menu. 100 * 101 */ 80 102 void TxMenu::display() { 81 103 char choice; … … 114 136 } 115 137 138 /** Return the internally stored title of the menu. 139 * \return title string 140 */ 116 141 std::string TxMenu::getTitle(){ 117 142 return title; 118 143 } 119 144 145 /** Return the internally stored outputter of the menu. 146 * \return output stream reference 147 */ 120 148 std::ostream& TxMenu::getOutputter() 121 149 { … … 123 151 } 124 152 125 153 /** Add a default item to the menu. 154 * \param *_defaultItem MenuItem to act as default item. 155 */ 126 156 void TxMenu::addDefault(MenuItem* _defaultItem) { 127 157 defaultItem = _defaultItem; 128 158 } 129 159 130 /****************************** Contained Actions ****************/131 132 TxMenu::LeaveAction::LeaveAction(TxMenu* const _menu, const ActionTraits & LeaveActionTrait) :133 Action(LeaveActionTrait, true),134 menu(_menu)135 {}136 137 TxMenu::LeaveAction::~LeaveAction(){}138 139 bool TxMenu::LeaveAction::canUndo(){140 return false;141 }142 143 bool TxMenu::LeaveAction::shouldUndo(){144 return false;145 }146 147 void TxMenu::LeaveAction::getParametersfromValueStorage()148 {}149 150 Dialog* TxMenu::LeaveAction::fillDialog(Dialog *dialog){151 ASSERT(dialog,"No Dialog given when filling action dialog");152 return dialog;153 }154 155 156 Action::state_ptr TxMenu::LeaveAction::performCall(){157 menu->doQuit();158 return Action::success;159 }160 161 162 Action::state_ptr TxMenu::LeaveAction::performUndo(Action::state_ptr){163 ASSERT(0,"Cannot undo leaving a menu");164 return Action::success;165 }166 167 Action::state_ptr TxMenu::LeaveAction::performRedo(Action::state_ptr){168 ASSERT(0,"Cannot redo leaving a menu");169 return Action::success;170 } -
src/UIElements/Menu/TextMenu/TxMenu.hpp
r41e15b r5d4b73 14 14 15 15 #include "Menu/Menu.hpp" 16 #include "Actions/Action.hpp"17 #include "Actions/ActionTraits.hpp"18 16 #include "defs.hpp" 19 17 20 18 class MenuItem; 21 19 22 /** 23 * Used to produce any kind of text menu 20 /** Menu for the TextUI. 24 21 * 25 * All Items are displayed and user is prompted for a key. The item corresponding to that key is then activated. 22 * Used to produce any kind of text menu. This is a generic text menu user 23 * interface, i.e. we have a list of MenuItem's, which can either be 24 * -# Action's 25 * -# Displayers 26 * -# Separators 27 * -# other Menu's 28 * 29 * In this manner we have a tree structure, the (sub)menus generating new 30 * branches, the rest making up the leaves. 31 * 32 * All Items are displayed via a given output stream and user is prompted 33 * for a key. The item corresponding to that key is then activated. 26 34 */ 27 35 class TxMenu 28 36 { 29 37 public: 30 class LeaveAction : public Action { 31 public: 32 LeaveAction(TxMenu* const, const ActionTraits &_trait); 33 virtual ~LeaveAction(); 34 35 bool canUndo(); 36 bool shouldUndo(); 37 38 protected: 39 virtual Dialog* fillDialog(Dialog *dialog); 40 private: 41 virtual void getParametersfromValueStorage(); 42 virtual Action::state_ptr performCall(); 43 virtual Action::state_ptr performUndo(Action::state_ptr); 44 virtual Action::state_ptr performRedo(Action::state_ptr); 45 46 TxMenu* const menu; 47 }; 38 class LeaveAction; 48 39 49 40 TxMenu(std::ostream& _outputter, const std::string _title, char _spacer=STD_MENU_TITLE_SPACER,int _length=STD_MENU_LENGTH); -
src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/AtomQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 -
src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/AtomsQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 -
src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 22 23 #include <Qt/qcombobox.h> 23 24 25 #include "Helpers/MemDebug.hpp" 24 26 25 27 BooleanQtQueryPipe::BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox) : -
src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 … … 23 24 #include <Qt/qtablewidget.h> 24 25 26 #include "Helpers/MemDebug.hpp" 25 27 #include "LinearAlgebra/Matrix.hpp" 26 28 #include "Box.hpp" -
src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/DoubleQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 22 #include <Qt/qcombobox.h> 23 23 #include "Helpers/MemDebug.hpp" 24 24 25 25 DoubleQtQueryPipe::DoubleQtQueryPipe(double *_content, QtDialog *_dialog) : -
src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/ElementQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 22 23 #include <Qt/qcombobox.h> 23 24 25 #include "Helpers/MemDebug.hpp" 24 26 #include "element.hpp" 25 27 #include "periodentafel.hpp" -
src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/ElementsQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 … … 24 25 #include <Qt/qcombobox.h> 25 26 27 #include "Helpers/MemDebug.hpp" 26 28 #include "element.hpp" 27 29 #include "periodentafel.hpp" -
src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/EmptyQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 22 #include <Qt/qcombobox.h> 23 23 #include "Helpers/MemDebug.hpp" 24 24 25 25 EmptyQtQueryPipe::EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel) : -
src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/QtDialog.hpp" 20 #include <QtGui/QFileDialog> 21 #include <Qt/qcombobox.h> 22 #include <Qt/qlineedit.h> 23 #include <Qt/qpushbutton.h> 24 25 #include "Helpers/MemDebug.hpp" 21 26 22 27 #include <iostream> 23 28 #include <boost/filesystem.hpp> 24 29 25 #include <Qt/qcombobox.h> 26 #include <Qt/qlineedit.h> 27 #include <Qt/qpushbutton.h> 28 30 #include "UIElements/Qt4/Pipe/FileQtQueryPipe.hpp" 31 #include "UIElements/Qt4/QtDialog.hpp" 29 32 30 33 FileQtQueryPipe::FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) : -
src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/IntQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 22 #include <Qt/qcombobox.h>23 #include "Helpers/MemDebug.hpp" 23 24 24 25 -
src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/MoleculeQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 22 23 #include <Qt/qcombobox.h> 24 25 #include "Helpers/MemDebug.hpp" 23 26 24 27 #include "Descriptors/MoleculeIdDescriptor.hpp" -
src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/MoleculesQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 … … 23 24 24 25 #include <Qt/qcombobox.h> 26 27 #include "Helpers/MemDebug.hpp" 25 28 26 29 #include "Descriptors/MoleculeIdDescriptor.hpp" -
src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp
r41e15b r5d4b73 9 9 #define QTQUERYLISTPIPE_HPP_ 10 10 11 #include "QtQueryPipe.hpp" 12 11 13 #include <boost/lexical_cast.hpp> 12 14 13 15 using boost::lexical_cast; 14 16 using boost::bad_lexical_cast; 17 15 18 16 19 template<typename T> QtQueryListPipe<T>::QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton) : -
src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/StringQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 23 #include "Helpers/MemDebug.hpp" 24 22 25 #include <string> 23 24 #include <Qt/qcombobox.h>25 26 26 27 -
src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 22 23 #include <Qt/qcombobox.h> 24 25 #include "Helpers/MemDebug.hpp" 23 26 24 27 -
src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp
r41e15b r5d4b73 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp" 20 21 #include "UIElements/Qt4/QtDialog.hpp" 21 22 23 #include <Qt/qcombobox.h> 24 25 #include "Helpers/MemDebug.hpp" 26 22 27 #include <vector> 23 24 #include <Qt/qcombobox.h>25 28 26 29 -
src/UIElements/Qt4/QtDialog.cpp
r41e15b r5d4b73 19 19 20 20 #include "UIElements/Qt4/QtDialog.hpp" 21 #include "UIElements/Qt4/Query/QtQuery.hpp" 21 22 22 23 #include <QtGui/QDialogButtonBox> -
src/UIElements/Qt4/QtDialog.hpp
r41e15b r5d4b73 11 11 #include "UIElements/Dialog.hpp" 12 12 #include <QtGui/QDialog> 13 #include <QtGui/QFileDialog>14 15 #include <boost/filesystem.hpp>16 13 17 14 #include <map> … … 20 17 21 18 class QBoxLayout; 22 class QLabel;23 class QSpinBox;24 class QDoubleSpinBox;25 class QLineEdit;26 class QListWidget;27 class QTableWidget;28 class QComboBox;29 19 class QDialogButtonBox; 30 31 class Matrix;32 33 // Forward declarations for plumbing34 template<typename T> class QtQueryListPipe;35 class BooleanQtQueryPipe;36 class BoxQtQueryPipe;37 class StringQtQueryPipe;38 class StringsQtQueryPipe;39 class IntQtQueryPipe;40 class DoubleQtQueryPipe;41 class DoublesQtQueryPipe;42 class AtomQtQueryPipe;43 class AtomsQtQueryPipe;44 class MoleculeQtQueryPipe;45 class MoleculesQtQueryPipe;46 class EmptyQtQueryPipe;47 class ElementQtQueryPipe;48 class ElementsQtQueryPipe;49 class VectorQtQueryPipe;50 class VectorsQtQueryPipe;51 class FileQtQueryPipe;52 20 53 21 class QtDialog : public QDialog, public Dialog … … 82 50 83 51 protected: 84 class IntQtQuery : public Dialog::IntQuery { 85 public: 86 IntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog); 87 virtual ~IntQtQuery(); 88 virtual bool handle(); 89 private: 90 QBoxLayout *parent; 91 QBoxLayout *thisLayout; 92 QLabel *titleLabel; 93 QSpinBox *inputBox; 94 95 IntQtQueryPipe *pipe; 96 }; 97 98 class IntsQtQuery : public Dialog::IntsQuery { 99 public: 100 IntsQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog); 101 virtual ~IntsQtQuery(); 102 virtual bool handle(); 103 void IntegerEntered(const QString&); 104 void IntegerSelected(); 105 void AddInteger(); 106 void RemoveInteger(); 107 private: 108 QBoxLayout *parent; 109 QBoxLayout *thisLayout; 110 QLabel *titleLabel; 111 112 QtQueryListPipe<int> *pipe; 113 }; 114 115 class DoubleQtQuery : public Dialog::DoubleQuery { 116 public: 117 DoubleQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog); 118 virtual ~DoubleQtQuery(); 119 virtual bool handle(); 120 private: 121 QBoxLayout *parent; 122 QBoxLayout *thisLayout; 123 QLabel *titleLabel; 124 QDoubleSpinBox *inputBox; 125 126 DoubleQtQueryPipe *pipe; 127 }; 128 129 class DoublesQtQuery : public Dialog::DoublesQuery { 130 public: 131 DoublesQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog); 132 virtual ~DoublesQtQuery(); 133 virtual bool handle(); 134 private: 135 QBoxLayout *parent; 136 QBoxLayout *thisLayout; 137 QLabel *titleLabel; 138 QDoubleSpinBox *inputBox; 139 140 QtQueryListPipe<double> *pipe; 141 }; 142 143 class StringQtQuery : public Dialog::StringQuery { 144 public: 145 StringQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); 146 virtual ~StringQtQuery(); 147 virtual bool handle(); 148 private: 149 QBoxLayout *parent; 150 QBoxLayout *thisLayout; 151 QLabel *titleLabel; 152 QLineEdit *inputBox; 153 154 StringQtQueryPipe *pipe; 155 }; 156 157 class StringsQtQuery : public Dialog::StringsQuery { 158 public: 159 StringsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); 160 virtual ~StringsQtQuery(); 161 virtual bool handle(); 162 private: 163 QBoxLayout *parent; 164 QBoxLayout *thisLayout; 165 QLabel *titleLabel; 166 QLineEdit *inputBox; 167 168 QtQueryListPipe<std::string> *pipe; 169 }; 170 171 class BoxQtQuery : public Dialog::BoxQuery { 172 public: 173 BoxQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); 174 virtual ~BoxQtQuery(); 175 virtual bool handle(); 176 private: 177 QBoxLayout *parent; 178 QBoxLayout *thisLayout; 179 QLabel *titleLabel; 180 QTableWidget *inputTable; 181 182 BoxQtQueryPipe *pipe; 183 }; 184 185 class AtomQtQuery : public Dialog::AtomQuery { 186 public: 187 AtomQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); 188 virtual ~AtomQtQuery(); 189 virtual bool handle(); 190 private: 191 QBoxLayout *parent; 192 QBoxLayout *thisLayout; 193 QLabel *titleLabel; 194 QComboBox *inputBox; 195 196 AtomQtQueryPipe *pipe; 197 }; 198 199 class AtomsQtQuery : public Dialog::AtomsQuery { 200 public: 201 AtomsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); 202 virtual ~AtomsQtQuery(); 203 virtual bool handle(); 204 private: 205 QBoxLayout *parent; 206 QBoxLayout *thisLayout; 207 QLabel *titleLabel; 208 QLabel *inputLabel; 209 QListWidget *inputList; 210 211 AtomsQtQueryPipe *pipe; 212 }; 213 214 class MoleculeQtQuery : public Dialog::MoleculeQuery { 215 public: 216 MoleculeQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); 217 virtual ~MoleculeQtQuery(); 218 virtual bool handle(); 219 private: 220 QBoxLayout *parent; 221 QBoxLayout *thisLayout; 222 QLabel *titleLabel; 223 QComboBox *inputBox; 224 225 MoleculeQtQueryPipe *pipe; 226 }; 227 228 class MoleculesQtQuery : public Dialog::MoleculesQuery { 229 public: 230 MoleculesQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); 231 virtual ~MoleculesQtQuery(); 232 virtual bool handle(); 233 private: 234 QBoxLayout *parent; 235 QBoxLayout *thisLayout; 236 QLabel *titleLabel; 237 QComboBox *inputBox; 238 239 MoleculesQtQueryPipe *pipe; 240 }; 241 242 class VectorQtQuery : public Dialog::VectorQuery { 243 public: 244 VectorQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *); 245 virtual ~VectorQtQuery(); 246 virtual bool handle(); 247 private: 248 QBoxLayout *parent; 249 QBoxLayout *mainLayout; 250 QLabel *titleLabel; 251 QBoxLayout *subLayout; 252 QBoxLayout *coordLayout; 253 QLabel *coordLabel; 254 QDoubleSpinBox *coordInput; 255 256 VectorQtQueryPipe *pipe; 257 }; 258 259 class VectorsQtQuery : public Dialog::VectorsQuery { 260 public: 261 VectorsQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *); 262 virtual ~VectorsQtQuery(); 263 virtual bool handle(); 264 private: 265 QBoxLayout *parent; 266 QBoxLayout *mainLayout; 267 QLabel *titleLabel; 268 QBoxLayout *subLayout; 269 QBoxLayout *coordLayout; 270 QLabel *coordLabel; 271 QDoubleSpinBox *coordInput; 272 273 VectorsQtQueryPipe *pipe; 274 }; 275 276 class EmptyQtQuery : public Dialog::EmptyQuery { 277 public: 278 EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); 279 virtual ~EmptyQtQuery(); 280 virtual bool handle(); 281 private: 282 QBoxLayout *parent; 283 QBoxLayout *thisLayout; 284 QLabel *titleLabel; 285 286 EmptyQtQueryPipe *pipe; 287 }; 288 289 class BooleanQtQuery : public Dialog::BooleanQuery { 290 public: 291 BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); 292 virtual ~BooleanQtQuery(); 293 virtual bool handle(); 294 private: 295 QBoxLayout *parent; 296 QBoxLayout *thisLayout; 297 QLabel *titleLabel; 298 QComboBox *booleanComboBox; 299 300 BooleanQtQueryPipe *pipe; 301 }; 302 303 class ElementQtQuery : public Dialog::ElementQuery { 304 public: 305 ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); 306 virtual ~ElementQtQuery(); 307 virtual bool handle(); 308 private: 309 QBoxLayout *parent; 310 QBoxLayout *thisLayout; 311 QLabel *titleLabel; 312 QComboBox *inputBox; 313 314 ElementQtQueryPipe *pipe; 315 }; 316 317 class ElementsQtQuery : public Dialog::ElementsQuery { 318 public: 319 ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); 320 virtual ~ElementsQtQuery(); 321 virtual bool handle(); 322 private: 323 QBoxLayout *parent; 324 QBoxLayout *thisLayout; 325 QLabel *titleLabel; 326 QComboBox *inputBox; 327 328 ElementsQtQueryPipe *pipe; 329 }; 330 331 class FileQtQuery : public Dialog::FileQuery { 332 public: 333 FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); 334 virtual ~FileQtQuery(); 335 virtual bool handle(); 336 private: 337 QBoxLayout *parent; 338 QBoxLayout *thisLayout; 339 QLabel *filenameLabel; 340 QLineEdit *filenameLineEdit; 341 QPushButton *filedialogButton; 342 343 FileQtQueryPipe *pipe; 344 }; 52 class AtomQtQuery; 53 class AtomsQtQuery; 54 class BooleanQtQuery; 55 class BoxQtQuery; 56 class DoubleQtQuery; 57 class DoublesQtQuery; 58 class ElementQtQuery; 59 class ElementsQtQuery; 60 class EmptyQtQuery; 61 class FileQtQuery; 62 class IntQtQuery; 63 class IntsQtQuery; 64 class MoleculeQtQuery; 65 class MoleculesQtQuery; 66 class StringQtQuery; 67 class StringsQtQuery; 68 class VectorQtQuery; 69 class VectorsQtQuery; 345 70 346 71 private: … … 351 76 }; 352 77 353 // All kinds of plumbing for Queries354 // Plumbing needs to be outside of the class where it is needed,355 // since MOC doesn't like nested classes356 357 358 template<typename T> class QtQueryListPipe : public QWidget {359 public:360 QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton);361 virtual ~QtQueryListPipe();362 void AddInteger();363 void RemoveInteger();364 void IntegerSelected();365 void IntegerEntered(const QString&);366 367 private:368 void AddValue(T item);369 void RemoveRow(int row);370 371 std::vector<T> *content;372 QtDialog *dialog;373 QLineEdit *inputBox;374 QListWidget *inputList;375 QPushButton *AddButton;376 QPushButton *RemoveButton;377 };378 379 380 class StringQtQueryPipe : public QWidget {381 Q_OBJECT382 public:383 StringQtQueryPipe(std::string *_content, QtDialog *_dialog);384 virtual ~StringQtQueryPipe();385 386 public slots:387 void update(const QString&);388 389 private:390 std::string *content;391 QtDialog *dialog;392 393 };394 395 class IntQtQueryPipe : public QWidget {396 Q_OBJECT397 public:398 IntQtQueryPipe(int *_content, QtDialog *_dialog);399 virtual ~IntQtQueryPipe();400 401 public slots:402 void update(int);403 404 private:405 int *content;406 QtDialog *dialog;407 408 };409 410 411 class DoubleQtQueryPipe : public QWidget {412 Q_OBJECT413 public:414 DoubleQtQueryPipe(double *_content, QtDialog *_dialog);415 virtual ~DoubleQtQueryPipe();416 417 public slots:418 void update(double);419 420 private:421 double *content;422 QtDialog *dialog;423 424 };425 426 class BoxQtQueryPipe : public QWidget {427 Q_OBJECT428 public:429 BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable);430 virtual ~BoxQtQueryPipe();431 432 public slots:433 void update(int,int);434 435 private:436 Box &content;437 QtDialog *dialog;438 QTableWidget *inputTable;439 440 Matrix *tmpM;441 };442 443 444 class AtomQtQueryPipe : public QWidget {445 Q_OBJECT446 public:447 AtomQtQueryPipe(const atom **_content, QtDialog *_dialog, QComboBox *_theBox);448 virtual ~AtomQtQueryPipe();449 450 public slots:451 void update(int);452 453 private:454 const atom **content;455 QtDialog *dialog;456 QComboBox *theBox;457 458 };459 460 461 class AtomsQtQueryPipe : public QWidget {462 Q_OBJECT463 public:464 AtomsQtQueryPipe(std::vector<const atom *>*_content, QtDialog *_dialog, QListWidget *_theList);465 virtual ~AtomsQtQueryPipe();466 467 public slots:468 void update();469 void add();470 void remove();471 472 private:473 std::vector<const atom *>*content;474 std::map<int, const atom *> lookup;475 std::set<const atom *> currentList;476 QtDialog *dialog;477 QListWidget *theList;478 479 };480 481 class MoleculeQtQueryPipe : public QWidget {482 Q_OBJECT483 public:484 MoleculeQtQueryPipe(const molecule **_content, QtDialog *_dialog, QComboBox *_theBox);485 virtual ~MoleculeQtQueryPipe();486 487 public slots:488 void update(int);489 490 private:491 const molecule **content;492 QtDialog *dialog;493 QComboBox *theBox;494 495 };496 497 class MoleculesQtQueryPipe : public QWidget {498 Q_OBJECT499 public:500 MoleculesQtQueryPipe(std::vector<const molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox);501 virtual ~MoleculesQtQueryPipe();502 503 public slots:504 void update(int);505 506 private:507 std::vector<const molecule *>*content;508 QtDialog *dialog;509 QComboBox *theBox;510 511 };512 513 class VectorQtQueryPipe : public QWidget {514 Q_OBJECT515 public:516 VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox);517 virtual ~VectorQtQueryPipe();518 519 public slots:520 void update();521 522 private:523 Vector *content;524 QtDialog *dialog;525 QComboBox *theBox;526 };527 528 class VectorsQtQueryPipe : public QWidget {529 Q_OBJECT530 public:531 VectorsQtQueryPipe(std::vector<Vector>*_content, QtDialog *_dialog, QComboBox *_theBox);532 virtual ~VectorsQtQueryPipe();533 534 public slots:535 void update();536 537 private:538 std::vector<Vector> *content;539 QtDialog *dialog;540 QComboBox *theBox;541 };542 543 class EmptyQtQueryPipe : public QWidget {544 Q_OBJECT545 public:546 EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel);547 virtual ~EmptyQtQueryPipe();548 549 public slots:550 void update();551 552 private:553 QtDialog *dialog;554 QLabel *textLabel;555 };556 557 class BooleanQtQueryPipe : public QWidget {558 Q_OBJECT559 public:560 BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox);561 virtual ~BooleanQtQueryPipe();562 563 public slots:564 void update();565 566 private:567 const bool *content;568 QtDialog *dialog;569 QComboBox *booleanComboBox;570 };571 572 class ElementQtQueryPipe : public QWidget {573 Q_OBJECT574 public:575 ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox);576 virtual ~ElementQtQueryPipe();577 578 public slots:579 void update(int);580 581 private:582 const element **content;583 QtDialog *dialog;584 QComboBox *theBox;585 };586 587 class ElementsQtQueryPipe : public QWidget {588 Q_OBJECT589 public:590 ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox);591 virtual ~ElementsQtQueryPipe();592 593 public slots:594 void update(int);595 596 private:597 std::vector<const element *>*content;598 QtDialog *dialog;599 QComboBox *theBox;600 };601 602 class FileQtQueryPipe : public QWidget {603 Q_OBJECT604 public:605 FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton);606 virtual ~FileQtQueryPipe();607 608 public slots:609 void update();610 void showFileDialog();611 612 private:613 boost::filesystem::path *content;614 QtDialog *dialog;615 QLineEdit *filenameLineEdit;616 QPushButton *filedialogButton;617 QFileDialog *theFileDialog;618 };619 78 620 79 #endif /* QTDIALOG_HPP_ */ -
src/UIElements/Qt4/Query/AtomQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/AtomQtQueryPipe.hpp" 27 28 28 29 #include "atom.hpp" -
src/UIElements/Qt4/Query/AtomsQtQuery.cpp
r41e15b r5d4b73 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/QtDialog.hpp" 28 #include "UIElements/Qt4/Query/QtQuery.hpp" 29 #include "UIElements/Qt4/Pipe/AtomsQtQueryPipe.hpp" 29 30 30 31 #include "atom.hpp" -
src/UIElements/Qt4/Query/BooleanQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp" 27 28 28 29 -
src/UIElements/Qt4/Query/BoxQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp" 27 28 28 29 #include "LinearAlgebra/Matrix.hpp" -
src/UIElements/Qt4/Query/DoubleQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/DoubleQtQueryPipe.hpp" 27 28 28 29 -
src/UIElements/Qt4/Query/DoublesQtQuery.cpp
r41e15b r5d4b73 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/Q tDialog.hpp"28 #include "UIElements/Qt4/Query/QtQuery.hpp" 29 29 #include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp" 30 30 -
src/UIElements/Qt4/Query/ElementQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/ElementQtQueryPipe.hpp" 27 28 28 29 #include "element.hpp" -
src/UIElements/Qt4/Query/ElementsQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/ElementsQtQueryPipe.hpp" 27 28 28 29 #include "element.hpp" -
src/UIElements/Qt4/Query/EmptyQtQuery.cpp
r41e15b r5d4b73 23 23 #include "Helpers/MemDebug.hpp" 24 24 25 #include "UIElements/Qt4/QtDialog.hpp" 25 #include "UIElements/Qt4/Query/QtQuery.hpp" 26 #include "UIElements/Qt4/Pipe/EmptyQtQueryPipe.hpp" 26 27 27 28 -
src/UIElements/Qt4/Query/FileQtQuery.cpp
r41e15b r5d4b73 25 25 #include "Helpers/MemDebug.hpp" 26 26 27 #include "UIElements/Qt4/QtDialog.hpp" 27 #include "UIElements/Qt4/Query/QtQuery.hpp" 28 #include "UIElements/Qt4/Pipe/FileQtQueryPipe.hpp" 28 29 29 30 -
src/UIElements/Qt4/Query/IntQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/IntQtQueryPipe.hpp" 27 28 28 29 -
src/UIElements/Qt4/Query/IntsQtQuery.cpp
r41e15b r5d4b73 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/Q tDialog.hpp"28 #include "UIElements/Qt4/Query/QtQuery.hpp" 29 29 #include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp" 30 30 -
src/UIElements/Qt4/Query/MoleculeQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/MoleculeQtQueryPipe.hpp" 27 28 28 29 #include "molecule.hpp" -
src/UIElements/Qt4/Query/MoleculesQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/MoleculesQtQueryPipe.hpp" 27 28 28 29 #include "molecule.hpp" -
src/UIElements/Qt4/Query/StringQtQuery.cpp
r41e15b r5d4b73 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/QtDialog.hpp" 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/StringQtQueryPipe.hpp" 27 28 28 29 -
src/UIElements/Qt4/Query/StringsQtQuery.cpp
r41e15b r5d4b73 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/Q tDialog.hpp"28 #include "UIElements/Qt4/Query/QtQuery.hpp" 29 29 #include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp" 30 30 -
src/UIElements/Qt4/Query/VectorQtQuery.cpp
r41e15b r5d4b73 25 25 #include "Helpers/MemDebug.hpp" 26 26 27 #include "UIElements/Qt4/QtDialog.hpp" 27 #include "UIElements/Qt4/Query/QtQuery.hpp" 28 #include "UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp" 28 29 29 30 -
src/UIElements/Qt4/Query/VectorsQtQuery.cpp
r41e15b r5d4b73 25 25 #include "Helpers/MemDebug.hpp" 26 26 27 #include "UIElements/Qt4/QtDialog.hpp" 27 #include "UIElements/Qt4/Query/QtQuery.hpp" 28 #include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp" 28 29 29 30 -
src/UIElements/TextUI/Query/AtomTextQuery.cpp
r41e15b r5d4b73 24 24 #include <Descriptors/AtomDescriptor.hpp> 25 25 #include <Descriptors/AtomIdDescriptor.hpp> 26 #include "TextUI/ TextDialog.hpp"26 #include "TextUI/Query/TextQuery.hpp" 27 27 28 28 #include "Helpers/Log.hpp" … … 41 41 do{ 42 42 badInput = false; 43 Log() << Verbose(0) << getTitle();44 cin >> idxOfAtom;45 if( cin.fail()){43 std::cout << getDescription() << ": "; 44 std::cin >> idxOfAtom; 45 if(std::cin.fail()){ 46 46 badInput = true; 47 cin.clear();48 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');49 Log() << Verbose(0) << "Input was not a number!" <<endl;47 std::cin.clear(); 48 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 49 std::cout << "Input was not a number!" << std::endl; 50 50 continue; 51 51 } … … 53 53 tmp = World::getInstance().getAtom(AtomById(idxOfAtom)); 54 54 if(!tmp && idxOfAtom!=-1){ 55 Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom <<endl;55 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; 56 56 badInput = true; 57 57 } 58 58 59 59 } while(badInput); 60 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');60 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 61 61 return (idxOfAtom!=-1); 62 62 } -
src/UIElements/TextUI/Query/AtomsTextQuery.cpp
r41e15b r5d4b73 22 22 #include <Descriptors/AtomDescriptor.hpp> 23 23 #include <Descriptors/AtomIdDescriptor.hpp> 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 bool TextDialog::AtomsTextQuery::handle() { 40 40 int idxOfAtom=-1; 41 Log() << Verbose(0) << getTitle();41 std::cout << getDescription() << ": "; 42 42 std::string line; 43 getline( cin,line);43 getline(std::cin,line); 44 44 // dissect by " " 45 45 std::string::iterator olditer = line.begin(); … … 50 50 temp = World::getInstance().getAtom(AtomById(idxOfAtom)); 51 51 if(!temp && idxOfAtom!=-1){ 52 Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom <<endl;52 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; 53 53 break; 54 54 } … … 62 62 temp = World::getInstance().getAtom(AtomById(idxOfAtom)); 63 63 if(!temp && idxOfAtom!=-1) { 64 Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom <<endl;64 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; 65 65 tmp.push_back(temp); 66 66 } -
src/UIElements/TextUI/Query/BooleanTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 do{ 40 40 badInput = false; 41 Log() << Verbose(0) << getTitle();42 cin >> input;41 std::cout << getDescription() << "[y/n]: "; 42 std::cin >> input; 43 43 if ((input == 'y' ) || (input == 'Y')) { 44 44 tmp = true; … … 47 47 } else { 48 48 badInput=true; 49 cin.clear();50 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');51 Log() << Verbose(0) << "Input was not of [yYnN]!" <<endl;49 std::cin.clear(); 50 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 51 std::cout << "Input was not of [yYnN]!" << std::endl; 52 52 } 53 53 } while(badInput); 54 54 // clear the input buffer of anything still in the line 55 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');55 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 56 56 return true; 57 57 } -
src/UIElements/TextUI/Query/BoxTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 37 37 38 38 bool TextDialog::BoxTextQuery::handle() { 39 Log() << Verbose(0)<< getTitle();39 std::cout << getTitle(); 40 40 41 41 double temp[6]; 42 std::cout << getDescription() << " - "; 42 43 std::string coords[6] = {"xx","yx","yy", "zx", "zy", "zz"}; 43 44 for (int i=0;i<6;i++) { 44 Log() << Verbose(0)<< coords[i] << ": ";45 cin >> temp[i];45 std::cout << coords[i] << ": "; 46 std::cin >> temp[i]; 46 47 } 47 48 Matrix M; -
src/UIElements/TextUI/Query/DoubleTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 38 38 do{ 39 39 badInput = false; 40 Log() << Verbose(0) << getTitle();41 cin >> tmp;42 if( cin.fail()){40 std::cout << getDescription() << ": "; 41 std::cin >> tmp; 42 if(std::cin.fail()){ 43 43 badInput = true; 44 cin.clear();45 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');46 Log() << Verbose(0) << "Input was not a number!" <<endl;44 std::cin.clear(); 45 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 46 std::cout << "Input was not a number!" << std::endl; 47 47 } 48 48 }while(badInput); 49 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');49 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 50 50 return true; 51 51 } -
src/UIElements/TextUI/Query/DoublesTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::DoublesTextQuery::handle() { 37 Log() << Verbose(0) << getTitle();37 std::cout << getDescription() << ": "; 38 38 std::string line; 39 getline( cin,line);39 getline(std::cin,line); 40 40 // dissect by " " 41 41 std::string::iterator olditer = line.begin(); -
src/UIElements/TextUI/Query/ElementTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 44 44 do{ 45 45 badInput = false; 46 Log() << Verbose(0) << getTitle();46 std::cout << getDescription() << ": "; 47 47 48 48 // try to read as Atomic number 49 49 int Z; 50 cin >> Z;51 if(! cin.fail()){50 std::cin >> Z; 51 if(!std::cin.fail()){ 52 52 if(Z==-1){ 53 53 aborted = true; … … 56 56 temp = World::getInstance().getPeriode()->FindElement(Z); 57 57 if(!temp){ 58 Log() << Verbose(0) << "No element with this atomic number!" <<endl;58 std::cout << "No element with this atomic number!" << std::endl; 59 59 badInput = true; 60 60 } … … 63 63 } 64 64 else{ 65 cin.clear();65 std::cin.clear(); 66 66 } 67 67 … … 70 70 // same thing again, this time as a std::string 71 71 std::string shorthand; 72 cin >> shorthand;73 if(! cin.fail()){72 std::cin >> shorthand; 73 if(!std::cin.fail()){ 74 74 if(shorthand.empty()){ 75 75 aborted = true; … … 78 78 temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str()); 79 79 if(!temp){ 80 Log() << Verbose(0) << "No element with this shorthand!" <<endl;80 std::cout << "No element with this shorthand!" << std::endl; 81 81 badInput = true; 82 82 } … … 84 84 } 85 85 else{ 86 Log() << Verbose(0) << "Could not read input. Try Again." <<endl;87 cin.clear();88 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');86 std::cout << "Could not read input. Try Again." << std::endl; 87 std::cin.clear(); 88 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 89 89 badInput = true; 90 90 } 91 91 92 92 }while(badInput); 93 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');93 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 94 94 return !aborted; 95 95 } -
src/UIElements/TextUI/Query/ElementsTextQuery.cpp
r41e15b r5d4b73 23 23 #include <boost/lexical_cast.hpp> 24 24 25 #include "TextUI/ TextDialog.hpp"25 #include "TextUI/Query/TextQuery.hpp" 26 26 27 27 #include "Helpers/Log.hpp" … … 45 45 std::string shorthand; 46 46 int Z=-1; 47 Log() << Verbose(0) << getTitle();47 std::cout << getDescription() << ": "; 48 48 std::string line; 49 getline( cin,line);49 getline(std::cin,line); 50 50 // dissect by " " 51 51 std::string::iterator olditer = line.begin(); … … 61 61 }; 62 62 if(!temp && Z!=-1){ 63 Log() << Verbose(0) << "Invalid Element" << shorthand <<endl;63 std::cout << "Invalid Element" << shorthand << std::endl; 64 64 break; 65 65 } … … 78 78 }; 79 79 if(!temp && Z!=-1) { 80 Log() << Verbose(0) << "Invalid Element" << shorthand <<endl;80 std::cout << "Invalid Element" << shorthand << std::endl; 81 81 tmp.push_back(temp); 82 82 } -
src/UIElements/TextUI/Query/EmptyTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" -
src/UIElements/TextUI/Query/FileTextQuery.cpp
r41e15b r5d4b73 21 21 22 22 #include <iostream> 23 #include <string> 23 24 24 25 #include <boost/filesystem.hpp> 25 26 26 #include "TextUI/ TextDialog.hpp"27 #include "TextUI/Query/TextQuery.hpp" 27 28 28 29 #include "Helpers/Log.hpp" … … 37 38 38 39 bool TextDialog::FileTextQuery::handle() { 39 Log() << Verbose(0) << getTitle();40 bool badInput = false; 40 41 std::string tempstring; 41 getline(cin,tempstring); 42 do{ 43 badInput = false; 44 std::cout << getDescription() << ": "; 45 std::cin >> tempstring; 46 if(std::cin.fail()){ 47 badInput = true; 48 std::cin.clear(); 49 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 50 std::cout << "Input was not a number!" << std::endl; 51 continue; 52 } 53 } while(badInput); 54 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 42 55 tmp = tempstring; 43 56 return true; -
src/UIElements/TextUI/Query/IntTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 38 38 do{ 39 39 badInput = false; 40 Log() << Verbose(0) << getTitle();41 cin >> tmp;42 if( cin.fail()){40 std::cout << getDescription() << ": "; 41 std::cin >> tmp; 42 if(std::cin.fail()){ 43 43 badInput=true; 44 cin.clear();45 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');46 Log() << Verbose(0) << "Input was not a number!" <<endl;44 std::cin.clear(); 45 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 46 std::cout << "Input was not a number!" << std::endl; 47 47 } 48 48 } while(badInput); 49 49 // clear the input buffer of anything still in the line 50 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');50 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 51 51 return true; 52 52 } -
src/UIElements/TextUI/Query/IntsTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::IntsTextQuery::handle() { 37 Log() << Verbose(0) << getTitle();37 std::cout << getDescription() << ": "; 38 38 std::string line; 39 getline( cin,line);39 getline(std::cin,line); 40 40 // dissect by " " 41 41 std::string::iterator olditer = line.begin(); -
src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
r41e15b r5d4b73 24 24 #include <Descriptors/MoleculeDescriptor.hpp> 25 25 #include <Descriptors/MoleculeIdDescriptor.hpp> 26 #include "TextUI/ TextDialog.hpp"26 #include "TextUI/Query/TextQuery.hpp" 27 27 28 28 #include "Helpers/Log.hpp" … … 42 42 do{ 43 43 badInput = false; 44 Log() << Verbose(0) << getTitle();45 cin >> idxOfMol;46 if( cin.fail()){44 std::cout << getDescription() << ": "; 45 std::cin >> idxOfMol; 46 if(std::cin.fail()){ 47 47 badInput = true; 48 cin.clear();49 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');50 Log() << Verbose(0) << "Input was not a number!" <<endl;48 std::cin.clear(); 49 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 50 std::cout << "Input was not a number!" << std::endl; 51 51 continue; 52 52 } … … 54 54 tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 55 55 if(!tmp && idxOfMol!=-1){ 56 Log() << Verbose(0) << "Invalid Molecule Index" <<endl;56 std::cout << "Invalid Molecule Index" << std::endl; 57 57 badInput = true; 58 58 } 59 59 60 60 } while(badInput); 61 cin.ignore(std::numeric_limits<streamsize>::max(),'\n');61 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 62 62 return (idxOfMol!=-1); 63 63 } -
src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
r41e15b r5d4b73 24 24 #include <Descriptors/MoleculeDescriptor.hpp> 25 25 #include <Descriptors/MoleculeIdDescriptor.hpp> 26 #include "TextUI/ TextDialog.hpp"26 #include "TextUI/Query/TextQuery.hpp" 27 27 28 28 #include "Helpers/Log.hpp" … … 39 39 bool TextDialog::MoleculesTextQuery::handle() { 40 40 int idxOfMol=-1; 41 Log() << Verbose(0) << getTitle();41 std::cout << getDescription() << ": "; 42 42 std::string line; 43 getline( cin,line);43 getline(std::cin,line); 44 44 // dissect by " " 45 45 std::string::iterator olditer = line.begin(); … … 50 50 temp = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 51 51 if(!temp && idxOfMol!=-1){ 52 Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol <<endl;52 std::cout << "Invalid Molecule Index" << idxOfMol << std::endl; 53 53 break; 54 54 } … … 62 62 temp = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 63 63 if(!temp && idxOfMol!=-1){ 64 Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol <<endl;64 std::cout << "Invalid Molecule Index" << idxOfMol << std::endl; 65 65 tmp.push_back(temp); 66 66 } -
src/UIElements/TextUI/Query/StringTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::StringTextQuery::handle() { 37 Log() << Verbose(0) << getTitle();38 getline( cin,tmp);37 std::cout << getDescription() << ": "; 38 getline(std::cin,tmp); 39 39 return true; 40 40 } -
src/UIElements/TextUI/Query/StringsTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::StringsTextQuery::handle() { 37 Log() << Verbose(0) << getTitle();38 getline( cin,temp);37 std::cout << getDescription() << ": "; 38 getline(std::cin,temp); 39 39 // dissect by " " 40 40 std::string::iterator olditer = temp.begin(); -
src/UIElements/TextUI/Query/VectorTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 40 40 bool TextDialog::VectorTextQuery::handle() { 41 std::cout << get Title();41 std::cout << getDescription() << std::endl; 42 42 const Matrix &M = World::getInstance().getDomain().getM(); 43 43 char coords[3] = {'x', 'y', 'z'}; … … 46 46 47 47 std::string line; 48 getline( cin,line);48 getline(std::cin,line); 49 49 50 50 // dissect by "," -
src/UIElements/TextUI/Query/VectorsTextQuery.cpp
r41e15b r5d4b73 22 22 #include <iostream> 23 23 24 #include "TextUI/ TextDialog.hpp"24 #include "TextUI/Query/TextQuery.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 40 40 bool TextDialog::VectorsTextQuery::handle() { 41 std::cout << get Title();41 std::cout << getDescription() << std::endl; 42 42 char coords[3] = {'x', 'y', 'z'}; 43 43 const Matrix &M = World::getInstance().getDomain().getM(); … … 46 46 47 47 std::string line; 48 getline( cin,line);48 getline(std::cin,line); 49 49 50 50 // dissect by "," -
src/UIElements/TextUI/TextDialog.cpp
r41e15b r5d4b73 21 21 22 22 #include "TextUI/TextDialog.hpp" 23 #include "TextUI/Query/TextQuery.hpp" 23 24 24 25 using namespace std; -
src/UIElements/TextUI/TextDialog.hpp
r41e15b r5d4b73 45 45 protected: 46 46 // specialized stuff for text queries 47 class EmptyTextQuery : public Dialog::EmptyQuery { 48 public: 49 EmptyTextQuery(std::string title, std::string _description = NULL); 50 virtual ~EmptyTextQuery(); 51 virtual bool handle(); 52 }; 53 54 class BooleanTextQuery : public Dialog::BooleanQuery { 55 public: 56 BooleanTextQuery(std::string title, std::string _description = NULL); 57 virtual ~BooleanTextQuery(); 58 virtual bool handle(); 59 }; 60 61 class IntTextQuery : public Dialog::IntQuery { 62 public: 63 IntTextQuery(std::string title, std::string _description = NULL); 64 virtual ~IntTextQuery(); 65 virtual bool handle(); 66 }; 67 68 class IntsTextQuery : public Dialog::IntsQuery { 69 public: 70 IntsTextQuery(std::string title, std::string _description = NULL); 71 virtual ~IntsTextQuery(); 72 virtual bool handle(); 73 }; 74 75 class DoubleTextQuery : public Dialog::DoubleQuery { 76 public: 77 DoubleTextQuery(std::string title, std::string _description = NULL); 78 virtual ~DoubleTextQuery(); 79 virtual bool handle(); 80 }; 81 82 class DoublesTextQuery : public Dialog::DoublesQuery { 83 public: 84 DoublesTextQuery(std::string title, std::string _description = NULL); 85 virtual ~DoublesTextQuery(); 86 virtual bool handle(); 87 }; 88 89 class StringTextQuery : public Dialog::StringQuery { 90 public: 91 StringTextQuery(std::string title, std::string _description = NULL); 92 virtual ~StringTextQuery(); 93 virtual bool handle(); 94 }; 95 96 class StringsTextQuery : public Dialog::StringsQuery { 97 public: 98 StringsTextQuery(std::string title, std::string _description = NULL); 99 virtual ~StringsTextQuery(); 100 virtual bool handle(); 101 }; 102 103 class AtomTextQuery : public Dialog::AtomQuery { 104 public: 105 AtomTextQuery(std::string title, std::string _description = NULL); 106 virtual ~AtomTextQuery(); 107 virtual bool handle(); 108 }; 109 110 class AtomsTextQuery : public Dialog::AtomsQuery { 111 public: 112 AtomsTextQuery(std::string title, std::string _description = NULL); 113 virtual ~AtomsTextQuery(); 114 virtual bool handle(); 115 }; 116 117 class MoleculeTextQuery : public Dialog::MoleculeQuery { 118 public: 119 MoleculeTextQuery(std::string title, std::string _description = NULL); 120 virtual ~MoleculeTextQuery(); 121 virtual bool handle(); 122 }; 123 124 class MoleculesTextQuery : public Dialog::MoleculesQuery { 125 public: 126 MoleculesTextQuery(std::string title, std::string _description = NULL); 127 virtual ~MoleculesTextQuery(); 128 virtual bool handle(); 129 }; 130 131 class VectorTextQuery : public Dialog::VectorQuery { 132 public: 133 VectorTextQuery(std::string title,bool _check, std::string _description = NULL); 134 virtual ~VectorTextQuery(); 135 virtual bool handle(); 136 }; 137 138 class VectorsTextQuery : public Dialog::VectorsQuery { 139 public: 140 VectorsTextQuery(std::string title,bool _check, std::string _description = NULL); 141 virtual ~VectorsTextQuery(); 142 virtual bool handle(); 143 }; 144 145 class BoxTextQuery : public Dialog::BoxQuery { 146 public: 147 BoxTextQuery(std::string title, std::string _description = NULL); 148 virtual ~BoxTextQuery(); 149 virtual bool handle(); 150 }; 151 152 class ElementTextQuery : public Dialog::ElementQuery { 153 public: 154 ElementTextQuery(std::string title, std::string _description = NULL); 155 virtual ~ElementTextQuery(); 156 virtual bool handle(); 157 }; 158 159 class ElementsTextQuery : public Dialog::ElementsQuery { 160 public: 161 ElementsTextQuery(std::string title, std::string _description = NULL); 162 virtual ~ElementsTextQuery(); 163 virtual bool handle(); 164 }; 165 166 class FileTextQuery : public Dialog::FileQuery { 167 public: 168 FileTextQuery(std::string title, std::string _description = NULL); 169 virtual ~FileTextQuery(); 170 virtual bool handle(); 171 }; 47 // all placed into Query/TextQuery.hpp 48 // !please adhere to alphabetical ordering! 49 class AtomTextQuery; 50 class AtomsTextQuery; 51 class BooleanTextQuery; 52 class BoxTextQuery; 53 class DoubleTextQuery; 54 class DoublesTextQuery; 55 class ElementTextQuery; 56 class ElementsTextQuery; 57 class EmptyTextQuery; 58 class FileTextQuery; 59 class IntTextQuery; 60 class IntsTextQuery; 61 class MoleculeTextQuery; 62 class MoleculesTextQuery; 63 class StringTextQuery; 64 class StringsTextQuery; 65 class VectorTextQuery; 66 class VectorsTextQuery; 172 67 }; 173 68 -
src/UIElements/TextUI/TextWindow.cpp
r41e15b r5d4b73 26 26 #include "Menu/TextMenu/TxMenu.hpp" 27 27 #include "Menu/TextMenu/ActionMenuItem.hpp" 28 #include "Menu/TextMenu/Sep eratorItem.hpp"28 #include "Menu/TextMenu/SeparatorMenuItem.hpp" 29 29 #include "Menu/TextMenu/DisplayMenuItem.hpp" 30 30 #include "Menu/TextMenu/SubMenuItem.hpp" … … 65 65 new DisplayMenuItem(main_menu->getMenuInstance(),moleculeView,"Molecule List"); 66 66 67 new Sep eratorItem(main_menu->getMenuInstance());67 new SeparatorMenuItem(main_menu->getMenuInstance()); 68 68 69 69 main_menu->init(); 70 70 71 new Sep eratorItem(main_menu->getMenuInstance());71 new SeparatorMenuItem(main_menu->getMenuInstance()); 72 72 73 73 // save has reserved key 's'
Note:
See TracChangeset
for help on using the changeset viewer.