00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __RDFPARSER__H__
00013 #define __RDFPARSER__H__
00014
00015 #include "../../scenemanager.h"
00016 #include "../../geometrynode.h"
00017 #include "../../geometrytriangles.h"
00018 #include "../../textparser.h"
00019
00020
00021 namespace VRUT
00022 {
00023 class Module;
00024
00026 class RDFParser
00027 {
00028 private:
00030 wxInputStream * inputStream;
00032 SCENE_ID sceneID;
00034 wxString fileName;
00036 Module * module;
00037
00039 wxString readValue(TextParser &textParser)
00040 {
00041 if (textParser.GetChar() != '=')
00042 LOGERROR(wxT("<RDFParser>Wrong format for readValue."));
00043 return textParser.GetWxString();
00044 }
00045
00047 float readFloat(TextParser &textParser)
00048 {
00049 if (textParser.GetChar() != '=')
00050 LOGERROR(wxT("<RDFParser>Wrong format for readValue."));
00051 float val=0;
00052 if (!textParser.ParseFloat(&val))
00053 LOGERROR(wxT("<RDFParser>float expected."));
00054 return val;
00055 }
00056
00058 bool parseASCII(GeometryNode *node, std::vector<VECTOR3> * verts, std::vector<GeometryTriangles::Indice> * indices);
00059
00060 public:
00066 RDFParser(wxInputStream * _inputStream, SCENE_ID _sceneID, const wxString _scenePath, Module * _module);
00068 ~RDFParser();
00069
00073 bool Parse(const wxString & rootUid);
00074 };
00075 };
00076
00077
00078 #endif