Ignore:
Timestamp:
May 8, 2017, 1:54:50 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_goodresults, ForceAnnealing_tocheck
Children:
d7bd62
Parents:
a443e1
git-author:
Frederik Heber <heber@…> (03/30/17 21:59:00)
git-committer:
Frederik Heber <frederik.heber@…> (05/08/17 13:54:50)
Message:

Vector(s) are now stored as strings in Querys intermediately.

  • they get evaluated first after being stored in a Parameter/Value on request via get().
  • Needed to change all Vector(s)..Query's of all UIs and also the general base classes inside Dialog.
  • QtQueryList need to be specialized in order to allow a QtQueryList<Vector> to actually store a vector of strings.
  • we may use setAsString() in order to set the Parameter thankfully.
  • TESTS: All regression tests on Geometry Actions are now working.
Location:
src/UIElements/CommandLineUI/Query
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp

    ra443e1 rcb5231  
    5353
    5454bool CommandLineDialog::VectorCommandLineQuery::handle() {
    55   VectorValue _temp;
     55  VectorValue temporary;
    5656  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    57     try {
    58       _temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
    59     } catch(boost::bad_any_cast &e) {
    60       for (size_t i=0;i<NDIM;++i)
    61         _temp.vector[i] = 0.;
    62       return false;
    63     }
    64     temp = _temp.toVector();
     57    temporary = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
     58    temp = temporary.vectorstring;
    6559    return true;
    6660  }
  • src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp

    ra443e1 rcb5231  
    4646
    4747CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(Parameter<std::vector<Vector> > &_param, const std::string &_title, const std::string &_description) :
    48     Dialog::TQuery<std::vector<Vector> >(_param, _title, _description)
     48    Dialog::TQuery< std::vector<Vector> >(_param, _title, _description)
    4949{}
    5050
     
    5353
    5454bool CommandLineDialog::VectorsCommandLineQuery::handle() {
    55   std::vector<VectorValue> temporary;
     55  std::vector<std::string> temporary;
     56  std::stringstream output;
    5657  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    57     try {
    58       temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >();
    59     } catch(boost::bad_any_cast &e) {
    60       temporary.clear();
    61       return false;
    62     }
    63     for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) {
    64       Vector temp_element = (*iter).toVector();
    65       temp.push_back(temp_element);
    66     }
     58    temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >();
    6759    return true;
    6860  }
Note: See TracChangeset for help on using the changeset viewer.