[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 |
|
---|
[f130d4] | 51 | void TextDialog::queryEmpty(const std::string title, const std::string description){
|
---|
[86466e] | 52 | registerQuery(new EmptyTextQuery(title,description));
|
---|
| 53 | }
|
---|
| 54 |
|
---|
[f130d4] | 55 | void TextDialog::queryBoolean(Parameter<bool> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 56 | registerQuery(new BooleanTextQuery(_param, title,description));
|
---|
[97ebf8] | 57 | }
|
---|
| 58 |
|
---|
[f130d4] | 59 | void TextDialog::queryInt(Parameter<int> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 60 | registerQuery(new IntTextQuery(_param, title,description));
|
---|
[45f5d6] | 61 | }
|
---|
| 62 |
|
---|
[f130d4] | 63 | void TextDialog::queryInts(Parameter<std::vector<int> > &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 64 | registerQuery(new IntsTextQuery(_param, title,description));
|
---|
[7cd6e7] | 65 | }
|
---|
| 66 |
|
---|
[f130d4] | 67 | void TextDialog::queryUnsignedInt(Parameter<unsigned int> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 68 | registerQuery(new UnsignedIntTextQuery(_param, title,description));
|
---|
[838cd0] | 69 | }
|
---|
| 70 |
|
---|
[f130d4] | 71 | void TextDialog::queryUnsignedInts(Parameter<std::vector<unsigned int> > &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 72 | registerQuery(new UnsignedIntsTextQuery(_param, title,description));
|
---|
[12948c] | 73 | }
|
---|
| 74 |
|
---|
[f130d4] | 75 | void TextDialog::queryDouble(Parameter<double> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 76 | registerQuery(new DoubleTextQuery(_param, title,description));
|
---|
[2ededc2] | 77 | }
|
---|
| 78 |
|
---|
[f130d4] | 79 | void TextDialog::queryDoubles(Parameter<std::vector<double> > &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 80 | registerQuery(new DoublesTextQuery(_param, title,description));
|
---|
[7cd6e7] | 81 | }
|
---|
| 82 |
|
---|
[f130d4] | 83 | void TextDialog::queryString(Parameter<std::string> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 84 | registerQuery(new StringTextQuery(_param, title,description));
|
---|
[f5a86a] | 85 | }
|
---|
| 86 |
|
---|
[f130d4] | 87 | void TextDialog::queryStrings(Parameter<std::vector<std::string> > &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 88 | registerQuery(new StringsTextQuery(_param, title,description));
|
---|
[cd8e55] | 89 | }
|
---|
| 90 |
|
---|
[f130d4] | 91 | void TextDialog::queryAtom(Parameter<const atom *> &_param, const std::string title, const std::string description) {
|
---|
[9d5531] | 92 | registerQuery(new AtomTextQuery(_param, title,description));
|
---|
[97ebf8] | 93 | }
|
---|
| 94 |
|
---|
[f130d4] | 95 | void TextDialog::queryAtoms(Parameter<std::vector<const atom *> > &_param, const std::string title, const std::string description) {
|
---|
[9d5531] | 96 | registerQuery(new AtomsTextQuery(_param, title,description));
|
---|
[7cd6e7] | 97 | }
|
---|
| 98 |
|
---|
[f130d4] | 99 | void TextDialog::queryMolecule(Parameter<const molecule *> &_param, const std::string title, const std::string description) {
|
---|
[9d5531] | 100 | registerQuery(new MoleculeTextQuery(_param, title,description));
|
---|
[7aa000] | 101 | }
|
---|
| 102 |
|
---|
[f130d4] | 103 | void TextDialog::queryMolecules(Parameter<std::vector<const molecule *> > &_param, const std::string title, const std::string description) {
|
---|
[9d5531] | 104 | registerQuery(new MoleculesTextQuery(_param, title,description));
|
---|
[7cd6e7] | 105 | }
|
---|
| 106 |
|
---|
[f130d4] | 107 | void TextDialog::queryVector(Parameter<Vector> &_param, const std::string title, const std::string description) {
|
---|
[9d5531] | 108 | registerQuery(new VectorTextQuery(_param, title,description));
|
---|
[2ededc2] | 109 | }
|
---|
| 110 |
|
---|
[f130d4] | 111 | void TextDialog::queryVectors(Parameter<std::vector<Vector> > &_param, const std::string title, const std::string description) {
|
---|
[9d5531] | 112 | registerQuery(new VectorsTextQuery(_param, title,description));
|
---|
[7cd6e7] | 113 | }
|
---|
| 114 |
|
---|
[f130d4] | 115 | void TextDialog::queryRealSpaceMatrix(Parameter<RealSpaceMatrix> &_param, const std::string title, const std::string description) {
|
---|
[9d5531] | 116 | registerQuery(new RealSpaceMatrixTextQuery(_param, title,description));
|
---|
[97ebf8] | 117 | }
|
---|
| 118 |
|
---|
[f130d4] | 119 | void TextDialog::queryElement(Parameter<const element *> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 120 | registerQuery(new ElementTextQuery(_param, title,description));
|
---|
[5a7243] | 121 | }
|
---|
| 122 |
|
---|
[f130d4] | 123 | void TextDialog::queryElements(Parameter<std::vector<const element *> > &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 124 | registerQuery(new ElementsTextQuery(_param, title,description));
|
---|
[7cd6e7] | 125 | }
|
---|
| 126 |
|
---|
[f130d4] | 127 | void TextDialog::queryFile(Parameter<boost::filesystem::path> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 128 | registerQuery(new FileTextQuery(_param, title,description));
|
---|
[6f5dfe] | 129 | }
|
---|
| 130 |
|
---|
[f130d4] | 131 | void TextDialog::queryFiles(Parameter<std::vector< boost::filesystem::path> > &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 132 | registerQuery(new FilesTextQuery(_param, title,description));
|
---|
[2c5765] | 133 | }
|
---|
| 134 |
|
---|
[f130d4] | 135 | void TextDialog::queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &_param, const std::string title, const std::string description){
|
---|
[9d5531] | 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 |
|
---|