IvfPolyReader.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 //
00022 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef _CIvfPolyReader_h_
00026 #define _CIvfPolyReader_h_
00027 
00028 #include <ivffile/IvfFileReader.h>
00029 
00030 //namespace std {};
00031 //using namespace std;
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 

Generated on Fri Sep 1 15:36:46 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO