Ignore:
Timestamp:
Jun 11, 2012, 9:53:19 AM (13 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
95f965
Parents:
b9c69d
git-author:
Michael Ankele <ankele@…> (04/24/12 13:55:16)
git-committer:
Frederik Heber <heber@…> (06/11/12 09:53:19)
Message:

disastrously big and ugly commit

  • using new Parameter<T> classes:
    • Actions
    • Queries (all UIs)
  • TODO:
    • actions crash cause Value is unset
    • no query<BoxVector>
Location:
src/UIElements/CommandLineUI
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/CommandLineUI/CommandLineDialog.cpp

    rb9c69d rf10b0c  
    4040}
    4141
    42 void CommandLineDialog::queryInt(const char* title, std::string _description){
    43   registerQuery(new IntCommandLineQuery(title, _description));
     42void CommandLineDialog::queryInt(Parameter<int> &param, const char* title, std::string _description){
     43  registerQuery(new IntCommandLineQuery(param, title, _description));
    4444}
    4545
    46 void CommandLineDialog::queryInts(const char* title, std::string _description){
    47   registerQuery(new IntsCommandLineQuery(title, _description));
     46void CommandLineDialog::queryInts(Parameter<std::vector<int> > &param, const char* title, std::string _description){
     47  registerQuery(new IntsCommandLineQuery(param, title, _description));
    4848}
    4949
    50 void CommandLineDialog::queryUnsignedInt(const char* title, std::string _description){
    51   registerQuery(new UnsignedIntCommandLineQuery(title, _description));
     50void CommandLineDialog::queryUnsignedInt(Parameter<unsigned int> &param, const char* title, std::string _description){
     51  registerQuery(new UnsignedIntCommandLineQuery(param, title, _description));
    5252}
    5353
    54 void CommandLineDialog::queryUnsignedInts(const char* title, std::string _description){
    55   registerQuery(new UnsignedIntsCommandLineQuery(title, _description));
     54void CommandLineDialog::queryUnsignedInts(Parameter<std::vector<unsigned int> > &param, const char* title, std::string _description){
     55  registerQuery(new UnsignedIntsCommandLineQuery(param, title, _description));
    5656}
    5757
    58 void CommandLineDialog::queryBoolean(const char* title, std::string _description){
    59   registerQuery(new BooleanCommandLineQuery(title, _description));
     58void CommandLineDialog::queryBoolean(Parameter<bool> &param, const char* title, std::string _description){
     59  registerQuery(new BooleanCommandLineQuery(param, title, _description));
    6060}
    6161
    62 void CommandLineDialog::queryDouble(const char* title, std::string _description){
    63   registerQuery(new DoubleCommandLineQuery(title, _description));
     62void CommandLineDialog::queryDouble(Parameter<double> &param, const char* title, std::string _description){
     63  registerQuery(new DoubleCommandLineQuery(param, title, _description));
    6464}
    6565
    66 void CommandLineDialog::queryDoubles(const char* title, std::string _description){
    67   registerQuery(new DoublesCommandLineQuery(title, _description));
     66void CommandLineDialog::queryDoubles(Parameter<std::vector<double> > &param, const char* title, std::string _description){
     67  registerQuery(new DoublesCommandLineQuery(param, title, _description));
    6868}
    6969
    70 void CommandLineDialog::queryString(const char* title, std::string _description){
    71   registerQuery(new StringCommandLineQuery(title, _description));
     70void CommandLineDialog::queryString(Parameter<std::string> &param, const char* title, std::string _description){
     71  registerQuery(new StringCommandLineQuery(param, title, _description));
    7272}
    7373
    74 void CommandLineDialog::queryStrings(const char* title, std::string _description){
    75   registerQuery(new StringsCommandLineQuery(title, _description));
     74void CommandLineDialog::queryStrings(Parameter<std::vector<std::string> > &param, const char* title, std::string _description){
     75  registerQuery(new StringsCommandLineQuery(param, title, _description));
    7676}
    7777
    78 void CommandLineDialog::queryAtom(const char* title, std::string _description) {
    79   registerQuery(new AtomCommandLineQuery(title, _description));
     78void CommandLineDialog::queryAtom(Parameter<const atom *> &param, const char* title, std::string _description) {
     79  registerQuery(new AtomCommandLineQuery(param, title, _description));
    8080}
    8181
    82 void CommandLineDialog::queryAtoms(const char* title, std::string _description) {
    83   registerQuery(new AtomsCommandLineQuery(title, _description));
     82void CommandLineDialog::queryAtoms(Parameter<std::vector<const atom *> > &param, const char* title, std::string _description) {
     83  registerQuery(new AtomsCommandLineQuery(param, title, _description));
    8484}
    8585
    86 void CommandLineDialog::queryMolecule(const char* title, std::string _description) {
    87   registerQuery(new MoleculeCommandLineQuery(title, _description));
     86void CommandLineDialog::queryMolecule(Parameter<const molecule *> &param, const char* title, std::string _description) {
     87  registerQuery(new MoleculeCommandLineQuery(param, title, _description));
    8888}
    8989
    90 void CommandLineDialog::queryMolecules(const char* title, std::string _description) {
    91   registerQuery(new MoleculesCommandLineQuery(title, _description));
     90void CommandLineDialog::queryMolecules(Parameter<std::vector<const molecule *> > &param, const char* title, std::string _description) {
     91  registerQuery(new MoleculesCommandLineQuery(param, title, _description));
    9292}
    9393
    94 void CommandLineDialog::queryVector(const char* title, bool check, std::string _description) {
    95   registerQuery(new VectorCommandLineQuery(title,check, _description));
     94void CommandLineDialog::queryVector(Parameter<Vector> &param, const char* title, bool check, std::string _description) {
     95  registerQuery(new VectorCommandLineQuery(param, title,check, _description));
    9696}
    9797
    98 void CommandLineDialog::queryVectors(const char* title, bool check, std::string _description) {
    99   registerQuery(new VectorsCommandLineQuery(title,check, _description));
     98void CommandLineDialog::queryVectors(Parameter<std::vector<Vector> > &param, const char* title, bool check, std::string _description) {
     99  registerQuery(new VectorsCommandLineQuery(param, title,check, _description));
    100100}
    101101
    102 void CommandLineDialog::queryBox(const char* title, std::string _description) {
    103   registerQuery(new BoxCommandLineQuery(title,_description));
     102void CommandLineDialog::queryBox(Parameter<Box> &param, const char* title, std::string _description) {
     103  registerQuery(new BoxCommandLineQuery(param, title,_description));
    104104}
    105105
    106 void CommandLineDialog::queryElement(const char* title, std::string _description){
    107   registerQuery(new ElementCommandLineQuery(title, _description));
     106void CommandLineDialog::queryElement(Parameter<const element *> &param, const char* title, std::string _description){
     107  registerQuery(new ElementCommandLineQuery(param, title, _description));
    108108}
    109109
    110 void CommandLineDialog::queryElements(const char* title, std::string _description){
    111   registerQuery(new ElementsCommandLineQuery(title, _description));
     110void CommandLineDialog::queryElements(Parameter<std::vector<const element *> > &param, const char* title, std::string _description){
     111  registerQuery(new ElementsCommandLineQuery(param, title, _description));
    112112}
    113113
    114 void CommandLineDialog::queryFile(const char* title, std::string _description){
    115   registerQuery(new FileCommandLineQuery(title, _description));
     114void CommandLineDialog::queryFile(Parameter<boost::filesystem::path> &param, const char* title, std::string _description){
     115  registerQuery(new FileCommandLineQuery(param, title, _description));
    116116}
    117117
    118 void CommandLineDialog::queryRandomNumberDistribution_Parameters(const char* title, std::string _description){
    119   registerQuery(new RandomNumberDistribution_ParametersCommandLineQuery(title, _description));
     118void CommandLineDialog::queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &param, const char* title, std::string _description){
     119  registerQuery(new RandomNumberDistribution_ParametersCommandLineQuery(param, title, _description));
    120120}
    121121
  • src/UIElements/CommandLineUI/CommandLineDialog.hpp

    rb9c69d rf10b0c  
    3434
    3535  virtual void queryEmpty(const char *, std::string = "");
    36   virtual void queryInt(const char *, std::string = "");
    37   virtual void queryInts(const char *, std::string = "");
    38   virtual void queryUnsignedInt(const char *, std::string = "");
    39   virtual void queryUnsignedInts(const char *, std::string = "");
    40   virtual void queryBoolean(const char *, std::string = "");
    41   virtual void queryString(const char*, std::string = "");
    42   virtual void queryStrings(const char*, std::string = "");
    43   virtual void queryDouble(const char*, std::string = "");
    44   virtual void queryDoubles(const char*, std::string = "");
    45   virtual void queryAtom(const char*, std::string = "");
    46   virtual void queryAtoms(const char*, std::string = "");
    47   virtual void queryMolecule(const char*, std::string = "");
    48   virtual void queryMolecules(const char*, std::string = "");
    49   virtual void queryVector(const char*, bool, std::string = "");
    50   virtual void queryVectors(const char*, bool, std::string = "");
    51   virtual void queryBox(const char*, std::string = "");
    52   virtual void queryElement(const char*, std::string = "");
    53   virtual void queryElements(const char*, std::string = "");
    54   virtual void queryFile(const char*, std::string = "");
    55   virtual void queryRandomNumberDistribution_Parameters(const char*, std::string = "");
     36  virtual void queryInt(Parameter<int> &, const char *, std::string = "");
     37  virtual void queryInts(Parameter<std::vector<int> > &, const char *, std::string = "");
     38  virtual void queryUnsignedInt(Parameter<unsigned int> &, const char *, std::string = "");
     39  virtual void queryUnsignedInts(Parameter<std::vector<unsigned int> > &, const char *, std::string = "");
     40  virtual void queryBoolean(Parameter<bool> &, const char *, std::string = "");
     41  virtual void queryString(Parameter<std::string> &, const char*, std::string = "");
     42  virtual void queryStrings(Parameter<std::vector<std::string> > &, const char*, std::string = "");
     43  virtual void queryDouble(Parameter<double> &, const char*, std::string = "");
     44  virtual void queryDoubles(Parameter<std::vector<double> > &, const char*, std::string = "");
     45  virtual void queryAtom(Parameter<const atom *> &, const char*, std::string = "");
     46  virtual void queryAtoms(Parameter<std::vector<const atom *> > &, const char*, std::string = "");
     47  virtual void queryMolecule(Parameter<const molecule *> &, const char*, std::string = "");
     48  virtual void queryMolecules(Parameter<std::vector<const molecule *> > &, const char*, std::string = "");
     49  virtual void queryVector(Parameter<Vector> &, const char*, bool, std::string = "");
     50  virtual void queryVectors(Parameter<std::vector<Vector> > &, const char*, bool, std::string = "");
     51  virtual void queryBox(Parameter<Box> &, const char*, std::string = "");
     52  virtual void queryElement(Parameter<const element *> &, const char*, std::string = "");
     53  virtual void queryElements(Parameter<std::vector<const element *> > &, const char*, std::string = "");
     54  virtual void queryFile(Parameter<boost::filesystem::path> &, const char*, std::string = "");
     55  virtual void queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &, const char*, std::string = "");
    5656protected:
    5757  // specialized stuff for command line queries
  • src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp

    rb9c69d rf10b0c  
    3333using namespace std;
    3434
    35 CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(std::string title, std::string _description) :
    36     Dialog::AtomQuery(title, _description)
     35CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(Parameter<const atom *> &param, std::string title, std::string _description) :
     36    Dialog::AtomQuery(param, title, _description)
    3737{}
    3838
     
    4343  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4444    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
    45     tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
     45    tmp.set(World::getInstance().getAtom(AtomById(IdxOfAtom)));
    4646    return true;
    4747  } else {
  • src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2828#include "World.hpp"
    2929
    30 CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(std::string title, std::string _description) :
    31     Dialog::AtomsQuery(title, _description)
     30CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(Parameter<std::vector<const atom *> > &param, std::string title, std::string _description) :
     31    Dialog::AtomsQuery(param, title, _description)
    3232{}
    3333
     
    3838  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    3939    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
     40    std::vector<const atom *> temp_atoms;
    4041    for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) {
    4142      temp = World::getInstance().getAtom(AtomById(*iter));
    4243      if (temp)
    43         tmp.push_back(temp);
     44        temp_atoms.push_back(temp);
    4445    }
     46    tmp.set(temp_atoms);
    4547    return true;
    4648  } else {
  • src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::BooleanQuery(title, _description)
     27CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(Parameter<bool> &param, std::string title, std::string _description) :
     28    Dialog::BooleanQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::BooleanCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as<bool>();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<bool>());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2727#include "LinearAlgebra/RealSpaceMatrix.hpp"
    2828
    29 CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(std::string title, std::string _description) :
    30     Dialog::BoxQuery(title, _description)
     29CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(Parameter<Box> &param, std::string title, std::string _description) :
     30    Dialog::BoxQuery(param, title, _description)
    3131{}
    3232
     
    3838  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    3939    temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >();
    40     tmp = temp.toBox();
     40    tmp.set(temp.toBox());
    4141    return true;
    4242  } else {
  • src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp

    rb9c69d rf10b0c  
    2626class CommandLineDialog::IntCommandLineQuery : public Dialog::IntQuery {
    2727public:
    28   IntCommandLineQuery(std::string title, std::string _description = "");
     28  IntCommandLineQuery(Parameter<int> &param, std::string title, std::string _description = "");
    2929  virtual ~IntCommandLineQuery();
    3030  virtual bool handle();
     
    3333class CommandLineDialog::IntsCommandLineQuery : public Dialog::IntsQuery {
    3434public:
    35   IntsCommandLineQuery(std::string title, std::string _description = "");
     35  IntsCommandLineQuery(Parameter<std::vector<int> > &param, std::string title, std::string _description = "");
    3636  virtual ~IntsCommandLineQuery();
    3737  virtual bool handle();
     
    4040class CommandLineDialog::UnsignedIntCommandLineQuery : public Dialog::UnsignedIntQuery {
    4141public:
    42   UnsignedIntCommandLineQuery(std::string title, std::string _description = "");
     42  UnsignedIntCommandLineQuery(Parameter<unsigned int> &param, std::string title, std::string _description = "");
    4343  virtual ~UnsignedIntCommandLineQuery();
    4444  virtual bool handle();
     
    4747class CommandLineDialog::UnsignedIntsCommandLineQuery : public Dialog::UnsignedIntsQuery {
    4848public:
    49   UnsignedIntsCommandLineQuery(std::string title, std::string _description = "");
     49  UnsignedIntsCommandLineQuery(Parameter<std::vector<unsigned int> > &param, std::string title, std::string _description = "");
    5050  virtual ~UnsignedIntsCommandLineQuery();
    5151  virtual bool handle();
     
    5454class CommandLineDialog::BooleanCommandLineQuery : public Dialog::BooleanQuery {
    5555public:
    56   BooleanCommandLineQuery(std::string title, std::string _description = "");
     56  BooleanCommandLineQuery(Parameter<bool> &param, std::string title, std::string _description = "");
    5757  virtual ~BooleanCommandLineQuery();
    5858  virtual bool handle();
     
    6161class CommandLineDialog::DoubleCommandLineQuery : public Dialog::DoubleQuery {
    6262public:
    63   DoubleCommandLineQuery(std::string title, std::string _description = "");
     63  DoubleCommandLineQuery(Parameter<double> &param, std::string title, std::string _description = "");
    6464  virtual ~DoubleCommandLineQuery();
    6565  virtual bool handle();
     
    6868class CommandLineDialog::DoublesCommandLineQuery : public Dialog::DoublesQuery {
    6969public:
    70   DoublesCommandLineQuery(std::string title, std::string _description = "");
     70  DoublesCommandLineQuery(Parameter<std::vector<double> > &param, std::string title, std::string _description = "");
    7171  virtual ~DoublesCommandLineQuery();
    7272  virtual bool handle();
     
    7575class CommandLineDialog::StringCommandLineQuery : public Dialog::StringQuery {
    7676public:
    77   StringCommandLineQuery(std::string title, std::string _description = "");
     77  StringCommandLineQuery(Parameter<std::string> &param, std::string title, std::string _description = "");
    7878  virtual ~StringCommandLineQuery();
    7979  virtual bool handle();
     
    8282class CommandLineDialog::StringsCommandLineQuery : public Dialog::StringsQuery {
    8383public:
    84   StringsCommandLineQuery(std::string title, std::string _description = "");
     84  StringsCommandLineQuery(Parameter<std::vector<std::string> > &param, std::string title, std::string _description = "");
    8585  virtual ~StringsCommandLineQuery();
    8686  virtual bool handle();
     
    8989class CommandLineDialog::AtomCommandLineQuery : public Dialog::AtomQuery {
    9090public:
    91   AtomCommandLineQuery(std::string title, std::string _description = "");
     91  AtomCommandLineQuery(Parameter<const atom *> &param, std::string title, std::string _description = "");
    9292  virtual ~AtomCommandLineQuery();
    9393  virtual bool handle();
     
    9696class CommandLineDialog::AtomsCommandLineQuery : public Dialog::AtomsQuery {
    9797public:
    98   AtomsCommandLineQuery(std::string title, std::string _description = "");
     98  AtomsCommandLineQuery(Parameter<std::vector<const atom *> > &param, std::string title, std::string _description = "");
    9999  virtual ~AtomsCommandLineQuery();
    100100  virtual bool handle();
     
    103103class CommandLineDialog::MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
    104104public:
    105   MoleculeCommandLineQuery(std::string title, std::string _description = "");
     105  MoleculeCommandLineQuery(Parameter<const molecule *> &param, std::string title, std::string _description = "");
    106106  virtual ~MoleculeCommandLineQuery();
    107107  virtual bool handle();
     
    110110class CommandLineDialog::MoleculesCommandLineQuery : public Dialog::MoleculesQuery {
    111111public:
    112   MoleculesCommandLineQuery(std::string title, std::string _description = "");
     112  MoleculesCommandLineQuery(Parameter<std::vector<const molecule *> > &param, std::string title, std::string _description = "");
    113113  virtual ~MoleculesCommandLineQuery();
    114114  virtual bool handle();
     
    117117class CommandLineDialog::VectorCommandLineQuery : public Dialog::VectorQuery {
    118118public:
    119   VectorCommandLineQuery(std::string title,bool _check, std::string _description = "");
     119  VectorCommandLineQuery(Parameter<Vector> &param, std::string title,bool _check, std::string _description = "");
    120120  virtual ~VectorCommandLineQuery();
    121121  virtual bool handle();
     
    124124class CommandLineDialog::VectorsCommandLineQuery : public Dialog::VectorsQuery {
    125125public:
    126   VectorsCommandLineQuery(std::string title,bool _check, std::string _description = "");
     126  VectorsCommandLineQuery(Parameter<std::vector<Vector> > &param, std::string title,bool _check, std::string _description = "");
    127127  virtual ~VectorsCommandLineQuery();
    128128  virtual bool handle();
     
    131131class CommandLineDialog::BoxCommandLineQuery : public Dialog::BoxQuery {
    132132public:
    133   BoxCommandLineQuery(std::string title, std::string _description = "");
     133  BoxCommandLineQuery(Parameter<Box> &param, std::string title, std::string _description = "");
    134134  virtual ~BoxCommandLineQuery();
    135135  virtual bool handle();
     
    138138class CommandLineDialog::ElementCommandLineQuery : public Dialog::ElementQuery {
    139139public:
    140   ElementCommandLineQuery(std::string title, std::string _description = "");
     140  ElementCommandLineQuery(Parameter<const element *> &param, std::string title, std::string _description = "");
    141141  virtual ~ElementCommandLineQuery();
    142142  virtual bool handle();
     
    145145class CommandLineDialog::ElementsCommandLineQuery : public Dialog::ElementsQuery {
    146146public:
    147   ElementsCommandLineQuery(std::string title, std::string _description = "");
     147  ElementsCommandLineQuery(Parameter<std::vector<const element *> > &param, std::string title, std::string _description = "");
    148148  virtual ~ElementsCommandLineQuery();
    149149  virtual bool handle();
     
    152152class CommandLineDialog::FileCommandLineQuery : public Dialog::FileQuery {
    153153public:
    154   FileCommandLineQuery(std::string title, std::string _description = "");
     154  FileCommandLineQuery(Parameter<boost::filesystem::path> &param, std::string title, std::string _description = "");
    155155  virtual ~FileCommandLineQuery();
    156156  virtual bool handle();
     
    159159class CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery : public Dialog::RandomNumberDistribution_ParametersQuery {
    160160public:
    161   RandomNumberDistribution_ParametersCommandLineQuery(std::string title, std::string _description = "");
     161  RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> &param, std::string title, std::string _description = "");
    162162  virtual ~RandomNumberDistribution_ParametersCommandLineQuery();
    163163  virtual bool handle();
  • src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2626
    2727
    28 CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(std::string title, std::string _description) :
    29     Dialog::DoubleQuery(title, _description)
     28CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(Parameter<double> &param, std::string title, std::string _description) :
     29    Dialog::DoubleQuery(param, title, _description)
    3030{}
    3131
     
    3434bool CommandLineDialog::DoubleCommandLineQuery::handle() {
    3535  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    36     tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
     36    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<double>());
    3737    return true;
    3838  } else {
  • src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::DoublesQuery(title, _description)
     27CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(Parameter<std::vector<double> > &param, std::string title, std::string _description) :
     28    Dialog::DoublesQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::DoublesCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2828#include "World.hpp"
    2929
    30 CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(std::string title, std::string _description) :
    31     Dialog::ElementQuery(title, _description)
     30CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(Parameter<const element*> &param, std::string title, std::string _description) :
     31    Dialog::ElementQuery(param, title, _description)
    3232{}
    3333
     
    4040  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4141    int Z = CommandLineParser::getInstance().vm[getTitle()].as< int >();
    42     tmp = periode->FindElement(Z);
    43     ASSERT(tmp != NULL, "Invalid element specified in ElementCommandLineQuery");
     42    tmp.set(periode->FindElement(Z));
     43    ASSERT(tmp.get() != NULL, "Invalid element specified in ElementCommandLineQuery");
    4444    return true;
    4545  } else {
  • src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2828#include "World.hpp"
    2929
    30 CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(std::string title, std::string _description) :
    31     Dialog::ElementsQuery(title, _description)
     30CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(Parameter<std::vector<const element*> > &param, std::string title, std::string _description) :
     31    Dialog::ElementsQuery(param, title, _description)
    3232{}
    3333
     
    4040  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4141    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
     42    vector<const element *> temp_elements;
    4243    for (vector<int>::iterator ZRunner = AllElements.begin(); ZRunner != AllElements.end(); ++ZRunner) {
    4344      temp = periode->FindElement(*ZRunner);
    4445      ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery");
    45       tmp.push_back(temp);
     46      temp_elements.push_back(temp);
    4647    }
     48    tmp.set(temp_elements);
    4749    return true;
    4850  } else {
  • src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::FileQuery(title, _description)
     27CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(Parameter<boost::filesystem::path> &param, std::string title, std::string _description) :
     28    Dialog::FileQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::FileCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::IntQuery(title, _description)
     27CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(Parameter<int> &param, std::string title, std::string _description) :
     28    Dialog::IntQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::IntCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<int>());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::IntsQuery(title, _description)
     27CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(Parameter<std::vector<int> > &param, std::string title, std::string _description) :
     28    Dialog::IntsQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::IntsCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2828#include "CodePatterns/Verbose.hpp"
    2929
    30 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(std::string title, std::string _description) :
    31     Dialog::MoleculeQuery(title, _description)
     30CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(Parameter<const molecule *> &param, std::string title, std::string _description) :
     31    Dialog::MoleculeQuery(param, title, _description)
    3232{}
    3333
     
    3838  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    3939    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
    40     tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
     40    tmp.set(World::getInstance().getMolecule(MoleculeById(IdxOfMol)));
    4141    return true;
    4242  } else {
  • src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2929#include "World.hpp"
    3030
    31 CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(std::string title, std::string _description) :
    32     Dialog::MoleculesQuery(title, _description)
     31CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(Parameter<std::vector<const molecule *> > &param, std::string title, std::string _description) :
     32    Dialog::MoleculesQuery(param, title, _description)
    3333{}
    3434
     
    3939  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4040    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
     41    std::vector<const molecule *> temp_molecules;
    4142    for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) {
    4243      temp = World::getInstance().getMolecule(MoleculeById(*iter));
    4344      if (temp)
    44         tmp.push_back(temp);
     45        temp_molecules.push_back(temp);
    4546    }
     47    tmp.set(temp_molecules);
    4648    return true;
    4749  } else {
  • src/UIElements/CommandLineUI/Query/RandomNumberDistribution_ParametersCommandLineQuery.cpp

    rb9c69d rf10b0c  
    3131#include "RandomNumbers/RandomNumberDistribution_Parameters.hpp"
    3232
    33 CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery::RandomNumberDistribution_ParametersCommandLineQuery(std::string title, std::string _description) :
    34     Dialog::RandomNumberDistribution_ParametersQuery(title, _description)
     33CommandLineDialog::RandomNumberDistribution_ParametersCommandLineQuery::RandomNumberDistribution_ParametersCommandLineQuery(Parameter<RandomNumberDistribution_Parameters> &param, std::string title, std::string _description) :
     34    Dialog::RandomNumberDistribution_ParametersQuery(param, title, _description)
    3535{}
    3636
     
    4242    std::stringstream text(stringtext);
    4343//    LOG(1, "INFO: Parameter set from CommandLine is '" << text.str() << "'");
    44     text >> tmp;
     44    RandomNumberDistribution_Parameters temp_params;
     45    text >> temp_params;
     46    tmp.set(temp_params);
    4547    return true;
    4648  } else {
  • src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::StringQuery(title, _description)
     27CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(Parameter<std::string> &param, std::string title, std::string _description) :
     28    Dialog::StringQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::StringCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<string>());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::StringsQuery(title, _description)
     27CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(Parameter<std::vector<std::string> > &param, std::string title, std::string _description) :
     28    Dialog::StringsQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::StringsCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::UnsignedIntCommandLineQuery::UnsignedIntCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::UnsignedIntQuery(title, _description)
     27CommandLineDialog::UnsignedIntCommandLineQuery::UnsignedIntCommandLineQuery(Parameter<unsigned int> &param, std::string title, std::string _description) :
     28    Dialog::UnsignedIntQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::UnsignedIntCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2525#include "CodePatterns/Verbose.hpp"
    2626
    27 CommandLineDialog::UnsignedIntsCommandLineQuery::UnsignedIntsCommandLineQuery(std::string title, std::string _description) :
    28     Dialog::UnsignedIntsQuery(title, _description)
     27CommandLineDialog::UnsignedIntsCommandLineQuery::UnsignedIntsCommandLineQuery(Parameter<std::vector<unsigned int> > &param, std::string title, std::string _description) :
     28    Dialog::UnsignedIntsQuery(param, title, _description)
    2929{}
    3030
     
    3333bool CommandLineDialog::UnsignedIntsCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >();
     35    tmp.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >());
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2929#include "World.hpp"
    3030
    31 CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(std::string title, bool _check, std::string _description) :
    32     Dialog::VectorQuery(title,_check, _description)
     31CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(Parameter<Vector> &param, std::string title, bool _check, std::string _description) :
     32    Dialog::VectorQuery(param, title,_check, _description)
    3333{}
    3434
     
    4040  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4141    temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
    42     tmp = temp.toVector();
    43     if ((check) && (!World::getInstance().getDomain().isValid(tmp))) {
    44       ELOG(1, "Vector " << tmp << " would be outside of box domain.");
     42    Vector temp_vector = temp.toVector();
     43    if ((check) && (!World::getInstance().getDomain().isValid(temp_vector))) {
     44      ELOG(1, "Vector " << temp_vector << " would be outside of box domain.");
    4545      return false;
    4646    }
     47    tmp.set(temp_vector);
    4748    return true;
    4849  } else {
  • src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp

    rb9c69d rf10b0c  
    2929#include "World.hpp"
    3030
    31 CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(std::string title, bool _check, std::string _description) :
    32     Dialog::VectorsQuery(title,_check, _description)
     31CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(Parameter<std::vector<Vector> > &param, std::string title, bool _check, std::string _description) :
     32    Dialog::VectorsQuery(param, title,_check, _description)
    3333{}
    3434
     
    4040  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4141    temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >();
     42    std::vector<Vector> temp_vectors;
    4243    for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) {
    4344      temp = (*iter).toVector();
    4445      if ((!check) || (World::getInstance().getDomain().isValid(temp)))
    45         tmp.push_back(temp);
     46        temp_vectors.push_back(temp);
    4647      else
    4748        ELOG(1, "Vector " << temp << " would be outside of box domain.");
    4849    }
     50    tmp.set(temp_vectors);
    4951    return true;
    5052  } else {
Note: See TracChangeset for help on using the changeset viewer.