VTK  9.7.1
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 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkDataSet;
38 class vtkHyperTreeGrid;
39 class vtkImageData;
43 class vtkPolyData;
44 class vtkRectilinearGrid;
45 class vtkStructuredGrid;
46 
47 class VTKFILTERSGENERAL_EXPORT vtkAxisAlignedReflectionFilter : public vtkCompositeDataSetAlgorithm
48 {
49 public:
51 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
55  enum PlaneAxis
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 
131  vtkMTimeType GetMTime() override;
132 
133 protected:
134  vtkAxisAlignedReflectionFilter() = default;
135  ~vtkAxisAlignedReflectionFilter() override = default;
136 
139  int FillInputPortInformation(int port, vtkInformation* info) override;
140 
146  virtual void ComputeBounds(vtkDataObject* input, double bounds[6]);
147 
148 private:
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 
215 VTK_ABI_NAMESPACE_END
216 #endif
composite dataset to encapsulates a dataset consisting of partitions.
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Reflects the input over an axis-aligned plane.
void SetPlaneModeToZMin()
Determines which plane to reflect across.
Superclass for algorithms that produce only vtkCompositeDataSet as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
void SetPlaneModeToXMax()
Determines which plane to reflect across.
void SetPlaneModeToYMin()
Determines which plane to reflect across.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void SetPlaneModeToYMax()
Determines which plane to reflect across.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual vtkMTimeType GetMTime()
Return this object's modified time.
perform various plane computations
Definition: vtkPlane.h:31
represent and manipulate attribute data in a dataset
structured grid with explicit topology and geometry
void SetPlaneModeToZMax()
Determines which plane to reflect across.
void SetPlaneModeToXMin()
Determines which plane to reflect across.
topologically regular array of data
Composite dataset that organizes datasets into blocks.
static vtkCompositeDataSetAlgorithm * New()
Store zero or more vtkInformation instances.
void SetPlaneModeToPlane()
Determines which plane to reflect across.
general representation of visualization data
Definition: vtkDataObject.h:55
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Composite dataset that groups datasets as a collection.