| 1 | /* | 
|---|
| 2 | * Project: MoleCuilder | 
|---|
| 3 | * Description: creates and alters molecular systems | 
|---|
| 4 | * Copyright (C)  2010-2012 University of Bonn. All rights reserved. | 
|---|
| 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/>. | 
|---|
| 21 | */ | 
|---|
| 22 |  | 
|---|
| 23 | /* | 
|---|
| 24 | * TextDialog.cpp | 
|---|
| 25 | * | 
|---|
| 26 | *  Created on: Jan 5, 2010 | 
|---|
| 27 | *      Author: crueger | 
|---|
| 28 | */ | 
|---|
| 29 |  | 
|---|
| 30 | // include config.h | 
|---|
| 31 | #ifdef HAVE_CONFIG_H | 
|---|
| 32 | #include <config.h> | 
|---|
| 33 | #endif | 
|---|
| 34 |  | 
|---|
| 35 | #include "CodePatterns/MemDebug.hpp" | 
|---|
| 36 |  | 
|---|
| 37 | #include "TextUI/TextDialog.hpp" | 
|---|
| 38 | #include "TextUI/Query/TextQuery.hpp" | 
|---|
| 39 |  | 
|---|
| 40 | using namespace std; | 
|---|
| 41 |  | 
|---|
| 42 |  | 
|---|
| 43 | TextDialog::TextDialog() | 
|---|
| 44 | { | 
|---|
| 45 | } | 
|---|
| 46 |  | 
|---|
| 47 | TextDialog::~TextDialog() | 
|---|
| 48 | { | 
|---|
| 49 | } | 
|---|
| 50 |  | 
|---|
| 51 | void TextDialog::queryEmpty(const std::string title, const std::string description){ | 
|---|
| 52 | registerQuery(new EmptyTextQuery(title,description)); | 
|---|
| 53 | } | 
|---|
| 54 |  | 
|---|
| 55 | void TextDialog::queryBoolean(Parameter<bool> &_param, const std::string title, const std::string description){ | 
|---|
| 56 | registerQuery(new BooleanTextQuery(_param, title,description)); | 
|---|
| 57 | } | 
|---|
| 58 |  | 
|---|
| 59 | void TextDialog::queryInt(Parameter<int> &_param, const std::string title, const std::string description){ | 
|---|
| 60 | registerQuery(new IntTextQuery(_param, title,description)); | 
|---|
| 61 | } | 
|---|
| 62 |  | 
|---|
| 63 | void TextDialog::queryInts(Parameter<std::vector<int> > &_param, const std::string title, const std::string description){ | 
|---|
| 64 | registerQuery(new IntsTextQuery(_param, title,description)); | 
|---|
| 65 | } | 
|---|
| 66 |  | 
|---|
| 67 | void TextDialog::queryUnsignedInt(Parameter<unsigned int> &_param, const std::string title, const std::string description){ | 
|---|
| 68 | registerQuery(new UnsignedIntTextQuery(_param, title,description)); | 
|---|
| 69 | } | 
|---|
| 70 |  | 
|---|
| 71 | void TextDialog::queryUnsignedInts(Parameter<std::vector<unsigned int> > &_param, const std::string title, const std::string description){ | 
|---|
| 72 | registerQuery(new UnsignedIntsTextQuery(_param, title,description)); | 
|---|
| 73 | } | 
|---|
| 74 |  | 
|---|
| 75 | void TextDialog::queryDouble(Parameter<double> &_param, const std::string title, const std::string description){ | 
|---|
| 76 | registerQuery(new DoubleTextQuery(_param, title,description)); | 
|---|
| 77 | } | 
|---|
| 78 |  | 
|---|
| 79 | void TextDialog::queryDoubles(Parameter<std::vector<double> > &_param, const std::string title, const std::string description){ | 
|---|
| 80 | registerQuery(new DoublesTextQuery(_param, title,description)); | 
|---|
| 81 | } | 
|---|
| 82 |  | 
|---|
| 83 | void TextDialog::queryString(Parameter<std::string> &_param, const std::string title, const std::string description){ | 
|---|
| 84 | registerQuery(new StringTextQuery(_param, title,description)); | 
|---|
| 85 | } | 
|---|
| 86 |  | 
|---|
| 87 | void TextDialog::queryStrings(Parameter<std::vector<std::string> > &_param, const std::string title, const std::string description){ | 
|---|
| 88 | registerQuery(new StringsTextQuery(_param, title,description)); | 
|---|
| 89 | } | 
|---|
| 90 |  | 
|---|
| 91 | void TextDialog::queryAtom(Parameter<const atom *> &_param, const std::string title, const std::string description) { | 
|---|
| 92 | registerQuery(new AtomTextQuery(_param, title,description)); | 
|---|
| 93 | } | 
|---|
| 94 |  | 
|---|
| 95 | void TextDialog::queryAtoms(Parameter<std::vector<const atom *> > &_param, const std::string title, const std::string description) { | 
|---|
| 96 | registerQuery(new AtomsTextQuery(_param, title,description)); | 
|---|
| 97 | } | 
|---|
| 98 |  | 
|---|
| 99 | void TextDialog::queryMolecule(Parameter<const molecule *> &_param, const std::string title, const std::string description) { | 
|---|
| 100 | registerQuery(new MoleculeTextQuery(_param, title,description)); | 
|---|
| 101 | } | 
|---|
| 102 |  | 
|---|
| 103 | void TextDialog::queryMolecules(Parameter<std::vector<const molecule *> > &_param, const std::string title, const std::string description) { | 
|---|
| 104 | registerQuery(new MoleculesTextQuery(_param, title,description)); | 
|---|
| 105 | } | 
|---|
| 106 |  | 
|---|
| 107 | void TextDialog::queryVector(Parameter<Vector> &_param, const std::string title, const std::string description) { | 
|---|
| 108 | registerQuery(new VectorTextQuery(_param, title,description)); | 
|---|
| 109 | } | 
|---|
| 110 |  | 
|---|
| 111 | void TextDialog::queryVectors(Parameter<std::vector<Vector> > &_param, const std::string title, const std::string description) { | 
|---|
| 112 | registerQuery(new VectorsTextQuery(_param, title,description)); | 
|---|
| 113 | } | 
|---|
| 114 |  | 
|---|
| 115 | void TextDialog::queryRealSpaceMatrix(Parameter<RealSpaceMatrix> &_param, const std::string title, const std::string description) { | 
|---|
| 116 | registerQuery(new RealSpaceMatrixTextQuery(_param, title,description)); | 
|---|
| 117 | } | 
|---|
| 118 |  | 
|---|
| 119 | void TextDialog::queryElement(Parameter<const element *> &_param, const std::string title, const std::string description){ | 
|---|
| 120 | registerQuery(new ElementTextQuery(_param, title,description)); | 
|---|
| 121 | } | 
|---|
| 122 |  | 
|---|
| 123 | void TextDialog::queryElements(Parameter<std::vector<const element *> > &_param, const std::string title, const std::string description){ | 
|---|
| 124 | registerQuery(new ElementsTextQuery(_param, title,description)); | 
|---|
| 125 | } | 
|---|
| 126 |  | 
|---|
| 127 | void TextDialog::queryFile(Parameter<boost::filesystem::path> &_param, const std::string title, const std::string description){ | 
|---|
| 128 | registerQuery(new FileTextQuery(_param, title,description)); | 
|---|
| 129 | } | 
|---|
| 130 |  | 
|---|
| 131 | void TextDialog::queryFiles(Parameter<std::vector< boost::filesystem::path> > &_param, const std::string title, const std::string description){ | 
|---|
| 132 | registerQuery(new FilesTextQuery(_param, title,description)); | 
|---|
| 133 | } | 
|---|
| 134 |  | 
|---|
| 135 | void TextDialog::queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &_param, const std::string title, const std::string description){ | 
|---|
| 136 | registerQuery(new RandomNumberDistribution_ParametersTextQuery(_param, title,description)); | 
|---|
| 137 | } | 
|---|
| 138 |  | 
|---|
| 139 |  | 
|---|
| 140 | /************************** Query Infrastructure ************************/ | 
|---|
| 141 | /*       ---> shifted to folder Query                                   */ | 
|---|
| 142 | /************************************************************************/ | 
|---|
| 143 |  | 
|---|