Changes in src/UIElements/Dialog.cpp [5605032:26f75a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Dialog.cpp
r5605032 r26f75a 8 8 #include <cassert> 9 9 10 #include "UIElements/Dialog.hpp" 11 10 #include "Dialog.hpp" 11 12 #include "atom.hpp" 13 #include "element.hpp" 14 #include "molecule.hpp" 12 15 #include "vector.hpp" 13 16 … … 51 54 52 55 // Base class 53 Dialog::Query::Query(string _title) : 54 title(_title) 56 Dialog::Query::Query(string _title, string _description) : 57 title(_title), 58 description(_description) 55 59 {} 56 60 … … 61 65 } 62 66 67 const std::string Dialog::Query::getDescription() const{ 68 return description; 69 } 70 // empty Queries 71 72 Dialog::EmptyQuery::EmptyQuery(string title, std::string description) : 73 Query(title, description) 74 {} 75 76 Dialog::EmptyQuery::~EmptyQuery() {} 77 78 void Dialog::EmptyQuery::setResult() { 79 } 80 63 81 // Int Queries 64 82 65 Dialog::IntQuery::IntQuery(string title,int *_target ) :66 Query(title ), target(_target)83 Dialog::IntQuery::IntQuery(string title,int *_target, std::string description) : 84 Query(title, description), target(_target) 67 85 {} 68 86 … … 73 91 } 74 92 93 // Int Queries 94 95 Dialog::BooleanQuery::BooleanQuery(string title,bool *_target, std::string description) : 96 Query(title, description), target(_target) 97 {} 98 99 Dialog::BooleanQuery::~BooleanQuery() {} 100 101 void Dialog::BooleanQuery::setResult() { 102 *target = tmp; 103 } 104 75 105 // String Queries 76 106 77 Dialog::StringQuery::StringQuery(string title,string *_target ) :78 Query(title ), target(_target)107 Dialog::StringQuery::StringQuery(string title,string *_target, std::string _description) : 108 Query(title, _description), target(_target) 79 109 {} 80 110 … … 87 117 // Double Queries 88 118 89 Dialog::DoubleQuery::DoubleQuery(string title,double *_target ) :90 Query(title ), target(_target)119 Dialog::DoubleQuery::DoubleQuery(string title,double *_target, std::string _description) : 120 Query(title, _description), target(_target) 91 121 {} 92 122 … … 98 128 99 129 130 // Atom Queries 131 132 Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) : 133 Query(title, _description), 134 tmp(0), 135 target(_target) 136 137 {} 138 139 Dialog::AtomQuery::~AtomQuery() {} 140 141 void Dialog::AtomQuery::setResult() { 142 *target = tmp; 143 } 144 100 145 // Molecule Queries 101 146 102 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules) :103 Query(title ),147 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) : 148 Query(title, _description), 104 149 tmp(0), 105 molecules(_molecules),106 150 target(_target) 107 151 … … 116 160 // Vector Queries 117 161 118 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check ) :119 Query(title ),162 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description) : 163 Query(title, _description), 120 164 cellSize(_cellSize), 121 165 check(_check), 122 166 target(_target) 123 167 { 124 tmp = new Vector();168 tmp = new Vector(); 125 169 } 126 170 … … 134 178 } 135 179 180 // Box Queries 181 182 Dialog::BoxQuery::BoxQuery(std::string title, double ** const _cellSize, std::string _description) : 183 Query(title, _description), 184 target(_cellSize) 185 { 186 tmp = new double[6]; 187 } 188 189 Dialog::BoxQuery::~BoxQuery() 190 { 191 delete[] tmp; 192 } 193 194 void Dialog::BoxQuery::setResult() { 195 for (int i=0;i<6;i++) { 196 (*target)[i] = tmp[i]; 197 } 198 } 199 136 200 // Element Queries 137 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target ) :138 Query(title ),201 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target, std::string _description) : 202 Query(title, _description), 139 203 tmp(0), 140 204 target(_target)
Note:
See TracChangeset
for help on using the changeset viewer.