/usr/include/paraview/vtkSpyPlotBlock.h is in paraview-dev 5.0.1+dfsg1-4.
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 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkSpyPlotBlock.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 vtkSpyPlotBlock - Represents a SpyPlot Block Grid
// .SECTION Description
// vtkSpyPlotBlock is a regular hexahedral grid stored in a SpyPlot file.
// The grid can be part of an Adaptive Mesh Refinement (AMR) dataset or
// part
// The class was extracted from vtkSpyPlotUniReader and expanded upon by
// transisitioning functionality from vtkSpyPlotUniReader and adding it to
// this class. Note that this helper class is not derived from vtkObject
// and can be allocated on the static
#ifndef vtkSpyPlotBlock_h
#define vtkSpyPlotBlock_h
#include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
#include "vtkSystemIncludes.h"
class vtkCellData;
class vtkDoubleArray;
class vtkDataArray;
class vtkFloatArray;
class vtkSpyPlotIStream;
class vtkBoundingBox;
class vtkUnsignedCharArray;
class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkSpyPlotBlock
{
public:
vtkSpyPlotBlock();
~vtkSpyPlotBlock();
// Description:
//
int GetLevel() const;
void GetDimensions(int dims[3]) const;
int GetDimension(int i) const;
void GetBounds(double bounds[6])const;
void GetSpacing(double spacing[3]) const;
void GetVectors(vtkDataArray *coordinates[3]) const;
void GetVectors(vtkFloatArray *coordinates[3]) const;
vtkFloatArray *GetVectors(int i) const;
void GetExtents(int extents[6]) const;
int IsAllocated() const;
int IsFixed() const;
int IsActive() const;
int IsAMR() const;
void MarkedAsFixed();
void GetRealBounds(double realBounds[6]) const;
int GetAMRInformation(const vtkBoundingBox &globalBounds,
int *level,
double spacing[3],
double origin[3],
int extents[6],
int realExtents[6],
int realDimensions[3])const;
// Read reads in the actual block's information
int Read(int isAMR, int fileVersion, vtkSpyPlotIStream *stream);
// Advances the stream to be after the block, information w/r
// whether the block is allocated in the time step is returned
// as an arguement
static int Scan(vtkSpyPlotIStream *stream, unsigned char *isAllocated, int fileVersion);
int SetGeometry(int dir,
const unsigned char* encodedInfo,
int infoSize);
int GetTotalSize() const;
int FixInformation(const vtkBoundingBox &globalBounds,
int extents[6],
int realExtents[6],
int realDims[3],
vtkDataArray *ca[3]);
// Dummy functions so we can use vtk macros
void SetDebug(unsigned char i);
unsigned char GetDebug() const;
const char *GetClassName() const;
int HasObserver(const char *) const;
int InvokeEvent(const char *, void *) const;
void SetCoordinateSystem(const int &coordinateSystem);
void ComputeDerivedVariables(vtkCellData *data, const int &numberOfMaterials,
vtkDataArray** materialMasses, vtkDataArray** materialVolumeFractions,
const int &downConvertVolumeFraction) const;
protected:
//will return a negative volume if you requst a the volume of a cell
//that is outside the demensions of the block
double GetCellVolume(int i, int j, int k) const;
void ComputeMaterialDensity(vtkIdType position,
vtkDataArray* materialMasses, vtkUnsignedCharArray* materialFraction,
vtkDoubleArray* volumes, vtkDoubleArray* materialdensity,
double* material_mass, double* material_volume) const;
void ComputeMaterialDensity(vtkIdType position,
vtkDataArray* materialMasses, vtkFloatArray* materialFraction,
vtkDoubleArray* volumes, vtkDoubleArray* materialdensity,
double* material_mass, double* material_volume) const;
int Dimensions[3];
struct BlockStatusType
{
#ifndef __WRAP__
unsigned Active: 1;
unsigned Allocated: 1;
unsigned AMR: 1;
unsigned Fixed :1;
unsigned Debug :1;
#endif
};
BlockStatusType Status;
int Level;
vtkFloatArray* XYZArrays[3];
//for restoring structured once external ghost cells are removed
int SavedExtents[6];
int SavedRealExtents[6];
int SavedRealDims[3];
private:
enum CoordinateSystem
{
Cylinder1D=11,
Sphere1D=12,
Cartesian2D=20,
Cylinder2D=21,
Cartesian3D=30
};
CoordinateSystem CoordSystem;
};
inline int vtkSpyPlotBlock::GetLevel() const
{
return this->Level;
}
inline void vtkSpyPlotBlock::GetDimensions(int dims[3]) const
{
dims[0] = this->Dimensions[0];
dims[1] = this->Dimensions[1];
dims[2] = this->Dimensions[2];
}
inline int vtkSpyPlotBlock::IsActive() const
{
return this->Status.Active;
}
inline int vtkSpyPlotBlock::IsAllocated() const
{
return this->Status.Allocated;
}
inline int vtkSpyPlotBlock::IsAMR() const
{
return this->Status.AMR;
}
inline int vtkSpyPlotBlock::IsFixed() const
{
return this->Status.Fixed;
}
inline void vtkSpyPlotBlock::MarkedAsFixed()
{
this->Status.Fixed = 1;
}
inline int vtkSpyPlotBlock::GetDimension(int i) const
{
return this->Dimensions[i];
}
inline void vtkSpyPlotBlock::GetVectors(vtkFloatArray *fa[3]) const
{
fa[0] = this->XYZArrays[0];
fa[1] = this->XYZArrays[1];
fa[2] = this->XYZArrays[2];
}
inline vtkFloatArray *vtkSpyPlotBlock::GetVectors(int i) const
{
return this->XYZArrays[i];
}
inline void vtkSpyPlotBlock::GetExtents(int extents[6]) const
{
extents[0] = extents[2] = extents[4] = 0;
extents[1] = (this->Dimensions[0] == 1) ? 0 : this->Dimensions[0];
extents[3] = (this->Dimensions[1] == 1) ? 0 : this->Dimensions[1];
extents[5] = (this->Dimensions[2] == 1) ? 0 : this->Dimensions[2];
}
inline int vtkSpyPlotBlock::GetTotalSize() const
{
return (this->Dimensions[0]*
this->Dimensions[1]*
this->Dimensions[2]);
}
#endif
// VTK-HeaderTest-Exclude: vtkSpyPlotBlock.h
|