VTK
vtkLandmarkTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLandmarkTransform.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkLandmarkTransform_h
33 #define vtkLandmarkTransform_h
34 
35 #include "vtkCommonTransformsModule.h" // For export macro
36 #include "vtkLinearTransform.h"
37 
38 #define VTK_LANDMARK_RIGIDBODY 6
39 #define VTK_LANDMARK_SIMILARITY 7
40 #define VTK_LANDMARK_AFFINE 12
41 
42 class VTKCOMMONTRANSFORMS_EXPORT vtkLandmarkTransform : public vtkLinearTransform
43 {
44 public:
45  static vtkLandmarkTransform* New();
46 
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
56  void SetSourceLandmarks(vtkPoints* points);
57  void SetTargetLandmarks(vtkPoints* points);
58  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
59  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
61 
63 
72  vtkSetMacro(Mode, int);
73  void SetModeToRigidBody() { this->SetMode(VTK_LANDMARK_RIGIDBODY); }
74  void SetModeToSimilarity() { this->SetMode(VTK_LANDMARK_SIMILARITY); }
75  void SetModeToAffine() { this->SetMode(VTK_LANDMARK_AFFINE); }
77 
79 
82  vtkGetMacro(Mode, int);
83  const char* GetModeAsString();
85 
90  void Inverse() override;
91 
95  vtkMTimeType GetMTime() override;
96 
101 
102 protected:
104  ~vtkLandmarkTransform() override;
105 
106  // Update the matrix from the quaternion.
107  void InternalUpdate() override;
108 
112  void InternalDeepCopy(vtkAbstractTransform* transform) override;
113 
116 
117  int Mode;
118 
119 private:
121  void operator=(const vtkLandmarkTransform&) = delete;
122 };
123 
125 {
126  switch (this->Mode)
127  {
129  return "RigidBody";
131  return "Similarity";
132  case VTK_LANDMARK_AFFINE:
133  return "Affine";
134  default:
135  return "Unrecognized";
136  }
137 }
138 
139 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkLinearTransform.h
vtkHomogeneousTransform::InternalDeepCopy
void InternalDeepCopy(vtkAbstractTransform *transform) override
Perform any subclass-specific DeepCopy.
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:50
vtkLandmarkTransform::SetModeToSimilarity
void SetModeToSimilarity()
Definition: vtkLandmarkTransform.h:74
vtkAbstractTransform::Inverse
virtual void Inverse()=0
Invert the transformation.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkAbstractTransform::InternalUpdate
virtual void InternalUpdate()
Perform any subclass-specific Update.
Definition: vtkAbstractTransform.h:317
vtkLinearTransform::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLandmarkTransform::GetModeAsString
const char * GetModeAsString()
Definition: vtkLandmarkTransform.h:124
vtkLinearTransform
abstract superclass for linear transformations
Definition: vtkLinearTransform.h:31
vtkX3D::points
Definition: vtkX3D.h:452
VTK_LANDMARK_AFFINE
#define VTK_LANDMARK_AFFINE
Definition: vtkLandmarkTransform.h:40
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAbstractTransform::GetMTime
vtkMTimeType GetMTime() override
Override GetMTime necessary because of inverse transforms.
VTK_LANDMARK_RIGIDBODY
#define VTK_LANDMARK_RIGIDBODY
Definition: vtkLandmarkTransform.h:38
VTK_LANDMARK_SIMILARITY
#define VTK_LANDMARK_SIMILARITY
Definition: vtkLandmarkTransform.h:39
vtkLandmarkTransform::SetModeToRigidBody
void SetModeToRigidBody()
Definition: vtkLandmarkTransform.h:73
vtkLandmarkTransform::Mode
int Mode
Definition: vtkLandmarkTransform.h:117
vtkLandmarkTransform::SetModeToAffine
void SetModeToAffine()
Definition: vtkLandmarkTransform.h:75
vtkLandmarkTransform::TargetLandmarks
vtkPoints * TargetLandmarks
Definition: vtkLandmarkTransform.h:115
vtkLandmarkTransform::SourceLandmarks
vtkPoints * SourceLandmarks
Definition: vtkLandmarkTransform.h:114
vtkAbstractTransform::MakeTransform
virtual vtkAbstractTransform * MakeTransform()=0
Make another transform of the same type.
vtkLandmarkTransform
a linear transform specified by two corresponding point sets
Definition: vtkLandmarkTransform.h:42
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:298