Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 void SetIntersectingSlicesVisibility(bool visible) { this->SetVisibility2D(visible); };
54 vtkBooleanMacro(IntersectingSlicesVisibility, bool);
56
58
61 vtkBooleanMacro(IntersectingThickSlabVisibility, bool);
63
65
68 vtkBooleanMacro(IntersectingSlicesInteractive, bool);
70
72
75 vtkBooleanMacro(IntersectingThickSlabInteractive, bool);
77
79
85 vtkBooleanMacro(IntersectingSlicesRotationEnabled, bool);
87
93
95
100
102 {
106 //FadingVisible, // Handles' opacity increases as the mouse gets closer to them
107 HandlesVisibilityMode_Last // insert new types above this line
108 };
109
111
116
118
122
124 {
127 IntersectionMode_Last // insert new types above this line
128 };
129
131
136
138
142
144 {
148 LineThicknessMode_Last // insert new types above this line
149 };
150
152
157
159
164
166 static const std::string GetDefaultContextName() { return ""; };
167
178
187
192
194 void SetActiveComponent(int componentType, int componentIndex,
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.