VTK  9.4.20241221
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
28
29#include <set> // For block selection
30#include <vector> // For pieces number
31
32VTK_ABI_NAMESPACE_BEGIN
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
41class VTKFILTERSPARALLEL_EXPORT vtkPeriodicFilter : public vtkMultiBlockDataSetAlgorithm
42{
43public:
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
88protected:
91
92 // see algorithm for more info
93 int FillInputPortInformation(int port, vtkInformation* info) override;
94
96
102
106 virtual void SetPeriodNumber(
107 vtkCompositeDataIterator* loc, vtkCompositeDataSet* output, int nbPeriod) = 0;
108
109 std::vector<int> PeriodNumbers; // Periods numbers by leaf
111
112private:
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
122VTK_ABI_NAMESPACE_END
123#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:108
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.
#define VTK_ITERATION_MODE_DIRECT_NB
#define VTK_ITERATION_MODE_MAX