VTK
dox/Common/ExecutionModel/vtkTableExtentTranslator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkTableExtentTranslator.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 =========================================================================*/
00025 #ifndef __vtkTableExtentTranslator_h
00026 #define __vtkTableExtentTranslator_h
00027 
00028 #include "vtkCommonExecutionModelModule.h" // For export macro
00029 #include "vtkExtentTranslator.h"
00030 
00031 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkTableExtentTranslator : public vtkExtentTranslator
00032 {
00033 public:
00034   vtkTypeMacro(vtkTableExtentTranslator,vtkExtentTranslator);
00035   void PrintSelf(ostream& os, vtkIndent indent);
00036 
00037   static vtkTableExtentTranslator* New();
00038 
00039 
00040   // Set the number of pieces into which the whole extent will be
00041   // split.  If this is 1 then the whole extent will be returned.  If
00042   // this is more than the number of pieces in the table then the
00043   // extra pieces will be empty data.  If this is more than one but
00044   // less than the number of pieces in the table then only this many
00045   // pieces will be returned (FIXME).
00046   void SetNumberOfPieces(int pieces);
00047 
00049 
00050   void SetNumberOfPiecesInTable(int pieces);
00051   vtkGetMacro(NumberOfPiecesInTable, int);
00053 
00056   int PieceToExtent();
00057 
00059   int PieceToExtentByPoints();
00060 
00062 
00063   int PieceToExtentThreadSafe(int piece, int numPieces,
00064                               int ghostLevel, int *wholeExtent,
00065                               int *resultExtent, int splitMode,
00066                               int byPoints);
00068 
00071   virtual void SetExtentForPiece(int piece, int* extent);
00072 
00074 
00077   virtual void GetExtentForPiece(int piece, int* extent);
00078   virtual int* GetExtentForPiece(int piece);
00080 
00082 
00085   vtkSetMacro(MaximumGhostLevel, int);
00086   vtkGetMacro(MaximumGhostLevel, int);
00088 
00090 
00092   virtual void SetPieceAvailable(int piece, int available);
00093   virtual int GetPieceAvailable(int piece);
00095 
00096 protected:
00097   vtkTableExtentTranslator();
00098   ~vtkTableExtentTranslator();
00099 
00100   // Store the extent table in a single array.  Every 6 values form an extent.
00101   int* ExtentTable;
00102   int NumberOfPiecesInTable;
00103   int MaximumGhostLevel;
00104 
00105   // Store a flag for the availability of each piece.
00106   int* PieceAvailable;
00107 
00108 private:
00109   vtkTableExtentTranslator(const vtkTableExtentTranslator&);  // Not implemented.
00110   void operator=(const vtkTableExtentTranslator&);  // Not implemented.
00111 };
00112 
00113 #endif