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 
128  void CopyPointsAndPointData( int inExt[6], int outExt[6],
129  vtkPointData* pd, vtkPoints* inpnts,
130  vtkPointData* outPD, vtkPoints* outpnts);
132 
134 
138  void CopyCellData(int inExt[6], int outExt[6],
139  vtkCellData* cd, vtkCellData* outCD);
141 
143 
154  static void GetPartitionedVOI(const int globalVOI[6],
155  const int partitionedExtent[6],
156  const int sampleRate[3],
157  bool includeBoundary,
158  int partitionedVOI[6]);
160 
161 
173  static void GetPartitionedOutputExtent(const int globalVOI[6],
174  const int partitionedVOI[6],
175  const int outputWholeExtent[6],
176  const int sampleRate[3],
177  bool includeBoundary,
178  int partitionedOutputExtent[6]);
180 
181 protected:
184 
185  // Input parameters -- used to reinitialize when data changes.
186  int VOI[6];
187  int InputWholeExtent[6];
188  int SampleRate[3];
190 
191  int OutputWholeExtent[6];
192  vtk::detail::vtkIndexMap* IndexMap;
193 
195  void Invalidate();
196 
197 private:
199  void operator=(const vtkExtractStructuredGridHelper&); // Not implemented.
200 };
201 
202 #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