X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fscene.h;h=65e1a55565a75c8cd6266d00f78a356b10aad7fe;hp=f295bbced04a810bc867419b9a75dff534753291;hb=0d27f859021b4af5dbb5404ef5af012546abf335;hpb=68e71418a70dab4174981d5a579e96a9089f8682 diff --git a/src/scene.h b/src/scene.h index f295bbc..65e1a55 100644 --- a/src/scene.h +++ b/src/scene.h @@ -3,6 +3,7 @@ #include #include +#include #include "mesh.h" #include "snode.h" #include "texture.h" @@ -21,6 +22,8 @@ class MetaScene; class Scene { public: + std::string name; + MetaScene *metascn; DataMap datamap; @@ -34,7 +37,7 @@ public: TextureSet *texset; void *loader_data; - explicit Scene(); + Scene(); ~Scene(); Scene(const Scene &rhs) = delete; @@ -60,6 +63,13 @@ public: bool remove_node(SceneNode *n); bool have_node(SceneNode *n) const; + // find node by name + SceneNode *find_node(const char *name) const; + // match nodes with regexp and return the first that matches + SceneNode *match_node(const char *qstr) const; + // match nodes with regexp and return a list of matches + std::list match_nodes(const char *qstr) const; + /* find and remove all nodes whose names match the regexp * XXX at the moment this has the effect of flattening the hierarchy in the * result scene. If we ever need verbatim extraction of whole subtrees we'll @@ -77,6 +87,7 @@ public: void draw() const; }; +//! Resource manager for Scenes class SceneSet : public DataSet { private: static Scene *create_scene();