Slicer  4.10
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) VTK_OVERRIDE;
36 
37  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE = 0;
38 
41  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
42 
45  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
46 
49  virtual const char* GetNodeTagName() VTK_OVERRIDE = 0;
50 
59  bool SetAndObserveTransformNodeID(const char *transformNodeID);
60 
63  vtkMRMLTransformNode* GetParentTransformNode();
64 
67  virtual void ProcessMRMLEvents ( vtkObject * /*caller*/,
68  unsigned long /*event*/,
69  void * /*callData*/ ) VTK_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:
118  void operator=(const vtkMRMLTransformableNode&);
119 
120  static const char* TransformNodeReferenceRole;
122 
123  virtual const char* GetTransformNodeReferenceRole();
124  virtual const char* GetTransformNodeReferenceMRMLAttributeName();
125 
128  virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) VTK_OVERRIDE
129  {
131  if (std::string(reference->GetReferenceRole()) == this->TransformNodeReferenceRole)
132  {
134  }
135  }
136 
139  virtual void OnNodeReferenceModified(vtkMRMLNodeReference *reference) VTK_OVERRIDE
140  {
142  if (std::string(reference->GetReferenceRole()) == this->TransformNodeReferenceRole)
143  {
145  }
146  }
147 
150  virtual void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) VTK_OVERRIDE
151  {
153  if (std::string(reference->GetReferenceRole()) == this->TransformNodeReferenceRole)
154  {
156  }
157  }
158 
159 
160 private:
161  char* TransformNodeIDInternal;
162  vtkSetStringMacro(TransformNodeIDInternal);
163  vtkGetStringMacro(TransformNodeIDInternal);
164 
165 };
166 
167 #endif
MRML node for representing a transformation between this node space and a parent node space...
static const char * TransformNodeReferenceMRMLAttributeName
virtual void OnNodeReferenceModified(vtkMRMLNodeReference *reference) VTK_OVERRIDE
Called when a node reference ID is modified.
virtual void OnNodeReferenceModified(vtkMRMLNodeReference *reference)
Called when a referenced node pointer is modified.
Definition: vtkMRMLNode.h:871
virtual vtkMRMLNode * CreateNodeInstance() VTK_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 NULL).
Definition: vtkMRMLNode.h:877
static const char * TransformNodeReferenceRole
virtual void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) VTK_OVERRIDE
Called after a node reference ID is removed (list size decreased).
virtual void InvokeCustomModifiedEvent(int eventId, void *callData=NULL)
This method allows the node to compress events.
Definition: vtkMRMLNode.h:496
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference)
Definition: vtkMRMLNode.h:865
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
Class to hold information about a node reference.
Definition: vtkMRMLNode.h:741
virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) VTK_OVERRIDE
Called when a node reference ID is added (list size increased).
void operator=(const vtkMRMLStorableNode &)
MRML node for representing a node with a transform.