VTK  9.5.20251102
vtkAxisAlignedReflectionFilter.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
26#ifndef vtkAxisAlignedReflectionFilter_h
27#define vtkAxisAlignedReflectionFilter_h
28
30#include "vtkFiltersGeneralModule.h" // for export macro
31#include "vtkPlane.h" // for vtkPlane class
32#include "vtkSmartPointer.h" // for smart pointer
33
34VTK_ABI_NAMESPACE_BEGIN
35class vtkDataSet;
39class vtkImageData;
43class vtkPolyData;
46
47class VTKFILTERSGENERAL_EXPORT vtkAxisAlignedReflectionFilter : public vtkCompositeDataSetAlgorithm
48{
49public:
51
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56 {
57 X_PLANE = 0,
58 Y_PLANE = 1,
59 Z_PLANE = 2
60 };
61
63 {
64 PLANE = 0,
65 X_MIN = 1,
66 Y_MIN = 2,
67 Z_MIN = 3,
68 X_MAX = 4,
69 Y_MAX = 5,
70 Z_MAX = 6,
71 };
72
74
78 vtkSetSmartPointerMacro(ReflectionPlane, vtkPlane);
79 vtkGetSmartPointerMacro(ReflectionPlane, vtkPlane);
81
83
90 vtkSetClampMacro(PlaneMode, int, 0, 6);
91 vtkGetMacro(PlaneMode, int);
92 void SetPlaneModeToPlane() { this->SetPlaneMode(PLANE); }
93 void SetPlaneModeToXMin() { this->SetPlaneMode(X_MIN); }
94 void SetPlaneModeToYMin() { this->SetPlaneMode(Y_MIN); }
95 void SetPlaneModeToZMin() { this->SetPlaneMode(Z_MIN); }
96 void SetPlaneModeToXMax() { this->SetPlaneMode(X_MAX); }
97 void SetPlaneModeToYMax() { this->SetPlaneMode(Y_MAX); }
98 void SetPlaneModeToZMax() { this->SetPlaneMode(Z_MAX); }
100
102
107 vtkSetMacro(CopyInput, bool);
108 vtkGetMacro(CopyInput, bool);
109 vtkBooleanMacro(CopyInput, bool);
111
113
121 vtkSetMacro(ReflectAllInputArrays, bool);
122 vtkGetMacro(ReflectAllInputArrays, bool);
123 vtkBooleanMacro(ReflectAllInputArrays, bool);
125
132
133protected:
136
139 int FillInputPortInformation(int port, vtkInformation* info) override;
140
146 virtual void ComputeBounds(vtkDataObject* input, double bounds[6]);
147
148private:
150 void operator=(const vtkAxisAlignedReflectionFilter&) = delete;
151
155 void FindAndReflectArrays(vtkDataSet* input, vtkDataSet* output, int mirrorDir[3],
156 int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
157
161 bool ProcessPDC(vtkPartitionedDataSetCollection* inputPDC,
162 vtkPartitionedDataSetCollection* outputPDC, double bounds[6]);
163
167 bool ProcessMB(
168 vtkMultiBlockDataSet* inputMB, vtkPartitionedDataSetCollection* outputMB, double bounds[6]);
169
173 bool ProcessPDS(
174 vtkPartitionedDataSet* inputPDS, vtkPartitionedDataSetCollection* outputPDC, double bounds[6]);
175
179 bool ProcessDO(
180 vtkDataObject* inputDObj, vtkPartitionedDataSetCollection* outputPDC, double bounds[6]);
181
185 bool ProcessLeaf(vtkDataObject* inputDO, vtkDataObject* outputDO, double bounds[6]);
186
188
191 void ProcessExplicitStructuredGrid(vtkExplicitStructuredGrid* input,
192 vtkExplicitStructuredGrid* output, double constant[3], int mirrorDir[3],
193 int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
194 void ProcessHtg(vtkHyperTreeGrid* input, vtkHyperTreeGrid* output, int mirrorDir[3],
195 int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
196 void ProcessImageData(vtkImageData* input, vtkImageData* output, double constant[3],
197 int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
198 void ProcessPolyData(vtkPolyData* input, vtkPolyData* output, double constant[3],
199 int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
200 void ProcessRectilinearGrid(vtkRectilinearGrid* input, vtkRectilinearGrid* output,
201 double constant[3], int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
202 void ProcessStructuredGrid(vtkStructuredGrid* input, vtkStructuredGrid* output,
203 double constant[3], int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
205
206 bool CopyInput = true;
207 bool ReflectAllInputArrays = false;
208 int PlaneMode = PLANE;
209 vtkSmartPointer<vtkPlane> ReflectionPlane;
210
211 PlaneAxis PlaneAxisInternal = X_PLANE;
212 double PlaneOriginInternal[3] = { 0.0, 0.0, 0.0 };
213};
214
215VTK_ABI_NAMESPACE_END
216#endif
Reflects the input over an axis-aligned plane.
void SetPlaneModeToZMax()
Determines which plane to reflect across.
void SetPlaneModeToZMin()
Determines which plane to reflect across.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetPlaneModeToXMin()
Determines which plane to reflect across.
void SetPlaneModeToPlane()
Determines which plane to reflect across.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMTimeType GetMTime() override
Get the last modified time of this filter.
void SetPlaneModeToYMax()
Determines which plane to reflect across.
void SetPlaneModeToXMax()
Determines which plane to reflect across.
static vtkAxisAlignedReflectionFilter * New()
void SetPlaneModeToYMin()
Determines which plane to reflect across.
virtual void ComputeBounds(vtkDataObject *input, double bounds[6])
Compute the bounds of the input data object.
~vtkAxisAlignedReflectionFilter() override=default
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
Superclass for algorithms that produce only vtkCompositeDataSet as output.
general representation of visualization data
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
structured grid with explicit topology and geometry
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
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.
Composite dataset that organizes datasets into blocks.
Composite dataset that groups datasets as a collection.
composite dataset to encapsulates a dataset consisting of partitions.
perform various plane computations
Definition vtkPlane.h:141
concrete dataset represents vertices, lines, polygons, and triangle strips
a dataset that is topologically regular with variable spacing in the three coordinate directions
Hold a reference to a vtkObjectBase instance.
topologically regular array of data
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322