VTK
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 
52 class VTKFILTERSPARALLEL_EXPORT vtkPeriodicFilter : public vtkMultiBlockDataSetAlgorithm
53 {
54 public:
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
64  vtkSetClampMacro(IterationMode, int,
67  vtkGetMacro(IterationMode, int);
69  { this->SetIterationMode(VTK_ITERATION_MODE_DIRECT_NB); }
71  { this->SetIterationMode(VTK_ITERATION_MODE_MAX); }
73 
75 
79  vtkSetMacro(NumberOfPeriods, int);
80  vtkGetMacro(NumberOfPeriods, int);
82 
91  virtual void AddIndex(unsigned int index);
92 
96  virtual void RemoveIndex(unsigned int index);
97 
101  virtual void RemoveAllIndices();
102 
103 protected:
106 
107  // see algorithm for more info
109 
110  virtual int RequestData(vtkInformation *,
113 
117  virtual void CreatePeriodicDataSet(vtkCompositeDataIterator* loc,
118  vtkCompositeDataSet* output,
119  vtkCompositeDataSet* input) = 0;
120 
124  virtual void SetPeriodNumber(vtkCompositeDataIterator* loc,
125  vtkCompositeDataSet* output,
126  int nbPeriod) = 0;
127 
128  std::vector<int> PeriodNumbers; // Periods numbers by leaf
130 
131 private:
132  vtkPeriodicFilter(const vtkPeriodicFilter&) VTK_DELETE_FUNCTION;
133  void operator=(const vtkPeriodicFilter&) VTK_DELETE_FUNCTION;
134 
135  int IterationMode;
136  int NumberOfPeriods; // User provided number of periods
137 
138  std::set<vtkIdType> Indices; // Selected indices
139 };
140 
141 #endif
#define VTK_ITERATION_MODE_DIRECT_NB
Store vtkAlgorithm input/output information.
int vtkIdType
Definition: vtkType.h:287
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
#define VTK_ITERATION_MODE_MAX
superclass for composite data iterators
void SetIterationModeToMax()
Set/Get Iteration mode.
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
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.
void SetIterationModeToDirectNb()
Set/Get Iteration mode.
Store zero or more vtkInformation instances.
superclass for composite data iterators
std::vector< int > PeriodNumbers