VTK  9.5.20250718
vtkAxisAlignedTransformFilter.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
16#ifndef vtkAxisAlignedTransformFilter_h
17#define vtkAxisAlignedTransformFilter_h
18
20
21#include "vtkFiltersGeneralModule.h" // for export macro
22
23VTK_ABI_NAMESPACE_BEGIN
24class vtkHyperTree;
27class vtkTransform;
28class vtkImageData;
30
31class VTKFILTERSGENERAL_EXPORT vtkAxisAlignedTransformFilter : public vtkDataObjectAlgorithm
32{
33public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
37
41 enum Axis : int
42 {
43 X = 0,
44 Y = 1,
45 Z = 2
46 };
47
51 enum Angle : int
52 {
53 ROT0 = 0,
54 ROT90 = 1,
55 ROT180 = 2,
56 ROT270 = 3
57 };
58
60
63 vtkSetVector3Macro(Translation, double);
64 vtkGetVectorMacro(Translation, double, 3);
66
68
71 vtkSetVector3Macro(Scale, double);
72 vtkGetVectorMacro(Scale, double, 3);
74
76
81 vtkSetClampMacro(RotationAngle, int, ROT0, ROT270);
82 vtkGetMacro(RotationAngle, int);
84
86
90 vtkSetClampMacro(RotationAxis, int, X, Z);
91 vtkGetMacro(RotationAxis, unsigned int);
93
94protected:
96 ~vtkAxisAlignedTransformFilter() override = default;
97
102 vtkInformationVector* outputVector) override;
103
108 vtkInformationVector* outputVector) override;
109
111 vtkInformationVector* outputVector) override;
112 int FillInputPortInformation(int port, vtkInformation* info) override;
113
114private:
116 void operator=(const vtkAxisAlignedTransformFilter&) = delete;
117
119
122 bool ProcessGeneric(vtkDataObject* inputDataObject, vtkDataObject* outputDataObject);
123 bool ProcessHTG(vtkHyperTreeGrid* inputHTG, vtkHyperTreeGrid* outputHTG, int R[3][3]);
124 bool ProcessImageData(vtkImageData* inputID, vtkImageData* outputID, int R[3][3]);
125 bool ProcessRectilinearGrid(
126 vtkRectilinearGrid* inputRG, vtkRectilinearGrid* outputRG, int R[3][3]);
128
132 bool Dispatch(vtkDataObject* inputDataObject, vtkDataObject* outputDataObject);
133
138 void GetRotationMatrix(int axis, int rotation, int R[3][3]);
139
143 int GetRotatedId(int id, int R[3][3], int newDims[3], int dims[3], int Tvec[3], bool transposed);
144
148 void GetTransform(vtkTransform* transform);
149
154 void ComputeCellScale(vtkDataArray* xCoords, vtkDataArray* yCoords, vtkDataArray* zCoords,
155 int dims[3], double scales[3]);
156
161 void ApplyCellScale(vtkHyperTreeGridNonOrientedCursor* cursor, double scales[3]);
162
167 vtkAxisAlignedTransformFilter::Axis FindNormalAxis(int dims[3]);
168
173 std::vector<unsigned int> ComputePermutation(
174 unsigned int branchFactor, int axis, int normalAxis, int rotation, int dimension);
175
180 void CopyAndRotate(vtkHyperTree* input, vtkHyperTree* output, vtkIdType inputIndex,
181 vtkIdType outputIndex, const std::vector<unsigned int>& permutation, unsigned int depth,
183
188 vtkHyperTree* CreateNewRotatedHyperTree(
189 vtkHyperTreeGrid* htg, vtkHyperTree* dest, const std::vector<unsigned int>& permutation);
190
191 // Transformation parameters
192 double Translation[3] = { 0.0, 0.0, 0.0 };
193 double Scale[3] = { 1.0, 1.0, 1.0 };
194 int RotationAngle = Angle::ROT0;
195 int RotationAxis = Axis::X;
196};
197
198VTK_ABI_NAMESPACE_END
199#endif
Applies an axis-aligned affine transformation (translation, scaling, and rotation)
Axis
Enumeration for specifying the rotation axis.
static vtkAxisAlignedTransformFilter * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkAxisAlignedTransformFilter() override=default
Angle
Enumeration for specifying the rotation angle.
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This creates an output that matches the type of the input data.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is required to capture REQUEST_DATA_OBJECT requests.
abstract superclass for arrays of numeric data
Superclass for algorithms that produce only data object as output.
general representation of visualization data
Objects for traversal a HyperTreeGrid.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
A data object structured as a tree.
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
a dataset that is topologically regular with variable spacing in the three coordinate directions
describes linear transformations via a 4x4 matrix
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:332