OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OSGVruiUserDataCollection.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 OSG_VRUI_USER_DATA_COLLECTION_H
9 #define OSG_VRUI_USER_DATA_COLLECTION_H
10 
11 #include <util/coTypes.h>
12 
13 #include <osg/Referenced>
14 #include <osg/Node>
15 
16 #include <map>
17 #include <string>
18 
19 namespace vrui
20 {
21 
22 class vruiUserData;
23 
24 class OSGVRUIEXPORT OSGVruiUserDataCollection : public osg::Referenced
25 {
26 
27 public:
29 
30  void setUserData(const std::string &name, vruiUserData *data);
31  void removeUserData(const std::string &name);
32 
33  vruiUserData *getUserData(const std::string &name);
34  static vruiUserData *getUserData(osg::Node *, const std::string &name);
35  static void setUserData(osg::Node *, const std::string &name, vruiUserData *data);
36 
37 protected:
38  virtual ~OSGVruiUserDataCollection();
39 
40 private:
41  std::map<std::string, vruiUserData *> data;
42 };
43 }
44 #endif
Definition: OSGVruiUserDataCollection.h:24
Userdata that can be attached to Nodes in the scenegraph.
Definition: vruiUserData.h:17