VTK  9.3.1
vtkExtractStructuredGridHelper.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
18 #ifndef vtkExtractStructuredGridHelper_h
19 #define vtkExtractStructuredGridHelper_h
20 
21 #include "vtkCommonDataModelModule.h" // For export macro
22 #include "vtkObject.h"
23 
24 // Forward declarations
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkCellData;
27 class vtkPointData;
28 class vtkPoints;
29 VTK_ABI_NAMESPACE_END
30 
31 namespace vtk
32 {
33 namespace detail
34 {
35 VTK_ABI_NAMESPACE_BEGIN
36 
37 struct vtkIndexMap;
38 
39 VTK_ABI_NAMESPACE_END
40 } // END namespace detail
41 } // END namespace vtk
42 
43 VTK_ABI_NAMESPACE_BEGIN
44 class VTKCOMMONDATAMODEL_EXPORT vtkExtractStructuredGridHelper : public vtkObject
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
51  // Get & Set Macros
52  vtkGetVector6Macro(OutputWholeExtent, int);
53 
61  void Initialize(int voi[6], int wholeExt[6], int sampleRate[3], bool includeBoundary);
62 
66  bool IsValid() const;
67 
73  int GetSize(int dim);
74 
87  int GetMappedIndex(int dim, int outIdx);
88 
102  int GetMappedIndexFromExtentValue(int dim, int outExtVal);
103 
116  int GetMappedExtentValue(int dim, int outExtVal);
117 
130  int GetMappedExtentValueFromIndex(int dim, int outIdx);
131 
139  void ComputeBeginAndEnd(int inExt[6], int voi[6], int begin[3], int end[3]);
140 
152  void CopyPointsAndPointData(int inExt[6], int outExt[6], vtkPointData* pd, vtkPoints* inpnts,
153  vtkPointData* outPD, vtkPoints* outpnts);
154 
164  void CopyCellData(int inExt[6], int outExt[6], vtkCellData* cd, vtkCellData* outCD);
165 
179  static void GetPartitionedVOI(const int globalVOI[6], const int partitionedExtent[6],
180  const int sampleRate[3], bool includeBoundary, int partitionedVOI[6]);
196  static void GetPartitionedOutputExtent(const int globalVOI[6], const int partitionedVOI[6],
197  const int outputWholeExtent[6], const int sampleRate[3], bool includeBoundary,
198  int partitionedOutputExtent[6]);
199 
200 protected:
202  ~vtkExtractStructuredGridHelper() override;
203 
204  // Input parameters -- used to reinitialize when data changes.
205  int VOI[6];
206  int InputWholeExtent[6];
207  int SampleRate[3];
209 
210  int OutputWholeExtent[6];
211  vtk::detail::vtkIndexMap* IndexMap;
212 
216  void Invalidate();
217 
218 private:
220  void operator=(const vtkExtractStructuredGridHelper&) = delete;
221 };
222 
223 VTK_ABI_NAMESPACE_END
224 #endif /* VTKEXTRACTSTRUCTUREDGRIDHELPER_H_ */
abstract base class for most VTK objects
Definition: vtkObject.h:51
represent and manipulate point attribute data
Definition: vtkPointData.h:29
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represent and manipulate cell attribute data
Definition: vtkCellData.h:30
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
helper for extracting/sub-sampling structured datasets.
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:28