VTK: Filters/General/vtkReflectionFilter.h Source File

| VTK 9.3.1

vtkReflectionFilter.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
25 #ifndef vtkReflectionFilter_h
26 #define vtkReflectionFilter_h
27
28 #include "vtkDataObjectAlgorithm.h"
29 #include "vtkFiltersGeneralModule.h" // For export macro
30
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkUnstructuredGrid;
33 class vtkDataSet;
34
35 class VTKFILTERSGENERAL_EXPORT vtkReflectionFilter : public vtkDataObjectAlgorithm
36 {
37 public:
38 static vtkReflectionFilter* New();
39
40 vtkTypeMacro(vtkReflectionFilter, vtkDataObjectAlgorithm);
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
43 enum ReflectionPlane
44 {
45 USE_X_MIN = 0,
46 USE_Y_MIN = 1,
47 USE_Z_MIN = 2,
48 USE_X_MAX = 3,
49 USE_Y_MAX = 4,
50 USE_Z_MAX = 5,
51 USE_X = 6,
52 USE_Y = 7,
53 USE_Z = 8
54 };
55
57
60 vtkSetClampMacro(Plane, int, 0, 8);
61 vtkGetMacro(Plane, int);
62 void SetPlaneToX() { this->SetPlane(USE_X); }
63 void SetPlaneToY() { this->SetPlane(USE_Y); }
64 void SetPlaneToZ() { this->SetPlane(USE_Z); }
65 void SetPlaneToXMin() { this->SetPlane(USE_X_MIN); }
66 void SetPlaneToYMin() { this->SetPlane(USE_Y_MIN); }
67 void SetPlaneToZMin() { this->SetPlane(USE_Z_MIN); }
68 void SetPlaneToXMax() { this->SetPlane(USE_X_MAX); }
69 void SetPlaneToYMax() { this->SetPlane(USE_Y_MAX); }
70 void SetPlaneToZMax() { this->SetPlane(USE_Z_MAX); }
72
74
78 vtkSetMacro(Center, double);
79 vtkGetMacro(Center, double);
81
83
87 vtkSetMacro(CopyInput, vtkTypeBool);
88 vtkGetMacro(CopyInput, vtkTypeBool);
89 vtkBooleanMacro(CopyInput, vtkTypeBool);
91
93
100 vtkSetMacro(FlipAllInputArrays, bool);
101 vtkGetMacro(FlipAllInputArrays, bool);
102 vtkBooleanMacro(FlipAllInputArrays, bool);
104
105 protected:
106 vtkReflectionFilter();
107 ~vtkReflectionFilter() override;
108
114 int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
115
119 virtual int RequestDataInternal(vtkDataSet* input, vtkUnstructuredGrid* output, double bounds[6]);
120
124 virtual int ComputeBounds(vtkDataObject* input, double bounds[6]);
125
129 virtual vtkIdType ReflectNon3DCell(
130 vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdType numInputPoints);
131
132 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
133 int FillInputPortInformation(int port, vtkInformation* info) override;
134
135 void FlipTuple(double* tuple, int* mirrorDir, int nComp);
136
137 int Plane;
138 double Center;
139 vtkTypeBool CopyInput;
140 bool FlipAllInputArrays;
141
142 private:
143 vtkReflectionFilter(const vtkReflectionFilter&) = delete;
144 void operator=(const vtkReflectionFilter&) = delete;
145 };
146
147 VTK_ABI_NAMESPACE_END
148 #endif
vtkDataObjectAlgorithm
Superclass for algorithms that produce only data object as output.
Definition: vtkDataObjectAlgorithm.h:33
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkReflectionFilter
reflects a data set across a plane
Definition: vtkReflectionFilter.h:36
vtkReflectionFilter::Plane
int Plane
Definition: vtkReflectionFilter.h:137
vtkReflectionFilter::New
static vtkReflectionFilter * New()
vtkReflectionFilter::ReflectNon3DCell
virtual vtkIdType ReflectNon3DCell(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numInputPoints)
Generate new, non-3D cell and return the generated cells id.
vtkReflectionFilter::ReflectionPlane
ReflectionPlane
Definition: vtkReflectionFilter.h:44
vtkReflectionFilter::SetPlaneToY
void SetPlaneToY()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:63
vtkReflectionFilter::SetPlaneToZMin
void SetPlaneToZMin()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:67
vtkReflectionFilter::RequestDataInternal
virtual int RequestDataInternal(vtkDataSet *input, vtkUnstructuredGrid *output, double bounds[6])
Actual implementation for reflection.
vtkReflectionFilter::SetPlaneToX
void SetPlaneToX()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:62
vtkReflectionFilter::SetPlaneToYMin
void SetPlaneToYMin()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:66
vtkReflectionFilter::FlipTuple
void FlipTuple(double *tuple, int *mirrorDir, int nComp)
vtkReflectionFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkReflectionFilter::SetPlaneToXMax
void SetPlaneToXMax()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:68
vtkReflectionFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkReflectionFilter::Center
double Center
Definition: vtkReflectionFilter.h:138
vtkReflectionFilter::vtkReflectionFilter
vtkReflectionFilter()
vtkReflectionFilter::SetPlaneToZMax
void SetPlaneToZMax()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:70
vtkReflectionFilter::SetPlaneToYMax
void SetPlaneToYMax()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:69
vtkReflectionFilter::ComputeBounds
virtual int ComputeBounds(vtkDataObject *input, double bounds[6])
Internal method to compute bounds.
vtkReflectionFilter::CopyInput
vtkTypeBool CopyInput
Definition: vtkReflectionFilter.h:139
vtkReflectionFilter::SetPlaneToZ
void SetPlaneToZ()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:64
vtkReflectionFilter::RequestDataObject
int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkReflectionFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkReflectionFilter::SetPlaneToXMin
void SetPlaneToXMin()
Set the normal of the plane to use as mirror.
Definition: vtkReflectionFilter.h:65
vtkReflectionFilter::~vtkReflectionFilter
~vtkReflectionFilter() override
vtkReflectionFilter::FlipAllInputArrays
bool FlipAllInputArrays
Definition: vtkReflectionFilter.h:140
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:99
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkDataObjectAlgorithm.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315