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 
41 #ifndef vtkAngularPeriodicFilter_h
42 #define vtkAngularPeriodicFilter_h
43 
44 #include "vtkFiltersParallelModule.h" // For export macro
45 #include "vtkPeriodicFilter.h"
46 
49 class vtkPointSet;
50 
51 #define VTK_ROTATION_MODE_DIRECT_ANGLE 0 // Use user-provided angle
52 #define VTK_ROTATION_MODE_ARRAY_VALUE 1 // Use array from input data as angle
53 
54 class VTKFILTERSPARALLEL_EXPORT vtkAngularPeriodicFilter : public vtkPeriodicFilter
55 {
56 public:
57  static vtkAngularPeriodicFilter* New();
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
62 
67  vtkSetMacro(ComputeRotationsOnTheFly, bool);
68  vtkGetMacro(ComputeRotationsOnTheFly, bool);
69  vtkBooleanMacro(ComputeRotationsOnTheFly, bool);
71 
73 
78  vtkSetClampMacro(RotationMode, int,
80  vtkGetMacro(RotationMode, int);
82  { this->SetRotationMode(VTK_ROTATION_MODE_DIRECT_ANGLE); }
84  { this->SetRotationMode(VTK_ROTATION_MODE_ARRAY_VALUE); }
86 
88 
93  vtkSetMacro(RotationAngle, double);
94  vtkGetMacro(RotationAngle, double);
96 
98 
102  vtkSetStringMacro(RotationArrayName);
103  vtkGetStringMacro(RotationArrayName);
105 
107 
110  vtkSetClampMacro(RotationAxis, int, 0, 2);
111  vtkGetMacro(RotationAxis, int);
112  void SetRotationAxisToX();
113  void SetRotationAxisToY();
114  void SetRotationAxisToZ();
116 
118 
121  vtkSetVector3Macro(Center, double);
122  vtkGetVector3Macro(Center, double);
124 
125 protected:
128 
129  virtual int RequestData(vtkInformation *,
132 
136  vtkDataArray* TransformDataArray(vtkDataArray* inputArray,
137  double angle,
138  bool useCenter = true,
139  bool normalize = false);
140 
144  void AppendPeriodicPiece(double angle, vtkIdType iPiece,
145  vtkDataObject* inputNode,
146  vtkMultiPieceDataSet* multiPiece);
147 
151  virtual void SetPeriodNumber(vtkCompositeDataIterator* loc,
152  vtkCompositeDataSet* output,
153  int nbPeriod);
154 
158  void ComputePeriodicMesh(vtkPointSet* dataset, vtkPointSet* rotatedDataset,
159  double angle);
160 
164  void ComputeAngularPeriodicData(vtkDataSetAttributes* data,
165  vtkDataSetAttributes* rotatedData,
166  double angle);
167 
172  vtkCompositeDataSet* output,
173  vtkCompositeDataSet* input);
174 
178  virtual void GeneratePieceName(vtkCompositeDataSet* input,
179  vtkCompositeDataIterator* inputLoc,
180  vtkMultiPieceDataSet* output,
181  vtkIdType outputId);
182 
183 private:
184  vtkAngularPeriodicFilter(const vtkAngularPeriodicFilter&) VTK_DELETE_FUNCTION;
185  void operator=(const vtkAngularPeriodicFilter&) VTK_DELETE_FUNCTION;
186 
187  bool ComputeRotationsOnTheFly;
188 
189  int RotationMode;
190  char* RotationArrayName; // user-provided array name to use as angle, for ROTATION_MODE_ARRAY_VALUE
191 
192  // Transform parameters
193  double RotationAngle;
194  int RotationAxis; // Axis to rotate around, 0 for X, 1 for Y, 2 for Z
195  double Center[3]; // Center of rotation
196 };
197 
198 #endif
virtual void SetPeriodNumber(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, int nbPeriod)=0
Manually set the number of period on a specific leaf.
#define VTK_ROTATION_MODE_ARRAY_VALUE
Store vtkAlgorithm input/output information.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:42
#define VTK_ROTATION_MODE_DIRECT_ANGLE
int vtkIdType
Definition: vtkType.h:287
void SetRotationModeToArrayValue()
Set/Get The rotation mode.
static vtkMultiBlockDataSetAlgorithm * New()
superclass for composite data iterators
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:39
composite dataset to encapsulates pieces of dataset.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
represent and manipulate attribute data in a dataset
A filter to produce mapped periodic multiblock dataset from a single block.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
A filter to produce mapped angular periodic multiblock dataset from a single block, by rotation.
virtual void CreatePeriodicDataSet(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, vtkCompositeDataSet *input)=0
Create a periodic data, leaf of the tree.
Store zero or more vtkInformation instances.
void SetRotationModeToDirectAngle()
Set/Get The rotation mode.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:64