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
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
24class vtkAbstractTransform;
25class vtkImplicitFunction;
26class vtkMatrix4x4;
27
32class VTK_MRML_EXPORT vtkMRMLTransformableNode : public vtkMRMLStorableNode
33{
34public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
39
42 void ReadXMLAttributes( const char** atts) override;
43
46 void WriteXML(ostream& of, int indent) override;
47
50 const char* GetNodeTagName() override = 0;
51
60 bool SetAndObserveTransformNodeID(const char *transformNodeID);
61
65
68 void ProcessMRMLEvents ( vtkObject * /*caller*/,
69 unsigned long /*event*/,
70 void * /*callData*/ ) override;
71
73 enum
74 {
76 };
77
81 virtual bool CanApplyNonLinearTransforms()const;
82
86 virtual void ApplyTransformMatrix(vtkMatrix4x4* transformMatrix);
87
90 virtual void ApplyTransform(vtkAbstractTransform* transform);
91
97 virtual void TransformPointToWorld(const double inLocal[3], double outWorld[3]);
98
101 virtual void TransformPointToWorld(const vtkVector3d &inLocal, vtkVector3d &outWorld);
102
105 virtual void TransformPointFromWorld(const double inWorld[3], double outLocal[3]);
106
109 virtual void TransformPointFromWorld(const vtkVector3d &inWorld, vtkVector3d &outLocal);
110
112 const char *GetTransformNodeID();
113
117
123 virtual vtkImplicitFunction* GetImplicitFunctionWorld() { return nullptr; };
124
125protected:
130
131 static const char* TransformNodeReferenceRole;
133
134 virtual const char* GetTransformNodeReferenceRole();
136
140
144
148
151
152private:
153 char* TransformNodeIDInternal;
154 vtkSetStringMacro(TransformNodeIDInternal);
155 vtkGetStringMacro(TransformNodeIDInternal);
156
157};
158
159#endif
Class to hold information about a node reference.
MRML node for representing a transformation between this node space and a parent node space.
bool SetAndObserveTransformNodeID(const char *transformNodeID)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
virtual const char * GetTransformNodeReferenceMRMLAttributeName()
~vtkMRMLTransformableNode() override
static const char * TransformNodeReferenceRole
virtual void TransformPointToWorld(const vtkVector3d &inLocal, vtkVector3d &outWorld)
static const char * TransformNodeReferenceMRMLAttributeName
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override
Called after a node reference ID is removed (list size decreased).
void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override
Called when a node reference ID is modified.
virtual const char * GetTransformNodeReferenceRole()
virtual bool CanApplyNonLinearTransforms() const
virtual void TransformPointToWorld(const double inLocal[3], double outWorld[3])
virtual void ApplyTransformMatrix(vtkMatrix4x4 *transformMatrix)
const char * GetTransformNodeID()
Get referenced transform node id.
virtual void OnTransformNodeReferenceChanged(vtkMRMLTransformNode *transformNode)
Called when transform node reference added/modified/removed.
vtkMRMLTransformableNode(const vtkMRMLTransformableNode &)
void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override
Called when a node reference ID is added (list size increased).
virtual void TransformPointFromWorld(const double inWorld[3], double outLocal[3])
void operator=(const vtkMRMLTransformableNode &)
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Transform nodes
virtual void ApplyTransform(vtkAbstractTransform *transform)
const char * GetNodeTagName() override=0
Get node XML tag name (like Volume, Model)
virtual vtkImplicitFunction * GetImplicitFunctionWorld()
virtual void TransformPointFromWorld(const vtkVector3d &inWorld, vtkVector3d &outLocal)
vtkMRMLTransformNode * GetParentTransformNode()
Associated transform MRML node.
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.