/usr/include/vtk-5.10/vtkRectilinearGrid.h is in libvtk5-dev 5.10.1+dfsg-2.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkRectilinearGrid.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkRectilinearGrid - a dataset that is topologically regular with variable spacing in the three coordinate directions
// .SECTION Description
// vtkRectilinearGrid is a data object that is a concrete implementation of
// vtkDataSet. vtkRectilinearGrid represents a geometric structure that is
// topologically regular with variable spacing in the three coordinate
// directions x-y-z.
//
// To define a vtkRectilinearGrid, you must specify the dimensions of the
// data and provide three arrays of values specifying the coordinates
// along the x-y-z axes. The coordinate arrays are specified using three
// vtkDataArray objects (one for x, one for y, one for z).
// .SECTION Caveats
// Make sure that the dimensions of the grid match the number of coordinates
// in the x-y-z directions. If not, unpredictable results (including
// program failure) may result. Also, you must supply coordinates in all
// three directions, even if the dataset topology is 2D, 1D, or 0D.
#ifndef __vtkRectilinearGrid_h
#define __vtkRectilinearGrid_h
#include "vtkDataSet.h"
#include "vtkStructuredData.h" // For inline methods
class vtkVertex;
class vtkLine;
class vtkPixel;
class vtkVoxel;
class vtkDataArray;
class VTK_FILTERING_EXPORT vtkRectilinearGrid : public vtkDataSet
{
public:
static vtkRectilinearGrid *New();
vtkTypeMacro(vtkRectilinearGrid,vtkDataSet);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Return what type of dataset this is.
int GetDataObjectType() {return VTK_RECTILINEAR_GRID;};
// Description:
// Copy the geometric and topological structure of an input rectilinear grid
// object.
void CopyStructure(vtkDataSet *ds);
// Description:
// Restore object to initial state. Release memory back to system.
void Initialize();
// Description:
// Standard vtkDataSet API methods. See vtkDataSet for more information.
vtkIdType GetNumberOfCells();
vtkIdType GetNumberOfPoints();
double *GetPoint(vtkIdType ptId);
void GetPoint(vtkIdType id, double x[3]);
vtkCell *GetCell(vtkIdType cellId);
void GetCell(vtkIdType cellId, vtkGenericCell *cell);
void GetCellBounds(vtkIdType cellId, double bounds[6]);
vtkIdType FindPoint(double x, double y, double z) { return this->vtkDataSet::FindPoint(x, y, z);};
vtkIdType FindPoint(double x[3]);
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2,
int& subId, double pcoords[3], double *weights);
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell,
vtkIdType cellId, double tol2, int& subId,
double pcoords[3], double *weights);
vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,
double tol2, int& subId, double pcoords[3],
double *weights);
int GetCellType(vtkIdType cellId);
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
{vtkStructuredData::GetCellPoints(cellId,ptIds,this->DataDescription,
this->Dimensions);}
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
{vtkStructuredData::GetPointCells(ptId,cellIds,this->Dimensions);}
void ComputeBounds();
int GetMaxCellSize() {return 8;}; //voxel is the largest
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
vtkIdList *cellIds);
// Description:
// Set dimensions of rectilinear grid dataset.
// This also sets the extent.
void SetDimensions(int i, int j, int k);
void SetDimensions(int dim[3]);
// Description:
// Get dimensions of this rectilinear grid dataset.
vtkGetVectorMacro(Dimensions,int,3);
// Description:
// Return the dimensionality of the data.
int GetDataDimension();
// Description:
// Convenience function computes the structured coordinates for a point x[3].
// The cell is specified by the array ijk[3], and the parametric coordinates
// in the cell are specified with pcoords[3]. The function returns a 0 if the
// point x is outside of the grid, and a 1 if inside the grid.
int ComputeStructuredCoordinates(double x[3], int ijk[3], double pcoords[3]);
// Description:
// Given a location in structured coordinates (i-j-k), return the point id.
vtkIdType ComputePointId(int ijk[3]);
// Description:
// Given a location in structured coordinates (i-j-k), return the cell id.
vtkIdType ComputeCellId(int ijk[3]);
// Description:
// Specify the grid coordinates in the x-direction.
virtual void SetXCoordinates(vtkDataArray*);
vtkGetObjectMacro(XCoordinates,vtkDataArray);
// Description:
// Specify the grid coordinates in the y-direction.
virtual void SetYCoordinates(vtkDataArray*);
vtkGetObjectMacro(YCoordinates,vtkDataArray);
// Description:
// Specify the grid coordinates in the z-direction.
virtual void SetZCoordinates(vtkDataArray*);
vtkGetObjectMacro(ZCoordinates,vtkDataArray);
// Description:
// Different ways to set the extent of the data array. The extent
// should be set before the "Scalars" are set or allocated.
// The Extent is stored in the order (X, Y, Z).
void SetExtent(int extent[6]);
void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
vtkGetVector6Macro(Extent, int);
// Description:
// Return the actual size of the data in kilobytes. This number
// is valid only after the pipeline has updated. The memory size
// returned is guaranteed to be greater than or equal to the
// memory required to represent the data (e.g., extra space in
// arrays, etc. are not included in the return value). THIS METHOD
// IS THREAD SAFE.
unsigned long GetActualMemorySize();
// Description:
// Shallow and Deep copy.
void ShallowCopy(vtkDataObject *src);
void DeepCopy(vtkDataObject *src);
// Description:
// Structured extent. The extent type is a 3D extent
int GetExtentType() { return VTK_3D_EXTENT; };
// Description:
// Reallocates and copies to set the Extent to the UpdateExtent.
// This is used internally when the exact extent is requested,
// and the source generated more than the update extent.
virtual void Crop();
//BTX
// Description:
// Retrieve an instance of this class from an information object.
static vtkRectilinearGrid* GetData(vtkInformation* info);
static vtkRectilinearGrid* GetData(vtkInformationVector* v, int i=0);
//ETX
protected:
vtkRectilinearGrid();
~vtkRectilinearGrid();
// for the GetCell method
vtkVertex *Vertex;
vtkLine *Line;
vtkPixel *Pixel;
vtkVoxel *Voxel;
int Dimensions[3];
int DataDescription;
int Extent[6];
vtkDataArray *XCoordinates;
vtkDataArray *YCoordinates;
vtkDataArray *ZCoordinates;
// Hang on to some space for returning points when GetPoint(id) is called.
double PointReturn[3];
private:
void Cleanup();
// Description:
// For legacy compatibility. Do not use.
VTK_LEGACY(void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds));
private:
vtkRectilinearGrid(const vtkRectilinearGrid&); // Not implemented.
void operator=(const vtkRectilinearGrid&); // Not implemented.
};
//----------------------------------------------------------------------------
inline vtkIdType vtkRectilinearGrid::GetNumberOfCells()
{
vtkIdType nCells=1;
int i;
for (i=0; i<3; i++)
{
if (this->Dimensions[i] <= 0)
{
return 0;
}
if (this->Dimensions[i] > 1)
{
nCells *= (this->Dimensions[i]-1);
}
}
return nCells;
}
//----------------------------------------------------------------------------
inline vtkIdType vtkRectilinearGrid::GetNumberOfPoints()
{
return this->Dimensions[0]*this->Dimensions[1]*this->Dimensions[2];
}
//----------------------------------------------------------------------------
inline int vtkRectilinearGrid::GetDataDimension()
{
return vtkStructuredData::GetDataDimension(this->DataDescription);
}
//----------------------------------------------------------------------------
inline vtkIdType vtkRectilinearGrid::ComputePointId(int ijk[3])
{
return vtkStructuredData::ComputePointId(this->Dimensions,ijk);
}
//----------------------------------------------------------------------------
inline vtkIdType vtkRectilinearGrid::ComputeCellId(int ijk[3])
{
return vtkStructuredData::ComputeCellId(this->Dimensions,ijk);
}
//----------------------------------------------------------------------------
#ifndef VTK_LEGACY_REMOVE
inline void vtkRectilinearGrid::GetCellNeighbors(vtkIdType cellId,
vtkIdList& ptIds, vtkIdList& cellIds)
{
this->GetCellNeighbors(cellId, &ptIds, &cellIds);
}
#endif
#endif
|