15 #ifndef vtkMultiBlockPLOT3DReaderInternals_h
16 #define vtkMultiBlockPLOT3DReaderInternals_h
18 #include "vtkIOParallelModule.h"
30 # define vtk_fseek _fseeki64
31 # define vtk_ftell _ftelli64
32 # define vtk_off_t __int64
34 # define vtk_fseek fseek
35 # define vtk_ftell ftell
36 # define vtk_off_t long
46 memset(this->
Values, 0, 3*
sizeof(
int));
53 std::vector<vtkSmartPointer<vtkStructuredGrid> >
Blocks;
69 NumberOfDimensions(3),
80 NeedToCheckXYZFile(true)
84 int ReadInts(FILE* fp,
int n,
int* val);
109 preskip = nPtsInPlane * extent[4];
110 postskip = nPtsInPlane * (wextent[5] - extent[5]);
116 class Plot3DException :
public std::exception
133 vtkTypeUInt64 HeaderOffset;
134 vtkTypeUInt64 FooterOffset;
137 typedef std::vector<vtkSubRecord> VectorOfSubRecords;
138 VectorOfSubRecords SubRecords;
150 static const int SubRecordSeparatorWidth =
sizeof(
int) * 2;
161 bool Initialize(FILE* fp, vtkTypeUInt64
offset,
171 return (this->SubRecords.size()==0 || this->SubRecords.front().HeaderOffset ==
offset);
180 return (this->SubRecords.size()==0 ||
181 (this->SubRecords.back().FooterOffset +
sizeof(
int) == offset));
187 SubRecordSeparators GetSubRecordSeparators(vtkTypeUInt64 startOffset, vtkTypeUInt64
length)
const;
194 static std::vector<std::pair<vtkTypeUInt64, vtkTypeUInt64> > GetChunksToRead(
195 vtkTypeUInt64 start, vtkTypeUInt64
length,
const std::vector<vtkTypeUInt64> &markers);
202 vtkTypeUInt64 GetLengthWithSeparators(vtkTypeUInt64 start, vtkTypeUInt64
length)
const;
205 vtkTypeUInt64 start, vtkTypeUInt64
length)
const
207 return this->GetChunksToRead(start, length, this->GetSubRecordSeparators(start, length));
int ReadInts(FILE *fp, int n, int *val)
vtkMultiBlockPLOT3DReaderInternals()
int CheckByteOrder(FILE *fp)
int CheckMultiGrid(FILE *fp)
std::vector< Dims > Dimensions
int Check2DGeom(FILE *fp)
static void CalculateSkips(const int extent[6], const int wextent[6], vtkIdType &preskip, vtkIdType &postskip)
bool AtEnd(vtkTypeUInt64 offset)
size_t CalculateFileSize(int mgrid, int precision, int blanking, int ndims, int hasByteCount, int nGrids, int *gridDims)
InternalSettings Settings
int CheckByteCount(FILE *fp)
int CheckBlankingAndPrecision(FILE *fp)
std::vector< vtkTypeUInt64 > SubRecordSeparators
size_t CalculateFileSizeForBlock(int precision, int blanking, int ndims, int hasByteCount, int *gridDims)
std::vector< vtkSmartPointer< vtkStructuredGrid > > Blocks
void CheckBinaryFile(FILE *fp, size_t fileSize)
int CheckCFile(FILE *fp, size_t fileSize)
std::vector< std::pair< vtkTypeUInt64, vtkTypeUInt64 > > GetChunksToRead(vtkTypeUInt64 start, vtkTypeUInt64 length) const
bool AtStart(vtkTypeUInt64 offset)
Multiprocessing communication superclass.