VTK  9.2.6
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 =========================================================================*/
44 #ifndef vtkLandmarkTransform_h
45 #define vtkLandmarkTransform_h
46 
47 #include "vtkCommonTransformsModule.h" // For export macro
48 #include "vtkLinearTransform.h"
49 
50 #define VTK_LANDMARK_RIGIDBODY 6
51 #define VTK_LANDMARK_SIMILARITY 7
52 #define VTK_LANDMARK_AFFINE 12
53 
54 class VTKCOMMONTRANSFORMS_EXPORT vtkLandmarkTransform : public vtkLinearTransform
55 {
56 public:
58 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
70  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
71  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
73 
75 
84  vtkSetMacro(Mode, int);
85  void SetModeToRigidBody() { this->SetMode(VTK_LANDMARK_RIGIDBODY); }
86  void SetModeToSimilarity() { this->SetMode(VTK_LANDMARK_SIMILARITY); }
87  void SetModeToAffine() { this->SetMode(VTK_LANDMARK_AFFINE); }
89 
91 
94  vtkGetMacro(Mode, int);
95  const char* GetModeAsString();
97 
102  void Inverse() override;
103 
107  vtkMTimeType GetMTime() override;
108 
113 
114 protected:
117 
118  // Update the matrix from the quaternion.
119  void InternalUpdate() override;
120 
124  void InternalDeepCopy(vtkAbstractTransform* transform) override;
125 
128 
129  int Mode;
130 
131 private:
133  void operator=(const vtkLandmarkTransform&) = delete;
134 };
135 
137 {
138  switch (this->Mode)
139  {
141  return "RigidBody";
143  return "Similarity";
144  case VTK_LANDMARK_AFFINE:
145  return "Affine";
146  default:
147  return "Unrecognized";
148  }
149 }
150 
151 #endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:49
a linear transform specified by two corresponding point sets
void SetModeToAffine()
Set the number of degrees of freedom to constrain the solution to.
void InternalDeepCopy(vtkAbstractTransform *transform) override
This method does no type checking, use DeepCopy instead.
void InternalUpdate() override
Perform any subclass-specific Update.
void SetTargetLandmarks(vtkPoints *target)
Specify the source and target landmark sets.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetModeAsString()
Get the current transformation mode.
void SetSourceLandmarks(vtkPoints *source)
Specify the source and target landmark sets.
void Inverse() override
Invert the transformation.
~vtkLandmarkTransform() override
void SetModeToRigidBody()
Set the number of degrees of freedom to constrain the solution to.
void SetModeToSimilarity()
Set the number of degrees of freedom to constrain the solution to.
vtkAbstractTransform * MakeTransform() override
Make another transform of the same type.
vtkMTimeType GetMTime() override
Get the MTime.
static vtkLandmarkTransform * New()
abstract superclass for linear transformations
represent and manipulate 3D points
Definition: vtkPoints.h:49
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_LANDMARK_AFFINE
#define VTK_LANDMARK_SIMILARITY
#define VTK_LANDMARK_RIGIDBODY
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287