Changes in src/UIElements/Dialog.cpp [26f75a:5605032]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Dialog.cpp
r26f75a r5605032 8 8 #include <cassert> 9 9 10 #include " Dialog.hpp"10 #include "UIElements/Dialog.hpp" 11 11 12 #include "atom.hpp"13 #include "element.hpp"14 #include "molecule.hpp"15 12 #include "vector.hpp" 16 13 … … 54 51 55 52 // Base class 56 Dialog::Query::Query(string _title, string _description) : 57 title(_title), 58 description(_description) 53 Dialog::Query::Query(string _title) : 54 title(_title) 59 55 {} 60 56 … … 65 61 } 66 62 67 const std::string Dialog::Query::getDescription() const{68 return description;69 }70 // empty Queries71 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 81 63 // Int Queries 82 64 83 Dialog::IntQuery::IntQuery(string title,int *_target , std::string description) :84 Query(title , description), target(_target)65 Dialog::IntQuery::IntQuery(string title,int *_target) : 66 Query(title), target(_target) 85 67 {} 86 68 … … 91 73 } 92 74 93 // Int Queries94 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 105 75 // String Queries 106 76 107 Dialog::StringQuery::StringQuery(string title,string *_target , std::string _description) :108 Query(title , _description), target(_target)77 Dialog::StringQuery::StringQuery(string title,string *_target) : 78 Query(title), target(_target) 109 79 {} 110 80 … … 117 87 // Double Queries 118 88 119 Dialog::DoubleQuery::DoubleQuery(string title,double *_target , std::string _description) :120 Query(title , _description), target(_target)89 Dialog::DoubleQuery::DoubleQuery(string title,double *_target) : 90 Query(title), target(_target) 121 91 {} 122 92 … … 128 98 129 99 130 // Atom Queries131 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 145 100 // Molecule Queries 146 101 147 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) :148 Query(title , _description),102 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules) : 103 Query(title), 149 104 tmp(0), 105 molecules(_molecules), 150 106 target(_target) 151 107 … … 160 116 // Vector Queries 161 117 162 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check , std::string _description) :163 Query(title , _description),118 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check) : 119 Query(title), 164 120 cellSize(_cellSize), 165 121 check(_check), 166 122 target(_target) 167 123 { 168 124 tmp = new Vector(); 169 125 } 170 126 … … 178 134 } 179 135 180 // Box Queries181 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 200 136 // Element Queries 201 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target , std::string _description) :202 Query(title , _description),137 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target) : 138 Query(title), 203 139 tmp(0), 204 140 target(_target)
Note:
See TracChangeset
for help on using the changeset viewer.