VTK  9.3.0
vtkLandmarkTransform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
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 VTK_ABI_NAMESPACE_BEGIN
43 class VTKCOMMONTRANSFORMS_EXPORT vtkLandmarkTransform : public vtkLinearTransform
44 {
45 public:
47 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
59  vtkGetObjectMacro(SourceLandmarks, vtkPoints);
60  vtkGetObjectMacro(TargetLandmarks, vtkPoints);
62 
64 
73  vtkSetMacro(Mode, int);
74  void SetModeToRigidBody() { this->SetMode(VTK_LANDMARK_RIGIDBODY); }
75  void SetModeToSimilarity() { this->SetMode(VTK_LANDMARK_SIMILARITY); }
76  void SetModeToAffine() { this->SetMode(VTK_LANDMARK_AFFINE); }
78 
80 
83  vtkGetMacro(Mode, int);
84  const char* GetModeAsString();
86 
91  void Inverse() override;
92 
96  vtkMTimeType GetMTime() override;
97 
102 
103 protected:
106 
107  // Update the matrix from the quaternion.
108  void InternalUpdate() override;
109 
113  void InternalDeepCopy(vtkAbstractTransform* transform) override;
114 
117 
118  int Mode;
119 
120 private:
122  void operator=(const vtkLandmarkTransform&) = delete;
123 };
124 
126 {
127  switch (this->Mode)
128  {
130  return "RigidBody";
132  return "Similarity";
133  case VTK_LANDMARK_AFFINE:
134  return "Affine";
135  default:
136  return "Unrecognized";
137  }
138 }
139 
140 VTK_ABI_NAMESPACE_END
141 #endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:38
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:38
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:270