VTK
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(RotationMode, int,
77  vtkGetMacro(RotationMode, int);
79  { this->SetRotationMode(VTK_ROTATION_MODE_DIRECT_ANGLE); }
81  { this->SetRotationMode(VTK_ROTATION_MODE_ARRAY_VALUE); }
83 
85 
90  vtkSetMacro(RotationAngle, double);
91  vtkGetMacro(RotationAngle, double);
93 
95 
99  vtkSetStringMacro(RotationArrayName);
100  vtkGetStringMacro(RotationArrayName);
102 
104 
107  vtkSetClampMacro(RotationAxis, int, 0, 2);
108  vtkGetMacro(RotationAxis, int);
109  void SetRotationAxisToX();
110  void SetRotationAxisToY();
111  void SetRotationAxisToZ();
113 
115 
118  vtkSetVector3Macro(Center, double);
119  vtkGetVector3Macro(Center, double);
121 
122 protected:
124  ~vtkAngularPeriodicFilter() override;
125 
128  vtkInformationVector *) override;
129 
133  vtkDataArray* TransformDataArray(vtkDataArray* inputArray,
134  double angle,
135  bool useCenter = true,
136  bool normalize = false);
137 
141  void AppendPeriodicPiece(double angle, vtkIdType iPiece,
142  vtkDataObject* inputNode,
143  vtkMultiPieceDataSet* multiPiece);
144 
149  vtkCompositeDataSet* output,
150  int nbPeriod) override;
151 
155  void ComputePeriodicMesh(vtkPointSet* dataset, vtkPointSet* rotatedDataset,
156  double angle);
157 
161  void ComputeAngularPeriodicData(vtkDataSetAttributes* data,
162  vtkDataSetAttributes* rotatedData,
163  double angle);
164 
169  vtkCompositeDataSet* output,
170  vtkCompositeDataSet* input) override;
171 
175  virtual void GeneratePieceName(vtkCompositeDataSet* input,
176  vtkCompositeDataIterator* inputLoc,
177  vtkMultiPieceDataSet* output,
178  vtkIdType outputId);
179 
180 private:
182  void operator=(const vtkAngularPeriodicFilter&) = delete;
183 
184  bool ComputeRotationsOnTheFly;
185 
186  int RotationMode;
187  char* RotationArrayName; // user-provided array name to use as angle, for ROTATION_MODE_ARRAY_VALUE
188 
189  // Transform parameters
190  double RotationAngle;
191  int RotationAxis; // Axis to rotate around, 0 for X, 1 for Y, 2 for Z
192  double Center[3]; // Center of rotation
193 };
194 
195 #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:347
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
Definition: vtkX3D.h:315
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:48
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:45
vtkPeriodicFilter.h
vtkAngularPeriodicFilter::SetRotationModeToArrayValue
void SetRotationModeToArrayValue()
Definition: vtkAngularPeriodicFilter.h:80
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:80
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:39
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:58
VTK_ROTATION_MODE_ARRAY_VALUE
#define VTK_ROTATION_MODE_ARRAY_VALUE
Definition: vtkAngularPeriodicFilter.h:49