VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkExtentTranslator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtentTranslator.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 =========================================================================*/
27 #ifndef __vtkExtentTranslator_h
28 #define __vtkExtentTranslator_h
29 
30 #include "vtkCommonDataModelModule.h" // For export macro
31 #include "vtkObject.h"
32 
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkExtentTranslator : public vtkObject
35 {
36 public:
37  static vtkExtentTranslator *New();
38 
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43 
45  vtkSetVector6Macro(WholeExtent, int);
46  vtkGetVector6Macro(WholeExtent, int);
47  vtkSetVector6Macro(Extent, int);
48  vtkGetVector6Macro(Extent, int);
49  vtkSetMacro(Piece,int);
50  vtkGetMacro(Piece,int);
51  vtkSetMacro(NumberOfPieces,int);
52  vtkGetMacro(NumberOfPieces,int);
53  vtkSetMacro(GhostLevel, int);
54  vtkGetMacro(GhostLevel, int);
56 
58 
63  virtual int PieceToExtent();
64  virtual int PieceToExtentByPoints();
65  virtual int PieceToExtentThreadSafe(int piece, int numPieces,
66  int ghostLevel, int *wholeExtent,
67  int *resultExtent, int splitMode,
68  int byPoints);
70 
71 
72 
74 
79  {this->SplitMode = vtkExtentTranslator::BLOCK_MODE;}
81  {this->SplitMode = vtkExtentTranslator::X_SLAB_MODE;}
83  {this->SplitMode = vtkExtentTranslator::Y_SLAB_MODE;}
85  {this->SplitMode = vtkExtentTranslator::Z_SLAB_MODE;}
86  vtkGetMacro(SplitMode,int);
88 
95  void SetSplitPath(int len, int *splitpath);
96 
97 protected:
100 
102 
104  int SplitExtent(int piece, int numPieces, int *extent, int splitMode);
105  int SplitExtentByPoints(int piece, int numPieces, int *extent,
106  int splitMode);
108 
109  int Piece;
112  int Extent[6];
113  int WholeExtent[6];
115 
116  int* SplitPath;
117  int SplitLen;
118 
119 //BTX
120  // Don't change the numbers here - they are used in the code
121  // to indicate array indices.
122  enum Modes {
123  X_SLAB_MODE=0,
124  Y_SLAB_MODE=1,
125  Z_SLAB_MODE=2,
126  BLOCK_MODE= 3
127  };
128 //ETX
129 
130 private:
131  vtkExtentTranslator(const vtkExtentTranslator&); // Not implemented.
132  void operator=(const vtkExtentTranslator&); // Not implemented.
133 };
134 
135 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
Generates a structured extent from unstructured.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
static vtkObject * New()