diff --git a/parser/nodes.cc b/parser/nodes.cc new file mode 100644 index 0000000..e69de29 diff --git a/parser/nodes.h b/parser/nodes.h new file mode 100644 index 0000000..556a828 --- /dev/null +++ b/parser/nodes.h @@ -0,0 +1,26 @@ + +#ifndef NODES_H +#define NODES_H NODES_H + +#include + +class Node +{ + public: + void addChild(refptr child) { m_children.push_back(child); } + + virtual refptr getMaterial() + { + return refptr(NULL); + } + + protected: + std::vector< refptr > m_children; +}; + +class SceneNode +{ +}; + +#endif + diff --git a/parser/parser.yy b/parser/parser.yy index 4a73c2e..6f6eb0b 100644 --- a/parser/parser.yy +++ b/parser/parser.yy @@ -8,6 +8,7 @@ #include "util/Vector.h" #include "util/refptr.h" #include "shapes/Shape.h" /* includes all shape types */ +#include "nodes.h" using namespace std; extern "C" { @@ -27,28 +28,6 @@ int yywrap() return 1; } -class Node -{ - public: - Node(); - int type; - refptr the_double; - refptr the_Node; - refptr the_tail; - refptr the_Material; - refptr the_Shape; - refptr the_Vector; - refptr the_Color; -}; - -enum Node_Type -{ - Node_Shape = 0x42001, /* don't clash with bison token namespace */ - Node_Camera, - Node_Options, - Node_Light -}; - #define YYSTYPE refptr static Scene * g_scene;