Slicer  5.1
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 
96  virtual void TransformPointToWorld(const double inLocal[3], double outWorld[3]);
97 
100  virtual void TransformPointToWorld(const vtkVector3d &inLocal, vtkVector3d &outWorld);
101 
104  virtual void TransformPointFromWorld(const double inWorld[3], double outLocal[3]);
105 
108  virtual void TransformPointFromWorld(const vtkVector3d &inWorld, vtkVector3d &outLocal);
109 
111  const char *GetTransformNodeID();
112 
115  bool HardenTransform();
116 
117 protected:
119  ~vtkMRMLTransformableNode() override;
121  void operator=(const vtkMRMLTransformableNode&);
122 
123  static const char* TransformNodeReferenceRole;
125 
126  virtual const char* GetTransformNodeReferenceRole();
127  virtual const char* GetTransformNodeReferenceMRMLAttributeName();
128 
131  void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override;
132 
135  void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override;
136 
139  void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override;
140 
142  virtual void OnTransformNodeReferenceChanged(vtkMRMLTransformNode* transformNode);
143 
144 private:
145  char* TransformNodeIDInternal;
146  vtkSetStringMacro(TransformNodeIDInternal);
147  vtkGetStringMacro(TransformNodeIDInternal);
148 
149 };
150 
151 #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:936
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:942
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:930
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Class to hold information about a node reference.
Definition: vtkMRMLNode.h:801
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