diff --git a/src/Trade/AbstractMaterialData.cpp b/src/Trade/AbstractMaterialData.cpp index 7df183d61..4ee1fb912 100644 --- a/src/Trade/AbstractMaterialData.cpp +++ b/src/Trade/AbstractMaterialData.cpp @@ -28,18 +28,18 @@ namespace Magnum { namespace Trade { -AbstractMaterialData::AbstractMaterialData(Type type): _type(type) {} +AbstractMaterialData::AbstractMaterialData(MaterialType type): _type(type) {} AbstractMaterialData::~AbstractMaterialData() {} -Debug operator<<(Debug debug, const AbstractMaterialData::Type value) { +Debug operator<<(Debug debug, const MaterialType value) { switch(value) { - #define _c(value) case AbstractMaterialData::Type::value: return debug << "Trade::AbstractMaterialData::Type::" #value; + #define _c(value) case MaterialType::value: return debug << "Trade::MaterialType::" #value; _c(Phong) #undef _c } - return debug << "Trade::AbstractMaterialData::Type::(unknown)"; + return debug << "Trade::MaterialType::(unknown)"; } }} diff --git a/src/Trade/AbstractMaterialData.h b/src/Trade/AbstractMaterialData.h index 2cf22eddf..e233bcd12 100644 --- a/src/Trade/AbstractMaterialData.h +++ b/src/Trade/AbstractMaterialData.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Class Magnum::Trade::AbstractMaterialData + * @brief Class @ref Magnum::Trade::AbstractMaterialData, enum @ref Magnum::Trade::MaterialType */ #include "magnumVisibility.h" @@ -33,6 +33,15 @@ namespace Magnum { namespace Trade { +/** +@brief Material type + +@see @ref AbstractMaterialData::type() +*/ +enum class MaterialType: UnsignedByte { + Phong /**< Phong shading */ +}; + /** @brief Base for material data @@ -40,16 +49,11 @@ Subclasses provide access to parameters for given material type. */ class MAGNUM_EXPORT AbstractMaterialData { public: - /** @brief Material type */ - enum class Type: UnsignedByte { - Phong /**< Phong shading */ - }; - /** * @brief Constructor * @param type Material type */ - explicit AbstractMaterialData(Type type); + explicit AbstractMaterialData(MaterialType type); /** @brief Destructor */ virtual ~AbstractMaterialData() = 0; @@ -67,14 +71,14 @@ class MAGNUM_EXPORT AbstractMaterialData { AbstractMaterialData& operator=(AbstractMaterialData&&) = default; /** @brief Material type */ - Type type() const { return _type; } + MaterialType type() const { return _type; } private: - Type _type; + MaterialType _type; }; /** @debugoperator{Magnum::Trade::AbstractMaterialData} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, AbstractMaterialData::Type value); +Debug MAGNUM_EXPORT operator<<(Debug debug, MaterialType value); }} diff --git a/src/Trade/PhongMaterialData.h b/src/Trade/PhongMaterialData.h index c711b0dbf..1f91ff21c 100644 --- a/src/Trade/PhongMaterialData.h +++ b/src/Trade/PhongMaterialData.h @@ -71,7 +71,7 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData { * Colors and textures should be specified using member functions based * on what flags are set. */ - explicit PhongMaterialData(Flags flags, Float shininess): AbstractMaterialData(Type::Phong), _shininess(shininess), _flags(flags) {} + explicit PhongMaterialData(Flags flags, Float shininess): AbstractMaterialData(MaterialType::Phong), _shininess(shininess), _flags(flags) {} /** @brief Material flags */ Flags flags() const { return _flags; } diff --git a/src/Trade/Test/AbstractMaterialDataTest.cpp b/src/Trade/Test/AbstractMaterialDataTest.cpp index be2ab6ec8..a85f6308f 100644 --- a/src/Trade/Test/AbstractMaterialDataTest.cpp +++ b/src/Trade/Test/AbstractMaterialDataTest.cpp @@ -43,8 +43,8 @@ AbstractMaterialDataTest::AbstractMaterialDataTest() { void AbstractMaterialDataTest::debug() { std::ostringstream out; - Debug(&out) << AbstractMaterialData::Type::Phong; - CORRADE_COMPARE(out.str(), "Trade::AbstractMaterialData::Type::Phong\n"); + Debug(&out) << MaterialType::Phong; + CORRADE_COMPARE(out.str(), "Trade::MaterialType::Phong\n"); } }}}