Browse Source

SceneGraph: expose Type typedef and Dimensions constant everywhere.

pull/300/head
Vladimír Vondruš 7 years ago
parent
commit
f7a2694390
  1. 10
      doc/changelog.dox
  2. 7
      src/Magnum/SceneGraph/AbstractFeature.h
  3. 9
      src/Magnum/SceneGraph/AbstractObject.h
  4. 21
      src/Magnum/SceneGraph/FeatureGroup.h

10
doc/changelog.dox

@ -160,6 +160,16 @@ See also:
bootstrap project for using Magnum together with wxWidgets (see
[mosra/magnum-bootstrap#19](https://github.com/mosra/magnum-bootstrap/pull/19))
@subsubsection changelog-latest-new-scenegraph SceneGraph library
- Added @ref SceneGraph::AbstractObject::Type /
@ref SceneGraph::AbstractFeature::Type /
@ref SceneGraph::AbstractFeatureGroup::Type typedefs and
@ref SceneGraph::AbstractObject::Dimensions /
@ref SceneGraph::AbstractFeature::Dimensions /
@ref SceneGraph::AbstractFeatureGroup::Dimensions constants for querying
underlying type and dimension template parameters
@subsubsection changelog-latest-new-shaders Shaders library
- Normal texture support in @ref Shaders::Phong

7
src/Magnum/SceneGraph/AbstractFeature.h

@ -136,6 +136,13 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
#endif
{
public:
/** @brief Object transformation underlying type */
typedef T Type;
enum: UnsignedInt {
Dimensions = dimensions /**< Dimension count */
};
/**
* @brief Constructor
* @param object Object holding this feature

9
src/Magnum/SceneGraph/AbstractObject.h

@ -78,12 +78,19 @@ template<UnsignedInt dimensions, class T> class AbstractObject
#endif
{
public:
/** @brief Transformation underlying type */
typedef T Type;
/** @brief Matrix type */
typedef MatrixTypeFor<dimensions, T> MatrixType;
/** @brief Feature object type */
/** @brief Feature type */
typedef AbstractFeature<dimensions, T> FeatureType;
enum: UnsignedInt {
Dimensions = dimensions /**< Dimension count */
};
/* This isn't protected because having virtual destructor here is
better than having it duplicated in all Object specializations */
explicit AbstractObject();

21
src/Magnum/SceneGraph/FeatureGroup.h

@ -43,15 +43,24 @@ namespace Magnum { namespace SceneGraph {
See @ref FeatureGroup.
*/
template<UnsignedInt dimensions, class T> class AbstractFeatureGroup {
template<UnsignedInt, class, class> friend class FeatureGroup;
public:
/** @brief Object transformation underlying type */
typedef T Type;
enum: UnsignedInt {
Dimensions = dimensions /**< Dimension count */
};
private:
template<UnsignedInt, class, class> friend class FeatureGroup;
explicit AbstractFeatureGroup();
virtual ~AbstractFeatureGroup();
explicit AbstractFeatureGroup();
virtual ~AbstractFeatureGroup();
void add(AbstractFeature<dimensions, T>& feature);
void remove(AbstractFeature<dimensions, T>& feature);
void add(AbstractFeature<dimensions, T>& feature);
void remove(AbstractFeature<dimensions, T>& feature);
std::vector<std::reference_wrapper<AbstractFeature<dimensions, T>>> _features;
std::vector<std::reference_wrapper<AbstractFeature<dimensions, T>>> _features;
};
/**

Loading…
Cancel
Save