VTK: Common/Transforms/vtkLinearTransform.h Source File

| VTK 9.3.1

vtkLinearTransform.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
33 #ifndef vtkLinearTransform_h
34 #define vtkLinearTransform_h
35
36 #include "vtkCommonTransformsModule.h" // For export macro
37 #include "vtkHomogeneousTransform.h"
38
39 VTK_ABI_NAMESPACE_BEGIN
40 class VTKCOMMONTRANSFORMS_EXPORT vtkLinearTransform : public vtkHomogeneousTransform
41 {
42 public:
43 vtkTypeMacro(vtkLinearTransform, vtkHomogeneousTransform);
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
50 void TransformNormal(const float in[3], float out[3])
51 {
52 this->Update();
53 this->InternalTransformNormal(in, out);
54 }
55
60 void TransformNormal(const double in[3], double out[3])
61 {
62 this->Update();
63 this->InternalTransformNormal(in, out);
64 }
65
70 double* TransformNormal(double x, double y, double z) VTK_SIZEHINT(3)
71 {
72 return this->TransformDoubleNormal(x, y, z);
73 }
74 double* TransformNormal(const double normal[3]) VTK_SIZEHINT(3)
75 {
76 return this->TransformDoubleNormal(normal[0], normal[1], normal[2]);
77 }
78
80
84 float* TransformFloatNormal(float x, float y, float z) VTK_SIZEHINT(3)
85 {
86 this->InternalFloatPoint[0] = x;
87 this->InternalFloatPoint[1] = y;
88 this->InternalFloatPoint[2] = z;
89 this->TransformNormal(this->InternalFloatPoint, this->InternalFloatPoint);
90 return this->InternalFloatPoint;
91 }
92 float* TransformFloatNormal(const float normal[3]) VTK_SIZEHINT(3)
93 {
94 return this->TransformFloatNormal(normal[0], normal[1], normal[2]);
95 }
97
99
103 double* TransformDoubleNormal(double x, double y, double z) VTK_SIZEHINT(3)
104 {
105 this->InternalDoublePoint[0] = x;
106 this->InternalDoublePoint[1] = y;
107 this->InternalDoublePoint[2] = z;
108 this->TransformNormal(this->InternalDoublePoint, this->InternalDoublePoint);
109 return this->InternalDoublePoint;
110 }
111 double* TransformDoubleNormal(const double normal[3]) VTK_SIZEHINT(3)
112 {
113 return this->TransformDoubleNormal(normal[0], normal[1], normal[2]);
114 }
116
121 double* TransformVector(double x, double y, double z) VTK_SIZEHINT(3)
122 {
123 return this->TransformDoubleVector(x, y, z);
124 }
125 double* TransformVector(const double normal[3]) VTK_SIZEHINT(3)
126 {
127 return this->TransformDoubleVector(normal[0], normal[1], normal[2]);
128 }
129
134 void TransformVector(const float in[3], float out[3])
135 {
136 this->Update();
137 this->InternalTransformVector(in, out);
138 }
139
144 void TransformVector(const double in[3], double out[3])
145 {
146 this->Update();
147 this->InternalTransformVector(in, out);
148 }
149
151
155 float* TransformFloatVector(float x, float y, float z) VTK_SIZEHINT(3)
156 {
157 this->InternalFloatPoint[0] = x;
158 this->InternalFloatPoint[1] = y;
159 this->InternalFloatPoint[2] = z;
160 this->TransformVector(this->InternalFloatPoint, this->InternalFloatPoint);
161 return this->InternalFloatPoint;
162 }
163 float* TransformFloatVector(const float vec[3]) VTK_SIZEHINT(3)
164 {
165 return this->TransformFloatVector(vec[0], vec[1], vec[2]);
166 }
168
170
174 double* TransformDoubleVector(double x, double y, double z) VTK_SIZEHINT(3)
175 {
176 this->InternalDoublePoint[0] = x;
177 this->InternalDoublePoint[1] = y;
178 this->InternalDoublePoint[2] = z;
179 this->TransformVector(this->InternalDoublePoint, this->InternalDoublePoint);
180 return this->InternalDoublePoint;
181 }
182 double* TransformDoubleVector(const double vec[3]) VTK_SIZEHINT(3)
183 {
184 return this->TransformDoubleVector(vec[0], vec[1], vec[2]);
185 }
187
192 void TransformPoints(vtkPoints* inPts, vtkPoints* outPts) override;
193
198 virtual void TransformNormals(vtkDataArray* inNms, vtkDataArray* outNms);
199
204 virtual void TransformVectors(vtkDataArray* inVrs, vtkDataArray* outVrs);
205
210 void TransformPointsNormalsVectors(vtkPoints* inPts, vtkPoints* outPts, vtkDataArray* inNms,
211 vtkDataArray* outNms, vtkDataArray* inVrs, vtkDataArray* outVrs, int nOptionalVectors = 0,
212 vtkDataArray** inVrsArr = nullptr, vtkDataArray** outVrsArr = nullptr) override;
213
218 vtkLinearTransform* GetLinearInverse()
219 {
220 return static_cast<vtkLinearTransform*>(this->GetInverse());
221 }
222
224
228 void InternalTransformPoint(const float in[3], float out[3]) override;
229 void InternalTransformPoint(const double in[3], double out[3]) override;
231
233
237 virtual void InternalTransformNormal(const float in[3], float out[3]);
238 virtual void InternalTransformNormal(const double in[3], double out[3]);
240
242
246 virtual void InternalTransformVector(const float in[3], float out[3]);
247 virtual void InternalTransformVector(const double in[3], double out[3]);
249
251
256 void InternalTransformDerivative(
257 const float in[3], float out[3], float derivative[3][3]) override;
258 void InternalTransformDerivative(
259 const double in[3], double out[3], double derivative[3][3]) override;
261
262 protected:
263 vtkLinearTransform() = default;
264 ~vtkLinearTransform() override = default;
265
266 private:
267 vtkLinearTransform(const vtkLinearTransform&) = delete;
268 void operator=(const vtkLinearTransform&) = delete;
269 };
270
271 VTK_ABI_NAMESPACE_END
272 #endif
vtkAbstractTransform::InternalFloatPoint
float InternalFloatPoint[3]
Definition: vtkAbstractTransform.h:312
vtkAbstractTransform::Update
void Update()
Update the transform to account for any changes which have been made.
vtkAbstractTransform::GetInverse
vtkAbstractTransform * GetInverse()
Get the inverse of this transform.
vtkAbstractTransform::InternalDoublePoint
double InternalDoublePoint[3]
Definition: vtkAbstractTransform.h:313
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkHomogeneousTransform
superclass for homogeneous transformations
Definition: vtkHomogeneousTransform.h:24
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkLinearTransform
abstract superclass for linear transformations
Definition: vtkLinearTransform.h:41
vtkLinearTransform::TransformVectors
virtual void TransformVectors(vtkDataArray *inVrs, vtkDataArray *outVrs)
Apply the transformation to a series of vectors, and append the results to outVrs.
vtkLinearTransform::TransformNormals
virtual void TransformNormals(vtkDataArray *inNms, vtkDataArray *outNms)
Apply the transformation to a series of normals, and append the results to outNms.
vtkLinearTransform::InternalTransformVector
virtual void InternalTransformVector(const float in[3], float out[3])
This will calculate the transformation without calling Update.
vtkLinearTransform::InternalTransformPoint
void InternalTransformPoint(const float in[3], float out[3]) override
This will calculate the transformation without calling Update.
vtkLinearTransform::TransformNormal
double * TransformNormal(double x, double y, double z)
Synonymous with TransformDoubleNormal(x,y,z).
Definition: vtkLinearTransform.h:70
vtkLinearTransform::TransformDoubleVector
double * TransformDoubleVector(double x, double y, double z)
Apply the transformation to a double-precision (x,y,z) vector.
Definition: vtkLinearTransform.h:174
vtkLinearTransform::InternalTransformDerivative
void InternalTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override
This will calculate the transformation as well as its derivative without calling Update.
vtkLinearTransform::TransformPoints
void TransformPoints(vtkPoints *inPts, vtkPoints *outPts) override
Apply the transformation to a series of points, and append the results to outPts.
vtkLinearTransform::TransformFloatNormal
float * TransformFloatNormal(float x, float y, float z)
Apply the transformation to an (x,y,z) normal.
Definition: vtkLinearTransform.h:84
vtkLinearTransform::InternalTransformPoint
void InternalTransformPoint(const double in[3], double out[3]) override
This will calculate the transformation without calling Update.
vtkLinearTransform::TransformDoubleVector
double * TransformDoubleVector(const double vec[3])
Apply the transformation to a double-precision (x,y,z) vector.
Definition: vtkLinearTransform.h:182
vtkLinearTransform::InternalTransformNormal
virtual void InternalTransformNormal(const float in[3], float out[3])
This will calculate the transformation without calling Update.
vtkLinearTransform::InternalTransformVector
virtual void InternalTransformVector(const double in[3], double out[3])
This will calculate the transformation without calling Update.
vtkLinearTransform::vtkLinearTransform
vtkLinearTransform()=default
vtkLinearTransform::InternalTransformNormal
virtual void InternalTransformNormal(const double in[3], double out[3])
This will calculate the transformation without calling Update.
vtkLinearTransform::TransformVector
double * TransformVector(double x, double y, double z)
Synonymous with TransformDoubleVector(x,y,z).
Definition: vtkLinearTransform.h:121
vtkLinearTransform::TransformFloatNormal
float * TransformFloatNormal(const float normal[3])
Apply the transformation to an (x,y,z) normal.
Definition: vtkLinearTransform.h:92
vtkLinearTransform::~vtkLinearTransform
~vtkLinearTransform() override=default
vtkLinearTransform::TransformPointsNormalsVectors
void TransformPointsNormalsVectors(vtkPoints *inPts, vtkPoints *outPts, vtkDataArray *inNms, vtkDataArray *outNms, vtkDataArray *inVrs, vtkDataArray *outVrs, int nOptionalVectors=0, vtkDataArray **inVrsArr=nullptr, vtkDataArray **outVrsArr=nullptr) override
Apply the transformation to a combination of points, normals and vectors.
vtkLinearTransform::GetLinearInverse
vtkLinearTransform * GetLinearInverse()
Just like GetInverse, but it includes a typecast to vtkLinearTransform.
Definition: vtkLinearTransform.h:218
vtkLinearTransform::TransformFloatVector
float * TransformFloatVector(const float vec[3])
Apply the transformation to an (x,y,z) vector.
Definition: vtkLinearTransform.h:163
vtkLinearTransform::TransformVector
void TransformVector(const float in[3], float out[3])
Apply the transformation to a vector.
Definition: vtkLinearTransform.h:134
vtkLinearTransform::TransformNormal
void TransformNormal(const float in[3], float out[3])
Apply the transformation to a normal.
Definition: vtkLinearTransform.h:50
vtkLinearTransform::TransformVector
void TransformVector(const double in[3], double out[3])
Apply the transformation to a double-precision vector.
Definition: vtkLinearTransform.h:144
vtkLinearTransform::TransformFloatVector
float * TransformFloatVector(float x, float y, float z)
Apply the transformation to an (x,y,z) vector.
Definition: vtkLinearTransform.h:155
vtkLinearTransform::TransformDoubleNormal
double * TransformDoubleNormal(const double normal[3])
Apply the transformation to a double-precision (x,y,z) normal.
Definition: vtkLinearTransform.h:111
vtkLinearTransform::TransformNormal
double * TransformNormal(const double normal[3])
Definition: vtkLinearTransform.h:74
vtkLinearTransform::InternalTransformDerivative
void InternalTransformDerivative(const double in[3], double out[3], double derivative[3][3]) override
This will calculate the transformation as well as its derivative without calling Update.
vtkLinearTransform::TransformVector
double * TransformVector(const double normal[3])
Definition: vtkLinearTransform.h:125
vtkLinearTransform::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLinearTransform::TransformNormal
void TransformNormal(const double in[3], double out[3])
Apply the transformation to a double-precision normal.
Definition: vtkLinearTransform.h:60
vtkLinearTransform::TransformDoubleNormal
double * TransformDoubleNormal(double x, double y, double z)
Apply the transformation to a double-precision (x,y,z) normal.
Definition: vtkLinearTransform.h:103
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkHomogeneousTransform.h
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:36