OpenCOVER
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
14namespace vrui
15{
16
17class vruiHit;
18class vruiNode;
19class vruiActionUserData;
20
25class OPENVRUIEXPORT coAction
26{
27public:
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 }
66 virtual int hitAll(vruiHit *hit);
68 virtual void missAll();
69
70private:
71 vruiActionUserData *userData;
72 vruiNode *myNode;
73 coAction *child;
74 coAction *parent;
75 unsigned int thisFrame;
76
77protected:
81 std::string actionName;
82};
83
84}
85#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coAction.h:26
virtual int hitAll(vruiHit *hit)
INTERNAL same as miss/hit, but do it for all children as well.
coAction()
Constructor.
virtual void miss()
virtual int hit(vruiHit *hit)=0
std::string actionName
Definition: coAction.h:81
Result
Definition: coAction.h:44
unsigned int getFrame() const
INTERNAL get the framecounter (used to produce the miss call)
Definition: coAction.h:57
void addChild(coAction *)
INTERNAL add a child action.
void setNode(vruiNode *)
INTERNAL set the node this action belongs to.
virtual ~coAction()
Destructor.
void setFrame(unsigned int frame)
INTERNAL set the framecounter (used to produce the miss call)
Definition: coAction.h:52
virtual void missAll()
INTERNAL same as miss/hit, but do it for all children as well.
Userdata that can be attached to Nodes in the scenegraph.
Definition: vruiActionUserData.h:19
Definition: vruiHit.h:21
Definition: vruiNode.h:22