COVISE Core
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
25namespace covise
26{
27
30{
31
32private:
33 enum
34 {
35 MAX_CHOICE_LABELS = 256
36 };
37
40
43
46
49
53 char **d_choice;
54
55 // Parameter type name
56 static const char *s_type;
57
58public:
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
#define APIEXPORT
Definition: coExport.h:275
GLuint const GLchar * name
Definition: khronos-glext.h:6722
GLenum type
Definition: khronos-glext.h:6279
list of all chemical elements
Definition: coConfig.h:27
std::enable_if< I==sizeof...(Tp), void >::type print(Stream &s, const std::tuple< Tp... > &t)
Definition: tokenbuffer_util.h:68
parameter to choose values from a list
Definition: coChoiceParam.h:30
static coUifPara::Typeinfo s_paraType
my type info
Definition: coChoiceParam.h:48
@ CASE_INSENSITIVE
Definition: coChoiceParam.h:85
@ CASE_SENSITIVE
Definition: coChoiceParam.h:84
char ** d_choice
Definition: coChoiceParam.h:53
int d_numChoices
Port data fields.
Definition: coChoiceParam.h:51
static const char * s_type
Definition: coChoiceParam.h:56
coChoiceParam()
Default constructor: NOT IMPLEMENTED.
int d_activeChoice
Definition: coChoiceParam.h:52
coChoiceParam(const coChoiceParam &)
Copy-Constructor: NOT IMPLEMENTED.
int setValue(int numChoices, const std::vector< string > &list, int actChoice)
coChoiceParam & operator=(const coChoiceParam &)
Assignment operator: NOT IMPLEMENTED.
Definition: coUifPara.h:24
int Typeinfo
Definition: coUifPara.h:28