From 05167c36fdf1a291b1c75c8bea476d200a4d61fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 3 Nov 2013 20:02:22 +0100 Subject: [PATCH] SceneGraph: add Drawable::drawables() function. Similar to Animable::animables(). --- src/SceneGraph/Drawable.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/SceneGraph/Drawable.h b/src/SceneGraph/Drawable.h index b8e388a2f..305251c8d 100644 --- a/src/SceneGraph/Drawable.h +++ b/src/SceneGraph/Drawable.h @@ -129,6 +129,20 @@ template class Drawable: public AbstractGrouped */ explicit Drawable(AbstractObject& object, DrawableGroup* drawables = nullptr): AbstractGroupedFeature, T>(object, drawables) {} + /** + * @brief Group containing this drawable + * + * If the drawable doesn't belong to any group, returns `nullptr`. + */ + DrawableGroup* drawables() { + return AbstractGroupedFeature, T>::group(); + } + + /** @overload */ + const DrawableGroup* drawables() const { + return AbstractGroupedFeature, T>::group(); + } + /** * @brief Draw the object using given camera * @param transformationMatrix %Object transformation relative