VTK
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 =========================================================================*/
29 #ifndef vtkExtractStructuredGridHelper_h
30 #define vtkExtractStructuredGridHelper_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
33 #include "vtkObject.h"
34 
35 // Forward declarations
36 class vtkCellData;
37 class vtkPointData;
38 class vtkPoints;
39 
40 namespace vtk
41 {
42 namespace detail
43 {
44 
45 struct vtkIndexMap;
46 
47 } // END namespace detail
48 } // END namespace vtk
49 
51  public vtkObject
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
58  // Get & Set Macros
59  vtkGetVector6Macro(OutputWholeExtent,int);
60 
62 
66  void Initialize(int voi[6], int wholeExt[6], int sampleRate[3],
67  bool includeBoundary);
69 
71  bool IsValid() const;
72 
75  int GetSize(const int dim);
76 
84  int GetMappedIndex(int dim, int outIdx);
85 
95  int GetMappedIndexFromExtentValue(int dim, int outExtVal);
96 
105  int GetMappedExtentValue(int dim, int outExtVal);
106 
114  int GetMappedExtentValueFromIndex(int dim, int outIdx);
115 
119  void ComputeBeginAndEnd(int inExt[6], int voi[6], int begin[3], int end[3]);
120 
122 
130  void CopyPointsAndPointData( int inExt[6], int outExt[6],
131  vtkPointData* pd, vtkPoints* inpnts,
132  vtkPointData* outPD, vtkPoints* outpnts,
133  int sampleRate[3] = NULL);
135 
137 
142  void CopyCellData(int inExt[6], int outExt[6],
143  vtkCellData* cd, vtkCellData* outCD,
144  int sampleRate[3] = NULL);
146 
148 
159  static void GetPartitionedVOI(const int globalVOI[6],
160  const int partitionedExtent[6],
161  const int sampleRate[3],
162  bool includeBoundary,
163  int partitionedVOI[6]);
165 
166 
178  static void GetPartitionedOutputExtent(const int globalVOI[6],
179  const int partitionedVOI[6],
180  const int outputWholeExtent[6],
181  const int sampleRate[3],
182  bool includeBoundary,
183  int partitionedOutputExtent[6]);
185 
186 protected:
189 
190  // Input parameters -- used to reinitialize when data changes.
191  int VOI[6];
192  int InputWholeExtent[6];
193  int SampleRate[3];
195 
196  int OutputWholeExtent[6];
197  vtk::detail::vtkIndexMap* IndexMap;
198 
200  void Invalidate();
201 
202 private:
204  void operator=(const vtkExtractStructuredGridHelper&); // Not implemented.
205 };
206 
207 #endif /* VTKEXTRACTSTRUCTUREDGRIDHELPER_H_ */
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate point attribute data
Definition: vtkPointData.h:36
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
helper for extracting/sub-sampling structured datasets.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
static vtkObject * New()
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38