COVISE Core
Items.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// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9// CLASS FileItem
10// CLASS PortItem
11//
12// Description:
13//
14// Initial version: 2001-
15//
16// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17// (C) 2001 by VirCinity IT Consulting
18// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19//
20// Changes:
21//
22
23#ifndef ITEMS_H
24#define ITEMS_H
25
26#include <covise/covise.h>
27#include <map>
28
29#ifdef __sgi
30using namespace std;
31#endif
32#include <api/coChoiceParam.h>
34#include <api/coOutputPort.h>
35
37//
38// simple data class FileItem to store information about
39// filebrowser parameters
40//
42
43namespace covise
44{
45
47{
48public:
49 FileItem();
50 FileItem(const string &name,
51 const string &desc,
52 const string &value,
53 const string &mask);
54
55 string getName()
56 {
57 return name_;
58 };
59 string getDesc()
60 {
61 return desc_;
62 };
63 string getValue()
64 {
65 return value_;
66 };
67 string getMask()
68 {
69 return mask_;
70 };
71
72 // BE AWARE: allows user to change data but this behaviour is needed here
74 {
75 return browserPtr_;
76 };
78 {
79 browserPtr_ = ptr;
80 };
81
82 bool empty();
83
84private:
85 string name_;
86 string desc_;
87 string value_;
88 string mask_;
89 bool empty_;
91};
92
94//
95// simple data class PortItem to store information about
96// filebrowser ports
97//
100{
101
102public:
103 PortItem();
104 PortItem(const string &name,
105 const string &type,
106 const string &desc,
107 const bool &ifChoice);
108
109 virtual ~PortItem()
110 {
111 }
112
113 string getName()
114 {
115 return name_;
116 };
117 string getType()
118 {
119 return type_;
120 };
121 string getDesc()
122 {
123 return desc_;
124 };
125 coOutputPort *getPortPtr() const;
126
127 void setPortPtr(coOutputPort *ptr);
128
129 // BE AWARE: allows user to change data but this behaviour is needed here
131 {
132 return choicePtr_;
133 };
135 {
136 choicePtr_ = ptr;
137 };
138 //
139 void fillChoice(const string &it);
140 virtual void fillChoice(vector<string> &it, bool do_update = false);
141
142 virtual void updateChoice(vector<string> &it)
143 {
144 fillChoice(it, true);
145 };
146
147 int getChoice();
148 void cleanChoice();
149
151 {
152 return ifChoice_;
153 };
154 bool empty();
155
156private:
157 string name_;
158 string type_;
159 string desc_;
160 bool empty_;
165 vector<string> choiceLabels_;
166
167 // synchronise choices with COVISE API
168 void syncChoice(bool do_update);
169};
170
171typedef vector<PortItem *> PortItemList;
172
174//
175// simple data class CompVecPortItem to store information about
176// vector ports that are composed by scalar values in the reader
177//
180{
181
182public:
184 CompVecPortItem(const string &name,
185 const string &type,
186 const string &desc);
187
189 {
190 }
191
192 string getCompName(int comp)
193 {
194 return choices_[comp]->getName();
195 };
196
197 void setChoicePtrs(vector<coChoiceParam *> ptrs);
198 void fillChoice(vector<string> &it, bool do_update = false);
199
200 void updateChoice(vector<string> &it)
201 {
202 fillChoice(it, true);
203 };
204
205 vector<int> getChoice();
206
207private:
209
210 void addItem(const string &chName, const string &type, const string &desc);
211};
212}
213#endif
#define READEREXPORT
Definition: coExport.h:224
GLsizei const GLfloat * value
Definition: khronos-glext.h:6760
GLenum GLint GLuint mask
Definition: khronos-glext.h:6719
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
vector< PortItem * > PortItemList
Definition: Items.h:171
parameter to choose values from a list
Definition: coChoiceParam.h:30
File browser parameter.
Definition: coFileBrowserParam.h:30
Definition: coOutputPort.h:27
Definition: Items.h:47
string getDesc()
Definition: Items.h:59
string name_
Definition: Items.h:85
void setBrowserPtr(coFileBrowserParam *ptr)
Definition: Items.h:77
string desc_
Definition: Items.h:86
string getMask()
Definition: Items.h:67
coFileBrowserParam * browserPtr_
Definition: Items.h:90
coFileBrowserParam * getBrowserPtr()
Definition: Items.h:73
string mask_
Definition: Items.h:88
bool empty_
Definition: Items.h:89
string value_
Definition: Items.h:87
string getValue()
Definition: Items.h:63
string getName()
Definition: Items.h:55
Definition: Items.h:100
string getDesc()
Definition: Items.h:121
string getName()
Definition: Items.h:113
int maxChoiceVal_
Definition: Items.h:164
virtual ~PortItem()
Definition: Items.h:109
bool ifChoice_
Definition: Items.h:163
virtual void updateChoice(vector< string > &it)
Definition: Items.h:142
string getType()
Definition: Items.h:117
bool empty_
Definition: Items.h:160
string type_
Definition: Items.h:158
void setChoicePtr(coChoiceParam *ptr)
Definition: Items.h:134
string desc_
Definition: Items.h:159
coChoiceParam * getChoicePtr()
Definition: Items.h:130
vector< string > choiceLabels_
Definition: Items.h:165
string name_
Definition: Items.h:157
coOutputPort * portPtr_
Definition: Items.h:162
coChoiceParam * choicePtr_
Definition: Items.h:161
bool hasChoice()
Definition: Items.h:150
Definition: Items.h:180
void updateChoice(vector< string > &it)
Definition: Items.h:200
string getCompName(int comp)
Definition: Items.h:192
PortItemList choices_
Definition: Items.h:208
virtual ~CompVecPortItem()
Definition: Items.h:188