COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 
33 namespace covise
34 {
35 
36 typedef void(voidFuncintvoidpDef)(int, const void *);
37 
38 //=====================================================================
39 //
40 //=====================================================================
42 {
43 private:
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(int len, const void *data);
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;
69  static void *addObjectCallbackData;
71  static void *coviseErrorUserData;
74  static void *deleteObjectUserData;
76 
77 public:
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  static char *get_description_message();
91 //
92 // Callback and control
93 //
94 #ifdef USE_X11
95  static void init(int argc, char *argv[], XtAppContext appContext);
96 #else
97  static void init(int argc, char *argv[]);
98 #endif
99  static void reset()
100  {
102  };
103 
104  static void handleControllerMessage();
105 
106  static void sendFinishedMsg();
107  static int check_and_handle_event(float time = 0.0);
108  static void do_one_event();
109  static void ReceiveOneMsg();
110  static int deleteConnection();
111  static void main_loop();
112  static void progress_main_loop();
113  static void set_render_callback(CoviseCallback *f, void *userData);
114  static void set_render_module_callback(voidFuncintvoidpDef *f);
115  static void set_add_object_callback(CoviseCallback *f, void *userData);
116  static void set_covise_error_callback(CoviseCallback *f, void *userData);
117  static void set_delete_object_callback(CoviseCallback *f, void *userData);
118  static void remove_render_callback();
119  static void remove_add_object_callback();
120  static void remove_covise_error_callback();
121  static void remove_delete_object_callback();
122  static int isReplace();
123 
124  //
125  // Object name handling
126  //
127  static char *get_object_name()
128  {
129  return object_name;
130  }
131  //
132  // Render message components retrieving
133  //
134  static char *get_render_keyword()
135  {
136  return render_keyword;
137  }
138  static char *get_render_data()
139  {
140  return render_data;
141  }
142  //
143  // Render message setting
144  //
145  static void set_applMsg(Message *new_msg)
146  {
147  applMsg = new_msg;
148  };
149  //
150  // Render message retrieving
151  //
153  {
154  return applMsg;
155  }
156 
157  //
158  // Messages to COVISE environment
159  //
160  static int send_render_message(const char *keyword, const char *string);
161  static int send_render_binmessage(const char *keyword, const char *data, int len);
162  static void send_quit_message();
163  //
164  // The callback functions called in callXXX has to be
165  // implemented by the user
166  //
167  static void callRenderCallback(void);
168  static void callAddObjectCallback(void);
169  static void callCoviseErrorCallback(void);
170  static void callDeleteObjectCallback(void);
171 };
172 }
173 #endif
GLenum GLsizei len
Definition: khronos-glext.h:7440
static CoviseCallback * deleteObjectCallbackFunc
Definition: RenderInterface.h:73
static CoviseCallback * renderCallbackFunc
Definition: RenderInterface.h:64
appl_port_type
Definition: CoviseBase.h:42
static char * object_name
Definition: RenderInterface.h:49
static void * deleteObjectUserData
Definition: RenderInterface.h:74
GLuint const GLchar * name
Definition: khronos-glext.h:6722
static void * addObjectUserData
Definition: RenderInterface.h:68
static void * renderUserData
Definition: RenderInterface.h:65
static void set_applMsg(Message *new_msg)
Definition: RenderInterface.h:145
static int replaceObject
Definition: RenderInterface.h:44
void( voidFuncintvoidpDef)(int, const void *)
Definition: RenderInterface.h:36
static char * get_object_name()
Definition: RenderInterface.h:127
static void * renderCallbackData
Definition: RenderInterface.h:66
#define NULL
Definition: covise_list.h:22
Definition: message.h:111
void CoviseCallback(void *userData, void *callbackData)
Definition: CoviseBase.h:60
static char * get_render_keyword()
Definition: RenderInterface.h:134
Definition: RenderInterface.h:41
static Message * get_applMsg()
Definition: RenderInterface.h:152
static void * coviseErrorCallbackData
Definition: RenderInterface.h:72
static voidFuncintvoidpDef * renderModuleCallbackFunc
Definition: RenderInterface.h:63
Definition: CoviseBase.h:63
static void * addObjectCallbackData
Definition: RenderInterface.h:69
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
static void * coviseErrorUserData
Definition: RenderInterface.h:71
static char * render_keyword
Definition: RenderInterface.h:47
static char * get_render_data()
Definition: RenderInterface.h:138
const GLfloat * m
Definition: khronos-glext.h:12117
static char * render_data
Definition: RenderInterface.h:48
static void * deleteObjectCallbackData
Definition: RenderInterface.h:75
static void reset()
Definition: RenderInterface.h:99
Definition: coDistributedObject.h:295
GLfloat f
Definition: khronos-glext.h:8258
static CoviseCallback * coviseErrorCallbackFunc
Definition: RenderInterface.h:70
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: khronos-glext.h:6354
static char * port_name[MAX_PORTS]
Definition: CoviseBase.h:99
static CoviseCallback * addObjectCallbackFunc
Definition: RenderInterface.h:67
#define APPLEXPORT
Definition: coExport.h:57