3 #ifndef SCENEVIEW_DRAW_NODE_HPP__
4 #define SCENEVIEW_DRAW_NODE_HPP__
10 #include <sceneview/drawable.hpp>
11 #include <sceneview/scene_node.hpp>
12 #include <sceneview/geometry_resource.hpp>
13 #include <sceneview/material_resource.hpp>
38 void Add(
const Drawable::Ptr& drawable);
49 void Add(
const GeometryResource::Ptr& geometry,
50 const MaterialResource::Ptr& material);
55 const std::vector<Drawable::Ptr>&
Drawables()
const;
63 DrawGroup* GetDrawGroup() {
return draw_group_; }
65 void SetDrawGroup(DrawGroup* draw_group) {
66 draw_group_ = draw_group; }
70 friend class Drawable;
72 explicit DrawNode(
const QString& name);
74 std::vector<Drawable::Ptr> drawables_;
76 AxisAlignedBox bounding_box_;
77 bool bounding_box_dirty_;
79 DrawGroup* draw_group_ =
nullptr;
84 #endif // SCENEVIEW_DRAW_NODE_HPP__
Pure virtual class that all scene graph nodes inherit.
Definition: scene_node.hpp:41
void BoundingBoxChanged() override
Internal method, used to enable lazy bounding box computations.
const AxisAlignedBox & WorldBoundingBox() override
Retrieve the world-space bounding box of the node and all of its children (if applicable).
An axis-aligned box typically used for bounding box and intersection calculations.
Definition: axis_aligned_box.hpp:17
Scene node that contains a list of drawable objects.
Definition: draw_node.hpp:26
SceneNodeType NodeType() const override
Retrieve the node type.
Definition: draw_node.hpp:30
const std::vector< Drawable::Ptr > & Drawables() const
Retrieve a list of the drawables attached to the node.
Definition: draw_group.hpp:22
SceneNodeType
Specifies a scene node type.
Definition: scene_node.hpp:19
void Add(const Drawable::Ptr &drawable)
Attaches a generic drawable item to the node.