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 "vtkCommonExecutionModelModule.h" // For export macro
31 #include "vtkObject.h"
32 
35 
37 {
38 public:
39  static vtkExtentTranslator *New();
40 
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45 
47  vtkSetVector6Macro(WholeExtent, int);
48  vtkGetVector6Macro(WholeExtent, int);
49  vtkSetVector6Macro(Extent, int);
50  vtkGetVector6Macro(Extent, int);
51  vtkSetMacro(Piece,int);
52  vtkGetMacro(Piece,int);
53  vtkSetMacro(NumberOfPieces,int);
54  vtkGetMacro(NumberOfPieces,int);
55  vtkSetMacro(GhostLevel, int);
56  vtkGetMacro(GhostLevel, int);
58 
60 
65  virtual int PieceToExtent();
66  virtual int PieceToExtentByPoints();
67  virtual int PieceToExtentThreadSafe(int piece, int numPieces,
68  int ghostLevel, int *wholeExtent,
69  int *resultExtent, int splitMode,
70  int byPoints);
72 
73 
74 
76 
81  {this->SplitMode = vtkExtentTranslator::BLOCK_MODE;}
83  {this->SplitMode = vtkExtentTranslator::X_SLAB_MODE;}
85  {this->SplitMode = vtkExtentTranslator::Y_SLAB_MODE;}
87  {this->SplitMode = vtkExtentTranslator::Z_SLAB_MODE;}
88  vtkGetMacro(SplitMode,int);
90 
97  void SetSplitPath(int len, int *splitpath);
98 
99  // Don't change the numbers here - they are used in the code
100  // to indicate array indices.
101  enum Modes
102  {
103  X_SLAB_MODE=0,
104  Y_SLAB_MODE=1,
105  Z_SLAB_MODE=2,
106  BLOCK_MODE= 3
107  };
108 
111  static vtkInformationIntegerRequestKey* UPDATE_SPLIT_MODE();
112 
113 protected:
116 
117  static vtkInformationIntegerKey* DATA_SPLIT_MODE();
118 
119  friend class vtkInformationSplitModeRequestKey;
120 
122 
124  int SplitExtent(int piece, int numPieces, int *extent, int splitMode);
125  int SplitExtentByPoints(int piece, int numPieces, int *extent,
126  int splitMode);
128 
129  int Piece;
132  int Extent[6];
133  int WholeExtent[6];
135 
136  int* SplitPath;
137  int SplitLen;
138 
139 private:
140  vtkExtentTranslator(const vtkExtentTranslator&); // Not implemented.
141  void operator=(const vtkExtentTranslator&); // Not implemented.
142 };
143 
144 #endif
#define VTKCOMMONEXECUTIONMODEL_EXPORT
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
Key for integer values in vtkInformation.
static vtkObject * New()
key that can used to request integer values from the pipeline vtkInformationIntegerRequestKey is a vt...