Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 
28 class VTK_MRML_EXPORT vtkMRMLSliceDisplayNode : public vtkMRMLModelDisplayNode
29 {
30 public:
31  static vtkMRMLSliceDisplayNode *New();
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 
45  vtkMRMLNode* CreateNodeInstance() override;
46 
48  const char* GetNodeTagName() override {return "SliceDisplay";}
49 
51  bool GetIntersectingSlicesVisibility() { return this->GetVisibility2D(); };
53  void SetIntersectingSlicesVisibility(bool visible) { this->SetVisibility2D(visible); };
54  vtkBooleanMacro(IntersectingSlicesVisibility, bool);
56 
58  vtkGetMacro(IntersectingSlicesInteractive, bool);
60  vtkSetMacro(IntersectingSlicesInteractive, bool);
61  vtkBooleanMacro(IntersectingSlicesInteractive, bool);
63 
65  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  void SetIntersectingSlicesInteractiveModeEnabled(IntersectingSlicesInteractiveMode mode, bool enabled);
84  bool GetIntersectingSlicesInteractiveModeEnabled(IntersectingSlicesInteractiveMode mode);
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  vtkGetMacro(IntersectingSlicesInteractiveHandlesVisibilityMode, int);
100  vtkSetMacro(IntersectingSlicesInteractiveHandlesVisibilityMode, int);
102 
104  static const char* GetIntersectingSlicesInteractiveHandlesVisibilityModeAsString(int id);
106  static int GetIntersectingSlicesInteractiveHandlesVisibilityModeFromString(const char*);
108 
110  {
111  SkipLineCrossings = 0,
113  IntersectionMode_Last // insert new types above this line
114  };
115 
117  vtkGetMacro(IntersectingSlicesIntersectionMode, int);
120  vtkSetMacro(IntersectingSlicesIntersectionMode, int);
122 
124  static const char* GetIntersectingSlicesIntersectionModeAsString(int id);
126  static int GetIntersectingSlicesIntersectionModeFromString(const char*);
128 
130  {
131  FineLines = 0,
134  LineThicknessMode_Last // insert new types above this line
135  };
136 
138  vtkGetMacro(IntersectingSlicesLineThicknessMode, int);
141  vtkSetMacro(IntersectingSlicesLineThicknessMode, int);
143 
145  static const char* GetIntersectingSlicesLineThicknessModeAsString(int id);
148  static int GetIntersectingSlicesLineThicknessModeFromString(const char*);
150 
152  static const std::string GetDefaultContextName() { return ""; };
153 
155  {
156  ComponentNone = 0,
161  Component_Last
162  };
163 
171  int GetActiveComponentType(std::string context = vtkMRMLSliceDisplayNode::GetDefaultContextName());
172 
176  int GetActiveComponentIndex(std::string context= vtkMRMLSliceDisplayNode::GetDefaultContextName());
177 
179  void SetActiveComponent(int componentType, int componentIndex,
180  std::string context= vtkMRMLSliceDisplayNode::GetDefaultContextName());
181 
183  bool HasActiveComponent();
184 
187  std::vector<std::string> GetActiveComponentInteractionContexts();
188 
189 protected:
191  ~vtkMRMLSliceDisplayNode() override;
193  void operator=(const vtkMRMLSliceDisplayNode&);
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
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
mouse is near the middle of the slice intersection (translation section)
static vtkMRMLModelDisplayNode * New()
MRML node to represent a display property of 3D surface model.
MRML node to store display properties of slice nodes.
vtkMRMLCopyContentMacro(vtkMRMLModelDisplayNode)
mouse is near the intersection point of slice intersections
static const std::string GetDefaultContextName()
Get name of the default interaction context (typically the mouse)
slice intersection is active (not any handle), e.g., because user is interacting with the widget ...
std::map< std::string, ComponentInfo > ActiveComponents
mouse is near the end of the slice intersection (rotation section)
virtual void SetVisibility2D(int)
virtual int GetVisibility2D()
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
void operator=(const vtkMRMLModelDisplayNode &)
void SetIntersectingSlicesVisibility(bool visible)
void PrintSelf(ostream &os, vtkIndent indent) override
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void WriteXML(ostream &of, int indent) override
Write this node&#39;s information to a MRML file in XML format.
Handles are displayed when mouse pointer gets close.