OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
16 namespace vrui
17 {
18 class vruiCollabInterface;
19 }
20 
22 EXPORT_TEMPLATE(template class OPENVRUIEXPORT std::list<vrui::vruiCollabInterface *>)
23 
24 namespace vrui
25 {
26 
27 class OPENVRUIEXPORT vruiCOIM
28 {
29 
30 protected:
31  vruiCOIM();
32  virtual ~vruiCOIM();
33 
34 public:
35  void receiveMessage(int type, int len, const void *buf);
36 
37  void addInterface(vruiCollabInterface *myinterface);
38  void removeInterface(vruiCollabInterface *myinterface);
39 
40 private:
41  std::list<vruiCollabInterface *> interfaces;
42 };
43 
45 class OPENVRUIEXPORT vruiCollabInterface
46 {
47 public:
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);
60  virtual ~vruiCollabInterface();
61 
62  int getType() const;
64  {
65  return coim;
66  }
67 
68  virtual void parseMessage(int type, unsigned int len, const char *message);
69 
70 protected:
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 
80 private:
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
base class for collaborative Userinterface elements
Definition: vruiCollabInterface.h:45
Definition: vruiCollabInterface.h:27
int remoteContext
a remote context (if this UI element is used in several contexts)
Definition: vruiCollabInterface.h:71
vruiCOIM * getManager()
Definition: vruiCollabInterface.h:63