VTK  9.0.1
vtkExtractStructuredGridHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtractGrid.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 =========================================================================*/
30 #ifndef vtkExtractStructuredGridHelper_h
31 #define vtkExtractStructuredGridHelper_h
32 
33 #include "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkObject.h"
35 
36 // Forward declarations
37 class vtkCellData;
38 class vtkPointData;
39 class vtkPoints;
40 
41 namespace vtk
42 {
43 namespace detail
44 {
45 
46 struct vtkIndexMap;
47 
48 } // END namespace detail
49 } // END namespace vtk
50 
51 class VTKCOMMONDATAMODEL_EXPORT vtkExtractStructuredGridHelper : public vtkObject
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
58  // Get & Set Macros
59  vtkGetVector6Macro(OutputWholeExtent, int);
60 
68  void Initialize(int voi[6], int wholeExt[6], int sampleRate[3], bool includeBoundary);
69 
73  bool IsValid() const;
74 
80  int GetSize(const int dim);
81 
94  int GetMappedIndex(int dim, int outIdx);
95 
109  int GetMappedIndexFromExtentValue(int dim, int outExtVal);
110 
123  int GetMappedExtentValue(int dim, int outExtVal);
124 
137  int GetMappedExtentValueFromIndex(int dim, int outIdx);
138 
146  void ComputeBeginAndEnd(int inExt[6], int voi[6], int begin[3], int end[3]);
147 
159  void CopyPointsAndPointData(int inExt[6], int outExt[6], vtkPointData* pd, vtkPoints* inpnts,
160  vtkPointData* outPD, vtkPoints* outpnts);
161 
171  void CopyCellData(int inExt[6], int outExt[6], vtkCellData* cd, vtkCellData* outCD);
172 
186  static void GetPartitionedVOI(const int globalVOI[6], const int partitionedExtent[6],
187  const int sampleRate[3], bool includeBoundary, int partitionedVOI[6]);
203  static void GetPartitionedOutputExtent(const int globalVOI[6], const int partitionedVOI[6],
204  const int outputWholeExtent[6], const int sampleRate[3], bool includeBoundary,
205  int partitionedOutputExtent[6]);
206 
207 protected:
209  ~vtkExtractStructuredGridHelper() override;
210 
211  // Input parameters -- used to reinitialize when data changes.
212  int VOI[6];
213  int InputWholeExtent[6];
214  int SampleRate[3];
216 
217  int OutputWholeExtent[6];
218  vtk::detail::vtkIndexMap* IndexMap;
219 
223  void Invalidate();
224 
225 private:
227  void operator=(const vtkExtractStructuredGridHelper&) = delete;
228 };
229 
230 #endif /* VTKEXTRACTSTRUCTUREDGRIDHELPER_H_ */
abstract base class for most VTK objects
Definition: vtkObject.h:62
represent and manipulate point attribute data
Definition: vtkPointData.h:31
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:32
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:33
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:33