Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/TextUI/TextDialog.cpp

    r112b09 r84c494  
    2525#include "molecule.hpp"
    2626#include "vector.hpp"
     27#include "Matrix.hpp"
     28#include "Box.hpp"
    2729
    2830using namespace std;
     
    6668}
    6769
    68 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) {
    69   registerQuery(new VectorTextQuery(title,target,cellSize,check,description));
    70 }
    71 
    72 void TextDialog::queryBox(const char* title,double ** const cellSize, string description) {
     70void TextDialog::queryVector(const char* title, Vector *target, bool check, string description) {
     71  registerQuery(new VectorTextQuery(title,target,check,description));
     72}
     73
     74void TextDialog::queryBox(const char* title,Box* cellSize, string description) {
    7375  registerQuery(new BoxTextQuery(title,cellSize,description));
    7476}
    7577
    76 void TextDialog::queryElement(const char* title, const element **target, string description){
     78void TextDialog::queryElement(const char* title, std::vector<element *> *target, string description){
    7779  registerQuery(new ElementTextQuery(title,target,description));
    7880}
     
    243245}
    244246
    245 TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check, std::string _description) :
    246     Dialog::VectorQuery(title,_target,_cellSize,_check,_description)
     247TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, bool _check, std::string _description) :
     248    Dialog::VectorQuery(title,_target,_check,_description)
    247249{}
    248250
     
    253255  Log() << Verbose(0) << getTitle();
    254256
     257  const Matrix &M = World::getInstance().getDomain().getM();
    255258  char coords[3] = {'x','y','z'};
    256   int j = -1;
    257259  for (int i=0;i<3;i++) {
    258     j += i+1;
    259260    do {
    260       Log() << Verbose(0) << coords[i] << "[0.." << cellSize[j] << "]: ";
     261      Log() << Verbose(0) << coords[i] << "[0.." << M.at(i,i) << "]: ";
    261262      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));
    263264  }
    264265  return true;
    265266}
    266267
    267 TextDialog::BoxTextQuery::BoxTextQuery(std::string title, double ** const _cellSize, std::string _description) :
     268TextDialog::BoxTextQuery::BoxTextQuery(std::string title, Box* _cellSize, std::string _description) :
    268269    Dialog::BoxQuery(title,_cellSize,_description)
    269270{}
     
    283284}
    284285
    285 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) :
    286     Dialog::ElementQuery(title,target,_description)
     286TextDialog::ElementTextQuery::ElementTextQuery(std::string title, std::vector<element *> *_target, std::string _description) :
     287    Dialog::ElementQuery(title,_target,_description)
    287288{}
    288289
     
    293294  bool badInput=false;
    294295  bool aborted = false;
     296  element * tmp = NULL;
    295297  do{
    296298    badInput = false;
     
    309311          Log() << Verbose(0) << "No element with this atomic number!" << endl;
    310312          badInput = true;
     313        } else {
     314          elements.push_back(tmp);
    311315        }
    312316      }
     
    331335          Log() << Verbose(0) << "No element with this shorthand!" << endl;
    332336          badInput = true;
     337        } else {
     338          elements.push_back(tmp);
    333339        }
    334340      }
Note: See TracChangeset for help on using the changeset viewer.