00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00027 #ifndef __vtkExtentTranslator_h
00028 #define __vtkExtentTranslator_h
00029
00030 #include "vtkObject.h"
00031
00032
00033 class VTK_COMMON_EXPORT vtkExtentTranslator : public vtkObject
00034 {
00035 public:
00036 static vtkExtentTranslator *New();
00037
00038 vtkTypeRevisionMacro(vtkExtentTranslator,vtkObject);
00039 void PrintSelf(ostream& os, vtkIndent indent);
00040
00042
00044 vtkSetVector6Macro(WholeExtent, int);
00045 vtkGetVector6Macro(WholeExtent, int);
00046 vtkSetVector6Macro(Extent, int);
00047 vtkGetVector6Macro(Extent, int);
00048 vtkSetMacro(Piece,int);
00049 vtkGetMacro(Piece,int);
00050 vtkSetMacro(NumberOfPieces,int);
00051 vtkGetMacro(NumberOfPieces,int);
00052 vtkSetMacro(GhostLevel, int);
00053 vtkGetMacro(GhostLevel, int);
00055
00057
00062 virtual int PieceToExtent();
00063 virtual int PieceToExtentByPoints();
00064 virtual int PieceToExtentThreadSafe(int piece, int numPieces,
00065 int ghostLevel, int *wholeExtent,
00066 int *resultExtent, int splitMode,
00067 int byPoints);
00069
00070
00071
00073
00077 void SetSplitModeToBlock()
00078 {this->SplitMode = vtkExtentTranslator::BLOCK_MODE;}
00079 void SetSplitModeToXSlab()
00080 {this->SplitMode = vtkExtentTranslator::X_SLAB_MODE;}
00081 void SetSplitModeToYSlab()
00082 {this->SplitMode = vtkExtentTranslator::Y_SLAB_MODE;}
00083 void SetSplitModeToZSlab()
00084 {this->SplitMode = vtkExtentTranslator::Z_SLAB_MODE;}
00085 vtkGetMacro(SplitMode,int);
00087
00088 protected:
00089 vtkExtentTranslator();
00090 ~vtkExtentTranslator();
00091
00093
00095 int SplitExtent(int piece, int numPieces, int *extent, int splitMode);
00096 int SplitExtentByPoints(int piece, int numPieces, int *extent,
00097 int splitMode);
00099
00100 int Piece;
00101 int NumberOfPieces;
00102 int GhostLevel;
00103 int Extent[6];
00104 int WholeExtent[6];
00105 int SplitMode;
00106
00107
00108
00109
00110 enum Modes {
00111 X_SLAB_MODE=0,
00112 Y_SLAB_MODE=1,
00113 Z_SLAB_MODE=2,
00114 BLOCK_MODE= 3
00115 };
00116
00117
00118 private:
00119 vtkExtentTranslator(const vtkExtentTranslator&);
00120 void operator=(const vtkExtentTranslator&);
00121 };
00122
00123 #endif
00124