NutsnBolts  0.1.0
An extension library for Coin
Loading...
Searching...
No Matches
NbScriptEvent.h
1#ifndef NB_SCRIPT_EVENT_H
2#define NB_SCRIPT_EVENT_H
3
4#include <Inventor/nodes/SoSubNode.h>
5#include <Inventor/fields/SoMFString.h>
6#include <Inventor/fields/SoSFNode.h>
7#include <Inventor/fields/SoSFString.h>
8#include <Inventor/fields/SoSFTrigger.h>
9#include <NutsnBolts/Basic.h>
10
11class NbScriptEventP;
12class SoEvent;
13
14class NB_DLL_API NbScriptEvent : public SoNode {
15 typedef SoNode inherited;
16
17 SO_NODE_HEADER(NbScriptEvent);
18
19 public:
20
21 NbScriptEvent(void);
22 static void initClass(void);
23
24 virtual void execScript(void);
25
26 SoMFString eventName;
27 SoSFNode scriptNode;
28 SoSFString script;
29
30 SoSFTrigger trigger;
31
32 SbBool handle(const SoEvent * event, SoHandleEventAction * action);
33
34 SbBool isClickedEvent(const SbString & name);
35 SbBool isDoubleClickedEvent(const SbString & name);
36
37 SbBool isTooltipEvent(const SbName & name);
38 SbBool isGlobalEvent(const SbName & name);
39 SbBool isObjectPicked(const SoEvent * event, SoHandleEventAction * action);
40
41protected:
42 virtual ~NbScriptEvent();
43
44private:
45 void fetchParentNodes(SoHandleEventAction * action);
46 friend class NbScriptEventP;
47 NbScriptEventP * pimpl;
48};
49
50#endif // NB_SCRIPT_EVENT_H
The NbScriptEvent class enables you to trigger scripts based on event names.
Definition NbScriptEvent.h:14