OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coAction.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 CO_ACTION_H
9 #define CO_ACTION_H
10 
11 #include <util/coTypes.h>
12 #include <string>
13 
14 namespace vrui
15 {
16 
17 class vruiHit;
18 class vruiNode;
19 class vruiActionUserData;
20 
25 class OPENVRUIEXPORT coAction
26 {
27 public:
28  coAction();
29  virtual ~coAction();
30 
36  virtual int hit(vruiHit *hit) = 0;
37 
41  virtual void miss();
42 
43  enum Result
44  {
45  ACTION_DONE = 0x00,
46  ACTION_CALL_ON_MISS = 0x01,
47  ACTION_UNDEF = 0x02
48  };
49 
50  // internal:
52  void setFrame(unsigned int frame)
53  {
54  thisFrame = frame;
55  }
57  unsigned int getFrame() const
58  {
59  return thisFrame;
60  }
62  void setNode(vruiNode *);
64  void addChild(coAction *);
66  virtual int hitAll(vruiHit *hit);
68  virtual void missAll();
69 
70 private:
71  vruiActionUserData *userData;
72  vruiNode *myNode;
73  coAction *child;
74  coAction *parent;
75  unsigned int thisFrame;
76 
77 protected:
81  std::string actionName;
82 };
83 
84 }
85 #endif
Definition: vruiHit.h:20
Definition: vruiNode.h:21
Result
Definition: coAction.h:43
Definition: coAction.h:25
unsigned int getFrame() const
INTERNAL get the framecounter (used to produce the miss call)
Definition: coAction.h:57
std::string actionName
Definition: coAction.h:81
Userdata that can be attached to Nodes in the scenegraph.
Definition: vruiActionUserData.h:18
void setFrame(unsigned int frame)
INTERNAL set the framecounter (used to produce the miss call)
Definition: coAction.h:52