OpenCOVER
vruiCollabInterface.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 VRUI_COLLAB_INTERFACE_H
9#define VRUI_COLLAB_INTERFACE_H
10
11#include <util/coTypes.h>
12
13#include <list>
14#include <string>
15
16namespace vrui
17{
18class vruiCollabInterface;
19}
20
22EXPORT_TEMPLATE(template class OPENVRUIEXPORT std::list<vrui::vruiCollabInterface *>)
23
24namespace vrui
25{
26
27class OPENVRUIEXPORT vruiCOIM
28{
29
30protected:
32 virtual ~vruiCOIM();
33
34public:
35 void receiveMessage(int type, int len, const void *buf);
36
39
40private:
41 std::list<vruiCollabInterface *> interfaces;
42};
43
45class OPENVRUIEXPORT vruiCollabInterface
46{
47public:
48 enum
49 {
50 NONE = 10,
51 VALUEPOTI = 11,
52 HSVWHEEL = 12,
53 PUSHBUTTON = 13,
54 TOGGLEBUTTON = 14,
55 FunctionEditor = 15,
56 PinEditor = 16
57 };
58
59 vruiCollabInterface(vruiCOIM *manager, const std::string &interfaceName, int iType = NONE);
61
62 int getType() const;
64 {
65 return coim;
66 }
67
68 virtual void parseMessage(int type, unsigned int len, const char *message);
69
70protected:
72 void setType(int interfaceType);
73 void sendLockMessage(const char *message);
74 void sendOngoingMessage(const char *message);
75 void sendReleaseMessage(const char *message);
76 virtual void remoteLock(const char *message);
77 virtual void remoteOngoing(const char *message);
78 virtual void releaseRemoteLock(const char *message);
79
80private:
81 inline size_t composeMessage(const char messageType, const char *message);
82
83 int interfaceType;
84 std::string name;
85 size_t bufLen;
86 char *sendBuf;
87 bool locked;
88 vruiCOIM *coim;
89};
90}
91//typedef vruiCollabInterface coCollabInterface;
92#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: vruiCollabInterface.h:28
void addInterface(vruiCollabInterface *myinterface)
void removeInterface(vruiCollabInterface *myinterface)
virtual ~vruiCOIM()
void receiveMessage(int type, int len, const void *buf)
base class for collaborative Userinterface elements
Definition: vruiCollabInterface.h:46
virtual void remoteLock(const char *message)
vruiCollabInterface(vruiCOIM *manager, const std::string &interfaceName, int iType=NONE)
void sendReleaseMessage(const char *message)
vruiCOIM * getManager()
Definition: vruiCollabInterface.h:63
void setType(int interfaceType)
void sendOngoingMessage(const char *message)
int remoteContext
a remote context (if this UI element is used in several contexts)
Definition: vruiCollabInterface.h:71
virtual void remoteOngoing(const char *message)
virtual void releaseRemoteLock(const char *message)
virtual void parseMessage(int type, unsigned int len, const char *message)
void sendLockMessage(const char *message)