VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkExtentTranslator.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 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 vtkTypeMacro(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 00094 void SetSplitPath(int len, int *splitpath); 00095 00096 protected: 00097 vtkExtentTranslator(); 00098 ~vtkExtentTranslator(); 00099 00101 00103 int SplitExtent(int piece, int numPieces, int *extent, int splitMode); 00104 int SplitExtentByPoints(int piece, int numPieces, int *extent, 00105 int splitMode); 00107 00108 int Piece; 00109 int NumberOfPieces; 00110 int GhostLevel; 00111 int Extent[6]; 00112 int WholeExtent[6]; 00113 int SplitMode; 00114 00115 int* SplitPath; 00116 int SplitLen; 00117 00118 //BTX 00119 // Don't change the numbers here - they are used in the code 00120 // to indicate array indices. 00121 enum Modes { 00122 X_SLAB_MODE=0, 00123 Y_SLAB_MODE=1, 00124 Z_SLAB_MODE=2, 00125 BLOCK_MODE= 3 00126 }; 00127 //ETX 00128 00129 private: 00130 vtkExtentTranslator(const vtkExtentTranslator&); // Not implemented. 00131 void operator=(const vtkExtentTranslator&); // Not implemented. 00132 }; 00133 00134 #endif 00135