COVISE Core
RenderInterface.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 _APPL_INTERFACE_H
9#define _APPL_INTERFACE_H
10
11/**************************************************************************\
12 ** **
13 ** **
14 ** Description: Interface class for renderer modules to the COVISE **
15 ** software environment **
16 ** **
17 ** **
18 ** **
19 ** **
20 ** **
21 ** **
22 ** (C)1995 RUS **
23 ** Computer Center University of Stuttgart **
24 ** Allmandring 30 **
25 ** 70550 Stuttgart **
26 ** **
27 ** Date: 11.09.95 V1.0 **
28 ** Author: Dirk Rantzau **
29\**************************************************************************/
30
31#include "CoviseBase.h"
32
33namespace covise
34{
35class DataHandle;
37
38//=====================================================================
39//
40//=====================================================================
42{
43private:
44 static int replaceObject; //
45
46 // Communication Data
47 static char *render_keyword;
48 static char *render_data;
49 static char *object_name;
50
51 // private member funcs
52 static void doParam(Message *m);
53 static void doRender(char *key, char *data);
54 static void doRenderModule(const DataHandle &dh);
55 static void doAddObject(const coDistributedObject *, char *name);
56 static void doCoviseError(const char *error);
57 static void doDeleteObject(char *name);
58 static int doQuit();
59
60 //
61 // callback stuff
62 //
65 static void *renderUserData;
66 static void *renderCallbackData;
68 static void *addObjectUserData;
71 static void *coviseErrorUserData;
76
77public:
78 //
79 // description stuff
80 //
81 static void set_module_description(const char *);
82 static void add_port(enum appl_port_type, const char *);
83 static void add_port(enum appl_port_type, const char *, const char *, const char *);
84 static void remove_ports();
85 static void set_port_description(char *, char *);
86 static void set_port_default(const char *, const char *);
87 static void set_port_datatype(char *, char *);
88 static void set_port_dependency(char *, char *);
89 static void set_port_required(char *, int);
90//
91// Callback and control
92//
93#ifdef COVISE_USE_X11
94 static void init(int argc, char *argv[], XtAppContext appContext);
95#else
96 static void init(int argc, char *argv[]);
97#endif
98 static void reset()
99 {
101 };
102
103 static void handleControllerMessage();
104
105 static void sendFinishedMsg();
106 static int check_and_handle_event(float time = 0.0);
107 static covise::Message* check_event(float time = 0.0);
108 static void handle_event(covise::Message* msg);
109 static void do_one_event();
110 static void ReceiveOneMsg();
111 static int deleteConnection();
112 static void main_loop();
113 static void progress_main_loop();
114 static void set_render_callback(CoviseCallback *f, void *userData);
115 static void set_render_module_callback(voidFuncintvoidpDef *f);
116 static void set_add_object_callback(CoviseCallback *f, void *userData);
117 static void set_covise_error_callback(CoviseCallback *f, void *userData);
118 static void set_delete_object_callback(CoviseCallback *f, void *userData);
119 static void remove_render_callback();
120 static void remove_add_object_callback();
121 static void remove_covise_error_callback();
122 static void remove_delete_object_callback();
123 static int isReplace();
124
125 //
126 // Object name handling
127 //
128 static char *get_object_name()
129 {
130 return object_name;
131 }
132 //
133 // Render message components retrieving
134 //
135 static char *get_render_keyword()
136 {
137 return render_keyword;
138 }
139 static char *get_render_data()
140 {
141 return render_data;
142 }
143 //
144 // Render message setting
145 //
146 static void set_applMsg(Message *new_msg)
147 {
148 applMsg = new_msg;
149 };
150 //
151 // Render message retrieving
152 //
154 {
155 return applMsg;
156 }
157
158 //
159 // Messages to COVISE environment
160 //
161 static void send_quit_message();
162 //
163 // The callback functions called in callXXX has to be
164 // implemented by the user
165 //
166 static void callRenderCallback(void);
167 static void callAddObjectCallback(void);
168 static void callCoviseErrorCallback(void);
169 static void callDeleteObjectCallback(void);
170};
171}
172#endif
#define APPLEXPORT
Definition: coExport.h:57
#define NULL
Definition: covise_list.h:22
GLfloat f
Definition: khronos-glext.h:8258
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLuint const GLchar * name
Definition: khronos-glext.h:6722
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: khronos-glext.h:6354
const GLfloat * m
Definition: khronos-glext.h:12117
list of all chemical elements
Definition: coConfig.h:27
void CoviseCallback(void *userData, void *callbackData)
Definition: CoviseBase.h:61
void() voidFuncintvoidpDef(const DataHandle &dh)
Definition: RenderInterface.h:36
appl_port_type
Definition: CoviseBase.h:44
Definition: dataHandle.h:18
Definition: message.h:76
Definition: CoviseBase.h:66
static char * port_name[MAX_PORTS]
Definition: CoviseBase.h:101
Definition: RenderInterface.h:42
static void reset()
Definition: RenderInterface.h:98
static void * renderUserData
Definition: RenderInterface.h:65
static void * deleteObjectUserData
Definition: RenderInterface.h:74
static int replaceObject
Definition: RenderInterface.h:44
static CoviseCallback * deleteObjectCallbackFunc
Definition: RenderInterface.h:73
static void * coviseErrorCallbackData
Definition: RenderInterface.h:72
static void * addObjectCallbackData
Definition: RenderInterface.h:69
static CoviseCallback * coviseErrorCallbackFunc
Definition: RenderInterface.h:70
static voidFuncintvoidpDef * renderModuleCallbackFunc
Definition: RenderInterface.h:63
static void * addObjectUserData
Definition: RenderInterface.h:68
static void set_port_dependency(char *, char *)
static char * get_render_keyword()
Definition: RenderInterface.h:135
static char * get_render_data()
Definition: RenderInterface.h:139
static void * renderCallbackData
Definition: RenderInterface.h:66
static char * object_name
Definition: RenderInterface.h:49
static void ReceiveOneMsg()
static char * get_object_name()
Definition: RenderInterface.h:128
static char * render_data
Definition: RenderInterface.h:48
static Message * get_applMsg()
Definition: RenderInterface.h:153
static void set_applMsg(Message *new_msg)
Definition: RenderInterface.h:146
static void * deleteObjectCallbackData
Definition: RenderInterface.h:75
static void * coviseErrorUserData
Definition: RenderInterface.h:71
static char * render_keyword
Definition: RenderInterface.h:47
static CoviseCallback * renderCallbackFunc
Definition: RenderInterface.h:64
static CoviseCallback * addObjectCallbackFunc
Definition: RenderInterface.h:67
Definition: coDistributedObject.h:296