| [f5a86a] | 1 | /*
 | 
|---|
 | 2 |  * Dialog.hpp
 | 
|---|
 | 3 |  *
 | 
|---|
 | 4 |  *  Created on: Jan 5, 2010
 | 
|---|
 | 5 |  *      Author: crueger
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #ifndef DIALOG_HPP_
 | 
|---|
 | 9 | #define DIALOG_HPP_
 | 
|---|
 | 10 | 
 | 
|---|
| [56f73b] | 11 | // include config.h
 | 
|---|
 | 12 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 13 | #include <config.h>
 | 
|---|
 | 14 | #endif
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | 
 | 
|---|
| [f5a86a] | 17 | #include<string>
 | 
|---|
 | 18 | #include<list>
 | 
|---|
| [104524] | 19 | #include<vector>
 | 
|---|
| [f5a86a] | 20 | 
 | 
|---|
| [6f5dfe] | 21 | #include <boost/filesystem.hpp>
 | 
|---|
 | 22 | 
 | 
|---|
| [8bc733] | 23 | #include "Box.hpp"
 | 
|---|
| [57f243] | 24 | #include "LinearAlgebra/Vector.hpp"
 | 
|---|
| [7cd6e7] | 25 | 
 | 
|---|
| [97ebf8] | 26 | class atom;
 | 
|---|
| [84c494] | 27 | class Box;
 | 
|---|
| [97ebf8] | 28 | class element;
 | 
|---|
| [7aa000] | 29 | class molecule;
 | 
|---|
| [45f5d6] | 30 | 
 | 
|---|
| [de8e45] | 31 | 
 | 
|---|
 | 32 | /** Dialog is one of the two main classes of the UIFactory base class.
 | 
|---|
 | 33 |  *
 | 
|---|
| [db7cb0] | 34 |  * The Dialog is meant for asking the user for information needed to perform
 | 
|---|
 | 35 |  * actions he desires, such as asking for a position in space or a length.
 | 
|---|
| [de8e45] | 36 |  *
 | 
|---|
| [db7cb0] | 37 |  * For this purpose there is the base class Query and numerous specializations
 | 
|---|
 | 38 |  * for each of the types to be asked. There are primitives integer, doubles and
 | 
|---|
 | 39 |  * string, but also advanced types such as element, molecule or Vector. There
 | 
|---|
 | 40 |  * is also an empty query for displaying text.
 | 
|---|
| [e4afb4] | 41 |  *
 | 
|---|
 | 42 |  * Note that the templatization of Dialog::query() allows for easy implementation
 | 
|---|
 | 43 |  * of new types that correspond to/are derived from old ones.
 | 
|---|
 | 44 |  *
 | 
|---|
 | 45 |  * <H3>How do Dialogs operate?</H3>
 | 
|---|
 | 46 |  *
 | 
|---|
 | 47 |  * Dialogs are initiated by Action::FillDialog() function calls. Within Action::Call()
 | 
|---|
 | 48 |  * a dialog is created and passed on to FillDialog(), which is specialized in each
 | 
|---|
 | 49 |  * specific Action to ask for the specific parameter it needs.
 | 
|---|
 | 50 |  *
 | 
|---|
 | 51 |  * Dialogs are derived for each of the UI types
 | 
|---|
 | 52 |  *  -# CommandLineDialog
 | 
|---|
 | 53 |  *  -# QtDialog
 | 
|---|
 | 54 |  *  -# TextDialog
 | 
|---|
 | 55 |  *
 | 
|---|
 | 56 |  * This "asking" for parameters is done via the Query class.  There are four types
 | 
|---|
 | 57 |  * of Query types:
 | 
|---|
 | 58 |  *  -# Query, members in class Dialog
 | 
|---|
 | 59 |  *  -# CommandLineQuery, members in class CommandLineDialog
 | 
|---|
 | 60 |  *  -# QtQuery, members in class QtDialog
 | 
|---|
 | 61 |  *  -# TextQuery, members in class TextDialog
 | 
|---|
 | 62 |  * Each embodies a certain way of asking the user for the specific type of parameter
 | 
|---|
 | 63 |  * needed, e.g. a file via the TextMenu interface would be done in member functions of
 | 
|---|
 | 64 |  * TextDialog::FileTextQuery.
 | 
|---|
 | 65 |  *
 | 
|---|
 | 66 |  *
 | 
|---|
 | 67 |  * Generally, the sequence of events is as follows:
 | 
|---|
 | 68 |  *  -# Action::fillDialog() calls upon Dialog::query<T> for some type T, let's say T
 | 
|---|
 | 69 |  *     stands for double
 | 
|---|
 | 70 |  *  -# Dialog::query<double> call a function queryDouble()
 | 
|---|
 | 71 |  *  -# depending on the currently used UIFactory, the Dialog above is actually either
 | 
|---|
 | 72 |  *     of the three specialized types, let's say CommandLine. And we see that within
 | 
|---|
 | 73 |  *     CommandLineDialog we have the respective method ueryDouble() that registers
 | 
|---|
 | 74 |  *     a new instance of the class CommandLineDialog::DoubleCommandLineQuery.
 | 
|---|
 | 75 |  *  -# The Query's are first registered, as multiple parameters may be needed for
 | 
|---|
 | 76 |  *     a single Action and we don't want the popping up of a dialog window for each
 | 
|---|
 | 77 |  *     alone. Rather, we want to merge the Query's into a single Dialog. Therefore,
 | 
|---|
 | 78 |  *     they are first registered and then executed in sequence. This is done in
 | 
|---|
 | 79 |  *     Dialog::display(), i.e. when the dialog is finally shown to the user.
 | 
|---|
 | 80 |  *  -# Then each of the registered Query's, here our CommandLineDialog::
 | 
|---|
 | 81 |  *     DoubleCommandLineQuery, constructor is called.
 | 
|---|
 | 82 |  *     -# This will call the constructor of its base class, where the actual value
 | 
|---|
 | 83 |  *        is stored and later stored into the ValueStorage class by
 | 
|---|
 | 84 |  *        Dialog::Query::setResult().
 | 
|---|
 | 85 |  *     -# Also, e.g. for the Qt interface, the buttons, labels and so forth are
 | 
|---|
 | 86 |  *        created and added to the dialog.
 | 
|---|
 | 87 |  *  -# Now the users enters information for each UI something different happens:
 | 
|---|
 | 88 |  *    -# CommandLine: The actual value retrieval is done by the CommandLineParser and
 | 
|---|
 | 89 |  *       the boost::program_options library, the value is stored therein for the moment.
 | 
|---|
 | 90 |  *       (see here: http://www.boost.org/doc/libs/1_44_0/doc/html/program_options/)
 | 
|---|
 | 91 |  *    -# TextMenu: The value is requested via std::cin from the user.
 | 
|---|
 | 92 |  *    -# QtMenu: The users enters the value in a Dialog. Due to Qt necessities a
 | 
|---|
 | 93 |  *       Pipe class obtains the value from the Dialog with Qt's signal/slot mechanism
 | 
|---|
 | 94 |  *       and put it into Dialog::...Query value.
 | 
|---|
 | 95 |  *  -# in our case DoubleCommandLineQuery::handle() will be called. The value is
 | 
|---|
 | 96 |  *     retrieved and put into Dialog::DoubleQuery::tmp
 | 
|---|
 | 97 |  *  -# Finally, for each Query, also Dialog::DoubleQuery, setResult() is called which
 | 
|---|
 | 98 |  *     puts the value as a string into the ValueStorage under a given token that is
 | 
|---|
 | 99 |  *     associated with a type (and thereby we assure type-safety).
 | 
|---|
 | 100 |  *
 | 
|---|
 | 101 |  * <H3>Regarding derived types of types with already present queries</H3>
 | 
|---|
 | 102 |  *
 | 
|---|
 | 103 |  * Example: We have got a derived Vector class, called BoxVector, that is by any means
 | 
|---|
 | 104 |  * a Vector but with one difference: it is always bound to lie within the current domain.
 | 
|---|
 | 105 |  * With regards to type-casting it to and from a string however, nothing is different
 | 
|---|
 | 106 |  * between Vector and BoxVector.
 | 
|---|
 | 107 |  *
 | 
|---|
 | 108 |  * So, do we need a new Query for this?
 | 
|---|
 | 109 |  * No.
 | 
|---|
 | 110 |  *
 | 
|---|
 | 111 |  * We just have to do this:
 | 
|---|
 | 112 |  *  -# add a specialization of Dialog::query<BoxVector> where queryVector()is used.
 | 
|---|
 | 113 |  *     @code
 | 
|---|
 | 114 |  *     template <> void Dialog::query<BoxVector>(const char *token, std::string description) {
 | 
|---|
 | 115 |  *        queryVector(token, false, description);
 | 
|---|
 | 116 |  *     }
 | 
|---|
 | 117 |  *     @endcode
 | 
|---|
 | 118 |  *  -# make sure that
 | 
|---|
 | 119 |  *     -# ValueStorage::setCurrentValue() the specialization for class Vector has an
 | 
|---|
 | 120 |  *     if case also for BoxVector and does something appropriate.
 | 
|---|
 | 121 |  *     -# ValueStorage::queryCurrentValue() has another specialization doing the same
 | 
|---|
 | 122 |  *     as for Vector but for BoxVector in its signature.
 | 
|---|
 | 123 |  *
 | 
|---|
 | 124 |  * And that's all.
 | 
|---|
 | 125 |  *
 | 
|---|
 | 126 |  *
 | 
|---|
 | 127 |  * <H3>Adding new queries</H3>
 | 
|---|
 | 128 |  *
 | 
|---|
 | 129 |  * Check first whether you really need a new query or whether we can derive it and re-use
 | 
|---|
 | 130 |  * one of the present ones.
 | 
|---|
 | 131 |  *
 | 
|---|
 | 132 |  * Due to the three present UI interfaces we have to add a specific Query for each, here
 | 
|---|
 | 133 |  * is a list:
 | 
|---|
 | 134 |  *   -# add ValueStorage::setCurrentValue() and ValueStorage::queryCurrentValue() for
 | 
|---|
 | 135 |  *      both types
 | 
|---|
 | 136 |  *   -# add Dialog::query...()
 | 
|---|
 | 137 |  *   -# add Dialog::query<>() specialization calling the above function
 | 
|---|
 | 138 |  *   -# add CommandLineDialog::query...(), TextDialog::query...(), and QtDialog::query...(),
 | 
|---|
 | 139 |  *      i.e. for each of the three interface
 | 
|---|
 | 140 |  *   -# add Dialog::...Query class with tmp value of desired type
 | 
|---|
 | 141 |  *   -# add CommandLineDialog::...Query, TextDialog::...Query, QtDialog::...Query
 | 
|---|
 | 142 |  *   -# you probably also need a QtDialog::...QueryPipe() to handle the signal/slot stuff,
 | 
|---|
 | 143 |  *      Qt's moc does not like nested classes. Hence, this has to go extra.
 | 
|---|
 | 144 |  *
 | 
|---|
| [de8e45] | 145 |  */
 | 
|---|
| [f5a86a] | 146 | class Dialog
 | 
|---|
 | 147 | {
 | 
|---|
 | 148 | public:
 | 
|---|
 | 149 |   Dialog();
 | 
|---|
 | 150 |   virtual ~Dialog();
 | 
|---|
 | 151 | 
 | 
|---|
| [9ee38b] | 152 |   template <class T> void query(const char *, std::string = "");
 | 
|---|
 | 153 | 
 | 
|---|
| [86466e] | 154 |   virtual void queryEmpty(const char *, std::string = "")=0;
 | 
|---|
| [75dc28] | 155 |   virtual void queryBoolean(const char *, std::string = "")=0;
 | 
|---|
 | 156 |   virtual void queryInt(const char *, std::string = "")=0;
 | 
|---|
| [7cd6e7] | 157 |   virtual void queryInts(const char *, std::string = "")=0;
 | 
|---|
| [75dc28] | 158 |   virtual void queryDouble(const char*, std::string = "")=0;
 | 
|---|
| [7cd6e7] | 159 |   virtual void queryDoubles(const char*, std::string = "")=0;
 | 
|---|
| [75dc28] | 160 |   virtual void queryString(const char*, std::string = "")=0;
 | 
|---|
 | 161 |   virtual void queryStrings(const char*, std::string = "")=0;
 | 
|---|
 | 162 |   virtual void queryAtom(const char*,std::string = "")=0;
 | 
|---|
| [7cd6e7] | 163 |   virtual void queryAtoms(const char*,std::string = "")=0;
 | 
|---|
| [75dc28] | 164 |   virtual void queryMolecule(const char*, std::string = "")=0;
 | 
|---|
| [7cd6e7] | 165 |   virtual void queryMolecules(const char*, std::string = "")=0;
 | 
|---|
| [75dc28] | 166 |   virtual void queryVector(const char*,bool, std::string = "")=0;
 | 
|---|
| [7cd6e7] | 167 |   virtual void queryVectors(const char*,bool, std::string = "")=0;
 | 
|---|
| [75dc28] | 168 |   virtual void queryBox(const char*, std::string = "")=0;
 | 
|---|
 | 169 |   virtual void queryElement(const char*, std::string = "")=0;
 | 
|---|
| [7cd6e7] | 170 |   virtual void queryElements(const char*, std::string = "")=0;
 | 
|---|
| [6f5dfe] | 171 |   virtual void queryFile(const char*, std::string = "")=0;
 | 
|---|
| [f5a86a] | 172 | 
 | 
|---|
| [45f5d6] | 173 |   virtual bool display();
 | 
|---|
| [f5a86a] | 174 | 
 | 
|---|
| [d3a5ea] | 175 |   virtual bool checkAll();
 | 
|---|
 | 176 |   virtual void setAll();
 | 
|---|
 | 177 | 
 | 
|---|
| [c508ef5] | 178 |   virtual bool hasQueries();
 | 
|---|
 | 179 | 
 | 
|---|
| [f5a86a] | 180 | protected:
 | 
|---|
 | 181 |   // methodology for handling queries
 | 
|---|
 | 182 |   // all queries are stored and then performed at appropriate times
 | 
|---|
 | 183 | 
 | 
|---|
 | 184 |   //these queries can be handled by this dialog
 | 
|---|
| [45f5d6] | 185 | 
 | 
|---|
 | 186 |   //TODO: Find a way to reduce complexity...
 | 
|---|
 | 187 |   //needs O(N*M) query classes, where N is the number of query types and M is the number of GUIs
 | 
|---|
 | 188 |   //usual approach for reducing inheritance complexity (strategy pattern) does not work,
 | 
|---|
 | 189 |   //due to lack of common code for query types as well as GUI-Types (all subtypes differ a lot)
 | 
|---|
 | 190 | 
 | 
|---|
| [db7cb0] | 191 |   /** Base class for all queries.
 | 
|---|
 | 192 |    *
 | 
|---|
 | 193 |    *
 | 
|---|
 | 194 |    * <h1>How to add another query?</h1>
 | 
|---|
 | 195 |    *
 | 
|---|
 | 196 |    * Let's say  we want to query for a type called \a Value.
 | 
|---|
 | 197 |    *
 | 
|---|
 | 198 |    * Then, we do the following:
 | 
|---|
 | 199 |    *  -# Add a class ValueQuery inside class Dialog, the class contains
 | 
|---|
 | 200 |    *    -# constructor/destructor (latter virtual! because of derived class)
 | 
|---|
 | 201 |    *    -# virtual bool handle() and virtual void setResult()
 | 
|---|
 | 202 |    *    -# a protected member tmp of type Value (NOTE: herein the result is stored)
 | 
|---|
 | 203 |    *    -# if temporaries for conversion are needed put them in here
 | 
|---|
 | 204 |    *  -# add a function queryValue
 | 
|---|
 | 205 |    *  -# now, for each of the GUIs we basically have to repeat the above, i.e.
 | 
|---|
 | 206 |    *     add the class and the function that implement the virtual ones above.
 | 
|---|
| [4cf323d] | 207 |    *    -# QT: an extra class called ValueQtQueryPipe that actually handles
 | 
|---|
| [db7cb0] | 208 |    *       showing dialogs to obtain the value and placing it into the \a tmp
 | 
|---|
 | 209 |    *       variable (via a given pointer to it as reference). handle() will
 | 
|---|
| [4cf323d] | 210 |    *       simply return true. This is needed because of a restriction of Qt4:
 | 
|---|
| [db7cb0] | 211 |    *       its meta-object-compiler does not like nested classes.
 | 
|---|
 | 212 |    *    -# CommandLine: nothing special, handle() imports value from \a
 | 
|---|
 | 213 |    *       CommandLineParser and sets the tmp variable.
 | 
|---|
 | 214 |    *    -# Text: nothing special, handle() queries the user and sets the tmp
 | 
|---|
 | 215 |    *       variable
 | 
|---|
 | 216 |    */
 | 
|---|
| [45f5d6] | 217 |   class Query {
 | 
|---|
| [94d131] | 218 |     friend class Dialog;
 | 
|---|
| [45f5d6] | 219 |   public:
 | 
|---|
| [a2ab15] | 220 |     Query(std::string _title, std::string _description = "");
 | 
|---|
| [5a7243] | 221 |     virtual ~Query();
 | 
|---|
| [45f5d6] | 222 |     virtual bool handle()=0;
 | 
|---|
 | 223 |     virtual void setResult()=0;
 | 
|---|
 | 224 |   protected:
 | 
|---|
 | 225 |     const std::string getTitle() const;
 | 
|---|
| [a2ab15] | 226 |     const std::string getDescription() const;
 | 
|---|
| [45f5d6] | 227 |   private:
 | 
|---|
| [a2ab15] | 228 |     std::string title;  //!< short title of the query
 | 
|---|
 | 229 |     std::string description; //!< longer description for tooltips or for help
 | 
|---|
| [f5a86a] | 230 |   };
 | 
|---|
 | 231 | 
 | 
|---|
| [86466e] | 232 |   // Empty Query is just meant for showing text, such as version, help, initial message or alike
 | 
|---|
 | 233 |   class EmptyQuery : public Query {
 | 
|---|
 | 234 |   public:
 | 
|---|
 | 235 |     EmptyQuery(std::string title, std::string _description = "");
 | 
|---|
 | 236 |     virtual ~EmptyQuery();
 | 
|---|
 | 237 |     virtual bool handle()=0;
 | 
|---|
 | 238 |     virtual void setResult();
 | 
|---|
| [f5a86a] | 239 |   };
 | 
|---|
 | 240 | 
 | 
|---|
| [45f5d6] | 241 |   //Specialized classes for certain types. GUI-Types are not specialized at this time
 | 
|---|
| [97ebf8] | 242 |   class BooleanQuery : public Query {
 | 
|---|
 | 243 |   public:
 | 
|---|
| [75dc28] | 244 |     BooleanQuery(std::string title, std::string _description = "");
 | 
|---|
| [97ebf8] | 245 |     virtual ~BooleanQuery();
 | 
|---|
 | 246 |     virtual bool handle()=0;
 | 
|---|
 | 247 |     virtual void setResult();
 | 
|---|
 | 248 |   protected:
 | 
|---|
 | 249 |     bool tmp;
 | 
|---|
 | 250 |   };
 | 
|---|
 | 251 | 
 | 
|---|
| [45f5d6] | 252 |   class IntQuery : public Query {
 | 
|---|
 | 253 |   public:
 | 
|---|
| [75dc28] | 254 |     IntQuery(std::string title, std::string _description = "");
 | 
|---|
| [5a7243] | 255 |     virtual ~IntQuery();
 | 
|---|
| [45f5d6] | 256 |     virtual bool handle()=0;
 | 
|---|
 | 257 |     virtual void setResult();
 | 
|---|
 | 258 |   protected:
 | 
|---|
 | 259 |     int tmp;
 | 
|---|
 | 260 |   };
 | 
|---|
 | 261 | 
 | 
|---|
| [7cd6e7] | 262 |   class IntsQuery : public Query {
 | 
|---|
 | 263 |   public:
 | 
|---|
 | 264 |     IntsQuery(std::string title, std::string _description = "");
 | 
|---|
 | 265 |     virtual ~IntsQuery();
 | 
|---|
 | 266 |     virtual bool handle()=0;
 | 
|---|
 | 267 |     virtual void setResult();
 | 
|---|
 | 268 |   protected:
 | 
|---|
 | 269 |     int temp;
 | 
|---|
 | 270 |     std::vector<int> tmp;
 | 
|---|
 | 271 |   };
 | 
|---|
 | 272 | 
 | 
|---|
| [2ededc2] | 273 |   class DoubleQuery : public Query {
 | 
|---|
 | 274 |   public:
 | 
|---|
| [75dc28] | 275 |     DoubleQuery(std::string title, std::string _description = "");
 | 
|---|
| [5a7243] | 276 |     virtual ~DoubleQuery();
 | 
|---|
| [2ededc2] | 277 |     virtual bool handle()=0;
 | 
|---|
 | 278 |     virtual void setResult();
 | 
|---|
 | 279 |   protected:
 | 
|---|
 | 280 |     double tmp;
 | 
|---|
 | 281 |   };
 | 
|---|
 | 282 | 
 | 
|---|
| [7cd6e7] | 283 |   class DoublesQuery : public Query {
 | 
|---|
 | 284 |   public:
 | 
|---|
 | 285 |     DoublesQuery(std::string title, std::string _description = "");
 | 
|---|
 | 286 |     virtual ~DoublesQuery();
 | 
|---|
 | 287 |     virtual bool handle()=0;
 | 
|---|
 | 288 |     virtual void setResult();
 | 
|---|
 | 289 |   protected:
 | 
|---|
 | 290 |     double temp;
 | 
|---|
 | 291 |     std::vector<double> tmp;
 | 
|---|
 | 292 |   };
 | 
|---|
 | 293 | 
 | 
|---|
| [45f5d6] | 294 |   class StringQuery : public Query {
 | 
|---|
 | 295 |   public:
 | 
|---|
| [75dc28] | 296 |     StringQuery(std::string title, std::string _description = "");
 | 
|---|
| [5a7243] | 297 |     virtual ~StringQuery();
 | 
|---|
| [45f5d6] | 298 |     virtual bool handle()=0;
 | 
|---|
 | 299 |     virtual void setResult();
 | 
|---|
 | 300 |   protected:
 | 
|---|
 | 301 |     std::string tmp;
 | 
|---|
 | 302 |   };
 | 
|---|
 | 303 | 
 | 
|---|
| [cd8e55] | 304 |   class StringsQuery : public Query {
 | 
|---|
 | 305 |   public:
 | 
|---|
| [75dc28] | 306 |     StringsQuery(std::string title, std::string _description = "");
 | 
|---|
| [cd8e55] | 307 |     virtual ~StringsQuery();
 | 
|---|
 | 308 |     virtual bool handle()=0;
 | 
|---|
 | 309 |     virtual void setResult();
 | 
|---|
 | 310 |   protected:
 | 
|---|
 | 311 |     std::string temp;
 | 
|---|
 | 312 |     std::vector<std::string> tmp;
 | 
|---|
 | 313 |   };
 | 
|---|
 | 314 | 
 | 
|---|
| [7aa000] | 315 |   class MoleculeQuery : public Query {
 | 
|---|
 | 316 |   public:
 | 
|---|
| [75dc28] | 317 |     MoleculeQuery(std::string title, std::string _description = "");
 | 
|---|
| [5a7243] | 318 |     virtual ~MoleculeQuery();
 | 
|---|
| [7aa000] | 319 |     virtual bool handle()=0;
 | 
|---|
 | 320 |     virtual void setResult();
 | 
|---|
 | 321 |   protected:
 | 
|---|
| [e4afb4] | 322 |     const molecule *tmp;
 | 
|---|
| [7aa000] | 323 |   };
 | 
|---|
 | 324 | 
 | 
|---|
| [7cd6e7] | 325 |   class MoleculesQuery : public Query {
 | 
|---|
 | 326 |   public:
 | 
|---|
 | 327 |     MoleculesQuery(std::string title, std::string _description = "");
 | 
|---|
 | 328 |     virtual ~MoleculesQuery();
 | 
|---|
 | 329 |     virtual bool handle()=0;
 | 
|---|
 | 330 |     virtual void setResult();
 | 
|---|
 | 331 |   protected:
 | 
|---|
| [e4afb4] | 332 |     const molecule * temp;
 | 
|---|
 | 333 |     std::vector<const molecule *> tmp;
 | 
|---|
| [7cd6e7] | 334 |   };
 | 
|---|
 | 335 | 
 | 
|---|
| [97ebf8] | 336 |   class AtomQuery : public Query {
 | 
|---|
 | 337 |   public:
 | 
|---|
| [75dc28] | 338 |     AtomQuery(std::string title, std::string _description = "");
 | 
|---|
| [97ebf8] | 339 |     virtual ~AtomQuery();
 | 
|---|
 | 340 |     virtual bool handle()=0;
 | 
|---|
 | 341 |     virtual void setResult();
 | 
|---|
 | 342 |   protected:
 | 
|---|
| [e4afb4] | 343 |     const atom *tmp;
 | 
|---|
| [97ebf8] | 344 |   };
 | 
|---|
 | 345 | 
 | 
|---|
| [7cd6e7] | 346 |   class AtomsQuery : public Query {
 | 
|---|
 | 347 |   public:
 | 
|---|
 | 348 |     AtomsQuery(std::string title, std::string _description = "");
 | 
|---|
 | 349 |     virtual ~AtomsQuery();
 | 
|---|
 | 350 |     virtual bool handle()=0;
 | 
|---|
 | 351 |     virtual void setResult();
 | 
|---|
 | 352 |   protected:
 | 
|---|
| [e4afb4] | 353 |     const atom *temp;
 | 
|---|
 | 354 |     std::vector<const atom *> tmp;
 | 
|---|
| [7cd6e7] | 355 |   };
 | 
|---|
 | 356 | 
 | 
|---|
| [2ededc2] | 357 |   class VectorQuery : public Query {
 | 
|---|
 | 358 |   public:
 | 
|---|
| [75dc28] | 359 |       VectorQuery(std::string title,bool _check, std::string _description = "");
 | 
|---|
| [5a7243] | 360 |       virtual ~VectorQuery();
 | 
|---|
| [2ededc2] | 361 |       virtual bool handle()=0;
 | 
|---|
 | 362 |       virtual void setResult();
 | 
|---|
 | 363 |     protected:
 | 
|---|
| [7cd6e7] | 364 |       Vector tmp;
 | 
|---|
 | 365 |       bool check;
 | 
|---|
 | 366 |   };
 | 
|---|
 | 367 | 
 | 
|---|
 | 368 |   class VectorsQuery : public Query {
 | 
|---|
 | 369 |   public:
 | 
|---|
 | 370 |       VectorsQuery(std::string title,bool _check, std::string _description = "");
 | 
|---|
 | 371 |       virtual ~VectorsQuery();
 | 
|---|
 | 372 |       virtual bool handle()=0;
 | 
|---|
 | 373 |       virtual void setResult();
 | 
|---|
 | 374 |     protected:
 | 
|---|
 | 375 |       Vector temp;
 | 
|---|
 | 376 |       std::vector<Vector> tmp;
 | 
|---|
| [2ededc2] | 377 |       bool check;
 | 
|---|
 | 378 |   };
 | 
|---|
 | 379 | 
 | 
|---|
| [97ebf8] | 380 |   class BoxQuery : public Query {
 | 
|---|
 | 381 |   public:
 | 
|---|
| [75dc28] | 382 |       BoxQuery(std::string title, std::string _description = "");
 | 
|---|
| [97ebf8] | 383 |       virtual ~BoxQuery();
 | 
|---|
 | 384 |       virtual bool handle()=0;
 | 
|---|
 | 385 |       virtual void setResult();
 | 
|---|
 | 386 |     protected:
 | 
|---|
| [8bc733] | 387 |       Box tmp;
 | 
|---|
| [97ebf8] | 388 |   };
 | 
|---|
 | 389 | 
 | 
|---|
| [5a7243] | 390 |   class ElementQuery : public Query {
 | 
|---|
 | 391 |   public:
 | 
|---|
| [75dc28] | 392 |     ElementQuery(std::string title, std::string _description = "");
 | 
|---|
| [5a7243] | 393 |     virtual ~ElementQuery();
 | 
|---|
 | 394 |     virtual bool handle()=0;
 | 
|---|
 | 395 |     virtual void setResult();
 | 
|---|
 | 396 |   protected:
 | 
|---|
| [e5c0a1] | 397 |     const element * tmp;
 | 
|---|
| [7cd6e7] | 398 |   };
 | 
|---|
 | 399 | 
 | 
|---|
 | 400 |   class ElementsQuery : public Query {
 | 
|---|
 | 401 |   public:
 | 
|---|
 | 402 |     ElementsQuery(std::string title, std::string _description = "");
 | 
|---|
 | 403 |     virtual ~ElementsQuery();
 | 
|---|
 | 404 |     virtual bool handle()=0;
 | 
|---|
 | 405 |     virtual void setResult();
 | 
|---|
 | 406 |   protected:
 | 
|---|
| [e5c0a1] | 407 |     const element *temp;
 | 
|---|
 | 408 |     std::vector<const element *> tmp;
 | 
|---|
| [5a7243] | 409 |   };
 | 
|---|
 | 410 | 
 | 
|---|
| [6f5dfe] | 411 |   class FileQuery : public Query {
 | 
|---|
 | 412 |   public:
 | 
|---|
 | 413 |     FileQuery(std::string title, std::string _description = "");
 | 
|---|
 | 414 |     virtual ~FileQuery();
 | 
|---|
 | 415 |     virtual bool handle()=0;
 | 
|---|
 | 416 |     virtual void setResult();
 | 
|---|
 | 417 |   protected:
 | 
|---|
 | 418 |     boost::filesystem::path tmp;
 | 
|---|
 | 419 |   };
 | 
|---|
 | 420 | 
 | 
|---|
| [45f5d6] | 421 | void registerQuery(Query* query);
 | 
|---|
 | 422 | 
 | 
|---|
 | 423 | private:
 | 
|---|
 | 424 |   std::list<Query*> queries;
 | 
|---|
| [f5a86a] | 425 | 
 | 
|---|
 | 426 | };
 | 
|---|
 | 427 | 
 | 
|---|
| [a2ab15] | 428 | 
 | 
|---|
| [f5a86a] | 429 | #endif /* DIALOG_HPP_ */
 | 
|---|