- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/TextUI/TextDialog.cpp
r112b09 r84c494 25 25 #include "molecule.hpp" 26 26 #include "vector.hpp" 27 #include "Matrix.hpp" 28 #include "Box.hpp" 27 29 28 30 using namespace std; … … 66 68 } 67 69 68 void TextDialog::queryVector(const char* title, Vector *target, const double *const cellSize,bool check, string description) {69 registerQuery(new VectorTextQuery(title,target,c ellSize,check,description));70 } 71 72 void TextDialog::queryBox(const char* title, double ** constcellSize, string description) {70 void TextDialog::queryVector(const char* title, Vector *target, bool check, string description) { 71 registerQuery(new VectorTextQuery(title,target,check,description)); 72 } 73 74 void TextDialog::queryBox(const char* title,Box* cellSize, string description) { 73 75 registerQuery(new BoxTextQuery(title,cellSize,description)); 74 76 } 75 77 76 void TextDialog::queryElement(const char* title, const element **target, string description){78 void TextDialog::queryElement(const char* title, std::vector<element *> *target, string description){ 77 79 registerQuery(new ElementTextQuery(title,target,description)); 78 80 } … … 243 245 } 244 246 245 TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize,bool _check, std::string _description) :246 Dialog::VectorQuery(title,_target,_c ellSize,_check,_description)247 TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, bool _check, std::string _description) : 248 Dialog::VectorQuery(title,_target,_check,_description) 247 249 {} 248 250 … … 253 255 Log() << Verbose(0) << getTitle(); 254 256 257 const Matrix &M = World::getInstance().getDomain().getM(); 255 258 char coords[3] = {'x','y','z'}; 256 int j = -1;257 259 for (int i=0;i<3;i++) { 258 j += i+1;259 260 do { 260 Log() << Verbose(0) << coords[i] << "[0.." << cellSize[j]<< "]: ";261 Log() << Verbose(0) << coords[i] << "[0.." << M.at(i,i) << "]: "; 261 262 cin >> (*tmp)[i]; 262 } while ((((*tmp)[i] < 0) || ((*tmp)[i] >= cellSize[j])) && (check));263 } while ((((*tmp)[i] < 0) || ((*tmp)[i] >= M.at(i,i))) && (check)); 263 264 } 264 265 return true; 265 266 } 266 267 267 TextDialog::BoxTextQuery::BoxTextQuery(std::string title, double ** const_cellSize, std::string _description) :268 TextDialog::BoxTextQuery::BoxTextQuery(std::string title, Box* _cellSize, std::string _description) : 268 269 Dialog::BoxQuery(title,_cellSize,_description) 269 270 {} … … 283 284 } 284 285 285 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) :286 Dialog::ElementQuery(title, target,_description)286 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, std::vector<element *> *_target, std::string _description) : 287 Dialog::ElementQuery(title,_target,_description) 287 288 {} 288 289 … … 293 294 bool badInput=false; 294 295 bool aborted = false; 296 element * tmp = NULL; 295 297 do{ 296 298 badInput = false; … … 309 311 Log() << Verbose(0) << "No element with this atomic number!" << endl; 310 312 badInput = true; 313 } else { 314 elements.push_back(tmp); 311 315 } 312 316 } … … 331 335 Log() << Verbose(0) << "No element with this shorthand!" << endl; 332 336 badInput = true; 337 } else { 338 elements.push_back(tmp); 333 339 } 334 340 }
Note:
See TracChangeset
for help on using the changeset viewer.