Slicer 5.9
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
53
54 void SetIntersectingSlicesVisibility(bool visible) { this->SetVisibility2D(visible); };
55 vtkBooleanMacro(IntersectingSlicesVisibility, bool);
57
59
62 vtkBooleanMacro(IntersectingThickSlabVisibility, bool);
64
66
69 vtkBooleanMacro(IntersectingSlicesInteractive, bool);
71
73
76 vtkBooleanMacro(IntersectingThickSlabInteractive, bool);
78
80
86 vtkBooleanMacro(IntersectingSlicesRotationEnabled, bool);
88
94
96
101
103 {
107 // FadingVisible, // Handles' opacity increases as the mouse gets closer to them
108 HandlesVisibilityMode_Last // insert new types above this line
109 };
110
112
117
119
123
125 {
128 IntersectionMode_Last // insert new types above this line
129 };
130
132
137
139
143
145 {
149 LineThicknessMode_Last // insert new types above this line
150 };
151
153
158
160
165
167 static const std::string GetDefaultContextName() { return ""; };
168
179
188
193
195 void SetActiveComponent(int componentType, int componentIndex, std::string context = vtkMRMLSliceDisplayNode::GetDefaultContextName());
196
199
202 std::vector<std::string> GetActiveComponentInteractionContexts();
203
204protected:
209
211 {
213 {
214 this->Type = ComponentNone;
215 this->Index = -1;
216 }
217 int Type;
218 int Index;
219 };
220
226
228
230
232
235 std::map<std::string, ComponentInfo> ActiveComponents;
236};
237
238#endif
virtual int GetVisibility2D()
virtual void SetVisibility2D(int)
@ 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
@ ComponentNone
no component of the slice or slice intersection widget is active
@ ComponentSliceIntersection
slice intersection is active (not any handle), e.g., because user is interacting with the widget
@ ComponentTranslateIntersectingThickSlabHandle
mouse is near the handle for adjusting a thick slab
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.
@ SkipLineCrossings
Lines do not intersect and there is a gap around the intersection point.
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())
@ NeverVisible
Handles are never displayed.
@ NearbyVisible
Handles are displayed when mouse pointer gets close.
@ AlwaysVisible
Handles are always visible.