VTK: Filters/Parallel/vtkPeriodicFilter.h Source File

| VTK 9.3.1

vtkPeriodicFilter.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
3
23 #ifndef vtkPeriodicFilter_h
24 #define vtkPeriodicFilter_h
25
26 #include "vtkFiltersParallelModule.h" // For export macro
27 #include "vtkMultiBlockDataSetAlgorithm.h"
28
29 #include <set> // For block selection
30 #include <vector> // For pieces number
31
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkCompositeDataIterator;
34 class vtkCompositeDataSet;
35 class vtkDataObjectTreeIterator;
36 class vtkMultiPieceDataSet;
37
38 #define VTK_ITERATION_MODE_DIRECT_NB 0 // Generate a user-provided number of periods
39 #define VTK_ITERATION_MODE_MAX 1 // Generate a maximum of periods, i.e. a full period.
40
41 class VTKFILTERSPARALLEL_EXPORT vtkPeriodicFilter : public vtkMultiBlockDataSetAlgorithm
42 {
43 public:
44 vtkTypeMacro(vtkPeriodicFilter, vtkMultiBlockDataSetAlgorithm);
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
48
53 vtkSetClampMacro(IterationMode, int, VTK_ITERATION_MODE_DIRECT_NB, VTK_ITERATION_MODE_MAX);
54 vtkGetMacro(IterationMode, int);
55 void SetIterationModeToDirectNb() { this->SetIterationMode(VTK_ITERATION_MODE_DIRECT_NB); }
56 void SetIterationModeToMax() { this->SetIterationMode(VTK_ITERATION_MODE_MAX); }
58
60
64 vtkSetMacro(NumberOfPeriods, int);
65 vtkGetMacro(NumberOfPeriods, int);
67
76 virtual void AddIndex(unsigned int index);
77
81 virtual void RemoveIndex(unsigned int index);
82
86 virtual void RemoveAllIndices();
87
88 protected:
89 vtkPeriodicFilter();
90 ~vtkPeriodicFilter() override;
91
92 // see algorithm for more info
93 int FillInputPortInformation(int port, vtkInformation* info) override;
94
95 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
96
100 virtual void CreatePeriodicDataSet(
101 vtkCompositeDataIterator* loc, vtkCompositeDataSet* output, vtkCompositeDataSet* input) = 0;
102
106 virtual void SetPeriodNumber(
107 vtkCompositeDataIterator* loc, vtkCompositeDataSet* output, int nbPeriod) = 0;
108
109 std::vector<int> PeriodNumbers; // Periods numbers by leaf
110 bool ReducePeriodNumbers;
111
112 private:
113 vtkPeriodicFilter(const vtkPeriodicFilter&) = delete;
114 void operator=(const vtkPeriodicFilter&) = delete;
115
116 int IterationMode;
117 int NumberOfPeriods; // User provided number of periods
118
119 std::set<vtkIdType> Indices; // Selected indices
120 };
121
122 VTK_ABI_NAMESPACE_END
123 #endif
vtkCompositeDataIterator
superclass for composite data iterators
Definition: vtkCompositeDataIterator.h:28
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:51
vtkDataObjectTreeIterator
superclass for composite data iterators
Definition: vtkDataObjectTreeIterator.h:38
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
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:25
vtkMultiPieceDataSet
composite dataset to encapsulates pieces of dataset.
Definition: vtkMultiPieceDataSet.h:33
vtkPeriodicFilter
A filter to produce mapped periodic multiblock dataset from a single block.
Definition: vtkPeriodicFilter.h:42
vtkPeriodicFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPeriodicFilter::SetIterationModeToDirectNb
void SetIterationModeToDirectNb()
Set/Get Iteration mode.
Definition: vtkPeriodicFilter.h:55
vtkPeriodicFilter::SetIterationModeToMax
void SetIterationModeToMax()
Set/Get Iteration mode.
Definition: vtkPeriodicFilter.h:56
vtkPeriodicFilter::vtkPeriodicFilter
vtkPeriodicFilter()
vtkPeriodicFilter::AddIndex
virtual void AddIndex(unsigned int index)
Select the periodic pieces indices.
vtkPeriodicFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPeriodicFilter::~vtkPeriodicFilter
~vtkPeriodicFilter() override
vtkPeriodicFilter::RemoveAllIndices
virtual void RemoveAllIndices()
Clear selected indices tree.
vtkPeriodicFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPeriodicFilter::PeriodNumbers
std::vector< int > PeriodNumbers
Definition: vtkPeriodicFilter.h:109
vtkPeriodicFilter::RemoveIndex
virtual void RemoveIndex(unsigned int index)
Remove an index from selected indices tress.
vtkPeriodicFilter::SetPeriodNumber
virtual void SetPeriodNumber(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, int nbPeriod)=0
Manually set the number of period on a specific leaf.
vtkPeriodicFilter::ReducePeriodNumbers
bool ReducePeriodNumbers
Definition: vtkPeriodicFilter.h:110
vtkPeriodicFilter::CreatePeriodicDataSet
virtual void CreatePeriodicDataSet(vtkCompositeDataIterator *loc, vtkCompositeDataSet *output, vtkCompositeDataSet *input)=0
Create a periodic data, leaf of the tree.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkMultiBlockDataSetAlgorithm.h
VTK_ITERATION_MODE_DIRECT_NB
#define VTK_ITERATION_MODE_DIRECT_NB
Definition: vtkPeriodicFilter.h:38
VTK_ITERATION_MODE_MAX
#define VTK_ITERATION_MODE_MAX
Definition: vtkPeriodicFilter.h:39