MeVisLab Resolution Independence API
Loading...
Searching...
No Matches
SoActionLog.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2013, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef SO_ACTION_LOG_H
14#define SO_ACTION_LOG_H
15
16// Include base-class header.
17#include <Inventor/nodes/SoSubNode.h>
18// Include field headers.
19#include <Inventor/fields/SoSFBool.h>
20#include <Inventor/fields/SoSFString.h>
21#include <Inventor/fields/SoSFTrigger.h>
22#include <Inventor/sensors/SoFieldSensor.h>
23
24#include <string>
25
26// Forward declarations
27class SoGLRenderAction;
28class SoCallbackAction;
29class SoGetBoundingBoxAction;
30class SoGetMatrixAction;
31class SoHandleEventAction;
32class SoPickAction;
33class SoRayPickAction;
34class SoSearchAction;
35class SoWriteAction;
36
37// Declare SoActionLog node being a subnode of a SoNode
38class SoActionLog : public SoNode
39{
40 // Make a typedef of the parent type to allow easier adaptation of
41 // the sourcecode if the parent node should change.
42 typedef SoNode inherited;
43
44 // Insert sourcecode common to all subnodes of Open-Inventor.
45 SO_NODE_HEADER(SoActionLog);
46
47public:
48 SoSFBool traceGLRender;
49 SoSFBool traceCallback;
60 SoSFBool tracePick;
61 SoSFBool traceRayPick;
62 SoSFBool traceSearch;
63 SoSFBool traceWrite;
64
65 SoSFBool printViewerId;
66
68 SoSFBool logToConsole;
69
71 SoSFBool logToString;
73 SoSFString jsonLog;
74
76 SoSFTrigger clearLog;
77
80
81protected:
83 ~SoActionLog() override;
84
85public:
87 void GLRender(SoGLRenderAction* action) override;
88 void callback(SoCallbackAction* action) override;
89 void getBoundingBox(SoGetBoundingBoxAction* action) override;
90 void getMatrix(SoGetMatrixAction* action) override;
91 void handleEvent(SoHandleEventAction* action) override;
92 void pick(SoPickAction* action) override;
93 void rayPick(SoRayPickAction* action) override;
94 void search(SoSearchAction* action) override;
95 void write(SoWriteAction* action) override;
96
98 static void initClass();
99
100private:
101 void addEntryToJSON(const std::string& str);
102
103 void clearLogChangedCB(SoField* field);
104
105 void* getViewerId(SoAction* action);
106 std::string getViewerIdEntry(SoAction* action);
107};
108
109#endif // _SOACTIONLOG_H
~SoActionLog() override
Destructor.
SoSFBool traceUnknownEvent
Definition SoActionLog.h:59
void write(SoWriteAction *action) override
SoSFBool tracePick
Definition SoActionLog.h:60
SoSFBool traceLocation2Event
Definition SoActionLog.h:53
SoSFBool traceEnterLeaveEvent
Definition SoActionLog.h:57
SoSFBool traceMouseWheelEvent
Definition SoActionLog.h:58
SoSFBool traceGetBoundingBox
Definition SoActionLog.h:50
SoSFTrigger clearLog
clears jsonLog immediately
Definition SoActionLog.h:76
void handleEvent(SoHandleEventAction *action) override
SoSFBool traceWrite
Definition SoActionLog.h:63
SoSFBool logToString
flag to enable logging to jsonLog string
Definition SoActionLog.h:71
SoSFBool traceCallback
Definition SoActionLog.h:49
void search(SoSearchAction *action) override
SoSFBool traceRayPick
Definition SoActionLog.h:61
void GLRender(SoGLRenderAction *action) override
Action handlers.
void pick(SoPickAction *action) override
void getMatrix(SoGetMatrixAction *action) override
SoSFBool logToConsole
flag to enable logging to console
Definition SoActionLog.h:68
static void initClass()
Register this node with the Open Inventor runtime system.
SoSFBool traceHandleEvent
Definition SoActionLog.h:52
SoSFBool traceSearch
Definition SoActionLog.h:62
SoSFBool traceGLRender
Definition SoActionLog.h:48
void callback(SoCallbackAction *action) override
SoSFBool traceKeyboardEvent
Definition SoActionLog.h:56
void getBoundingBox(SoGetBoundingBoxAction *action) override
SoSFBool traceLocation2RefreshEvent
Definition SoActionLog.h:54
SoActionLog()
Constructor.
SoSFBool traceMouseButtonEvent
Definition SoActionLog.h:55
SoSFBool traceGetMatrix
Definition SoActionLog.h:51
SoSFBool printViewerId
Definition SoActionLog.h:65
void rayPick(SoRayPickAction *action) override
SoSFString jsonLog
contains the logged events in JSON format
Definition SoActionLog.h:73