Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLTransformableNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLTransformableNode.h,v $
10  Date: $Date: 2006/03/19 17:12:29 $
11  Version: $Revision: 1.13 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLTransformableNode_h
16 #define __vtkMRMLTransformableNode_h
17 
18 // MRML includes
19 #include "vtkMRMLStorableNode.h"
20 #include "vtkVector.h"
22 
23 // VTK includes
24 class vtkAbstractTransform;
25 class vtkMatrix4x4;
26 
31 class VTK_MRML_EXPORT vtkMRMLTransformableNode : public vtkMRMLStorableNode
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
37  vtkMRMLNode* CreateNodeInstance() override = 0;
38 
41  void ReadXMLAttributes( const char** atts) override;
42 
45  void WriteXML(ostream& of, int indent) override;
46 
49  const char* GetNodeTagName() override = 0;
50 
59  bool SetAndObserveTransformNodeID(const char *transformNodeID);
60 
63  vtkMRMLTransformNode* GetParentTransformNode();
64 
67  void ProcessMRMLEvents ( vtkObject * /*caller*/,
68  unsigned long /*event*/,
69  void * /*callData*/ ) override;
70 
72  enum
73  {
74  TransformModifiedEvent = 15000
75  };
76 
80  virtual bool CanApplyNonLinearTransforms()const;
81 
85  virtual void ApplyTransformMatrix(vtkMatrix4x4* transformMatrix);
86 
89  virtual void ApplyTransform(vtkAbstractTransform* transform);
90 
93  virtual void TransformPointToWorld(const double inLocal[3], double outWorld[3]);
94 
97  virtual void TransformPointToWorld(const vtkVector3d &inLocal, vtkVector3d &outWorld);
98 
101  virtual void TransformPointFromWorld(const double inWorld[3], double outLocal[3]);
102 
105  virtual void TransformPointFromWorld(const vtkVector3d &inWorld, vtkVector3d &outLocal);
106 
108  const char *GetTransformNodeID();
109 
112  bool HardenTransform();
113 
114 protected:
116  ~vtkMRMLTransformableNode() override;
118  void operator=(const vtkMRMLTransformableNode&);
119 
120  static const char* TransformNodeReferenceRole;
122 
123  virtual const char* GetTransformNodeReferenceRole();
124  virtual const char* GetTransformNodeReferenceMRMLAttributeName();
125 
128  void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override;
129 
132  void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override;
133 
136  void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override;
137 
139  virtual void OnTransformNodeReferenceChanged(vtkMRMLTransformNode* transformNode);
140 
141 private:
142  char* TransformNodeIDInternal;
143  vtkSetStringMacro(TransformNodeIDInternal);
144  vtkGetStringMacro(TransformNodeIDInternal);
145 
146 };
147 
148 #endif
MRML node for representing a transformation between this node space and a parent node space...
static const char * TransformNodeReferenceMRMLAttributeName
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
virtual void OnNodeReferenceModified(vtkMRMLNodeReference *reference)
Called when a referenced node pointer is modified.
Definition: vtkMRMLNode.h:905
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
MRML node to represent a 3D surface model.
virtual void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference)
Called when a referenced node pointer is removed (set to nullptr).
Definition: vtkMRMLNode.h:911
static const char * TransformNodeReferenceRole
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Storage nodes
virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference)
Definition: vtkMRMLNode.h:899
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Class to hold information about a node reference.
Definition: vtkMRMLNode.h:775
void operator=(const vtkMRMLStorableNode &)
const char * GetNodeTagName() override=0
MRML node for representing a node with a transform.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void PrintSelf(ostream &os, vtkIndent indent) override