source: trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.h @ 462

Revision 462, 3.2 KB checked in by mattausch, 19 years ago (diff)

worked on vsp kd view cells

Line 
1#ifndef __X3DEXPORTER_H
2#define __X3DEXPORTER_H
3
4#include <string>
5using std::string;
6
7#include <iostream>
8#include <fstream>
9
10#include "Exporter.h"
11#include "Containers.h"
12#include "VssRay.h"
13
14class SceneGraphNode;
15class Mesh;
16class Intersectable;
17class MeshInstance;
18class Polygon3;
19class ViewCell;
20class BspTree;
21class VspBspTree;
22class BspNode;
23class VspKdViewCell;
24
25
26class X3dExporter : public Exporter
27{
28  std::ofstream stream;
29
30public:
31
32  X3dExporter(const string filename);
33
34  ~X3dExporter();
35
36
37//    bool
38//    ExportRays(const vector<Ray> &rays,
39//           const float length=1000,
40//           const RgbColor &color = RgbColor(1,1,1));
41
42
43  bool
44  ExportKdTree(const KdTree &tree);
45
46  bool
47  ExportVssTree(const VssTree &tree);
48
49  bool
50  ExportVssTree2(const VssTree &tree,
51                                 const Vector3 direction
52                                 );
53
54  virtual bool
55  ExportRssTree2(const RssTree &tree,
56                                 const Vector3 direction
57                                 );
58
59  bool
60  ExportVspKdTree(const VspKdTree &tree, const int maxPvs);
61
62  bool ExportBspTree(const BspTree &tree);
63
64  bool
65  ExportScene(SceneGraphNode *root)
66  {
67    ExportSceneNode(root);
68    return true;
69  }
70
71  virtual void
72  ExportPolygon(Polygon3 *poly);
73
74  virtual void
75  ExportPolygons(const PolygonContainer &polys);
76
77  virtual bool
78  ExportBox(const AxisAlignedBox3 &box);
79
80  virtual void
81  ExportMeshInstance(MeshInstance *mi);
82
83  virtual void
84  ExportIntersectable(Intersectable *object);
85
86  virtual void
87  ExportMesh(Mesh *mesh);
88
89  virtual void
90  ExportViewCell(ViewCell *viewCell);
91
92  virtual void
93  ExportViewCells(const ViewCellContainer &viewCells);
94
95  virtual void
96  ExportGeometry(const ObjectContainer &objects);
97
98  bool
99  ExportRays(const RayContainer &rays,
100                         const float length=1000,
101                         const RgbColor &color = RgbColor(1,1,1));
102  bool
103  ExportRays(const VssRayContainer &rays,
104                         const RgbColor &color = RgbColor(1,1,1));
105
106  virtual void
107  ExportBspSplitPlanes(const BspTree &tree);
108
109  virtual void
110  ExportBspSplits(const BspTree &tree, const bool exportDepth);
111
112  virtual void
113  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
114
115  virtual void
116  ExportBspViewCellPartition(const BspTree &tree, const int maxPvs = 0);
117
118  virtual void
119  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
120
121
122  virtual void
123  ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
124
125  virtual void
126  ExportBspViewCellPartition(const VspBspTree &tree, const int maxPvs = 0);
127
128  virtual bool
129  ExportVspKdTreeViewCells(const VspKdTree &tree, const int maxPvs = 0);
130
131protected:
132
133
134  virtual void
135  ExportSceneNode(SceneGraphNode *node);
136
137  bool
138  ExportKdTreeRayDensity(const KdTree &tree);
139
140  bool
141  ExportBspTreeRayDensity(const BspTree &tree);
142
143  void
144  AddBoxToMesh(const AxisAlignedBox3 &box,
145                           Mesh *mesh);
146
147  void ExportBspNodeSplits(BspNode *root,
148                                                   const AxisAlignedBox3 &box,
149                                                   const bool exportDepth,
150                                                   const bool epsilon);
151
152  bool ExportVspKdTreeViewCell(const VspKdTree &tree, const VspKdViewCell &vc);
153
154
155  void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
156
157};
158
159
160
161#endif
Note: See TracBrowser for help on using the repository browser.