VTK
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 "vtkObject.h"
31 
32 
34 {
35 public:
36  static vtkExtentTranslator *New();
37 
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
42 
44  vtkSetVector6Macro(WholeExtent, int);
45  vtkGetVector6Macro(WholeExtent, int);
46  vtkSetVector6Macro(Extent, int);
47  vtkGetVector6Macro(Extent, int);
48  vtkSetMacro(Piece,int);
49  vtkGetMacro(Piece,int);
50  vtkSetMacro(NumberOfPieces,int);
51  vtkGetMacro(NumberOfPieces,int);
52  vtkSetMacro(GhostLevel, int);
53  vtkGetMacro(GhostLevel, int);
55 
57 
62  virtual int PieceToExtent();
63  virtual int PieceToExtentByPoints();
64  virtual int PieceToExtentThreadSafe(int piece, int numPieces,
65  int ghostLevel, int *wholeExtent,
66  int *resultExtent, int splitMode,
67  int byPoints);
69 
70 
71 
73 
78  {this->SplitMode = vtkExtentTranslator::BLOCK_MODE;}
80  {this->SplitMode = vtkExtentTranslator::X_SLAB_MODE;}
82  {this->SplitMode = vtkExtentTranslator::Y_SLAB_MODE;}
84  {this->SplitMode = vtkExtentTranslator::Z_SLAB_MODE;}
85  vtkGetMacro(SplitMode,int);
87 
94  void SetSplitPath(int len, int *splitpath);
95 
96 protected:
99 
101 
103  int SplitExtent(int piece, int numPieces, int *extent, int splitMode);
104  int SplitExtentByPoints(int piece, int numPieces, int *extent,
105  int splitMode);
107 
108  int Piece;
111  int Extent[6];
112  int WholeExtent[6];
114 
115  int* SplitPath;
116  int SplitLen;
117 
118 //BTX
119  // Don't change the numbers here - they are used in the code
120  // to indicate array indices.
121  enum Modes {
122  X_SLAB_MODE=0,
123  Y_SLAB_MODE=1,
124  Z_SLAB_MODE=2,
125  BLOCK_MODE= 3
126  };
127 //ETX
128 
129 private:
130  vtkExtentTranslator(const vtkExtentTranslator&); // Not implemented.
131  void operator=(const vtkExtentTranslator&); // Not implemented.
132 };
133 
134 #endif
135 
abstract base class for most VTK objects
Definition: vtkObject.h:60
Generates a structured extent from unstructured.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_COMMON_EXPORT
static vtkObject * New()