00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRML_PARSER_H
00019 #define VRML_PARSER_H
00020
00021 #include <string>
00022 #include <fstream>
00023 #include "Scene.h"
00024
00026 class VRMLParser {
00027 std::ifstream in;
00028 std::ofstream out;
00029 std::vector <Vertex *> parseVertices();
00030 std::vector <GLint> parseCoordIndex();
00031 std::vector <Color *> parseColor();
00032 std::vector <Color *> setColor(Color * c);
00033
00034 std::vector <Vertex *> vertices;
00035 std::vector <GLint> coordIndex;
00036 std::vector <Color *> colors;
00037
00038
00039
00040
00041 GLvoid addModelToScene(Scene * s);
00042 Color * diffuseColor;
00043 Vector translate;
00044 bool clockwise;
00045 std::vector <Vertex *> vertexList;
00046 bool verticesFinished;
00047 bool coordIndexFinished;
00048 bool colorsFinished;
00049 bool diffuseColorFinished;
00050 bool normalsFinished;
00051 bool normalIndexFinished;
00052 bool foundTranslation;
00053
00054 GLint numVertex;
00055
00056 public:
00057
00059 VRMLParser();
00060
00062
00070 Scene * parse(std::string filename);
00071
00073
00079 bool write(Scene * scene, std::string filename);
00080 };
00081
00082 #endif