3 #ifndef SCENEVIEW_SCENE_HPP__
4 #define SCENEVIEW_SCENE_HPP__
12 #include <sceneview/geometry_resource.hpp>
13 #include <sceneview/material_resource.hpp>
38 typedef std::shared_ptr<Scene> Ptr;
40 static const QString kAutoName;
55 const QString& Name()
const {
return scene_name_; }
70 const QString& name = kAutoName);
80 const QString& name = kAutoName);
88 const QString& name = kAutoName);
96 const QString& name = kAutoName);
106 const QString& name = kAutoName);
119 const GeometryResource::Ptr& geometry,
120 const MaterialResource::Ptr& material,
121 const QString& name = kAutoName);
131 const QString& name = kAutoName);
164 std::vector<LightNode*>&
Lights() {
return lights_; }
174 DrawGroup* GetDefaultDrawGroup() {
return default_draw_group_; }
179 friend class ResourceManager;
181 explicit Scene(
const QString& name);
183 QString AutogenerateName();
185 QString PickName(
const QString& name);
189 GroupNode* root_node_;
193 DrawGroup* default_draw_group_;
195 std::vector<LightNode*> lights_;
196 std::vector<CameraNode*> cameras_;
197 std::vector<DrawGroup*> draw_groups_;
198 std::map<QString, SceneNode*> nodes_;
203 #endif // SCENEVIEW_SCENE_HPP__
A scene graph node that can have children.
Definition: group_node.hpp:26
GroupNode * Root()
Retrieve the root node.
Definition: scene.hpp:62
DrawGroup * MakeDrawGroup(int ordering, const QString &name=kAutoName)
Create a draw group.
Pure virtual class that all scene graph nodes inherit.
Definition: scene_node.hpp:41
void DestroyDrawGroup(DrawGroup *draw_group)
Destroys a draw group.
Scene node that contains a list of drawable objects.
Definition: draw_node.hpp:26
Camera.
Definition: camera_node.hpp:25
void SetDrawGroup(DrawNode *draw_node, DrawGroup *draw_group)
Sets the draw group that a draw node belongs to.
static constexpr int kDefaultDrawGroupOrder
The order assigned to the default render group.
Definition: scene.hpp:45
void DestroyNode(SceneNode *node)
Destroys a node and all of its children.
A scene graph.
Definition: scene.hpp:36
LightNode * MakeLight(GroupNode *parent, const QString &name=kAutoName)
Create a light.
Definition: draw_group.hpp:22
A light in a scene graph used by some shaders to calculate lighting effects.
Definition: light_node.hpp:32
std::vector< LightNode * > & Lights()
Retrieve a list of all lights in the scene.
Definition: scene.hpp:164
DrawGroup * GetDrawGroup(const QString &name)
Retrieve the draw group with the specified name.
DrawNode * MakeDrawNode(GroupNode *parent, const QString &name=kAutoName)
Create an empty draw node.
static const QString kDefaultDrawGroupName
Name of the default render group.
Definition: scene.hpp:50
GroupNode * MakeGroupFromScene(GroupNode *parent, Scene::Ptr scene, const QString &name=kAutoName)
Create a group node populated as a copy of the specified scene graph.
CameraNode * MakeCamera(GroupNode *parent, const QString &name=kAutoName)
Create a camera.
GroupNode * MakeGroup(GroupNode *parent, const QString &name=kAutoName)
Create an empty group node.