| [bcf653] | 1 | /*
 | 
|---|
 | 2 |  * Project: MoleCuilder
 | 
|---|
 | 3 |  * Description: creates and alters molecular systems
 | 
|---|
| [0aa122] | 4 |  * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
 | 
|---|
| [94d5ac6] | 5 |  * 
 | 
|---|
 | 6 |  *
 | 
|---|
 | 7 |  *   This file is part of MoleCuilder.
 | 
|---|
 | 8 |  *
 | 
|---|
 | 9 |  *    MoleCuilder is free software: you can redistribute it and/or modify
 | 
|---|
 | 10 |  *    it under the terms of the GNU General Public License as published by
 | 
|---|
 | 11 |  *    the Free Software Foundation, either version 2 of the License, or
 | 
|---|
 | 12 |  *    (at your option) any later version.
 | 
|---|
 | 13 |  *
 | 
|---|
 | 14 |  *    MoleCuilder is distributed in the hope that it will be useful,
 | 
|---|
 | 15 |  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
 | 16 |  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
 | 17 |  *    GNU General Public License for more details.
 | 
|---|
 | 18 |  *
 | 
|---|
 | 19 |  *    You should have received a copy of the GNU General Public License
 | 
|---|
 | 20 |  *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
 | 
|---|
| [bcf653] | 21 |  */
 | 
|---|
 | 22 | 
 | 
|---|
| [f5a86a] | 23 | /*
 | 
|---|
 | 24 |  * TextDialog.cpp
 | 
|---|
 | 25 |  *
 | 
|---|
 | 26 |  *  Created on: Jan 5, 2010
 | 
|---|
 | 27 |  *      Author: crueger
 | 
|---|
 | 28 |  */
 | 
|---|
 | 29 | 
 | 
|---|
| [bf3817] | 30 | // include config.h
 | 
|---|
 | 31 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 32 | #include <config.h>
 | 
|---|
 | 33 | #endif
 | 
|---|
 | 34 | 
 | 
|---|
| [ad011c] | 35 | #include "CodePatterns/MemDebug.hpp"
 | 
|---|
| [112b09] | 36 | 
 | 
|---|
| [5079a0] | 37 | #include "TextUI/TextDialog.hpp"
 | 
|---|
| [738ae1] | 38 | #include "TextUI/Query/TextQuery.hpp"
 | 
|---|
| [7aa000] | 39 | 
 | 
|---|
| [f5a86a] | 40 | using namespace std;
 | 
|---|
 | 41 | 
 | 
|---|
 | 42 | 
 | 
|---|
 | 43 | TextDialog::TextDialog()
 | 
|---|
 | 44 | {
 | 
|---|
 | 45 | }
 | 
|---|
 | 46 | 
 | 
|---|
 | 47 | TextDialog::~TextDialog()
 | 
|---|
 | 48 | {
 | 
|---|
 | 49 | }
 | 
|---|
 | 50 | 
 | 
|---|
| [9ee38b] | 51 | void TextDialog::queryEmpty(const char* title, std::string description){
 | 
|---|
| [86466e] | 52 |   registerQuery(new EmptyTextQuery(title,description));
 | 
|---|
 | 53 | }
 | 
|---|
 | 54 | 
 | 
|---|
| [9d5531] | 55 | void TextDialog::queryBoolean(Parameter<bool> &_param, const char* title, std::string description){
 | 
|---|
 | 56 |   registerQuery(new BooleanTextQuery(_param, title,description));
 | 
|---|
| [97ebf8] | 57 | }
 | 
|---|
 | 58 | 
 | 
|---|
| [9d5531] | 59 | void TextDialog::queryInt(Parameter<int> &_param, const char* title, std::string description){
 | 
|---|
 | 60 |   registerQuery(new IntTextQuery(_param, title,description));
 | 
|---|
| [45f5d6] | 61 | }
 | 
|---|
 | 62 | 
 | 
|---|
| [9d5531] | 63 | void TextDialog::queryInts(Parameter<std::vector<int> > &_param, const char* title, std::string description){
 | 
|---|
 | 64 |   registerQuery(new IntsTextQuery(_param, title,description));
 | 
|---|
| [7cd6e7] | 65 | }
 | 
|---|
 | 66 | 
 | 
|---|
| [9d5531] | 67 | void TextDialog::queryUnsignedInt(Parameter<unsigned int> &_param, const char* title, std::string description){
 | 
|---|
 | 68 |   registerQuery(new UnsignedIntTextQuery(_param, title,description));
 | 
|---|
| [838cd0] | 69 | }
 | 
|---|
 | 70 | 
 | 
|---|
| [9d5531] | 71 | void TextDialog::queryUnsignedInts(Parameter<std::vector<unsigned int> > &_param, const char* title, std::string description){
 | 
|---|
 | 72 |   registerQuery(new UnsignedIntsTextQuery(_param, title,description));
 | 
|---|
| [12948c] | 73 | }
 | 
|---|
 | 74 | 
 | 
|---|
| [9d5531] | 75 | void TextDialog::queryDouble(Parameter<double> &_param, const char* title, std::string description){
 | 
|---|
 | 76 |   registerQuery(new DoubleTextQuery(_param, title,description));
 | 
|---|
| [2ededc2] | 77 | }
 | 
|---|
 | 78 | 
 | 
|---|
| [9d5531] | 79 | void TextDialog::queryDoubles(Parameter<std::vector<double> > &_param, const char* title, std::string description){
 | 
|---|
 | 80 |   registerQuery(new DoublesTextQuery(_param, title,description));
 | 
|---|
| [7cd6e7] | 81 | }
 | 
|---|
 | 82 | 
 | 
|---|
| [9d5531] | 83 | void TextDialog::queryString(Parameter<std::string> &_param, const char* title, std::string description){
 | 
|---|
 | 84 |   registerQuery(new StringTextQuery(_param, title,description));
 | 
|---|
| [f5a86a] | 85 | }
 | 
|---|
 | 86 | 
 | 
|---|
| [9d5531] | 87 | void TextDialog::queryStrings(Parameter<std::vector<std::string> > &_param, const char* title, std::string description){
 | 
|---|
 | 88 |   registerQuery(new StringsTextQuery(_param, title,description));
 | 
|---|
| [cd8e55] | 89 | }
 | 
|---|
 | 90 | 
 | 
|---|
| [9d5531] | 91 | void TextDialog::queryAtom(Parameter<const atom *> &_param, const char* title, std::string description) {
 | 
|---|
 | 92 |   registerQuery(new AtomTextQuery(_param, title,description));
 | 
|---|
| [97ebf8] | 93 | }
 | 
|---|
 | 94 | 
 | 
|---|
| [9d5531] | 95 | void TextDialog::queryAtoms(Parameter<std::vector<const atom *> > &_param, const char* title, std::string description) {
 | 
|---|
 | 96 |   registerQuery(new AtomsTextQuery(_param, title,description));
 | 
|---|
| [7cd6e7] | 97 | }
 | 
|---|
 | 98 | 
 | 
|---|
| [9d5531] | 99 | void TextDialog::queryMolecule(Parameter<const molecule *> &_param, const char* title, std::string description) {
 | 
|---|
 | 100 |   registerQuery(new MoleculeTextQuery(_param, title,description));
 | 
|---|
| [7aa000] | 101 | }
 | 
|---|
 | 102 | 
 | 
|---|
| [9d5531] | 103 | void TextDialog::queryMolecules(Parameter<std::vector<const molecule *> > &_param, const char* title, std::string description) {
 | 
|---|
 | 104 |   registerQuery(new MoleculesTextQuery(_param, title,description));
 | 
|---|
| [7cd6e7] | 105 | }
 | 
|---|
 | 106 | 
 | 
|---|
| [9d5531] | 107 | void TextDialog::queryVector(Parameter<Vector> &_param, const char* title, std::string description) {
 | 
|---|
 | 108 |   registerQuery(new VectorTextQuery(_param, title,description));
 | 
|---|
| [2ededc2] | 109 | }
 | 
|---|
 | 110 | 
 | 
|---|
| [9d5531] | 111 | void TextDialog::queryVectors(Parameter<std::vector<Vector> > &_param, const char* title, std::string description) {
 | 
|---|
 | 112 |   registerQuery(new VectorsTextQuery(_param, title,description));
 | 
|---|
| [7cd6e7] | 113 | }
 | 
|---|
 | 114 | 
 | 
|---|
| [9d5531] | 115 | void TextDialog::queryRealSpaceMatrix(Parameter<RealSpaceMatrix> &_param, const char* title, std::string description) {
 | 
|---|
 | 116 |   registerQuery(new RealSpaceMatrixTextQuery(_param, title,description));
 | 
|---|
| [97ebf8] | 117 | }
 | 
|---|
 | 118 | 
 | 
|---|
| [9d5531] | 119 | void TextDialog::queryElement(Parameter<const element *> &_param, const char* title, std::string description){
 | 
|---|
 | 120 |   registerQuery(new ElementTextQuery(_param, title,description));
 | 
|---|
| [5a7243] | 121 | }
 | 
|---|
 | 122 | 
 | 
|---|
| [9d5531] | 123 | void TextDialog::queryElements(Parameter<std::vector<const element *> > &_param, const char* title, std::string description){
 | 
|---|
 | 124 |   registerQuery(new ElementsTextQuery(_param, title,description));
 | 
|---|
| [7cd6e7] | 125 | }
 | 
|---|
 | 126 | 
 | 
|---|
| [9d5531] | 127 | void TextDialog::queryFile(Parameter<boost::filesystem::path> &_param, const char* title, std::string description){
 | 
|---|
 | 128 |   registerQuery(new FileTextQuery(_param, title,description));
 | 
|---|
| [6f5dfe] | 129 | }
 | 
|---|
 | 130 | 
 | 
|---|
| [9d5531] | 131 | void TextDialog::queryFiles(Parameter<std::vector< boost::filesystem::path> > &_param, const char* title, std::string description){
 | 
|---|
 | 132 |   registerQuery(new FilesTextQuery(_param, title,description));
 | 
|---|
| [2c5765] | 133 | }
 | 
|---|
 | 134 | 
 | 
|---|
| [9d5531] | 135 | void TextDialog::queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &_param, const char* title, std::string description){
 | 
|---|
 | 136 |   registerQuery(new RandomNumberDistribution_ParametersTextQuery(_param, title,description));
 | 
|---|
| [0275ad] | 137 | }
 | 
|---|
 | 138 | 
 | 
|---|
| [9d5531] | 139 | 
 | 
|---|
| [7aa000] | 140 | /************************** Query Infrastructure ************************/
 | 
|---|
| [8df74d] | 141 | /*       ---> shifted to folder Query                                   */
 | 
|---|
 | 142 | /************************************************************************/
 | 
|---|
| [6f5dfe] | 143 | 
 | 
|---|