Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Dialog.hpp

    r94d131 r5605032  
    1111#include<string>
    1212#include<list>
    13 #include<vector>
    1413
    15 class atom;
    16 class element;
     14class MoleculeListClass;
    1715class molecule;
    1816class Vector;
     17class element;
    1918
    2019class Dialog
     
    2423  virtual ~Dialog();
    2524
    26   virtual void queryEmpty(const char *, std::string = "")=0;
    27   virtual void queryBoolean(const char *, bool *, std::string = "")=0;
    28   virtual void queryInt(const char *, int *, std::string = "")=0;
    29   virtual void queryDouble(const char*,double *, std::string = "")=0;
    30   virtual void queryString(const char*, std::string *, std::string = "")=0;
    31   virtual void queryAtom(const char*,atom**,std::string = "")=0;
    32   virtual void queryMolecule(const char*,molecule**, std::string = "")=0;
    33   virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0;
    34   virtual void queryBox(const char*,double ** const, std::string = "")=0;
    35   virtual void queryElement(const char*, std::vector<element *> *, std::string = "")=0;
     25  virtual void queryInt(const char *, int *)=0;
     26  virtual void queryDouble(const char*,double *)=0;
     27  virtual void queryString(const char*, std::string *)=0;
     28  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*)=0;
     29  virtual void queryVector(const char*,Vector *,const double *const,bool)=0;
     30  virtual void queryElement(const char*,const element **)=0;
    3631
    3732  virtual bool display();
     
    5045  //base class for all queries
    5146  class Query {
    52     friend class Dialog;
    5347  public:
    54     Query(std::string _title, std::string _description = "");
     48    Query(std::string _title);
    5549    virtual ~Query();
    5650    virtual bool handle()=0;
     
    5852  protected:
    5953    const std::string getTitle() const;
    60     const std::string getDescription() const;
    6154  private:
    62     std::string title;  //!< short title of the query
    63     std::string description; //!< longer description for tooltips or for help
    64   };
    65 
    66   // Empty Query is just meant for showing text, such as version, help, initial message or alike
    67   class EmptyQuery : public Query {
    68   public:
    69     EmptyQuery(std::string title, std::string _description = "");
    70     virtual ~EmptyQuery();
    71     virtual bool handle()=0;
    72     virtual void setResult();
     55    std::string title;
    7356  };
    7457
    7558  //Specialized classes for certain types. GUI-Types are not specialized at this time
    76   class BooleanQuery : public Query {
    77   public:
    78     BooleanQuery(std::string title,bool *_target, std::string _description = "");
    79     virtual ~BooleanQuery();
    80     virtual bool handle()=0;
    81     virtual void setResult();
    82   protected:
    83     bool tmp;
    84   private:
    85     bool *target;
    86   };
    87 
    8859  class IntQuery : public Query {
    8960  public:
    90     IntQuery(std::string title,int *_target, std::string _description = "");
     61    IntQuery(std::string title,int *_target);
    9162    virtual ~IntQuery();
    9263    virtual bool handle()=0;
     
    10071  class DoubleQuery : public Query {
    10172  public:
    102     DoubleQuery(std::string title,double *_target, std::string _description = "");
     73    DoubleQuery(std::string title,double *_target);
    10374    virtual ~DoubleQuery();
    10475    virtual bool handle()=0;
     
    11283  class StringQuery : public Query {
    11384  public:
    114     StringQuery(std::string title,std::string *_target, std::string _description = "");
     85    StringQuery(std::string title,std::string *_target);
    11586    virtual ~StringQuery();
    11687    virtual bool handle()=0;
     
    12293  };
    12394
     95
    12496  class MoleculeQuery : public Query {
    12597  public:
    126     MoleculeQuery(std::string title, molecule **_target, std::string _description = "");
     98    MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);
    12799    virtual ~MoleculeQuery();
    128100    virtual bool handle()=0;
     
    130102  protected:
    131103    molecule *tmp;
     104    MoleculeListClass *molecules;
    132105  private:
    133106    molecule **target;
    134107  };
    135108
    136   class AtomQuery : public Query {
    137   public:
    138     AtomQuery(std::string title, atom **_target, std::string _description = "");
    139     virtual ~AtomQuery();
    140     virtual bool handle()=0;
    141     virtual void setResult();
    142   protected:
    143     atom *tmp;
    144   private:
    145     atom **target;
    146   };
    147 
    148109  class VectorQuery : public Query {
    149110  public:
    150       VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
     111      VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check);
    151112      virtual ~VectorQuery();
    152113      virtual bool handle()=0;
     
    160121  };
    161122
    162   class BoxQuery : public Query {
    163   public:
    164       BoxQuery(std::string title,double ** const _cellSize, std::string _description = "");
    165       virtual ~BoxQuery();
    166       virtual bool handle()=0;
    167       virtual void setResult();
    168     protected:
    169       double *tmp;
    170     private:
    171       double **target;
    172   };
    173 
    174123  class ElementQuery : public Query {
    175124  public:
    176     ElementQuery(std::string title, std::vector<element *> *_target, std::string _description = "");
     125    ElementQuery(std::string title, const element**_target);
    177126    virtual ~ElementQuery();
    178127    virtual bool handle()=0;
    179128    virtual void setResult();
    180129  protected:
    181     std::vector<element *> elements;
     130    const element *tmp;
    182131  private:
    183     std::vector<element *> * const target;
     132    const element **target;
    184133  };
    185134
     
    191140};
    192141
    193 
    194142#endif /* DIALOG_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.