MeVisLab Toolbox Reference
SoClipBox.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_CLIP_BOX_H
14 #define SO_CLIP_BOX_H
15 
16 
19 
20 #include "SoUtilsSystem.h"
21 #include <ThirdPartyWarningsDisable.h>
22 #include <Inventor/fields/SoSFBool.h>
23 #include <Inventor/fields/SoSFTrigger.h>
24 #include <Inventor/nodes/SoSeparator.h>
25 #include <Inventor/nodes/SoSubNode.h>
26 #include <Inventor/nodes/SoTransformSeparator.h>
27 #include <Inventor/nodes/SoSwitch.h>
28 #include <Inventor/nodes/SoFont.h>
29 #include <Inventor/nodes/SoClipPlane.h>
30 #include <Inventor/nodes/SoSurroundScale.h>
31 #include <Inventor/sensors/SoNodeSensor.h>
32 #include <ThirdPartyWarningsRestore.h>
33 #include "SoPlaneDragger.h"
34 
37 
42 class SoClipBox : public SoTransformSeparator {
43 
44  SO_NODE_HEADER(SoClipBox);
45 
46 public:
47 
49 
51  SoSFBool on;
52 
55 
57  SoSFBool hideGeometry;
58 
60  SoSFTrigger resetGeometry;
61 
63  SoSFTrigger resetSurround;
64 
66  SoSFBool isActive;
67 
69  SoSFRotation rotation0;
71  SoSFVec3f translation0;
73  SoSFRotation rotation1;
75  SoSFVec3f translation1;
77  SoSFRotation rotation2;
79  SoSFVec3f translation2;
81  SoSFRotation rotation3;
83  SoSFVec3f translation3;
85  SoSFRotation rotation4;
87  SoSFVec3f translation4;
89  SoSFRotation rotation5;
91  SoSFVec3f translation5;
92 
94  static void initClass();
95 
96  // Constructor
98 
99  void activityChanged(SoField* field);
100  void resetDraggerGeometry(SoField* field = nullptr);
101  void updateDraggerState(SoField* field = nullptr);
102  void resetSurroundChanged(SoField* field);
103 
104  protected:
105  ~SoClipBox() override;
106 
107  private:
108  SoSwitch* _onScene;
109  SoSwitch* _dragSwitches[6];
110  SoClipPlane* _clipPlanes[6];
111  SoPlaneDragger* _draggers[6];
112  SoSeparator* _dragGroup;
113  SoGroup* _clipGroup;
114  SoSurroundScale* _surround;
115 
116  SoSFVec3f* _translations[6];
117  SoSFRotation* _rotations[6];
118 
119 };
120 
121 #endif
SoClipBox defines a node with 6 clipping plane manipulators that are arrange on the sides of a box.
Definition: SoClipBox.h:42
SoSFVec3f translation0
translation of clip dragger 0
Definition: SoClipBox.h:71
SoSFBool bottom
Definition: SoClipBox.h:54
SoSFBool top
Definition: SoClipBox.h:54
SoSFBool rear
Definition: SoClipBox.h:54
SoSFBool hideGeometry
hide the geometry of the draggers
Definition: SoClipBox.h:57
SoSFTrigger resetGeometry
reset the geometry to form the standard box again
Definition: SoClipBox.h:60
SoSFRotation rotation3
rotation of clip dragger 3
Definition: SoClipBox.h:81
SoSFBool front
Definition: SoClipBox.h:54
SoSFRotation rotation0
rotation of clip dragger 0
Definition: SoClipBox.h:69
SoSFBool on
Fields.
Definition: SoClipBox.h:51
SoSFVec3f translation2
translation of clip dragger 2
Definition: SoClipBox.h:79
void resetDraggerGeometry(SoField *field=nullptr)
SoSFBool right
Definition: SoClipBox.h:54
SoSFVec3f translation3
translation of clip dragger 3
Definition: SoClipBox.h:83
SoSFBool isActive
shows if the clip box is currently active
Definition: SoClipBox.h:66
void resetSurroundChanged(SoField *field)
SoSFVec3f translation4
translation of clip dragger 4
Definition: SoClipBox.h:87
SoSFBool left
switch each of the six sides on/off
Definition: SoClipBox.h:54
void updateDraggerState(SoField *field=nullptr)
SoSFRotation rotation2
rotation of clip dragger 2
Definition: SoClipBox.h:77
SoSFVec3f translation5
translation of clip dragger 6
Definition: SoClipBox.h:91
SoSFRotation rotation5
rotation of clip dragger 5
Definition: SoClipBox.h:89
void activityChanged(SoField *field)
SoSFVec3f translation1
translation of clip dragger 1
Definition: SoClipBox.h:75
static void initClass()
inventor runtime type system init
SoSFRotation rotation1
rotation of clip dragger 1
Definition: SoClipBox.h:73
SoSFTrigger resetSurround
reset so that the clip box surrounds the current bounding box
Definition: SoClipBox.h:63
SoSFRotation rotation4
rotation of clip dragger 4
Definition: SoClipBox.h:85
~SoClipBox() override
Defines a plane dragger that can be used to manipulate a plane (and translation+rotation)