VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMultiBlockPLOT3DReaderInternals.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 #ifndef __vtkMultiBlockPLOT3DReaderInternals_h 00016 #define __vtkMultiBlockPLOT3DReaderInternals_h 00017 00018 #include "vtkByteSwap.h" 00019 #include "vtkMultiBlockPLOT3DReader.h" 00020 #include "vtkSmartPointer.h" 00021 #include "vtkStructuredGrid.h" 00022 00023 #include <vector> 00024 00025 struct vtkMultiBlockPLOT3DReaderInternals 00026 { 00027 std::vector<vtkSmartPointer<vtkStructuredGrid> > Blocks; 00028 int BinaryFile; 00029 int ByteOrder; 00030 int HasByteCount; 00031 int MultiGrid; 00032 int NumberOfDimensions; 00033 int Precision; // in bytes 00034 int IBlanking; 00035 00036 bool NeedToCheckXYZFile; 00037 00038 vtkMultiBlockPLOT3DReaderInternals() : 00039 BinaryFile(1), 00040 ByteOrder(vtkMultiBlockPLOT3DReader::FILE_BIG_ENDIAN), 00041 HasByteCount(1), 00042 MultiGrid(0), 00043 NumberOfDimensions(3), 00044 Precision(4), 00045 IBlanking(0), 00046 NeedToCheckXYZFile(true) 00047 { 00048 } 00049 00050 int ReadInts(FILE* fp, int n, int* val); 00051 void CheckBinaryFile(FILE *fp); 00052 int CheckByteOrder(FILE* fp); 00053 int CheckByteCount(FILE* fp); 00054 int CheckMultiGrid(FILE* fp); 00055 int Check2DGeom(FILE* fp); 00056 int CheckBlankingAndPrecision(FILE* fp); 00057 int CheckCFile(FILE* fp, long fileSize); 00058 long CalculateFileSize(int mgrid, 00059 int precision, // in bytes 00060 int blanking, 00061 int ndims, 00062 int hasByteCount, 00063 int nGrids, 00064 int* gridDims); 00065 long CalculateFileSizeForBlock(int precision, // in bytes 00066 int blanking, 00067 int ndims, 00068 int hasByteCount, 00069 int* gridDims); 00070 }; 00071 #endif 00072 // VTK-HeaderTest-Exclude: vtkMultiBlockPLOT3DReaderInternals.h