- added imgui
[laserbrain_demo] / src / scene.h
index 1cf8dcc..c0a5612 100644 (file)
@@ -31,7 +31,7 @@ public:
 
        Mesh *walk_mesh;
 
-       TextureSet *texset;     // only owned by Scene if own_texset is true
+       TextureSet *texset;
        void *loader_data;
 
        explicit Scene();
@@ -41,6 +41,7 @@ public:
        Scene &operator =(const Scene &rhs) = delete;
 
        void destroy();
+       void clear();   // clear all contents (meshes, objects, and nodes)
 
        bool load(const char *fname, unsigned int flags = 0);
 
@@ -59,6 +60,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<SceneNode*> 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
@@ -76,6 +84,7 @@ public:
        void draw() const;
 };
 
+//! Resource manager for Scenes
 class SceneSet : public DataSet<Scene*> {
 private:
        static Scene *create_scene();