00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfPolyReader_h_
00026 #define _CIvfPolyReader_h_
00027
00028 #include <ivffile/IvfFileReader.h>
00029
00030
00031
00032
00033 #define ET_NONE -1
00034 #define ET_VERTEX 0
00035 #define ET_FACE 1
00036 #define ET_EDGE 2
00037
00038 #define PFR_UINT8 0
00039 #define PFR_INT8 1
00040 #define PFR_UINT16 2
00041 #define PFR_INT16 3
00042 #define PFR_INT32 4
00043 #define PFR_UINT32 5
00044 #define PFR_FLOAT32 6
00045 #define PFR_FLOAT64 7
00046
00047 #define PFR_X 0
00048 #define PFR_Y 1
00049 #define PFR_Z 2
00050 #define PFR_RED 3
00051 #define PFR_GREEN 4
00052 #define PFR_BLUE 5
00053 #define PFR_OTHER 6
00054
00055 IvfSmartPointer(CIvfPolyReader);
00056
00066 class IVFFILE_API CIvfPolyReader : public CIvfFileReader {
00067 private:
00068 std::string m_row;
00069 int m_nFaces;
00070 int m_nVertices;
00071 int m_nEdges;
00072 int m_currentElementType;
00073 std::vector<int> m_vertexDataType;
00074 std::vector<int> m_vertexPropType;
00075 std::vector<int> m_faceDataType;
00076 std::vector<int> m_facePropType;
00077 std::vector<int> m_elementOrder;
00078
00079 int getDatatype(std::string &row, int &pos, int &size);
00080 int getElementType(std::string &row);
00081 int getKeyword(std::string &row);
00082 bool checkHeader(std::istream &in);
00083 bool parseProperty(std::string &row);
00084 bool parseComment(std::string &row);
00085 bool parseElement(std::string &row);
00086 bool parseHeader(std::istream &in);
00087 bool readEdges(std::istream &in);
00088 bool readFaces(std::istream &in);
00089 bool readVertices(std::istream &in);
00090 bool readData(std::istream &in);
00091 public:
00093 CIvfPolyReader();
00094
00096 virtual ~CIvfPolyReader();
00097
00098 IvfClassInfo("CIvfPolyReader",CIvfFileReader);
00099
00101 virtual void read();
00102
00103 };
00104
00105 #endif