COVISE Core
coCallFeedback.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 COCALLFEEDBACK_H
9 #define COCALLFEEDBACK_H
10 
11 #include <appl/CoviseBase.h>
12 #include "coModule.h"
13 
14 namespace covise
15 {
16 
17 class coCallFeedback : public CoviseBase
18 {
19 public:
21  coCallFeedback(const coCallFeedback &orig);
22  virtual ~coCallFeedback();
23  void init(const char *n, const char *attrib);
24  void unMask(char *string) const;
25  void sendFeedback(const char *info, const char *key, const char *data = NULL);
26  void executeModule(void);
27  void copyModule();
28  void copyModuleExec();
29  void deleteModule();
30 
31  int getBooleanParam(unsigned int paraNo, int &value) const;
32  int getIntScalarParam(unsigned int paraNo, int &value) const;
33  int getFloatScalarParam(unsigned int paraNo, float &value) const;
34  int getIntSliderParam(unsigned int paraNo, int &min, int &max, int &val) const;
35  int getFloatSliderParam(unsigned int paraNo, float &min, float &max, float &val) const;
36  int getIntVectorParam(unsigned int paraNo, int &numElem, int *&val) const;
37  int getFloatVectorParam(unsigned int paraNo, int &numElem, float *&val) const;
38  int getStringParam(unsigned int paraNo, const char *&val) const;
39  int getChoiceParam(unsigned int paraNo, int &num, char **&labels, int &active) const;
40  int getFileBrowserParam(unsigned int paraNo, char *&val) const;
41  int getBooleanParam(const std::string &paraName, int &value) const;
42  int getIntScalarParam(const std::string &paraName, int &value) const;
43  int getFloatScalarParam(const std::string &paraName, float &value) const;
44  int getIntSliderParam(const std::string &paraName, int &min, int &max, int &val) const;
45  int getFloatSliderParam(const std::string &paraName, float &min, float &max, float &val) const;
46  int getIntVectorParam(const std::string &paraName, int &numElem, int *&val) const;
47  int getFloatVectorParam(const std::string &paraName, int &numElem, float *&val) const;
48  int getStringParam(const std::string &paraName, const char *&val) const;
49  int getChoiceParam(const std::string &paraName, int &num, char **&labels, int &active) const;
50  int getFileBrowserParam(const std::string &paraName, char *&val) const;
51  void setBooleanParam(const char *name, int val);
52  void setScalarParam(const char *name, float val);
53  void setScalarParam(const char *name, int val);
54  void setSliderParam(const char *name, float min, float max, float value);
55  void setSliderParam(const char *name, int min, int max, int value);
56  void setVectorParam(const char *name, int numElem, float *field);
57  void setVectorParam(const char *name, float u, float v, float w);
58  void setVectorParam(const char *name, int numElem, int *field);
59  void setVectorParam(const char *name, int u, int v, int w);
60  void setStringParam(const char *name, const char *val);
61  void setChoiceParam(const char *name, int num, const char *const *list, int pos);
62  void setFileBrowserParam(const char *name, const char *val);
63 
64  void setChoiceParam(const char *name, int const pos);
65  void setChoiceParam(const char *name, std::string const label);
66  void setFloatSliderParam(const char *name, float const value);
67 
68  const char *getObjName()
69  {
70  return d_objName;
71  }
72  const char *getPluginName()
73  {
74  return d_pluginName;
75  }
76  const char *getModuleName()
77  {
78  return d_moduleName;
79  }
81  {
82  return d_moduleInstance;
83  }
84  const char *getModuleHost()
85  {
86  return d_moduleHost;
87  }
88  const char *getInfo()
89  {
90  return d_infoString;
91  }
92  int getNumParam() const
93  {
94  return d_numPara;
95  }
96  int getNumUser() const
97  {
98  return d_numUser;
99  }
100  const char *getParaName(unsigned int i) const;
101  const char *getParaType(unsigned int i) const;
102  const char *getParaValue(unsigned int i) const;
103  const char *getString(unsigned int i) const;
104  void print(FILE *outfile);
105 
106 private:
107  struct paraRec
108  {
109  const char *name;
110  const char *type;
111  const char *value;
112  };
113 
114  char *d_feedbackInfo; // the part of the attrib created by ApplLib
116  char *d_objName; // the name of the DO with the attirbs
117  char *d_moduleName; // the name of the module
118  int d_moduleInstance; // the instance of the module
119  char *d_moduleHost; // the hostname of the module
120  char *d_pluginName; // the name of the Plugin to load for this Interactor
121  char *d_infoString; // whatever the user put in the attribute
122 
123  unsigned int d_numPara; // number of parameters
124  unsigned int d_numUser; // number of user strings
125  paraRec *d_param; // Parameters
126  char **d_user; // User strings
127  char *d_splitString; // save splitted string in here
128 };
129 }
130 #endif /* COCALLFEEDBACK_H */
void init(const char *n, const char *attrib)
Definition: coCallFeedback.cpp:31
#define NULL
Definition: covise_list.h:22
int getBooleanParam(unsigned int paraNo, int &value) const
Definition: coCallFeedback.cpp:656
GLuint GLfloat * val
Definition: khronos-glext.h:7898
const char * getString(unsigned int i) const
const char * getObjName()
Definition: coCallFeedback.h:68
const char * type
Definition: coCallFeedback.h:110
GLuint GLsizei const GLchar * label
Definition: khronos-glext.h:8634
const char * getPluginName()
Definition: coCallFeedback.h:72
char * d_feedbackInfo
Definition: coCallFeedback.h:114
int getNumParam() const
Definition: coCallFeedback.h:92
const char * getModuleHost()
Definition: coCallFeedback.h:84
char * d_infoString
Definition: coCallFeedback.h:121
const char * getModuleName()
Definition: coCallFeedback.h:76
coCallFeedback()
Definition: coCallFeedback.cpp:19
const char * value
Definition: coCallFeedback.h:111
int max(int a, int b)
Definition: cutil_math.h:55
Definition: coCallFeedback.h:107
GLsizei const GLchar *const * string
Definition: khronos-glext.h:6750
void executeModule(void)
Definition: coCallFeedback.cpp:245
const char * name
Definition: coCallFeedback.h:109
int d_refCount
Definition: coCallFeedback.h:115
int getNumUser() const
Definition: coCallFeedback.h:96
void setStringParam(const char *name, const char *val)
Definition: coCallFeedback.cpp:479
paraRec * d_param
Definition: coCallFeedback.h:125
virtual ~coCallFeedback()
Definition: coCallFeedback.cpp:27
char * d_objName
Definition: coCallFeedback.h:116
void sendFeedback(const char *info, const char *key, const char *data=NULL)
Definition: coCallFeedback.cpp:930
void setFileBrowserParam(const char *name, const char *val)
Definition: coCallFeedback.cpp:497
unsigned int d_numPara
Definition: coCallFeedback.h:123
int getFileBrowserParam(unsigned int paraNo, char *&val) const
Definition: coCallFeedback.cpp:815
char * d_pluginName
Definition: coCallFeedback.h:120
void deleteModule()
Definition: coCallFeedback.cpp:272
int getModuleInstance()
Definition: coCallFeedback.h:80
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: khronos-glext.h:6354
int getIntVectorParam(unsigned int paraNo, int &numElem, int *&val) const
Definition: coCallFeedback.cpp:732
void copyModuleExec()
Definition: coCallFeedback.cpp:263
Definition: CoviseBase.h:65
char * d_splitString
Definition: coCallFeedback.h:127
void setScalarParam(const char *name, float val)
Definition: coCallFeedback.cpp:404
void setVectorParam(const char *name, int numElem, float *field)
Definition: coCallFeedback.cpp:305
char * d_moduleName
Definition: coCallFeedback.h:117
GLuint GLuint num
Definition: khronos-glext.h:10593
char * d_moduleHost
Definition: coCallFeedback.h:119
const char * getInfo()
Definition: coCallFeedback.h:88
void print(FILE *outfile)
Definition: coCallFeedback.cpp:943
Definition: coCallFeedback.h:17
int min(int a, int b)
Definition: cutil_math.h:60
GLubyte GLubyte GLubyte GLubyte w
Definition: khronos-glext.h:6793
const char * getParaType(unsigned int i) const
GLdouble n
Definition: khronos-glext.h:8447
void setChoiceParam(const char *name, int num, const char *const *list, int pos)
Definition: coCallFeedback.cpp:515
const char * getParaValue(unsigned int i) const
void copyModule()
Definition: coCallFeedback.cpp:254
int getIntSliderParam(unsigned int paraNo, int &min, int &max, int &val) const
Definition: coCallFeedback.cpp:692
int getStringParam(unsigned int paraNo, const char *&val) const
Definition: coCallFeedback.cpp:800
int getFloatScalarParam(unsigned int paraNo, float &value) const
Definition: coCallFeedback.cpp:680
const GLdouble * v
Definition: khronos-glext.h:6442
GLsizei const GLfloat * value
Definition: khronos-glext.h:6760
const char * getParaName(unsigned int i) const
Definition: coCallFeedback.cpp:281
void setSliderParam(const char *name, float min, float max, float value)
Definition: coCallFeedback.cpp:441
unsigned int d_numUser
Definition: coCallFeedback.h:124
char ** d_user
Definition: coCallFeedback.h:126
int getFloatVectorParam(unsigned int paraNo, int &numElem, float *&val) const
Definition: coCallFeedback.cpp:766
int getFloatSliderParam(unsigned int paraNo, float &min, float &max, float &val) const
Definition: coCallFeedback.cpp:704
list of all chemical elements
Definition: coConfig.h:26
void setBooleanParam(const char *name, int val)
Definition: coCallFeedback.cpp:289
int getChoiceParam(unsigned int paraNo, int &num, char **&labels, int &active) const
Definition: coCallFeedback.cpp:829
GLuint const GLchar * name
Definition: khronos-glext.h:6722
void setFloatSliderParam(const char *name, float const value)
Definition: coCallFeedback.cpp:919
int getIntScalarParam(unsigned int paraNo, int &value) const
Definition: coCallFeedback.cpp:668
int d_moduleInstance
Definition: coCallFeedback.h:118
void unMask(char *string) const
Definition: coCallFeedback.cpp:227