diff --git a/src/Trade/MeshData2D.h b/src/Trade/MeshData2D.h index 43b7ac6fb..bed9b2d3e 100644 --- a/src/Trade/MeshData2D.h +++ b/src/Trade/MeshData2D.h @@ -83,7 +83,11 @@ class MAGNUM_EXPORT MeshData2D { std::vector& indices(); const std::vector& indices() const; /**< @overload */ - /** @brief Count of position arrays */ + /** + * @brief Count of position arrays + * + * There is always at least one. + */ UnsignedInt positionArrayCount() const { return _positions.size(); } /** @@ -95,6 +99,9 @@ class MAGNUM_EXPORT MeshData2D { std::vector& positions(UnsignedInt id); const std::vector& positions(UnsignedInt id) const; /**< @overload */ + /** @brief Whether the data contain any 2D texture coordinates */ + bool hasTextureCoords2D() const { return !_textureCoords2D.empty(); } + /** @brief Count of 2D texture coordinate arrays */ UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); } diff --git a/src/Trade/MeshData3D.h b/src/Trade/MeshData3D.h index c1cffca6f..d157da1cc 100644 --- a/src/Trade/MeshData3D.h +++ b/src/Trade/MeshData3D.h @@ -84,7 +84,11 @@ class MAGNUM_EXPORT MeshData3D { std::vector& indices(); const std::vector& indices() const; /**< @overload */ - /** @brief Count of position arrays */ + /** + * @brief Count of position arrays + * + * There is always at least one. + */ UnsignedInt positionArrayCount() const { return _positions.size(); } /** @@ -96,6 +100,9 @@ class MAGNUM_EXPORT MeshData3D { std::vector& positions(UnsignedInt id); const std::vector& positions(UnsignedInt id) const; /**< @overload */ + /** @brief Whether the data contain any normals */ + bool hasNormals() const { return !_normals.empty(); } + /** @brief Count of normal arrays */ UnsignedInt normalArrayCount() const { return _normals.size(); } @@ -108,6 +115,9 @@ class MAGNUM_EXPORT MeshData3D { std::vector& normals(UnsignedInt id); const std::vector& normals(UnsignedInt id) const; /**< @overload */ + /** @brief Whether the data contain any 2D texture coordinates */ + bool hasTextureCoords2D() const { return !_textureCoords2D.empty(); } + /** @brief Count of 2D texture coordinate arrays */ UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); }