COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coChoiceParam.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _CO_CHOICE_PARAM_H_
9 #define _CO_CHOICE_PARAM_H_
10 
11 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 // + +
13 // + coChoiceParam Parameter handling class +
14 // + +
15 // + Andreas Werner +
16 // + (C) Computing Center University of Stuttgart +
17 // + Allmandring 30a +
18 // + 70550 Stuttgart +
19 // + Date: 19.07.99 +
20 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 
22 #include <covise/covise.h>
23 #include "coUifPara.h"
24 
25 namespace covise
26 {
27 
30 {
31 
32 private:
33  enum
34  {
35  MAX_CHOICE_LABELS = 256
36  };
37 
40 
42  coChoiceParam &operator=(const coChoiceParam &);
43 
45  coChoiceParam();
46 
49 
53  char **d_choice;
54 
55  // Parameter type name
56  static const char *s_type;
57 
58 public:
60  coChoiceParam(const char *name, const char *desc);
61 
63  virtual ~coChoiceParam();
64 
66  virtual int isOfType(coUifPara::Typeinfo type);
67 
69  static coUifPara::Typeinfo getType();
70 
72  virtual int paramChange();
73 
75  virtual void initialize();
76 
78  virtual void print(ostream &str) const;
79 
82  typedef enum
83  {
86  ALPHA
87  } cmpMode;
88 
91  int updateValue(int numChoices, const char *const *choice, int actChoice, cmpMode cmp = CASE_INSENSITIVE);
92 
94  int setValue(int numChoices, const char *const *choice, int actChoice);
95  int setValue(int numChoices, const std::vector<string> &list, int actChoice);
96 
98  int setValue(int actChoice);
99 
101  int setValue(const char *choiceLabel);
102 
104  int getValue() const;
105 
107  const char *getActLabel() const;
108 
110  const char *getLabel(int i) const;
111 
113  int getNumChoices() const;
114 
116  virtual const char *getTypeString() const;
117 
119  virtual const char *getValString() const;
120 
122  virtual void setValString(const char *str);
123 };
124 }
125 #endif
Definition: coUifPara.h:23
GLuint const GLchar * name
Definition: khronos-glext.h:6722
int d_activeChoice
Definition: coChoiceParam.h:52
char ** d_choice
Definition: coChoiceParam.h:53
Definition: coChoiceParam.h:84
static const char * s_type
Definition: coChoiceParam.h:56
#define APIEXPORT
Definition: coExport.h:251
GLenum type
Definition: khronos-glext.h:6279
parameter to choose values from a list
Definition: coChoiceParam.h:29
int Typeinfo
Definition: coUifPara.h:28
int d_numChoices
Port data fields.
Definition: coChoiceParam.h:51
static coUifPara::Typeinfo s_paraType
my type info
Definition: coChoiceParam.h:48
Definition: coChoiceParam.h:85