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
32class SoTranslation;
33class SoScale;
34class SoLineSet;
35class SoCoordinate3;
36class SoSwitch;
38class SoDrawStyle;
40
41class SOUTILS_EXPORT SoCrossHair : public SoSeparator {
42
43 SO_NODE_HEADER(SoCrossHair);
44
45public:
46
48 enum ColorMode {
49 CROSS_HAIR_0 = 0,
50 CROSS_HAIR_1 = 1,
51 CROSS_HAIR_2 = 2
52 };
53
56 Cylinders
57 };
58
61
63 static void initClass();
64
67
69
72
75
78
81
84
85protected:
87 ~SoCrossHair() override;
88
89private:
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.
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
Target mlrange_cast(Source arg)
Generic version of checked ML casts.