VTK
vtkUniformGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkUniformGrid.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 =========================================================================*/
23 #ifndef vtkUniformGrid_h
24 #define vtkUniformGrid_h
25 
26 #include "vtkCommonDataModelModule.h" // For export macro
27 #include "vtkImageData.h"
28 
29 class vtkEmptyCell;
30 class vtkStructuredVisibilityConstraint;
32 class vtkAMRBox;
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
35 {
36 public:
38 
41  static vtkUniformGrid *New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
50  void CopyStructure(vtkDataSet *ds) override;
51 
55  int GetDataObjectType() override {return VTK_UNIFORM_GRID;};
56 
58 
61  vtkCell *GetCell(int i, int j, int k) override;
62  vtkCell *GetCell(vtkIdType cellId) override;
63  void GetCell(vtkIdType cellId, vtkGenericCell *cell) override;
65  double x[3], vtkCell *cell, vtkIdType cellId, double tol2,
66  int& subId, double pcoords[3], double *weights) override;
68  double x[3], vtkCell *cell, vtkGenericCell *gencell,
69  vtkIdType cellId, double tol2, int& subId,
70  double pcoords[3], double *weights) override;
72  double x[3], vtkCell *cell, vtkIdType cellId,
73  double tol2, int& subId, double pcoords[3],
74  double *weights) override;
75  int GetCellType(vtkIdType cellId) override;
76  void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
78  this->GetDimensions());}
79  void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
80  {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}
81  void Initialize() override;
82  int GetMaxCellSize() override {return 8;}; //voxel is the largest
84 
88  int GetGridDescription();
89 
96  int Initialize(const vtkAMRBox *def, double* origin, double* spacing);
104  int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhosts);
105 
113  int Initialize(const vtkAMRBox *def, double* origin, double* spacing, const int nGhosts[3]);
122  int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhostsI,int nGhostsJ,int nGhostsK);
123 
125 
131  virtual void BlankPoint(vtkIdType ptId);
132  virtual void UnBlankPoint(vtkIdType ptId);
133  virtual void BlankPoint( const int i, const int j, const int k );
134  virtual void UnBlankPoint( const int i, const int j, const int k );
136 
138 
144  virtual void BlankCell(vtkIdType ptId);
145  virtual void UnBlankCell(vtkIdType ptId);
146  virtual void BlankCell( const int i, const int j, const int k );
147  virtual void UnBlankCell( const int i, const int j, const int k );
149 
154  bool HasAnyBlankCells() override;
159  bool HasAnyBlankPoints() override;
160 
166  virtual unsigned char IsPointVisible(vtkIdType ptId);
167 
173  virtual unsigned char IsCellVisible(vtkIdType cellId);
174 
175  virtual vtkImageData* NewImageDataCopy();
176 
178 
182  static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0);
184 
185 protected:
186  vtkUniformGrid();
187  ~vtkUniformGrid() override;
188 
192  void GetCellDims( int cellDims[3] );
193 
197  void ComputeScalarRange() override;
198 
199  vtkEmptyCell* GetEmptyCell();
200 
201 private:
202  vtkUniformGrid(const vtkUniformGrid&) = delete;
203  void operator=(const vtkUniformGrid&) = delete;
204 
205  vtkEmptyCell *EmptyCell;
206 
207  static unsigned char MASKED_CELL_VALUE;
208 };
209 
210 
211 #endif
212 
213 
214 
vtkAMRBox
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:33
vtkImageData.h
vtkDataSet::ComputeScalarRange
virtual void ComputeScalarRange()
Compute the range of the scalars and cache it into ScalarRange only if the cache became invalid (Scal...
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkUniformGrid::GetDataObjectType
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkUniformGrid.h:55
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkEmptyCell
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:29
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:34
vtkImageData::GetCellType
int GetCellType(vtkIdType cellId) override
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.
vtkImageData::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_UNIFORM_GRID
#define VTK_UNIFORM_GRID
Definition: vtkType.h:101
vtkImageData::GetCell
vtkCell * GetCell(vtkIdType cellId) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
vtkImageData::FindCell
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Locate cell based on global coordinate x and tolerance squared.
vtkImageData::GetDimensions
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
vtkImageData::FindAndGetCell
vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Locate the cell that contains a point and return the cell.
vtkUniformGrid::GetPointCells
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Topological inquiry to get cells using point.
Definition: vtkUniformGrid.h:79
vtkStructuredData::GetCellPoints
static void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds, int dataDescription, int dim[3])
Get the points defining a cell.
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
vtkStructuredData::GetPointCells
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3])
Get the cells using a point.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkDataSet::HasAnyBlankCells
virtual bool HasAnyBlankCells()
Returns 1 if there are any blanking cells 0 otherwise.
Definition: vtkDataSet.h:429
vtkUniformGrid::GetMaxCellSize
int GetMaxCellSize() override
Convenience method returns largest cell size in dataset.
Definition: vtkUniformGrid.h:82
vtkImageData::Initialize
void Initialize() override
Restore data object to initial state.
vtkImageData::vtkUniformGrid
friend class vtkUniformGrid
Definition: vtkImageData.h:477
vtkUniformGrid::GetCellPoints
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Topological inquiry to get points defining cell.
Definition: vtkUniformGrid.h:76
vtkDataSet::HasAnyBlankPoints
virtual bool HasAnyBlankPoints()
Returns 1 if there are any blanking points 0 otherwise.
Definition: vtkDataSet.h:438
vtkImageData::CopyStructure
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input image data object.
vtkX3D::spacing
Definition: vtkX3D.h:481
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkX3D::info
Definition: vtkX3D.h:376
vtkImageData::GetDataDescription
int GetDataDescription()
Definition: vtkImageData.h:471
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:36
vtkImageData::GetData
static vtkImageData * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkImageData::New
static vtkImageData * New()