MeVisLab Toolbox Reference
SoCrossHair.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_CROSS_HAIR_H
14 #define SO_CROSS_HAIR_H
15 
17 
18 // Creates a simple cross given by inventor cylinders which can be placed
19 // at arbitrary 3d positions.
20 
21 #include "SoUtilsSystem.h"
22 
23 #include <Inventor/nodes/SoSeparator.h>
24 #include <Inventor/fields/SoSFTrigger.h>
25 #include <Inventor/fields/SoSFBool.h>
26 #include <Inventor/fields/SoSFVec3f.h>
27 #include <Inventor/fields/SoSFFloat.h>
28 #include <Inventor/fields/SoSFUInt32.h>
29 #include <Inventor/fields/SoSFString.h>
30 #include <Inventor/fields/SoSFEnum.h>
31 
32 class SoTranslation;
33 class SoScale;
34 class SoLineSet;
35 class SoCoordinate3;
36 class SoSwitch;
37 class SoDragPointDragger;
38 class SoDrawStyle;
39 class SoPixelScaleAccess;
40 
41 class SOUTILS_EXPORT SoCrossHair : public SoSeparator {
42 
43  SO_NODE_HEADER(SoCrossHair);
44 
45 public:
46 
48  enum ColorMode {
49  CROSS_HAIR_0 = 0,
50  CROSS_HAIR_1 = 1,
51  CROSS_HAIR_2 = 2
52  };
53 
54  enum RenderMode {
56  Cylinders
57  };
58 
61 
63  static void initClass();
64 
66  SoSFEnum crosshairType;
67 
68  SoSFTypedEnum<RenderMode> renderMode;
69 
71  SoSFVec3f position;
72 
74  SoSFVec3f scale;
75 
77  SoSFFloat cylinderRadius;
78 
80  SoSFBool useDragger;
81 
83  SoSFVec3f positionOut;
84 
85 protected:
87  ~SoCrossHair() override;
88 
89 private:
90  void addCylinders(int numPoints, SbVec3f* data);
91 
94  void _useDraggerChanged(SoField*);
95  void _crossHairTypeChanged(SoField*);
97 
99  SoCoordinate3 *_coord;
100 
102  SoLineSet *_lines;
103 
105  SoSwitch *_draggerSwitch;
106 
108  SoDragPointDragger *_dragger;
109 
110  SoSwitch* _renderSwitch;
111 
112  SoSeparator* _cylinders;
113 };
114 
115 #endif
#define SOUTILS_EXPORT
System dependent includes. Disables some compiler/linker warnings.
Definition: SoUtilsSystem.h:31
SoSFBool useDragger
Enables/disables the dragger to move the cross. Default is off.
Definition: SoCrossHair.h:80
SoSFFloat cylinderRadius
If renderMode == Cylinder, this radius is used as radius of the Cylinder.
Definition: SoCrossHair.h:77
SoSFVec3f positionOut
The position output of the dragger.
Definition: SoCrossHair.h:83
SoSFTypedEnum< RenderMode > renderMode
Definition: SoCrossHair.h:68
SoSFEnum crosshairType
Type selector for cross hair cursor. Default is CROSS_HAIR_0.
Definition: SoCrossHair.h:66
ColorMode
Type selector for cross hair cursors.
Definition: SoCrossHair.h:48
SoSFVec3f scale
Extents of the three cross lines. Defaults are (2,2,2).
Definition: SoCrossHair.h:74
static void initClass()
Initializes this class.
~SoCrossHair() override
Destructor.
SoCrossHair()
Constructor.
SoSFVec3f position
Position of the cross in 3d. Default is (0,0,0).
Definition: SoCrossHair.h:71