MeVisLab Resolution Independence API
Loading...
Searching...
No Matches
SoPicking.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, 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_PICKING_H
14#define SO_PICKING_H
15
16
18
19#include <Inventor/nodes/SoSelection.h>
20#include <Inventor/fields/SoSFTrigger.h>
21#include <Inventor/fields/SoSFBool.h>
22#include <Inventor/fields/SoSFEnum.h>
23#include <Inventor/fields/SoSFVec3f.h>
24#include <Inventor/fields/SoSFColor.h>
25#include <Inventor/fields/SoSFVec4f.h>
26#include <Inventor/fields/SoSFFloat.h>
27#include <Inventor/fields/SoSFInt32.h>
28#include <Inventor/fields/SoSFString.h>
29#include <Inventor/fields/SoSFEnum.h>
30#include <Inventor/fields/SoSFPath.h>
31#include <Inventor/actions/SoCallbackAction.h>
32
33#include <SoInteractionNode.h>
34
35class SoNodeSensor;
36class SoDataSensor;
37class SoHandleEventAction;
38
39class SoPicking : public SoInteractionNode
40{
41 SO_NODE_HEADER(SoPicking);
42
43 friend class SoPickingPickAction;
44
45public:
48
50 static void initClass();
51
54 SoSFVec3f objectLocal;
55 SoSFVec3f objectWorld;
56 SoSFVec3f normalLocal;
57 SoSFVec3f normalWorld;
58 SoSFVec3f textureLocal3;
59 SoSFVec3f textureWorld3;
60 SoSFVec4f textureLocal4;
61 SoSFVec4f textureWorld4;
62 SoSFBool pointPicked;
63
65 SoSFColor diffuseColor;
66
68 SoSFPath pickedPath;
69
70 SoSFBool highlighted;
71 SoSFBool buttonPressed;
72 SoSFInt32 clickCount;
73
74 SoSFBool enabled;
78 SoSFEnum cursorShape;
79 SoSFString actionID;
80
81 SoSFBool highlighted2;
83 SoSFInt32 clickCount2;
84
85 SoSFBool enabled2;
88 SoSFEnum cursorShape2;
89 SoSFString actionID2;
90
91 SoSFBool highlighted3;
93 SoSFInt32 clickCount3;
94
95 SoSFBool enabled3;
98 SoSFEnum cursorShape3;
99 SoSFString actionID3;
100
102
103protected:
104 using SoInteractionOwner::pointerPosition;
105
107 void pointerPosition(const SoPointerPosition& pos) override;
108
110 using SoInteractionNode::pointerLeftWindow;
111 void pointerLeftWindow() override;
112
113private:
115 void _updatePickedPoint(SoHandleEventAction* action);
116
117 void _updateActionID(SoField* field = nullptr);
118 void _updateActionEnabled(SoField* field = nullptr);
119
120 void _updateActionID2(SoField* field = nullptr);
121 void _updateActionEnabled2(SoField* field = nullptr);
122
123 void _updateActionID3(SoField* field = nullptr);
124 void _updateActionEnabled3(SoField* field = nullptr);
125
126 void _updateContinouslyCalled(SoField* field = nullptr);
127
128 SoPointingAction* _pickPointAction;
129 SoPointingAction* _pickPointAction2;
130 SoPointingAction* _pickPointAction3;
131
132 // Used as userData for postTailCallback
133 struct PickingHelper
134 {
135 SbColor diffuseColor;
136 int materialIndex;
137 };
138 static SoCallbackAction::Response postTailCallback(void* userData, SoCallbackAction* action, const SoNode* node);
139};
140
141#endif
SoSFBool updateWhileDragging2
Definition SoPicking.h:86
void pointerLeftWindow() override
SoSFEnum cursorShape
Definition SoPicking.h:78
SoSFVec3f objectWorld
Definition SoPicking.h:55
SoSFVec3f objectLocal
Definition SoPicking.h:54
SoSFInt32 clickCount3
Definition SoPicking.h:93
SoSFVec3f normalWorld
Definition SoPicking.h:57
SoSFBool enableColorPicking
Definition SoPicking.h:64
SoSFBool highlighted
Definition SoPicking.h:70
SoSFBool pointPicked
Definition SoPicking.h:62
SoSFInt32 clickCount
Definition SoPicking.h:72
SoSFBool performPreClickTest
Definition SoPicking.h:76
SoSFEnum cursorShape2
Definition SoPicking.h:88
SoSFBool updateContinuously
Definition SoPicking.h:77
SoSFVec3f textureLocal3
Definition SoPicking.h:58
SoSFBool performPreClickTest3
Definition SoPicking.h:97
SoSFVec3f normalLocal
Definition SoPicking.h:56
SoSFPath pickedPath
Definition SoPicking.h:68
SoSFBool enabled2
Definition SoPicking.h:85
SoSFBool updateWhileDragging3
Definition SoPicking.h:96
SoSFString actionID3
Definition SoPicking.h:99
SoSFBool buttonPressed
Definition SoPicking.h:71
friend class SoPickingPickAction
Definition SoPicking.h:43
SoSFString actionID
Definition SoPicking.h:79
SoSFVec3f textureWorld3
Definition SoPicking.h:59
SoSFVec4f textureLocal4
Definition SoPicking.h:60
SoSFEnum cursorShape3
Definition SoPicking.h:98
SoPicking()
Constructor.
SoSFVec4f textureWorld4
Definition SoPicking.h:61
SoSFBool buttonPressed2
Definition SoPicking.h:82
SoSFString actionID2
Definition SoPicking.h:89
SoSFBool updateWhileDragging
Definition SoPicking.h:75
SoSFBool highlighted3
Definition SoPicking.h:91
void pointerPosition(const SoPointerPosition &pos) override
this is called for every mouse move
SoSFBool enabled
Definition SoPicking.h:74
SoSFBool buttonPressed3
Definition SoPicking.h:92
SoSFBool enablePathPicking
Definition SoPicking.h:67
SoSFColor diffuseColor
Definition SoPicking.h:65
static void initClass()
Initializes this class.
SoSFBool performPreClickTest2
Definition SoPicking.h:87
SoSFInt32 clickCount2
Definition SoPicking.h:83
SoSFBool highlighted2
Definition SoPicking.h:81
SoSFBool enabled3
Definition SoPicking.h:95