| [bcf653] | 1 | /* | 
|---|
|  | 2 | * Project: MoleCuilder | 
|---|
|  | 3 | * Description: creates and alters molecular systems | 
|---|
| [0aa122] | 4 | * Copyright (C)  2010-2012 University of Bonn. All rights reserved. | 
|---|
| [bcf653] | 5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
| [a2ab15] | 8 | /* | 
|---|
|  | 9 | * CommandLineDialog.cpp | 
|---|
|  | 10 | * | 
|---|
|  | 11 | *  Created on: May 8, 2010 | 
|---|
|  | 12 | *      Author: heber | 
|---|
|  | 13 | */ | 
|---|
|  | 14 |  | 
|---|
| [bf3817] | 15 | // include config.h | 
|---|
|  | 16 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 17 | #include <config.h> | 
|---|
|  | 18 | #endif | 
|---|
|  | 19 |  | 
|---|
| [ad011c] | 20 | #include "CodePatterns/MemDebug.hpp" | 
|---|
| [a2ab15] | 21 |  | 
|---|
| [5079a0] | 22 | #include "CommandLineUI/CommandLineDialog.hpp" | 
|---|
| [87db7a] | 23 | #include "CommandLineUI/Query/CommandLineQuery.hpp" | 
|---|
| [a2ab15] | 24 |  | 
|---|
| [97ebf8] | 25 |  | 
|---|
| [a2ab15] | 26 | using namespace std; | 
|---|
|  | 27 |  | 
|---|
|  | 28 |  | 
|---|
|  | 29 | CommandLineDialog::CommandLineDialog() | 
|---|
|  | 30 | { | 
|---|
|  | 31 | } | 
|---|
|  | 32 |  | 
|---|
|  | 33 | CommandLineDialog::~CommandLineDialog() | 
|---|
|  | 34 | { | 
|---|
|  | 35 | } | 
|---|
|  | 36 |  | 
|---|
|  | 37 |  | 
|---|
| [955b91] | 38 | void CommandLineDialog::queryEmpty(const char* title, std::string _description){ | 
|---|
| [86466e] | 39 | registerQuery(new EmptyCommandLineQuery(title, _description)); | 
|---|
| [a2ab15] | 40 | } | 
|---|
|  | 41 |  | 
|---|
| [f10b0c] | 42 | void CommandLineDialog::queryInt(Parameter<int> ¶m, const char* title, std::string _description){ | 
|---|
|  | 43 | registerQuery(new IntCommandLineQuery(param, title, _description)); | 
|---|
| [a2ab15] | 44 | } | 
|---|
|  | 45 |  | 
|---|
| [f10b0c] | 46 | void CommandLineDialog::queryInts(Parameter<std::vector<int> > ¶m, const char* title, std::string _description){ | 
|---|
|  | 47 | registerQuery(new IntsCommandLineQuery(param, title, _description)); | 
|---|
| [7cd6e7] | 48 | } | 
|---|
|  | 49 |  | 
|---|
| [f10b0c] | 50 | void CommandLineDialog::queryUnsignedInt(Parameter<unsigned int> ¶m, const char* title, std::string _description){ | 
|---|
|  | 51 | registerQuery(new UnsignedIntCommandLineQuery(param, title, _description)); | 
|---|
| [838cd0] | 52 | } | 
|---|
|  | 53 |  | 
|---|
| [f10b0c] | 54 | void CommandLineDialog::queryUnsignedInts(Parameter<std::vector<unsigned int> > ¶m, const char* title, std::string _description){ | 
|---|
|  | 55 | registerQuery(new UnsignedIntsCommandLineQuery(param, title, _description)); | 
|---|
| [12948c] | 56 | } | 
|---|
|  | 57 |  | 
|---|
| [f10b0c] | 58 | void CommandLineDialog::queryBoolean(Parameter<bool> ¶m, const char* title, std::string _description){ | 
|---|
|  | 59 | registerQuery(new BooleanCommandLineQuery(param, title, _description)); | 
|---|
| [97ebf8] | 60 | } | 
|---|
|  | 61 |  | 
|---|
| [f10b0c] | 62 | void CommandLineDialog::queryDouble(Parameter<double> ¶m, const char* title, std::string _description){ | 
|---|
|  | 63 | registerQuery(new DoubleCommandLineQuery(param, title, _description)); | 
|---|
| [a2ab15] | 64 | } | 
|---|
|  | 65 |  | 
|---|
| [f10b0c] | 66 | void CommandLineDialog::queryDoubles(Parameter<std::vector<double> > ¶m, const char* title, std::string _description){ | 
|---|
|  | 67 | registerQuery(new DoublesCommandLineQuery(param, title, _description)); | 
|---|
| [7cd6e7] | 68 | } | 
|---|
|  | 69 |  | 
|---|
| [f10b0c] | 70 | void CommandLineDialog::queryString(Parameter<std::string> ¶m, const char* title, std::string _description){ | 
|---|
|  | 71 | registerQuery(new StringCommandLineQuery(param, title, _description)); | 
|---|
| [a2ab15] | 72 | } | 
|---|
|  | 73 |  | 
|---|
| [f10b0c] | 74 | void CommandLineDialog::queryStrings(Parameter<std::vector<std::string> > ¶m, const char* title, std::string _description){ | 
|---|
|  | 75 | registerQuery(new StringsCommandLineQuery(param, title, _description)); | 
|---|
| [cd8e55] | 76 | } | 
|---|
|  | 77 |  | 
|---|
| [f10b0c] | 78 | void CommandLineDialog::queryAtom(Parameter<const atom *> ¶m, const char* title, std::string _description) { | 
|---|
|  | 79 | registerQuery(new AtomCommandLineQuery(param, title, _description)); | 
|---|
| [97ebf8] | 80 | } | 
|---|
|  | 81 |  | 
|---|
| [f10b0c] | 82 | void CommandLineDialog::queryAtoms(Parameter<std::vector<const atom *> > ¶m, const char* title, std::string _description) { | 
|---|
|  | 83 | registerQuery(new AtomsCommandLineQuery(param, title, _description)); | 
|---|
| [7cd6e7] | 84 | } | 
|---|
|  | 85 |  | 
|---|
| [f10b0c] | 86 | void CommandLineDialog::queryMolecule(Parameter<const molecule *> ¶m, const char* title, std::string _description) { | 
|---|
|  | 87 | registerQuery(new MoleculeCommandLineQuery(param, title, _description)); | 
|---|
| [a2ab15] | 88 | } | 
|---|
|  | 89 |  | 
|---|
| [f10b0c] | 90 | void CommandLineDialog::queryMolecules(Parameter<std::vector<const molecule *> > ¶m, const char* title, std::string _description) { | 
|---|
|  | 91 | registerQuery(new MoleculesCommandLineQuery(param, title, _description)); | 
|---|
| [7cd6e7] | 92 | } | 
|---|
|  | 93 |  | 
|---|
| [f10b0c] | 94 | void CommandLineDialog::queryVector(Parameter<Vector> ¶m, const char* title, bool check, std::string _description) { | 
|---|
|  | 95 | registerQuery(new VectorCommandLineQuery(param, title,check, _description)); | 
|---|
| [86466e] | 96 | } | 
|---|
|  | 97 |  | 
|---|
| [f10b0c] | 98 | void CommandLineDialog::queryVectors(Parameter<std::vector<Vector> > ¶m, const char* title, bool check, std::string _description) { | 
|---|
|  | 99 | registerQuery(new VectorsCommandLineQuery(param, title,check, _description)); | 
|---|
| [7cd6e7] | 100 | } | 
|---|
|  | 101 |  | 
|---|
| [7d9416] | 102 | void CommandLineDialog::queryRealSpaceMatrix(Parameter<RealSpaceMatrix> ¶m, const char* title, std::string _description) { | 
|---|
|  | 103 | registerQuery(new RealSpaceMatrixCommandLineQuery(param, title,_description)); | 
|---|
| [97ebf8] | 104 | } | 
|---|
|  | 105 |  | 
|---|
| [f10b0c] | 106 | void CommandLineDialog::queryElement(Parameter<const element *> ¶m, const char* title, std::string _description){ | 
|---|
|  | 107 | registerQuery(new ElementCommandLineQuery(param, title, _description)); | 
|---|
| [a2ab15] | 108 | } | 
|---|
|  | 109 |  | 
|---|
| [f10b0c] | 110 | void CommandLineDialog::queryElements(Parameter<std::vector<const element *> > ¶m, const char* title, std::string _description){ | 
|---|
|  | 111 | registerQuery(new ElementsCommandLineQuery(param, title, _description)); | 
|---|
| [7cd6e7] | 112 | } | 
|---|
|  | 113 |  | 
|---|
| [f10b0c] | 114 | void CommandLineDialog::queryFile(Parameter<boost::filesystem::path> ¶m, const char* title, std::string _description){ | 
|---|
|  | 115 | registerQuery(new FileCommandLineQuery(param, title, _description)); | 
|---|
| [6f5dfe] | 116 | } | 
|---|
|  | 117 |  | 
|---|
| [bd81f9] | 118 | void CommandLineDialog::queryFiles(Parameter<std::vector< boost::filesystem::path> > ¶m, const char* title, std::string _description){ | 
|---|
|  | 119 | registerQuery(new FilesCommandLineQuery(param, title, _description)); | 
|---|
| [2c5765] | 120 | } | 
|---|
|  | 121 |  | 
|---|
| [f10b0c] | 122 | void CommandLineDialog::queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> ¶m, const char* title, std::string _description){ | 
|---|
|  | 123 | registerQuery(new RandomNumberDistribution_ParametersCommandLineQuery(param, title, _description)); | 
|---|
| [0275ad] | 124 | } | 
|---|
|  | 125 |  | 
|---|
| [a2ab15] | 126 | /************************** Query Infrastructure ************************/ | 
|---|
| [8df74d] | 127 | /*       ---> shifted to folder Query                                   */ | 
|---|
|  | 128 | /************************************************************************/ | 
|---|