Browse Source

Trade: support strided arrays in MeshData::indicesInto().

There's no point in restricting this.
pull/430/head
Vladimír Vondruš 6 years ago
parent
commit
5e02e0ce8d
  1. 2
      src/Magnum/Trade/MeshData.cpp
  2. 2
      src/Magnum/Trade/MeshData.h

2
src/Magnum/Trade/MeshData.cpp

@ -394,7 +394,7 @@ Containers::StridedArrayView2D<char> MeshData::mutableAttribute(MeshAttribute na
return mutableAttribute(attributeId); return mutableAttribute(attributeId);
} }
void MeshData::indicesInto(const Containers::ArrayView<UnsignedInt> destination) const { void MeshData::indicesInto(const Containers::StridedArrayView1D<UnsignedInt> destination) const {
CORRADE_ASSERT(isIndexed(), CORRADE_ASSERT(isIndexed(),
"Trade::MeshData::indicesInto(): the mesh is not indexed", ); "Trade::MeshData::indicesInto(): the mesh is not indexed", );
CORRADE_ASSERT(destination.size() == indexCount(), "Trade::MeshData::indicesInto(): expected a view with" << indexCount() << "elements but got" << destination.size(), ); CORRADE_ASSERT(destination.size() == indexCount(), "Trade::MeshData::indicesInto(): expected a view with" << indexCount() << "elements but got" << destination.size(), );

2
src/Magnum/Trade/MeshData.h

@ -1464,7 +1464,7 @@ class MAGNUM_TRADE_EXPORT MeshData {
* sized to contain exactly all data. * sized to contain exactly all data.
* @see @ref indexCount() * @see @ref indexCount()
*/ */
void indicesInto(Containers::ArrayView<UnsignedInt> destination) const; void indicesInto(Containers::StridedArrayView1D<UnsignedInt> destination) const;
/** /**
* @brief Positions as 2D float vectors * @brief Positions as 2D float vectors

Loading…
Cancel
Save