source: trunk/VUT/GtpVisibilityPreprocessor/src/X3dParser.h @ 162

Revision 162, 1.6 KB checked in by bittner, 19 years ago (diff)

functional raycasting version

Line 
1#ifndef __X3DPARSER_H
2#define __X3DPARSER_H
3
4#include "parser.h"
5#include "mesh.h"
6
7#include <X3DTK/MESH/scenegraph.h>
8#include <X3DTK/kernel.h>
9#include <X3DTK/MESH/scenegraph.h>
10
11class X3dParser : public Parser
12{
13public:
14  X3dParser():Parser() {}
15 
16 
17  bool ParseFile(const string filename, SceneGraphNode **root);
18 
19};
20
21};
22
23
24namespace X3DTK {
25namespace MESH {
26
27class MyStructureComputerStateVariables : public StateVariables
28{
29public:
30  MyStructureComputerStateVariables();
31 
32  void init();
33  void finish();
34 
35  void beginNewMesh();
36  inline void addVertex(float x, float y, float z) {
37    //_mesh->addVertex(x, y, z);
38  };
39
40  void addFace(const Face &face);
41
42  void pushMatrix(const SFMatrix34f &transformation); 
43  void popMatrix();
44 
45inline Mesh *getMesh() const {return _mesh;}; 
46  SFMatrix34f getMatrix() const {return _matrixStack.front();};
47 
48private:
49  Mesh *_mesh;
50  unsigned int _decal;
51  std::list<SFMatrix34f> _matrixStack;
52};
53 
54  // MyStructureComputer processor.
55 
56  class MyStructureComputer : public X3DOnePassProcessor
57  {
58public:
59    MyStructureComputer();
60    virtual ~MyStructureComputer();
61   
62    virtual Mesh *compute(SFNode N);
63  };
64
65  class X3DGroupingNode;
66  class Transform;
67 
68  /// Visitor for the Core component of the MyStructureComputer module.
69 
70  class MyStructureComputerCoreVisitor : public CoreVisitor
71  {
72  public:
73    MyStructureComputerCoreVisitor();
74   
75    static void enterMesh(Mesh *M);
76    static void enterTransform(Transform *T);
77    static void leaveX3DGroupingNode(X3DGroupingNode *N);
78  };
79 
80}
81
82
83#endif
Note: See TracBrowser for help on using the repository browser.