Browse Source

SceneGraph: renamed Animable::group() to Animable::animables().

Fixes ambiguous case when inheriting multiple grouped features in a
single object. The original functions are now aliases to the new ones,
are marked as deprecated and will be removed in future release.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
61eb7fcfe3
  1. 22
      src/SceneGraph/Animable.h
  2. 6
      src/SceneGraph/Animable.hpp

22
src/SceneGraph/Animable.h

@ -216,12 +216,28 @@ template<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT Animabl
}
/**
* @brief %Animable group containing this animable
* @brief Group containing this animable
*
* If the animable doesn't belong to any group, returns `nullptr`.
*/
AnimableGroup<dimensions, T>* group();
const AnimableGroup<dimensions, T>* group() const; /**< @overload */
AnimableGroup<dimensions, T>* animables();
const AnimableGroup<dimensions, T>* animables() const; /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copydoc animables()
* @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()"
* instead.
*/
AnimableGroup<dimensions, T>* group() { return animables(); }
/**
* @copydoc animables()
* @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()"
* instead.
*/
const AnimableGroup<dimensions, T>* group() const { return animables(); }
#endif
protected:
/**

6
src/SceneGraph/Animable.hpp

@ -47,16 +47,16 @@ template<UnsignedInt dimensions, class T> Animable<dimensions, T>& Animable<dime
return *this;
/* Wake up the group in case no animations are running */
group()->wakeUp = true;
animables()->wakeUp = true;
currentState = state;
return *this;
}
template<UnsignedInt dimensions, class T> AnimableGroup<dimensions, T>* Animable<dimensions, T>::group() {
template<UnsignedInt dimensions, class T> AnimableGroup<dimensions, T>* Animable<dimensions, T>::animables() {
return static_cast<AnimableGroup<dimensions, T>*>(AbstractGroupedFeature<dimensions, Animable<dimensions, T>, T>::group());
}
template<UnsignedInt dimensions, class T> const AnimableGroup<dimensions, T>* Animable<dimensions, T>::group() const {
template<UnsignedInt dimensions, class T> const AnimableGroup<dimensions, T>* Animable<dimensions, T>::animables() const {
return static_cast<const AnimableGroup<dimensions, T>*>(AbstractGroupedFeature<dimensions, Animable<dimensions, T>, T>::group());
}

Loading…
Cancel
Save