Changes in / [5d4b73:41e15b]
- Location:
- src
- Files:
-
- 2 added
- 25 deleted
- 84 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
r5d4b73 r41e15b 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.hpp 135 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.cpp 178 179 QTUIHEADER = \ 180 ${QTUIMOC_HEADER} \ 181 UIElements/Qt4/Pipe/QtQueryListPipe.hpp \ 182 UIElements/Qt4/QtUIFactory.hpp 183 184 QTUI_DEFS = 126 185 127 186 TESSELATIONSOURCE = \ … … 299 358 300 359 #Stuff for building the GUI using Qt 301 molecuildergui_SOURCES = builder.cpp360 molecuildergui_SOURCES = ${QTUISOURCE} builder.cpp 302 361 molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT 303 362 molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS} ${GLU_LDFLAGS} … … 308 367 molecuildergui_LDADD = \ 309 368 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 310 UIElements/libMolecuilderQtUI-@MOLECUILDER_API_VERSION@.la \311 369 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 312 370 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ … … 339 397 Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 340 398 $(BOOST_LIB) 399 400 #Rules needed for Qt4 401 # UI-Files are scattered throughout several subdirectories 402 # Therfore `%'-rules do not seem to work 403 #Quick fix to get it done otherwise 404 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; 341 413 342 414 #EXTRA_DIST = ${molecuilder_DATA} -
src/UIElements/CommandLineUI/CommandLineDialog.cpp
r5d4b73 r41e15b 21 21 22 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 #include "CommandLineUI/Query/CommandLineQuery.hpp"24 23 25 24 -
src/UIElements/CommandLineUI/CommandLineDialog.hpp
r5d4b73 r41e15b 48 48 protected: 49 49 // specialized stuff for text queries 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; 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 }; 68 175 }; 69 176 -
src/UIElements/CommandLineUI/CommandLineParser.cpp
r5d4b73 r41e15b 21 21 22 22 #include <boost/filesystem.hpp> 23 #include <boost/lexical_cast.hpp> 23 24 #include <boost/program_options.hpp> 24 25 #include <fstream> 25 26 #include <iostream> 26 27 #include <map> 28 #include <vector> 27 29 28 30 #include "Actions/Action.hpp" … … 32 34 #include "Actions/OptionTrait.hpp" 33 35 #include "Actions/Values.hpp" 36 #include "Helpers/Assert.hpp" 34 37 #include "Helpers/Log.hpp" 35 38 #include "Helpers/Verbose.hpp" 36 39 #include "CommandLineParser.hpp" 37 #include "CommandLineParser_validate.hpp"38 40 39 41 #include "Patterns/Singleton_impl.hpp" 40 42 41 43 class element; 44 45 using namespace std; 46 47 /** boost::program_options validator specialization for VectorValue. 48 * \param &v reference for return value 49 * \param &values string vector of scanned options 50 * \param * 51 * \param 52 * 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 values 60 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 values 94 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 value 127 * \param &values string vector of scanned options 128 * \param * 129 * \param 130 * 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 values 139 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 42 147 43 148 /** Constructor of class CommandLineParser. … … 356 461 { 357 462 po::store(po::command_line_parser(argc,argv).options(cmdline_options).run(), vm); 358 std::ifstream input;463 ifstream input; 359 464 input.open("example.cfg"); 360 465 if (!input.fail()) … … 368 473 void CommandLineParser::scanforSequenceOfArguments() 369 474 { 370 std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();475 map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap(); 371 476 // go through all arguments 372 477 for (int i=1;i<argc;i++) { 373 ( std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl);478 (cout << Verbose(1) << "Checking on " << argv[i] << endl); 374 479 // check whether they 375 480 if (argv[i][0] == '-') { // .. begin with - … … 380 485 // .. and check that next letter is not numeric, if so insert 381 486 } else if (((argv[i][1] < '0') || (argv[i][1] > '9')) && ((argv[i][1] != '.'))) { 382 std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));487 map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1])); 383 488 if (iter != ShortFormToActionMap.end()) { 384 489 (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl); … … 406 511 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() 407 512 { 408 std::map <std::string, std::string> result;513 map <std::string, std::string> result; 409 514 410 515 ActionRegistry &AR = ActionRegistry::getInstance(); -
src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
r5d4b73 r41e15b 24 24 #include <Descriptors/AtomDescriptor.hpp> 25 25 #include <Descriptors/AtomIdDescriptor.hpp> 26 #include "CommandLineUI/CommandLineDialog.hpp" 26 27 27 #include "CommandLineUI/Query/CommandLineQuery.hpp"28 28 #include "CommandLineUI/CommandLineParser.hpp" 29 29 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
r5d4b73 r41e15b 22 22 #include <Descriptors/AtomDescriptor.hpp> 23 23 #include <Descriptors/AtomIdDescriptor.hpp> 24 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 #include "CommandLineUI/CommandLineDialog.hpp" 25 25 26 #include "CommandLineUI/CommandLineParser.hpp" 26 27 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 24 #include "Actions/Values.hpp" 23 #include "CommandLineUI/Query/CommandLineQuery.hpp"24 25 #include "CommandLineUI/CommandLineParser.hpp" 25 26 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "CommandLineUI/Query/CommandLineQuery.hpp" 24 #include "CommandLineUI/CommandLineDialog.hpp" 25 25 26 #include "CommandLineUI/CommandLineParser.hpp" 26 27 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
r5d4b73 r41e15b 22 22 #include <Descriptors/MoleculeDescriptor.hpp> 23 23 #include <Descriptors/MoleculeIdDescriptor.hpp> 24 #include "CommandLineUI/CommandLineDialog.hpp" 24 25 25 #include "CommandLineUI/Query/CommandLineQuery.hpp"26 26 #include "CommandLineUI/CommandLineParser.hpp" 27 27 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
r5d4b73 r41e15b 22 22 #include <Descriptors/MoleculeDescriptor.hpp> 23 23 #include <Descriptors/MoleculeIdDescriptor.hpp> 24 #include "CommandLineUI/CommandLineDialog.hpp" 24 25 25 #include "CommandLineUI/Query/CommandLineQuery.hpp"26 26 #include "CommandLineUI/CommandLineParser.hpp" 27 27 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/Query/CommandLineQuery.hpp" 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 23 24 #include "CommandLineUI/CommandLineParser.hpp" 24 25 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
r5d4b73 r41e15b 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "CommandLineUI/CommandLineDialog.hpp" 23 22 24 #include "Actions/Values.hpp" 23 #include "CommandLineUI/Query/CommandLineQuery.hpp"24 25 #include "CommandLineUI/CommandLineParser.hpp" 25 26 #include "Helpers/Log.hpp" -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
r5d4b73 r41e15b 22 22 #include <vector> 23 23 24 #include "CommandLineUI/CommandLineDialog.hpp" 25 24 26 #include "Actions/Values.hpp" 25 #include "CommandLineUI/Query/CommandLineQuery.hpp"26 27 #include "CommandLineUI/CommandLineParser.hpp" 27 28 #include "Helpers/Log.hpp" -
src/UIElements/Makefile.am
r5d4b73 r41e15b 3 3 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/UIElements 4 4 5 AM_LDFLAGS = -ldl6 AM_CXXFLAGS = $ {QT_CXXFLAGS} ${GLU_CXXFLAGS}5 AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl 6 AM_CXXFLAGS = $(CPPUNIT_CFLAGS) 7 7 8 8 VIEWSOURCE = \ … … 28 28 29 29 TEXTMENUSOURCE = \ 30 Menu/TextMenu/TxMenuLeaveAction.cpp \31 30 Menu/TextMenu/TxMenu.cpp \ 32 31 Menu/TextMenu/MenuItem.cpp \ 33 32 Menu/TextMenu/SubMenuItem.cpp \ 34 33 Menu/TextMenu/ActionMenuItem.cpp \ 35 Menu/TextMenu/Sep aratorMenuItem.cpp \34 Menu/TextMenu/SeperatorItem.cpp \ 36 35 Menu/TextMenu/DisplayMenuItem.cpp 37 36 … … 42 41 Menu/TextMenu/SubMenuItem.hpp \ 43 42 Menu/TextMenu/ActionMenuItem.hpp \ 44 Menu/TextMenu/Sep aratorMenuItem.hpp \43 Menu/TextMenu/SeperatorItem.hpp \ 45 44 Menu/TextMenu/DisplayMenuItem.hpp 46 45 … … 108 107 TextUI/TextWindow.cpp 109 108 TEXTUIHEADER = \ 110 TextUI/Query/TextQuery.hpp \111 109 TextUI/TextDialog.hpp \ 112 110 TextUI/TextStatusIndicator.hpp \ … … 135 133 CommandLineUI/CommandLineDialog.cpp \ 136 134 CommandLineUI/CommandLineParser.cpp \ 137 CommandLineUI/CommandLineParser_validate.cpp \138 135 CommandLineUI/CommandLineStatusIndicator.cpp \ 139 136 CommandLineUI/CommandLineUIFactory.cpp \ … … 142 139 143 140 COMMANDLINEUIHEADER = \ 144 CommandLineUI/Query/CommandLineQuery.hpp \145 141 CommandLineUI/CommandLineDialog.hpp \ 146 142 CommandLineUI/CommandLineParser.hpp \ 147 CommandLineUI/CommandLineParser_validate.hpp \148 143 CommandLineUI/CommandLineStatusIndicator.hpp \ 149 144 CommandLineUI/CommandLineUIFactory.hpp \ … … 151 146 CommandLineUI/TypeEnumContainer.cpp 152 147 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 148 lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la 233 149 libMolecuilderUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 234 libMolecuilderQtUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/235 150 libMolecuilderUI_LIBS = \ 236 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la237 libMolecuilderQtUI_LIBS = \238 151 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 239 152 240 153 nobase_libMolecuilderUI_include_HEADERS = ${UIHEADER} 241 nobase_libMolecuilderQtUI_include_HEADERS = ${QTUIHEADER}242 154 243 155 ## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la" … … 250 162 ## which are already listed elsewhere in a _HEADERS variable assignment. 251 163 libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${UISOURCE} 252 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${QTUISOURCE}253 164 254 165 ## Instruct libtool to include ABI version information in the generated shared … … 256 167 ## that all version information is kept in one place. 257 168 libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION) 258 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)259 169 260 170 ## The generated configuration header is installed in its own subdirectory of … … 270 180 ## shipped with the source tarball. 271 181 libMolecuilderUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include 272 libMolecuilderQtUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include273 182 nodist_libMolecuilderUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h 274 nodist_libMolecuilderQtUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h275 183 276 184 ## Install the generated pkg-config file (.pc) into the expected location for … … 287 195 done; 288 196 289 #Rules needed for Qt4290 # UI-Files are scattered throughout several subdirectories291 # Therfore `%'-rules do not seem to work292 #Quick fix to get it done otherwise293 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 304 197 MOSTLYCLEANFILES = unity.cpp -
src/UIElements/Menu/Menu.hpp
r5d4b73 r41e15b 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 constructor25 * to allow for something to be add to the menu beforehand which is necessary26 * for the TextMenu for example.27 *28 * <h1>Howto</h1>29 *30 * First, derive your own menu class, see QtMenu or TextMenu for example. These31 * have been templated because of the two Qt classes QMenu and QMenuBar to be32 * addressable in a unified manner. TextMenu does not actually need to be a33 * 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 and37 * ActionRegistry's contents and adds MenuItem's and Action's as requested.38 * -# It does so by calling virtual functions defined in MenuInterface. These39 * allow for adding of specific type of items: separators, Actions, menus40 * -# Your derived Menu implements add these specific adders, basically just as41 * wrappers. If you really have another UI type, implement its Menu42 * functionality separately, such as TxMenu does.43 * -# It also inherits both Menu and virtually MenuInterface such that it44 * contains initializing and adding functionality45 *46 * Note that MenuInterface is inherited by both Menu and your class and hence has47 * to be declared as a "virtual" base class for both.48 23 */ 49 24 class Menu : virtual public MenuInterface -
src/UIElements/Menu/TextMenu/TextMenu.hpp
r5d4b73 r41e15b 12 12 #include <string> 13 13 14 #include "Helpers/MemDebug.hpp"15 16 14 #include "Helpers/Log.hpp" 17 15 #include "Helpers/Verbose.hpp" … … 21 19 #include "Actions/ActionRegistry.hpp" 22 20 #include "Actions/ActionTraits.hpp" 23 #include "Menu/TextMenu/TxMenu LeaveAction.hpp"21 #include "Menu/TextMenu/TxMenu.hpp" 24 22 #include "Menu/TextMenu/ActionMenuItem.hpp" 25 #include "Menu/TextMenu/Sep aratorMenuItem.hpp"23 #include "Menu/TextMenu/SeperatorItem.hpp" 26 24 #include "Menu/TextMenu/SubMenuItem.hpp" 27 25 28 26 /** 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 all32 * MenuItem's from MenuDescriptions and Action's ActionRegistry.33 *34 27 * \sa QtMenu. 35 28 */ … … 38 31 { 39 32 public: 40 /** Constructor for class TextMenu.41 * Initializes outputter and token and takes note whether to delete the42 * MenuInstance or not.43 */44 33 TextMenu(std::ostream &_outputter, const std::string &_token) : 45 34 MenuInterface(_token), … … 57 46 {} 58 47 59 /** Destructor of MenuInstance.60 *61 */62 48 virtual ~TextMenu() 63 49 { … … 66 52 } 67 53 68 /** Display this MenuInstance.69 *70 */71 54 void display() 72 55 { … … 74 57 } 75 58 76 /** Returns a pointer to the contained/wrapped MenuInstance.77 * \return pointer to template class pointer78 */79 59 T * const getMenuInstance() 80 60 { … … 82 62 } 83 63 84 /** Reserves a specific trigger key such that it is not used during init().85 * \param trigger trigger key86 * \param &name token given for reference.87 */88 64 void reserveShortcut(char trigger, const std::string &name) 89 65 { … … 102 78 MenuShortcutMap ShortcutMap; 103 79 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 shown107 */108 80 virtual void addActionItem(const std::string &token, const std::string &description) 109 81 { … … 111 83 } 112 84 113 /** Adds a (dead) separator item.114 *115 */116 85 virtual void addSeparatorItem() 117 86 { 118 new Sep aratorMenuItem(MenuInstance);87 new SeperatorItem(MenuInstance); 119 88 } 120 89 121 /** Adds a Menu to this current Menu.122 * We also create here a leave action for this submenu to be able to return123 * to the current one again124 * \param &token token of the menu125 * \param &description descriptive text126 */127 90 virtual void addSubmenuItem(const std::string &token, const std::string &description) 128 91 { … … 139 102 } 140 103 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 to143 * each Action/Menu. The chosen trigger key is also stored in an internal ShortcutMap.144 * \param &name text shown in menu145 * \return trigger key146 */147 104 char getSuitableShortForm(const std::string &name) 148 105 { -
src/UIElements/Menu/TextMenu/TxMenu.cpp
r5d4b73 r41e15b 24 24 #include <iostream> 25 25 #include <cmath> 26 #include "Actions/Action.hpp" 27 #include "Actions/ActionTraits.hpp" 26 28 #include "Menu/TextMenu/TxMenu.hpp" 27 29 #include "Menu/TextMenu/MenuItem.hpp" 30 #include "Helpers/Assert.hpp" 28 31 29 32 30 /** Constructor for class TxMenu. 31 * 33 /** 32 34 * produce a text menu with a given title. 33 35 * The text will later be displayed using the stream passed to the constructor. 34 * \param &_outputter output stream to use for displaying the text35 * \param _title title of this menu36 * \param _spacer key to separate trigger key from descriptive text shown37 * \param _length maximum length of the descriptive text38 36 */ 39 37 TxMenu::TxMenu(std::ostream& _outputter, const std::string _title, char _spacer,int _length) : … … 47 45 } 48 46 49 /** Destructor for class TxMenu.50 *51 */52 47 TxMenu::~TxMenu() 53 48 { … … 56 51 } 57 52 58 /** Adds an MenuItem to the internal list.59 * \param *item item to add60 */61 53 void TxMenu::addItem(MenuItem* item) { 62 54 items.push_back(item); 63 55 } 64 56 65 /** Removes an MenuItem to the internal list.66 * \param *item item to remove67 */68 57 void TxMenu::removeItem(MenuItem* item) { 69 58 items.remove(item); 70 59 } 71 60 72 /** Function to quit this TxMenu.73 */74 61 void TxMenu::doQuit(){ 75 62 quit = true; 76 63 } 77 64 78 /** Return the current state of quitting.79 * \return quit boolean80 */81 65 bool TxMenu::hasQuit(){ 82 66 return quit; 83 67 } 84 68 85 /** Display in a formatted manner a given entry of this menu.86 * \param *entry MenuItem to show87 */88 69 void TxMenu::showEntry(MenuItem* entry){ 89 70 if(entry->isActive()==false){ … … 97 78 } 98 79 99 /** Display this menu.100 *101 */102 80 void TxMenu::display() { 103 81 char choice; … … 136 114 } 137 115 138 /** Return the internally stored title of the menu.139 * \return title string140 */141 116 std::string TxMenu::getTitle(){ 142 117 return title; 143 118 } 144 119 145 /** Return the internally stored outputter of the menu.146 * \return output stream reference147 */148 120 std::ostream& TxMenu::getOutputter() 149 121 { … … 151 123 } 152 124 153 /** Add a default item to the menu. 154 * \param *_defaultItem MenuItem to act as default item. 155 */ 125 156 126 void TxMenu::addDefault(MenuItem* _defaultItem) { 157 127 defaultItem = _defaultItem; 158 128 } 159 129 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
r5d4b73 r41e15b 14 14 15 15 #include "Menu/Menu.hpp" 16 #include "Actions/Action.hpp" 17 #include "Actions/ActionTraits.hpp" 16 18 #include "defs.hpp" 17 19 18 20 class MenuItem; 19 21 20 /** Menu for the TextUI. 22 /** 23 * Used to produce any kind of text menu 21 24 * 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. 25 * All Items are displayed and user is prompted for a key. The item corresponding to that key is then activated. 34 26 */ 35 27 class TxMenu 36 28 { 37 29 public: 38 class LeaveAction; 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 }; 39 48 40 49 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
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/AtomQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 -
src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/AtomsQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 -
src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 22 #include <Qt/qcombobox.h> 24 23 25 #include "Helpers/MemDebug.hpp"26 24 27 25 BooleanQtQueryPipe::BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox) : -
src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 … … 24 23 #include <Qt/qtablewidget.h> 25 24 26 #include "Helpers/MemDebug.hpp"27 25 #include "LinearAlgebra/Matrix.hpp" 28 26 #include "Box.hpp" -
src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/DoubleQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 #include "Helpers/MemDebug.hpp" 22 #include <Qt/qcombobox.h> 23 24 24 25 25 DoubleQtQueryPipe::DoubleQtQueryPipe(double *_content, QtDialog *_dialog) : -
src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/ElementQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 22 #include <Qt/qcombobox.h> 24 23 25 #include "Helpers/MemDebug.hpp"26 24 #include "element.hpp" 27 25 #include "periodentafel.hpp" -
src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/ElementsQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 … … 25 24 #include <Qt/qcombobox.h> 26 25 27 #include "Helpers/MemDebug.hpp"28 26 #include "element.hpp" 29 27 #include "periodentafel.hpp" -
src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/EmptyQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 #include "Helpers/MemDebug.hpp" 22 #include <Qt/qcombobox.h> 23 24 24 25 25 EmptyQtQueryPipe::EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel) : -
src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include <QtGui/QFileDialog> 20 #include "UIElements/Qt4/QtDialog.hpp" 21 22 #include <iostream> 23 #include <boost/filesystem.hpp> 24 21 25 #include <Qt/qcombobox.h> 22 26 #include <Qt/qlineedit.h> 23 27 #include <Qt/qpushbutton.h> 24 28 25 #include "Helpers/MemDebug.hpp"26 27 #include <iostream>28 #include <boost/filesystem.hpp>29 30 #include "UIElements/Qt4/Pipe/FileQtQueryPipe.hpp"31 #include "UIElements/Qt4/QtDialog.hpp"32 29 33 30 FileQtQueryPipe::FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) : -
src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/IntQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 #include "Helpers/MemDebug.hpp"22 #include <Qt/qcombobox.h> 24 23 25 24 -
src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/MoleculeQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 22 #include <Qt/qcombobox.h> 24 25 #include "Helpers/MemDebug.hpp"26 23 27 24 #include "Descriptors/MoleculeIdDescriptor.hpp" -
src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/MoleculesQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 … … 24 23 25 24 #include <Qt/qcombobox.h> 26 27 #include "Helpers/MemDebug.hpp"28 25 29 26 #include "Descriptors/MoleculeIdDescriptor.hpp" -
src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp
r5d4b73 r41e15b 9 9 #define QTQUERYLISTPIPE_HPP_ 10 10 11 #include "QtQueryPipe.hpp"12 13 11 #include <boost/lexical_cast.hpp> 14 12 15 13 using boost::lexical_cast; 16 14 using boost::bad_lexical_cast; 17 18 15 19 16 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
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/StringQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 #include "Helpers/MemDebug.hpp"22 #include <string> 24 23 25 #include < string>24 #include <Qt/qcombobox.h> 26 25 27 26 -
src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 23 22 #include <Qt/qcombobox.h> 24 25 #include "Helpers/MemDebug.hpp"26 23 27 24 -
src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp
r5d4b73 r41e15b 18 18 #endif 19 19 20 #include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp"21 20 #include "UIElements/Qt4/QtDialog.hpp" 22 21 22 #include <vector> 23 23 24 #include <Qt/qcombobox.h> 24 25 #include "Helpers/MemDebug.hpp"26 27 #include <vector>28 25 29 26 -
src/UIElements/Qt4/QtDialog.cpp
r5d4b73 r41e15b 19 19 20 20 #include "UIElements/Qt4/QtDialog.hpp" 21 #include "UIElements/Qt4/Query/QtQuery.hpp"22 21 23 22 #include <QtGui/QDialogButtonBox> -
src/UIElements/Qt4/QtDialog.hpp
r5d4b73 r41e15b 11 11 #include "UIElements/Dialog.hpp" 12 12 #include <QtGui/QDialog> 13 #include <QtGui/QFileDialog> 14 15 #include <boost/filesystem.hpp> 13 16 14 17 #include <map> … … 17 20 18 21 class QBoxLayout; 22 class QLabel; 23 class QSpinBox; 24 class QDoubleSpinBox; 25 class QLineEdit; 26 class QListWidget; 27 class QTableWidget; 28 class QComboBox; 19 29 class QDialogButtonBox; 30 31 class Matrix; 32 33 // Forward declarations for plumbing 34 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; 20 52 21 53 class QtDialog : public QDialog, public Dialog … … 50 82 51 83 protected: 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; 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 }; 70 345 71 346 private: … … 76 351 }; 77 352 353 // All kinds of plumbing for Queries 354 // Plumbing needs to be outside of the class where it is needed, 355 // since MOC doesn't like nested classes 356 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_OBJECT 382 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_OBJECT 397 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_OBJECT 413 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_OBJECT 428 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_OBJECT 446 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_OBJECT 463 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_OBJECT 483 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_OBJECT 499 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_OBJECT 515 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_OBJECT 530 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_OBJECT 545 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_OBJECT 559 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_OBJECT 574 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_OBJECT 589 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_OBJECT 604 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 }; 78 619 79 620 #endif /* QTDIALOG_HPP_ */ -
src/UIElements/Qt4/Query/AtomQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/AtomQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 #include "atom.hpp" -
src/UIElements/Qt4/Query/AtomsQtQuery.cpp
r5d4b73 r41e15b 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/Query/QtQuery.hpp" 29 #include "UIElements/Qt4/Pipe/AtomsQtQueryPipe.hpp" 28 #include "UIElements/Qt4/QtDialog.hpp" 30 29 31 30 #include "atom.hpp" -
src/UIElements/Qt4/Query/BooleanQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 -
src/UIElements/Qt4/Query/BoxQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 #include "LinearAlgebra/Matrix.hpp" -
src/UIElements/Qt4/Query/DoubleQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/DoubleQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 -
src/UIElements/Qt4/Query/DoublesQtQuery.cpp
r5d4b73 r41e15b 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/Q uery/QtQuery.hpp"28 #include "UIElements/Qt4/QtDialog.hpp" 29 29 #include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp" 30 30 -
src/UIElements/Qt4/Query/ElementQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/ElementQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 #include "element.hpp" -
src/UIElements/Qt4/Query/ElementsQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/ElementsQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 #include "element.hpp" -
src/UIElements/Qt4/Query/EmptyQtQuery.cpp
r5d4b73 r41e15b 23 23 #include "Helpers/MemDebug.hpp" 24 24 25 #include "UIElements/Qt4/Query/QtQuery.hpp" 26 #include "UIElements/Qt4/Pipe/EmptyQtQueryPipe.hpp" 25 #include "UIElements/Qt4/QtDialog.hpp" 27 26 28 27 -
src/UIElements/Qt4/Query/FileQtQuery.cpp
r5d4b73 r41e15b 25 25 #include "Helpers/MemDebug.hpp" 26 26 27 #include "UIElements/Qt4/Query/QtQuery.hpp" 28 #include "UIElements/Qt4/Pipe/FileQtQueryPipe.hpp" 27 #include "UIElements/Qt4/QtDialog.hpp" 29 28 30 29 -
src/UIElements/Qt4/Query/IntQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/IntQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 -
src/UIElements/Qt4/Query/IntsQtQuery.cpp
r5d4b73 r41e15b 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/Q uery/QtQuery.hpp"28 #include "UIElements/Qt4/QtDialog.hpp" 29 29 #include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp" 30 30 -
src/UIElements/Qt4/Query/MoleculeQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/MoleculeQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 #include "molecule.hpp" -
src/UIElements/Qt4/Query/MoleculesQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/MoleculesQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 #include "molecule.hpp" -
src/UIElements/Qt4/Query/StringQtQuery.cpp
r5d4b73 r41e15b 24 24 #include "Helpers/MemDebug.hpp" 25 25 26 #include "UIElements/Qt4/Query/QtQuery.hpp" 27 #include "UIElements/Qt4/Pipe/StringQtQueryPipe.hpp" 26 #include "UIElements/Qt4/QtDialog.hpp" 28 27 29 28 -
src/UIElements/Qt4/Query/StringsQtQuery.cpp
r5d4b73 r41e15b 26 26 #include "Helpers/MemDebug.hpp" 27 27 28 #include "UIElements/Qt4/Q uery/QtQuery.hpp"28 #include "UIElements/Qt4/QtDialog.hpp" 29 29 #include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp" 30 30 -
src/UIElements/Qt4/Query/VectorQtQuery.cpp
r5d4b73 r41e15b 25 25 #include "Helpers/MemDebug.hpp" 26 26 27 #include "UIElements/Qt4/Query/QtQuery.hpp" 28 #include "UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp" 27 #include "UIElements/Qt4/QtDialog.hpp" 29 28 30 29 -
src/UIElements/Qt4/Query/VectorsQtQuery.cpp
r5d4b73 r41e15b 25 25 #include "Helpers/MemDebug.hpp" 26 26 27 #include "UIElements/Qt4/Query/QtQuery.hpp" 28 #include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp" 27 #include "UIElements/Qt4/QtDialog.hpp" 29 28 30 29 -
src/UIElements/TextUI/Query/AtomTextQuery.cpp
r5d4b73 r41e15b 24 24 #include <Descriptors/AtomDescriptor.hpp> 25 25 #include <Descriptors/AtomIdDescriptor.hpp> 26 #include "TextUI/ Query/TextQuery.hpp"26 #include "TextUI/TextDialog.hpp" 27 27 28 28 #include "Helpers/Log.hpp" … … 41 41 do{ 42 42 badInput = false; 43 std::cout << getDescription() << ": ";44 std::cin >> idxOfAtom;45 if( std::cin.fail()){43 Log() << Verbose(0) << getTitle(); 44 cin >> idxOfAtom; 45 if(cin.fail()){ 46 46 badInput = true; 47 std::cin.clear();48 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');49 std::cout << "Input was not a number!" << std::endl;47 cin.clear(); 48 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 49 Log() << Verbose(0) << "Input was not a number!" << endl; 50 50 continue; 51 51 } … … 53 53 tmp = World::getInstance().getAtom(AtomById(idxOfAtom)); 54 54 if(!tmp && idxOfAtom!=-1){ 55 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl;55 Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl; 56 56 badInput = true; 57 57 } 58 58 59 59 } while(badInput); 60 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');60 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 61 61 return (idxOfAtom!=-1); 62 62 } -
src/UIElements/TextUI/Query/AtomsTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <Descriptors/AtomDescriptor.hpp> 23 23 #include <Descriptors/AtomIdDescriptor.hpp> 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 bool TextDialog::AtomsTextQuery::handle() { 40 40 int idxOfAtom=-1; 41 std::cout << getDescription() << ": ";41 Log() << Verbose(0) << getTitle(); 42 42 std::string line; 43 getline( std::cin,line);43 getline(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 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl;52 Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl; 53 53 break; 54 54 } … … 62 62 temp = World::getInstance().getAtom(AtomById(idxOfAtom)); 63 63 if(!temp && idxOfAtom!=-1) { 64 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl;64 Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl; 65 65 tmp.push_back(temp); 66 66 } -
src/UIElements/TextUI/Query/BooleanTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 do{ 40 40 badInput = false; 41 std::cout << getDescription() << "[y/n]: ";42 std::cin >> input;41 Log() << Verbose(0) << getTitle(); 42 cin >> input; 43 43 if ((input == 'y' ) || (input == 'Y')) { 44 44 tmp = true; … … 47 47 } else { 48 48 badInput=true; 49 std::cin.clear();50 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');51 std::cout << "Input was not of [yYnN]!" << std::endl;49 cin.clear(); 50 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 51 Log() << Verbose(0) << "Input was not of [yYnN]!" << endl; 52 52 } 53 53 } while(badInput); 54 54 // clear the input buffer of anything still in the line 55 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');55 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 56 56 return true; 57 57 } -
src/UIElements/TextUI/Query/BoxTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 37 37 38 38 bool TextDialog::BoxTextQuery::handle() { 39 std::cout<< getTitle();39 Log() << Verbose(0) << getTitle(); 40 40 41 41 double temp[6]; 42 std::cout << getDescription() << " - ";43 42 std::string coords[6] = {"xx","yx","yy", "zx", "zy", "zz"}; 44 43 for (int i=0;i<6;i++) { 45 std::cout<< coords[i] << ": ";46 std::cin >> temp[i];44 Log() << Verbose(0) << coords[i] << ": "; 45 cin >> temp[i]; 47 46 } 48 47 Matrix M; -
src/UIElements/TextUI/Query/DoubleTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 38 38 do{ 39 39 badInput = false; 40 std::cout << getDescription() << ": ";41 std::cin >> tmp;42 if( std::cin.fail()){40 Log() << Verbose(0) << getTitle(); 41 cin >> tmp; 42 if(cin.fail()){ 43 43 badInput = true; 44 std::cin.clear();45 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');46 std::cout << "Input was not a number!" << std::endl;44 cin.clear(); 45 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 46 Log() << Verbose(0) << "Input was not a number!" << endl; 47 47 } 48 48 }while(badInput); 49 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');49 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 50 50 return true; 51 51 } -
src/UIElements/TextUI/Query/DoublesTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::DoublesTextQuery::handle() { 37 std::cout << getDescription() << ": ";37 Log() << Verbose(0) << getTitle(); 38 38 std::string line; 39 getline( std::cin,line);39 getline(cin,line); 40 40 // dissect by " " 41 41 std::string::iterator olditer = line.begin(); -
src/UIElements/TextUI/Query/ElementTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 44 44 do{ 45 45 badInput = false; 46 std::cout << getDescription() << ": ";46 Log() << Verbose(0) << getTitle(); 47 47 48 48 // try to read as Atomic number 49 49 int Z; 50 std::cin >> Z;51 if(! std::cin.fail()){50 cin >> Z; 51 if(!cin.fail()){ 52 52 if(Z==-1){ 53 53 aborted = true; … … 56 56 temp = World::getInstance().getPeriode()->FindElement(Z); 57 57 if(!temp){ 58 std::cout << "No element with this atomic number!" << std::endl;58 Log() << Verbose(0) << "No element with this atomic number!" << endl; 59 59 badInput = true; 60 60 } … … 63 63 } 64 64 else{ 65 std::cin.clear();65 cin.clear(); 66 66 } 67 67 … … 70 70 // same thing again, this time as a std::string 71 71 std::string shorthand; 72 std::cin >> shorthand;73 if(! std::cin.fail()){72 cin >> shorthand; 73 if(!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 std::cout << "No element with this shorthand!" << std::endl;80 Log() << Verbose(0) << "No element with this shorthand!" << endl; 81 81 badInput = true; 82 82 } … … 84 84 } 85 85 else{ 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');86 Log() << Verbose(0) << "Could not read input. Try Again." << endl; 87 cin.clear(); 88 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 89 89 badInput = true; 90 90 } 91 91 92 92 }while(badInput); 93 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');93 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 94 94 return !aborted; 95 95 } -
src/UIElements/TextUI/Query/ElementsTextQuery.cpp
r5d4b73 r41e15b 23 23 #include <boost/lexical_cast.hpp> 24 24 25 #include "TextUI/ Query/TextQuery.hpp"25 #include "TextUI/TextDialog.hpp" 26 26 27 27 #include "Helpers/Log.hpp" … … 45 45 std::string shorthand; 46 46 int Z=-1; 47 std::cout << getDescription() << ": ";47 Log() << Verbose(0) << getTitle(); 48 48 std::string line; 49 getline( std::cin,line);49 getline(cin,line); 50 50 // dissect by " " 51 51 std::string::iterator olditer = line.begin(); … … 61 61 }; 62 62 if(!temp && Z!=-1){ 63 std::cout << "Invalid Element" << shorthand << std::endl;63 Log() << Verbose(0) << "Invalid Element" << shorthand << endl; 64 64 break; 65 65 } … … 78 78 }; 79 79 if(!temp && Z!=-1) { 80 std::cout << "Invalid Element" << shorthand << std::endl;80 Log() << Verbose(0) << "Invalid Element" << shorthand << endl; 81 81 tmp.push_back(temp); 82 82 } -
src/UIElements/TextUI/Query/EmptyTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" -
src/UIElements/TextUI/Query/FileTextQuery.cpp
r5d4b73 r41e15b 21 21 22 22 #include <iostream> 23 #include <string>24 23 25 24 #include <boost/filesystem.hpp> 26 25 27 #include "TextUI/ Query/TextQuery.hpp"26 #include "TextUI/TextDialog.hpp" 28 27 29 28 #include "Helpers/Log.hpp" … … 38 37 39 38 bool TextDialog::FileTextQuery::handle() { 40 bool badInput = false;39 Log() << Verbose(0) << getTitle(); 41 40 std::string 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'); 41 getline(cin,tempstring); 55 42 tmp = tempstring; 56 43 return true; -
src/UIElements/TextUI/Query/IntTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 38 38 do{ 39 39 badInput = false; 40 std::cout << getDescription() << ": ";41 std::cin >> tmp;42 if( std::cin.fail()){40 Log() << Verbose(0) << getTitle(); 41 cin >> tmp; 42 if(cin.fail()){ 43 43 badInput=true; 44 std::cin.clear();45 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');46 std::cout << "Input was not a number!" << std::endl;44 cin.clear(); 45 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 46 Log() << Verbose(0) << "Input was not a number!" << endl; 47 47 } 48 48 } while(badInput); 49 49 // clear the input buffer of anything still in the line 50 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');50 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 51 51 return true; 52 52 } -
src/UIElements/TextUI/Query/IntsTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::IntsTextQuery::handle() { 37 std::cout << getDescription() << ": ";37 Log() << Verbose(0) << getTitle(); 38 38 std::string line; 39 getline( std::cin,line);39 getline(cin,line); 40 40 // dissect by " " 41 41 std::string::iterator olditer = line.begin(); -
src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
r5d4b73 r41e15b 24 24 #include <Descriptors/MoleculeDescriptor.hpp> 25 25 #include <Descriptors/MoleculeIdDescriptor.hpp> 26 #include "TextUI/ Query/TextQuery.hpp"26 #include "TextUI/TextDialog.hpp" 27 27 28 28 #include "Helpers/Log.hpp" … … 42 42 do{ 43 43 badInput = false; 44 std::cout << getDescription() << ": ";45 std::cin >> idxOfMol;46 if( std::cin.fail()){44 Log() << Verbose(0) << getTitle(); 45 cin >> idxOfMol; 46 if(cin.fail()){ 47 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;48 cin.clear(); 49 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 50 Log() << Verbose(0) << "Input was not a number!" << endl; 51 51 continue; 52 52 } … … 54 54 tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 55 55 if(!tmp && idxOfMol!=-1){ 56 std::cout << "Invalid Molecule Index" << std::endl;56 Log() << Verbose(0) << "Invalid Molecule Index" << endl; 57 57 badInput = true; 58 58 } 59 59 60 60 } while(badInput); 61 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');61 cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 62 62 return (idxOfMol!=-1); 63 63 } -
src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
r5d4b73 r41e15b 24 24 #include <Descriptors/MoleculeDescriptor.hpp> 25 25 #include <Descriptors/MoleculeIdDescriptor.hpp> 26 #include "TextUI/ Query/TextQuery.hpp"26 #include "TextUI/TextDialog.hpp" 27 27 28 28 #include "Helpers/Log.hpp" … … 39 39 bool TextDialog::MoleculesTextQuery::handle() { 40 40 int idxOfMol=-1; 41 std::cout << getDescription() << ": ";41 Log() << Verbose(0) << getTitle(); 42 42 std::string line; 43 getline( std::cin,line);43 getline(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 std::cout << "Invalid Molecule Index" << idxOfMol << std::endl;52 Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl; 53 53 break; 54 54 } … … 62 62 temp = World::getInstance().getMolecule(MoleculeById(idxOfMol)); 63 63 if(!temp && idxOfMol!=-1){ 64 std::cout << "Invalid Molecule Index" << idxOfMol << std::endl;64 Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl; 65 65 tmp.push_back(temp); 66 66 } -
src/UIElements/TextUI/Query/StringTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::StringTextQuery::handle() { 37 std::cout << getDescription() << ": ";38 getline( std::cin,tmp);37 Log() << Verbose(0) << getTitle(); 38 getline(cin,tmp); 39 39 return true; 40 40 } -
src/UIElements/TextUI/Query/StringsTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 35 35 36 36 bool TextDialog::StringsTextQuery::handle() { 37 std::cout << getDescription() << ": ";38 getline( std::cin,temp);37 Log() << Verbose(0) << getTitle(); 38 getline(cin,temp); 39 39 // dissect by " " 40 40 std::string::iterator olditer = temp.begin(); -
src/UIElements/TextUI/Query/VectorTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 40 40 bool TextDialog::VectorTextQuery::handle() { 41 std::cout << get Description() << std::endl;41 std::cout << getTitle(); 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( std::cin,line);48 getline(cin,line); 49 49 50 50 // dissect by "," -
src/UIElements/TextUI/Query/VectorsTextQuery.cpp
r5d4b73 r41e15b 22 22 #include <iostream> 23 23 24 #include "TextUI/ Query/TextQuery.hpp"24 #include "TextUI/TextDialog.hpp" 25 25 26 26 #include "Helpers/Log.hpp" … … 39 39 40 40 bool TextDialog::VectorsTextQuery::handle() { 41 std::cout << get Description() << std::endl;41 std::cout << getTitle(); 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( std::cin,line);48 getline(cin,line); 49 49 50 50 // dissect by "," -
src/UIElements/TextUI/TextDialog.cpp
r5d4b73 r41e15b 21 21 22 22 #include "TextUI/TextDialog.hpp" 23 #include "TextUI/Query/TextQuery.hpp"24 23 25 24 using namespace std; -
src/UIElements/TextUI/TextDialog.hpp
r5d4b73 r41e15b 45 45 protected: 46 46 // specialized stuff for text queries 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; 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 }; 67 172 }; 68 173 -
src/UIElements/TextUI/TextWindow.cpp
r5d4b73 r41e15b 26 26 #include "Menu/TextMenu/TxMenu.hpp" 27 27 #include "Menu/TextMenu/ActionMenuItem.hpp" 28 #include "Menu/TextMenu/Sep aratorMenuItem.hpp"28 #include "Menu/TextMenu/SeperatorItem.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 aratorMenuItem(main_menu->getMenuInstance());67 new SeperatorItem(main_menu->getMenuInstance()); 68 68 69 69 main_menu->init(); 70 70 71 new Sep aratorMenuItem(main_menu->getMenuInstance());71 new SeperatorItem(main_menu->getMenuInstance()); 72 72 73 73 // save has reserved key 's'
Note:
See TracChangeset
for help on using the changeset viewer.