VTK  9.5.20250615
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;
41class vtkPolyData;
44
45class VTKFILTERSGENERAL_EXPORT vtkAxisAlignedReflectionFilter : public vtkCompositeDataSetAlgorithm
46{
47public:
49
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
54 {
55 X_PLANE = 0,
56 Y_PLANE = 1,
57 Z_PLANE = 2
58 };
59
61 {
62 PLANE = 0,
63 X_MIN = 1,
64 Y_MIN = 2,
65 Z_MIN = 3,
66 X_MAX = 4,
67 Y_MAX = 5,
68 Z_MAX = 6,
69 };
70
72
76 vtkSetSmartPointerMacro(ReflectionPlane, vtkPlane);
77 vtkGetSmartPointerMacro(ReflectionPlane, vtkPlane);
79
81
88 vtkSetClampMacro(PlaneMode, int, 0, 6);
89 vtkGetMacro(PlaneMode, int);
90 void SetPlaneModeToPlane() { this->SetPlaneMode(PLANE); }
91 void SetPlaneModeToXMin() { this->SetPlaneMode(X_MIN); }
92 void SetPlaneModeToYMin() { this->SetPlaneMode(Y_MIN); }
93 void SetPlaneModeToZMin() { this->SetPlaneMode(Z_MIN); }
94 void SetPlaneModeToXMax() { this->SetPlaneMode(X_MAX); }
95 void SetPlaneModeToYMax() { this->SetPlaneMode(Y_MAX); }
96 void SetPlaneModeToZMax() { this->SetPlaneMode(Z_MAX); }
98
100
105 vtkSetMacro(CopyInput, bool);
106 vtkGetMacro(CopyInput, bool);
107 vtkBooleanMacro(CopyInput, bool);
109
111
119 vtkSetMacro(ReflectAllInputArrays, bool);
120 vtkGetMacro(ReflectAllInputArrays, bool);
121 vtkBooleanMacro(ReflectAllInputArrays, bool);
123
130
131protected:
134
137 int FillInputPortInformation(int port, vtkInformation* info) override;
138
144 virtual void ComputeBounds(vtkDataObject* input, double bounds[6]);
145
146private:
148 void operator=(const vtkAxisAlignedReflectionFilter&) = delete;
149
153 void FindAndReflectArrays(vtkDataSet* input, vtkDataSet* output, int mirrorDir[3],
154 int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
155
159 void AddPartitionedDataSet(vtkPartitionedDataSetCollection* outputPDSC, vtkDataObject* dObj,
160 vtkInformation* inputMetadata, int nodeId, bool isParentMultiblock, bool isInputCopy);
161
169 bool ProcessComposite(vtkPartitionedDataSetCollection* outputPDSC, vtkCompositeDataSet* inputCD,
170 double bounds[6], int inputNodeId, int reflectionNodeId);
174 bool ProcessLeaf(
175 vtkDataObject* inputDataObject, vtkDataObject* outputDataObject, double bounds[6]);
176
178
181 void ProcessExplicitStructuredGrid(vtkExplicitStructuredGrid* input,
182 vtkExplicitStructuredGrid* output, double constant[3], int mirrorDir[3],
183 int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
184 void ProcessHtg(vtkHyperTreeGrid* input, vtkHyperTreeGrid* output, int mirrorDir[3],
185 int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
186 void ProcessImageData(vtkImageData* input, vtkImageData* output, double constant[3],
187 int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
188 void ProcessPolyData(vtkPolyData* input, vtkPolyData* output, double constant[3],
189 int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
190 void ProcessRectilinearGrid(vtkRectilinearGrid* input, vtkRectilinearGrid* output,
191 double constant[3], int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
192 void ProcessStructuredGrid(vtkStructuredGrid* input, vtkStructuredGrid* output,
193 double constant[3], int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9]);
195
196 bool CopyInput = true;
197 bool ReflectAllInputArrays = false;
198 int PlaneMode = PLANE;
199 vtkSmartPointer<vtkPlane> ReflectionPlane;
200
201 PlaneAxis PlaneAxisInternal = X_PLANE;
202 double PlaneOriginInternal[3] = { 0.0, 0.0, 0.0 };
203
204 // For naming purposes
205 int InputCount = 0;
206 int ReflectionCount = 0;
207
208 int PartitionIndex = 0;
209};
210
211VTK_ABI_NAMESPACE_END
212#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.
abstract superclass for composite (multi-block or AMR) datasets
general representation of visualization data
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
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 groups datasets as a collection.
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:287