VTK  9.0.1
vtkAngularPeriodicFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPeriodicFiler.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
38 #ifndef vtkAngularPeriodicFilter_h
39 #define vtkAngularPeriodicFilter_h
40 
41 #include "vtkFiltersParallelModule.h" // For export macro
42 #include "vtkPeriodicFilter.h"
43 
46 class vtkPointSet;
47 
48 #define VTK_ROTATION_MODE_DIRECT_ANGLE 0 // Use user-provided angle
49 #define VTK_ROTATION_MODE_ARRAY_VALUE 1 // Use array from input data as angle
50 
51 class VTKFILTERSPARALLEL_EXPORT vtkAngularPeriodicFilter : public vtkPeriodicFilter
52 {
53 public:
54  static vtkAngularPeriodicFilter* New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
59 
64  vtkSetMacro(ComputeRotationsOnTheFly, bool);
65  vtkGetMacro(ComputeRotationsOnTheFly, bool);
66  vtkBooleanMacro(ComputeRotationsOnTheFly, bool);
68 
70 
75  vtkSetClampMacro(
77  vtkGetMacro(RotationMode, int);
81 
83 
88  vtkSetMacro(RotationAngle, double);
89  vtkGetMacro(RotationAngle, double);
91 
93 
97  vtkSetStringMacro(RotationArrayName);
98  vtkGetStringMacro(RotationArrayName);
100 
102 
105  vtkSetClampMacro(RotationAxis, int, 0, 2);
106  vtkGetMacro(RotationAxis, int);
107  void SetRotationAxisToX();
108  void SetRotationAxisToY();
109  void SetRotationAxisToZ();
111 
113 
116  vtkSetVector3Macro(Center, double);
117  vtkGetVector3Macro(Center, double);
119 
120 protected:
122  ~vtkAngularPeriodicFilter() override;
123 
125 
129  vtkDataArray* TransformDataArray(
130  vtkDataArray* inputArray, double angle, bool useCenter = true, bool normalize = false);
131 
135  void AppendPeriodicPiece(
136  double angle, vtkIdType iPiece, vtkDataObject* inputNode, vtkMultiPieceDataSet* multiPiece);
137 
141  void SetPeriodNumber(
142  vtkCompositeDataIterator* loc, vtkCompositeDataSet* output, int nbPeriod) override;
143 
147  void ComputePeriodicMesh(vtkPointSet* dataset, vtkPointSet* rotatedDataset, double angle);
148 
152  void ComputeAngularPeriodicData(
153  vtkDataSetAttributes* data, vtkDataSetAttributes* rotatedData, double angle);
154 
159  vtkCompositeDataSet* input) override;
160 
164  virtual void GeneratePieceName(vtkCompositeDataSet* input, vtkCompositeDataIterator* inputLoc,
165  vtkMultiPieceDataSet* output, vtkIdType outputId);
166 
167 private:
169  void operator=(const vtkAngularPeriodicFilter&) = delete;
170 
171  bool ComputeRotationsOnTheFly;
172 
173  int RotationMode;
174  char*
175  RotationArrayName; // user-provided array name to use as angle, for ROTATION_MODE_ARRAY_VALUE
176 
177  // Transform parameters
178  double RotationAngle;
179  int RotationAxis; // Axis to rotate around, 0 for X, 1 for Y, 2 for Z
180  double Center[3]; // Center of rotation
181 };
182 
183 #endif
vtkPeriodicFilter::SetPeriodNumber
virtual void SetPeriodNumber(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, int nbPeriod)=0
Manually set the number of period on a specific leaf.
vtkAngularPeriodicFilter
A filter to produce mapped angular periodic multiblock dataset from a single block,...
Definition: vtkAngularPeriodicFilter.h:51
vtkMultiPieceDataSet
composite dataset to encapsulates pieces of dataset.
Definition: vtkMultiPieceDataSet.h:40
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkPeriodicFilter
A filter to produce mapped periodic multiblock dataset from a single block.
Definition: vtkPeriodicFilter.h:52
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:53
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkPeriodicFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPeriodicFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMultiBlockDataSetAlgorithm::New
static vtkMultiBlockDataSetAlgorithm * New()
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:45
vtkPeriodicFilter.h
vtkAngularPeriodicFilter::SetRotationModeToArrayValue
void SetRotationModeToArrayValue()
Definition: vtkAngularPeriodicFilter.h:79
VTK_ROTATION_MODE_DIRECT_ANGLE
#define VTK_ROTATION_MODE_DIRECT_ANGLE
Definition: vtkAngularPeriodicFilter.h:48
vtkAngularPeriodicFilter::SetRotationModeToDirectAngle
void SetRotationModeToDirectAngle()
Definition: vtkAngularPeriodicFilter.h:78
vtkCompositeDataIterator
superclass for composite data iterators
Definition: vtkCompositeDataIterator.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkPeriodicFilter::CreatePeriodicDataSet
virtual void CreatePeriodicDataSet(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, vtkCompositeDataSet *input)=0
Create a periodic data, leaf of the tree.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:62
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
VTK_ROTATION_MODE_ARRAY_VALUE
#define VTK_ROTATION_MODE_ARRAY_VALUE
Definition: vtkAngularPeriodicFilter.h:49