00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __VRMLWRITER__H__
00011 #define __VRMLWRITER__H__
00012
00013 #include "../../core/src/scenemanager.h"
00014 #include "../../core/src/geometrynode.h"
00015 #include "../../core/src/lightnode.h"
00016 #include "../../core/src/light.h"
00017 #include "../../core/src/camera.h"
00018 #include "../../core/src/geometrytriangles.h"
00019 #include "../../core/src/textwriter.h"
00020 #include "decompose.h"
00021 #include <stdio.h>
00022
00023 namespace VRUT
00024 {
00026 class VRMLWriter
00027 {
00028 private:
00030 wxBufferedOutputStream * outputStream;
00032 const Scene * scene;
00033 const wxString fname;
00034 TextWriter * tw;
00035 float maxBoundDistance;
00036 int mode;
00037 bool ccw;
00038 bool extraCams;
00039
00040 public:
00044 VRMLWriter(wxBufferedOutputStream * _outputStream, const Scene * _scene, const wxString &_fname);
00046 ~VRMLWriter();
00047
00049 void Write(bool hFlag, bool _extraCams);
00050
00051 private:
00052 void ExportFileInfo();
00053 void ExportWorldInfo();
00054 void ExportNode1(const SceneNode * node, wxString * tabs);
00055 void ExportNode2(const SceneNode * node, wxString * tabs, bool det);
00056 void ExportGeometry(const SceneNode * node, wxString * tabs, bool det);
00057 void ExportIndexedFaceSet(const SceneNode * node, wxString * tabs, bool det, bool outputTexCoord);
00058 void ExportIndexedLineSet(const SceneNode * node, wxString * tabs);
00059 void ExportPointSet(const SceneNode * node, wxString * tabs);
00060 bool ExportAppearance(const SceneNode * node, wxString * tabs);
00061 void ExportCamera(const SceneNode * node, wxString * tabs);
00062 void ExportCameras();
00063 void ExportGeneralLight(const SceneNode * node, wxString * tabs);
00064 void ExportOmniLight(const Light * light, const SceneNode * node, wxString * tabs);
00065 void ExportDirectionalLight(const Light * light, const SceneNode * node, wxString * tabs);
00066 void ExportSpotLight(const Light * light, const SceneNode * node, wxString * tabs);
00067 bool ExportTransform(const SceneNode * node, wxString * tabs, bool det);
00068 void AngAxisFromQa(const Quat& q, float *ang, vector3& axis);
00069 };
00070 };
00071
00072
00073 #endif
00074