VTK  9.1.0
vtkPeriodicFilter.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
35#ifndef vtkPeriodicFilter_h
36#define vtkPeriodicFilter_h
37
38#include "vtkFiltersParallelModule.h" // For export macro
40
41#include <set> // For block selection
42#include <vector> // For pieces number
43
48
49#define VTK_ITERATION_MODE_DIRECT_NB 0 // Generate a user-provided number of periods
50#define VTK_ITERATION_MODE_MAX 1 // Generate a maximum of periods, i.e. a full period.
51
52class VTKFILTERSPARALLEL_EXPORT vtkPeriodicFilter : public vtkMultiBlockDataSetAlgorithm
53{
54public:
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
59
64 vtkSetClampMacro(IterationMode, int, VTK_ITERATION_MODE_DIRECT_NB, VTK_ITERATION_MODE_MAX);
65 vtkGetMacro(IterationMode, int);
66 void SetIterationModeToDirectNb() { this->SetIterationMode(VTK_ITERATION_MODE_DIRECT_NB); }
67 void SetIterationModeToMax() { this->SetIterationMode(VTK_ITERATION_MODE_MAX); }
69
71
75 vtkSetMacro(NumberOfPeriods, int);
76 vtkGetMacro(NumberOfPeriods, int);
78
87 virtual void AddIndex(unsigned int index);
88
92 virtual void RemoveIndex(unsigned int index);
93
97 virtual void RemoveAllIndices();
98
99protected:
102
103 // see algorithm for more info
105
107
113
117 virtual void SetPeriodNumber(
118 vtkCompositeDataIterator* loc, vtkCompositeDataSet* output, int nbPeriod) = 0;
119
120 std::vector<int> PeriodNumbers; // Periods numbers by leaf
122
123private:
124 vtkPeriodicFilter(const vtkPeriodicFilter&) = delete;
125 void operator=(const vtkPeriodicFilter&) = delete;
126
127 int IterationMode;
128 int NumberOfPeriods; // User provided number of periods
129
130 std::set<vtkIdType> Indices; // Selected indices
131};
132
133#endif
superclass for composite data iterators
abstract superclass for composite (multi-block or AMR) datasets
superclass for composite data iterators
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
composite dataset to encapsulates pieces of dataset.
A filter to produce mapped periodic multiblock dataset from a single block.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetIterationModeToDirectNb()
Set/Get Iteration mode.
void SetIterationModeToMax()
Set/Get Iteration mode.
virtual void AddIndex(unsigned int index)
Select the periodic pieces indices.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
~vtkPeriodicFilter() override
virtual void RemoveAllIndices()
Clear selected indices tree.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
std::vector< int > PeriodNumbers
virtual void RemoveIndex(unsigned int index)
Remove an index from selected indices tress.
virtual void SetPeriodNumber(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, int nbPeriod)=0
Manually set the number of period on a specific leaf.
virtual void CreatePeriodicDataSet(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, vtkCompositeDataSet *input)=0
Create a periodic data, leaf of the tree.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ index
Definition: vtkX3D.h:252
#define VTK_ITERATION_MODE_DIRECT_NB
#define VTK_ITERATION_MODE_MAX