Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLSliceDisplayNode.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Ebatinca S.L., Las Palmas de Gran Canaria, Spain
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef __vtkMRMLSliceDisplayNode_h
19#define __vtkMRMLSliceDisplayNode_h
20
21// MRML includes
23
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
36 void ReadXMLAttributes(const char** atts) override;
37
39 void WriteXML(ostream& of, int indent) override;
40
44
46
48 const char* GetNodeTagName() override {return "SliceDisplay";}
49
51
52 bool GetIntersectingSlicesVisibility() { return this->GetVisibility2D(); };
53 void SetIntersectingSlicesVisibility(bool visible) { this->SetVisibility2D(visible); };
54 vtkBooleanMacro(IntersectingSlicesVisibility, bool);
56
58
59 vtkGetMacro(IntersectingSlicesInteractive, bool);
60 vtkSetMacro(IntersectingSlicesInteractive, bool);
61 vtkBooleanMacro(IntersectingSlicesInteractive, bool);
63
65
66 vtkGetMacro(IntersectingSlicesTranslationEnabled, bool);
67 vtkSetMacro(IntersectingSlicesTranslationEnabled, bool);
68 vtkBooleanMacro(IntersectingSlicesTranslationEnabled, bool);
69 vtkGetMacro(IntersectingSlicesRotationEnabled, bool);
70 vtkSetMacro(IntersectingSlicesRotationEnabled, bool);
71 vtkBooleanMacro(IntersectingSlicesRotationEnabled, bool);
73
75 {
77 ModeTranslation
78 };
79
81
86
88 {
89 NeverVisible = 0,
92 //FadingVisible, // Handles' opacity increases as the mouse gets closer to them
93 HandlesVisibilityMode_Last // insert new types above this line
94 };
95
97
99 vtkGetMacro(IntersectingSlicesInteractiveHandlesVisibilityMode, int);
100 vtkSetMacro(IntersectingSlicesInteractiveHandlesVisibilityMode, int);
102
104
108
110 {
111 SkipLineCrossings = 0,
113 IntersectionMode_Last // insert new types above this line
114 };
115
117
119 vtkGetMacro(IntersectingSlicesIntersectionMode, int);
120 vtkSetMacro(IntersectingSlicesIntersectionMode, int);
122
124
128
130 {
131 FineLines = 0,
134 LineThicknessMode_Last // insert new types above this line
135 };
136
138
140 vtkGetMacro(IntersectingSlicesLineThicknessMode, int);
141 vtkSetMacro(IntersectingSlicesLineThicknessMode, int);
143
145
150
152 static const std::string GetDefaultContextName() { return ""; };
153
163
172
177
179 void SetActiveComponent(int componentType, int componentIndex,
181
184
187 std::vector<std::string> GetActiveComponentInteractionContexts();
188
189protected:
194
196 {
198 {
199 this->Type = ComponentNone;
200 this->Index = -1;
201 }
202 int Type;
203 int Index;
204 };
205
206 bool IntersectingSlicesInteractive{ false };
207 bool IntersectingSlicesTranslationEnabled{ true };
208 bool IntersectingSlicesRotationEnabled{ true };
209
210 int IntersectingSlicesInteractiveHandlesVisibilityMode{ NeverVisible };
211
212 int IntersectingSlicesIntersectionMode{ FullLines };
213
214 int IntersectingSlicesLineThicknessMode{ FineLines };
215
218 std::map<std::string, ComponentInfo> ActiveComponents;
219};
220
221#endif
MRML node to represent a display property of 3D surface model.
Abstract Superclass for all specific types of MRML nodes.
MRML node to store display properties of slice nodes.
@ ComponentTranslateSingleIntersectingSliceHandle
mouse is near the middle of the slice intersection (translation section)
@ ComponentRotateIntersectingSlicesHandle
mouse is near the end of the slice intersection (rotation section)
@ ComponentTranslateIntersectingSlicesHandle
mouse is near the intersection point of slice intersections
@ ComponentSliceIntersection
slice intersection is active (not any handle), e.g., because user is interacting with the widget
bool GetIntersectingSlicesInteractiveModeEnabled(IntersectingSlicesInteractiveMode mode)
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void SetIntersectingSlicesVisibility(bool visible)
std::map< std::string, ComponentInfo > ActiveComponents
void operator=(const vtkMRMLSliceDisplayNode &)
~vtkMRMLSliceDisplayNode() override
static vtkMRMLSliceDisplayNode * New()
static int GetIntersectingSlicesLineThicknessModeFromString(const char *)
static const char * GetIntersectingSlicesLineThicknessModeAsString(int id)
void SetIntersectingSlicesInteractiveModeEnabled(IntersectingSlicesInteractiveMode mode, bool enabled)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
vtkMRMLCopyContentMacro(vtkMRMLSliceDisplayNode)
static int GetIntersectingSlicesInteractiveHandlesVisibilityModeFromString(const char *)
std::vector< std::string > GetActiveComponentInteractionContexts()
static const char * GetIntersectingSlicesInteractiveHandlesVisibilityModeAsString(int id)
Convert between intersecting slices interactive handles visibility mode ID and string.
static int GetIntersectingSlicesIntersectionModeFromString(const char *)
void PrintSelf(ostream &os, vtkIndent indent) override
bool GetIntersectingSlicesVisibility()
Toggles visibility of intersections of other slices in the slice viewer.
vtkMRMLSliceDisplayNode(const vtkMRMLSliceDisplayNode &)
int GetActiveComponentType(std::string context=vtkMRMLSliceDisplayNode::GetDefaultContextName())
static const char * GetIntersectingSlicesIntersectionModeAsString(int id)
Convert between intersecting slices intersection mode ID and string.
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
void SetActiveComponent(int componentType, int componentIndex, std::string context=vtkMRMLSliceDisplayNode::GetDefaultContextName())
Set active component type and index for interaction context (empty by default, meaning mouse)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
static const std::string GetDefaultContextName()
Get name of the default interaction context (typically the mouse)
bool HasActiveComponent()
Query if there is an active component for any interaction context.
int GetActiveComponentIndex(std::string context=vtkMRMLSliceDisplayNode::GetDefaultContextName())
@ NearbyVisible
Handles are displayed when mouse pointer gets close.
@ AlwaysVisible
Handles are always visible.