MeVisLab Toolbox Reference
CSOLabelRenderer.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2012, 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
15
16#pragma once
17
18#include <SoCSOIncludes.h>
19#include <mlModuleIncludes.h>
20
21#include "SoCSOLabelRenderer.h"
22
24{
27 // FixedVoxelPosition
28};
29
30
37
39
42{
43public:
44
46
47
48protected:
49
51
53 void activateAttachments() override;
54
55private:
56
57 // generates the label string and name with Python
58 void generateLabelString(CSO* cso, std::string& labelString, std::string& labelName, std::string& labelCaption,
59 int& deviceOffsetX, int& deviceOffsetY);
60
61 BaseField* _inVisualizationSettingsFld;
62 BaseField* _inLabelPlacementFld;
63
64 StringField* _extensionIdFld;
65 BoolField* _allowModificationFld;
66 BoolField* _shouldRenderFld;
67
68 BoolField* _shouldRenderLabelNameFld;
69
70 BoolField* _shouldDrawConnectingLineFld;
71 BoolField* _shouldHighlightBorderOnMouseOverFld;
72 FloatField* _connectingLineAlphaFld;
73 BoolField* _drawConnectingLineToCenterOfCSOFld;
74 IntField* _minConnectingLineLengthFld;
75
76 BoolField* _shouldDrawLabelBorderForSelectedCSOFld;
77
78 IntField* _labelBorderMarginXFld;
79 IntField* _labelBorderMarginYFld;
80
81 IntField* _fontSizeFld;
82
83 EnumField* _movePossibleCursorFld;
84 EnumField* _movePerformCursorFld;
85
86 EnumField* _scaleNCursorFld;
87 EnumField* _scaleNWCursorFld;
88 EnumField* _scaleWCursorFld;
89 EnumField* _scaleSWCursorFld;
90 EnumField* _scaleSCursorFld;
91 EnumField* _scaleSECursorFld;
92 EnumField* _scaleECursorFld;
93 EnumField* _scaleNECursorFld;
94
95 BoolField* _allowLabelResizeFld;
96 BoolField* _shouldDrawResizeHandlersFld;
97
98 SoNodeField* _outSceneFld;
99 BaseField* _outCSOListFld;
100 IntField* _currentCSOIdFld;
101
102 StringField* _labelNameFld;
103 StringField* _labelCaptionFld;
104 StringField* _labelStringFld;
105 StringField* _labelCodeFld;
106
107 IntField* _deviceOffsetXFld;
108 IntField* _deviceOffsetYFld;
109
110 StringField* _userDataFields[8];
111
112 NotifyField* _redrawAllLabelsFld;
113
114 NotifyField* _needsNewLabelStringFld;
115
116 BoolField* _tryToPlaceLabelsWithoutOverlapFld;
117
118 TypedEnumField<DetachedLabelPlacement>* _detachedLabelPlacementFld;
119 TypedEnumField<ViewerBorderHandling>* _viewerBorderHandlingFld;
120
121 IntField* _csoIdOfLabelUnderMouseCursorFld;
122
123
124 IntField* _inputInfoCSOIdFld;
125 StringField* _inputInfoViewerIdFld;
126
127 Vector2Field* _outputInfoLabelBoundingBoxStartFld;
128 Vector2Field* _outputInfoLabelBoundingBoxEndFld;
129 StringField* _outputInfoLabelCaptionFld;
130 StringField* _outputInfoLabelStringFld;
131 IntField* _outputInfoLabelCaptionWidthFld;
132 BoolField* _outputInfoIsValidFld;
133
134 NotifyField* _updateOutputLabelInfos;
135
136 BoolField* _shouldShowLabelStringOfOutputInfoLabelFld;
137
138 void computeOutputInformation();
139
140 void setLabelBorderMargins();
141
142 void setCursorFields();
143 EnumField* addCursorShapeEnumField(const std::string& name);
144
145 void setCSOIdOfLabelUnderMouseCursor(int csoId);
146
147 SoRef<SoCSOLabelRenderer> _soCSOLabelRenderer;
148
149 friend class ::SoCSOLabelRenderer;
150
152};
153
DetachedLabelPlacement
Module encapsulation the SoView2D extension for rendering labels for CSOs.
@ RelativeToCSO
@ RelativeToViewer
ViewerBorderHandling
@ MoveOverViewerBorder
@ ClampToViewerBorder
@ DoNotRenderOutsideViewer
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition SoCSOSystem.h:21
Field to encapsulate a pointer to an ML base object.
Definition mlFields.h:797
Field to encapsulate a boolean value.
Definition mlFields.h:58
Module encapsulation the SoView2D extension for rendering labels for CSOs.
~CSOLabelRenderer() override
void handleNotification(Field *field) override
Called when any field data in the field container of this module is modified.
void activateAttachments() override
Reactivates notification handling, i.e., all fields of this module will send notifications again to a...
The CSO represents a contour segmentation object.
Definition CSO.h:44
Field to encapsulate an enumerated value.
Definition mlFields.h:195
Base class for all fields used in the ML.
Definition mlField.h:73
Field to encapsulate a float value.
Definition mlFields.h:415
Field to encapsulate an integer value.
Definition mlFields.h:126
Base class for an image processing module of the ML.
Definition mlModule.h:151
Field without value for notifications.
Definition mlFields.h:659
Field to encapsulate a pointer to an SoNode instance of OpenInventor.
Definition mlFields.h:937
Field to encapsulate a string value.
Definition mlFields.h:610
TypedEnumField is used to encapsulate a C++ enum value and work with a real enum value instead of int...
Definition mlFields.h:384
Field to encapsulate a vector of 2 double values.
Definition mlFields.h:1038
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.