From 8d023a76123fdfd0d1ef5655f34f08e770dfb102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 18 Aug 2023 13:12:22 +0200 Subject: [PATCH] MeshTools: remove redundant MeshTools:: prefixes where possible. Except for test cases that ended up having the same name as the API they test. --- src/Magnum/MeshTools/CombineIndexedArrays.cpp | 2 +- src/Magnum/MeshTools/Compile.cpp | 18 ++++---- src/Magnum/MeshTools/GenerateNormals.cpp | 2 +- src/Magnum/MeshTools/RemoveDuplicates.cpp | 4 +- .../MeshTools/Test/BoundingVolumeTest.cpp | 42 +++++++++---------- .../Test/CombineIndexedArraysTest.cpp | 6 +-- src/Magnum/MeshTools/Test/CombineTest.cpp | 42 +++++++++---------- src/Magnum/MeshTools/Test/CompileGLTest.cpp | 22 +++++----- .../MeshTools/Test/CompressIndicesTest.cpp | 16 +++---- .../MeshTools/Test/GenerateNormalsTest.cpp | 2 +- src/Magnum/MeshTools/Test/TransformTest.cpp | 16 +++---- 11 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/Magnum/MeshTools/CombineIndexedArrays.cpp b/src/Magnum/MeshTools/CombineIndexedArrays.cpp index d2fdf28cc..c885d10d5 100644 --- a/src/Magnum/MeshTools/CombineIndexedArrays.cpp +++ b/src/Magnum/MeshTools/CombineIndexedArrays.cpp @@ -59,7 +59,7 @@ std::pair, std::vector> interleaveAndCombi /* Combine them */ std::vector combinedIndices; CORRADE_IGNORE_DEPRECATED_PUSH - std::tie(combinedIndices, interleavedArrays) = MeshTools::combineIndexArrays(interleavedArrays, stride); + std::tie(combinedIndices, interleavedArrays) = combineIndexArrays(interleavedArrays, stride); CORRADE_IGNORE_DEPRECATED_POP return {combinedIndices, interleavedArrays}; } diff --git a/src/Magnum/MeshTools/Compile.cpp b/src/Magnum/MeshTools/Compile.cpp index 6dfc7fcdb..0d867a8ef 100644 --- a/src/Magnum/MeshTools/Compile.cpp +++ b/src/Magnum/MeshTools/Compile.cpp @@ -360,7 +360,7 @@ GL::Mesh compile(const Trade::MeshData2D& meshData) { /* Interleave positions and put them in with ownership transfer, use the ref for the rest */ - Containers::Array data = MeshTools::interleave( + Containers::Array data = interleave( meshData.positions(0), stride - sizeof(Shaders::Generic2D::Position::Type)); mesh.addVertexBuffer(std::move(vertexBuffer), 0, @@ -369,7 +369,7 @@ GL::Mesh compile(const Trade::MeshData2D& meshData) { /* Add also texture coordinates, if present */ if(meshData.hasTextureCoords2D()) { - MeshTools::interleaveInto(data, + interleaveInto(data, textureCoordsOffset, meshData.textureCoords2D(0), stride - textureCoordsOffset - sizeof(Shaders::Generic2D::TextureCoordinates::Type)); @@ -381,7 +381,7 @@ GL::Mesh compile(const Trade::MeshData2D& meshData) { /* Add also colors, if present */ if(meshData.hasColors()) { - MeshTools::interleaveInto(data, + interleaveInto(data, colorsOffset, meshData.colors(0), stride - colorsOffset - sizeof(Shaders::Generic3D::Color4::Type)); @@ -399,7 +399,7 @@ GL::Mesh compile(const Trade::MeshData2D& meshData) { Containers::Array indexData; MeshIndexType indexType; UnsignedInt indexStart, indexEnd; - std::tie(indexData, indexType, indexStart, indexEnd) = MeshTools::compressIndices(meshData.indices()); + std::tie(indexData, indexType, indexStart, indexEnd) = compressIndices(meshData.indices()); GL::Buffer indexBuffer{GL::Buffer::TargetHint::ElementArray}; indexBuffer.setData(indexData, GL::BufferUsage::StaticDraw); @@ -501,7 +501,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData, CompileFlags flags) { /* Interleave positions and put them in with ownership transfer, use the ref for the rest */ - Containers::Array data = MeshTools::interleave( + Containers::Array data = interleave( positions, stride - sizeof(Shaders::Generic3D::Position::Type)); mesh.addVertexBuffer(std::move(vertexBuffer), 0, @@ -510,7 +510,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData, CompileFlags flags) { /* Add also normals, if present */ if(normals) { - MeshTools::interleaveInto(data, + interleaveInto(data, normalOffset, normals, stride - normalOffset - sizeof(Shaders::Generic3D::Normal::Type)); @@ -522,7 +522,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData, CompileFlags flags) { /* Add also texture coordinates, if present */ if(textureCoords2D) { - MeshTools::interleaveInto(data, + interleaveInto(data, textureCoordsOffset, textureCoords2D, stride - textureCoordsOffset - sizeof(Shaders::Generic3D::TextureCoordinates::Type)); @@ -534,7 +534,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData, CompileFlags flags) { /* Add also colors, if present */ if(colors) { - MeshTools::interleaveInto(data, + interleaveInto(data, colorsOffset, colors, stride - colorsOffset - sizeof(Shaders::Generic3D::Color4::Type)); @@ -553,7 +553,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData, CompileFlags flags) { Containers::Array indexData; MeshIndexType indexType; UnsignedInt indexStart, indexEnd; - std::tie(indexData, indexType, indexStart, indexEnd) = MeshTools::compressIndices(meshData.indices()); + std::tie(indexData, indexType, indexStart, indexEnd) = compressIndices(meshData.indices()); GL::Buffer indexBuffer{GL::Buffer::TargetHint::ElementArray}; indexBuffer.setData(indexData, GL::BufferUsage::StaticDraw); diff --git a/src/Magnum/MeshTools/GenerateNormals.cpp b/src/Magnum/MeshTools/GenerateNormals.cpp index 944f29d66..4fa7351d3 100644 --- a/src/Magnum/MeshTools/GenerateNormals.cpp +++ b/src/Magnum/MeshTools/GenerateNormals.cpp @@ -83,7 +83,7 @@ std::pair, std::vector> generateFlatNormals(co /* Remove duplicate normals and return */ CORRADE_IGNORE_DEPRECATED_PUSH - normalIndices = MeshTools::duplicate(normalIndices, MeshTools::removeDuplicates(normals)); + normalIndices = duplicate(normalIndices, removeDuplicates(normals)); CORRADE_IGNORE_DEPRECATED_POP return {std::move(normalIndices), std::move(normals)}; } diff --git a/src/Magnum/MeshTools/RemoveDuplicates.cpp b/src/Magnum/MeshTools/RemoveDuplicates.cpp index aa6b7c608..5fbabe664 100644 --- a/src/Magnum/MeshTools/RemoveDuplicates.cpp +++ b/src/Magnum/MeshTools/RemoveDuplicates.cpp @@ -429,7 +429,7 @@ Trade::MeshData removeDuplicates(const Trade::MeshData& mesh) { /* Because the interleaved mesh was forced to be repacked, the vertex data should span the whole stride -- this is relied on in the attribute rerouting loop below */ - const Containers::StridedArrayView2D vertexData = MeshTools::interleavedMutableData(ownedInterleaved); + const Containers::StridedArrayView2D vertexData = interleavedMutableData(ownedInterleaved); CORRADE_INTERNAL_ASSERT(vertexData.size()[1] == std::size_t(ownedInterleaved.attributeStride(0))); UnsignedInt uniqueVertexCount; @@ -474,7 +474,7 @@ Trade::MeshData removeDuplicatesFuzzy(const Trade::MeshData& mesh, const Float f /* Turn the passed data into an owned mutable instance we can operate on. There's a chance the original data are already like this, in which case this will be just a passthrough. */ - Trade::MeshData owned = MeshTools::copy(std::move(mesh)); + Trade::MeshData owned = copy(std::move(mesh)); /* Allocate an interleaved index array for all vertices times all attributes */ diff --git a/src/Magnum/MeshTools/Test/BoundingVolumeTest.cpp b/src/Magnum/MeshTools/Test/BoundingVolumeTest.cpp index b284af904..e08e1caad 100644 --- a/src/Magnum/MeshTools/Test/BoundingVolumeTest.cpp +++ b/src/Magnum/MeshTools/Test/BoundingVolumeTest.cpp @@ -73,7 +73,7 @@ void BoundingVolumeTest::range() { that the input and output are forwarded correctly */ constexpr Float cylinderLength = 7.0f; const Trade::MeshData cylinderMesh = Primitives::capsule3DSolid(3, 1, 12, cylinderLength*0.5f); - const Range3D box = MeshTools::boundingRange( + const Range3D box = boundingRange( cylinderMesh.attribute(Trade::MeshAttribute::Position)); CORRADE_COMPARE(box.center(), Vector3{}); @@ -83,7 +83,7 @@ void BoundingVolumeTest::range() { void BoundingVolumeTest::rangeNaN() { /* NaNs are skipped (unless it's all NaNs), matching minmax() behaviour */ { - const Range3D box = MeshTools::boundingRange(Containers::stridedArrayView({ + const Range3D box = boundingRange(Containers::stridedArrayView({ Vector3{Constants::nan()}, Vector3{1.0f, 1.0f, 1.0f}, Vector3{Constants::nan()}, @@ -93,7 +93,7 @@ void BoundingVolumeTest::rangeNaN() { CORRADE_COMPARE(box.min(), (Vector3{1.0f, 1.0f, 1.0f})); CORRADE_COMPARE(box.max(), (Vector3{2.0f, 2.0f, 2.0f})); } { - const Range3D box = MeshTools::boundingRange(Containers::stridedArrayView({ + const Range3D box = boundingRange(Containers::stridedArrayView({ Vector3{Constants::nan()}, Vector3{Constants::nan()} })); @@ -107,7 +107,7 @@ void BoundingVolumeTest::sphereBouncingBubble() { all identical positions */ { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(Containers::StridedArrayView1D{}); + boundingSphereBouncingBubble(Containers::StridedArrayView1D{}); CORRADE_COMPARE(sphere.first(), (Vector3{})); CORRADE_COMPARE(sphere.second(), Math::TypeTraits::epsilon()); @@ -115,14 +115,14 @@ void BoundingVolumeTest::sphereBouncingBubble() { the algorithm */ } { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(Containers::stridedArrayView({ + boundingSphereBouncingBubble(Containers::stridedArrayView({ Vector3{1.0f, 2.0f, 3.0f} })); CORRADE_COMPARE(sphere.first(), (Vector3{1.0f, 2.0f, 3.0f})); CORRADE_COMPARE(sphere.second(), Math::TypeTraits::epsilon()); } { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(Containers::stridedArrayView({ + boundingSphereBouncingBubble(Containers::stridedArrayView({ Vector3{3.0f, 1.0f, 2.0f}, Vector3{3.0f, 1.0f, 2.0f}, Vector3{3.0f, 1.0f, 2.0f} @@ -133,7 +133,7 @@ void BoundingVolumeTest::sphereBouncingBubble() { /* Simple cases */ } { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(Containers::stridedArrayView({ + boundingSphereBouncingBubble(Containers::stridedArrayView({ Vector3{1.0f, 1.0f, 1.0f}, Vector3{2.0f, 2.0f, 2.0f} })); @@ -141,7 +141,7 @@ void BoundingVolumeTest::sphereBouncingBubble() { CORRADE_COMPARE(sphere.second(), Vector3{0.5f}.length()); } { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(Containers::stridedArrayView({ + boundingSphereBouncingBubble(Containers::stridedArrayView({ Vector3{2.0f, 0.0f, 0.0f}, Vector3{-2.0f, 0.0f, 0.0f}, Vector3{0.0f, 2.0f, 0.0f}, @@ -154,7 +154,7 @@ void BoundingVolumeTest::sphereBouncingBubble() { } { const Trade::MeshData sphereMesh = Primitives::icosphereSolid(1); const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(sphereMesh.attribute(Trade::MeshAttribute::Position)); + boundingSphereBouncingBubble(sphereMesh.attribute(Trade::MeshAttribute::Position)); /* No error */ CORRADE_COMPARE(sphere.first(), (Vector3{0.0f, 0.0f, 0.0f})); CORRADE_COMPARE(sphere.second(), 1.0f); @@ -162,9 +162,9 @@ void BoundingVolumeTest::sphereBouncingBubble() { Trade::MeshData sphereMesh = Primitives::icosphereSolid(1); constexpr Vector3 translation{1.0f, 2.0f, 3.0f}; constexpr Vector3 scale{0.5f, 1.2f, 2.8f}; - MeshTools::transform3DInPlace(sphereMesh, Matrix4::translation(translation)*Matrix4::scaling(scale)); + transform3DInPlace(sphereMesh, Matrix4::translation(translation)*Matrix4::scaling(scale)); const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(sphereMesh.attribute(Trade::MeshAttribute::Position)); + boundingSphereBouncingBubble(sphereMesh.attribute(Trade::MeshAttribute::Position)); /* Noticeable error */ constexpr Float Delta = 0.04f; CORRADE_COMPARE_WITH(sphere.first(), translation, TestSuite::Compare::around(Vector3{Delta})); @@ -173,12 +173,12 @@ void BoundingVolumeTest::sphereBouncingBubble() { /* Cube -- translated and scaled */ } { - Trade::MeshData cubeMesh = MeshTools::copy(Primitives::cubeSolid()); + Trade::MeshData cubeMesh = copy(Primitives::cubeSolid()); constexpr Vector3 translation{1.0f, 2.0f, 3.0f}; constexpr Float scale = 13.2f; - MeshTools::transform3DInPlace(cubeMesh, Matrix4::translation(translation)*Matrix4::scaling(Vector3{scale})); + transform3DInPlace(cubeMesh, Matrix4::translation(translation)*Matrix4::scaling(Vector3{scale})); const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(cubeMesh.attribute(Trade::MeshAttribute::Position)); + boundingSphereBouncingBubble(cubeMesh.attribute(Trade::MeshAttribute::Position)); /* Noticeable error */ constexpr Float Delta = 0.04f; CORRADE_COMPARE_WITH(sphere.first(), translation, TestSuite::Compare::around(Vector3{Delta})); @@ -191,11 +191,11 @@ void BoundingVolumeTest::sphereBouncingBubble() { for(Deg degrees = 0.0_degf; degrees < 360.0_degf; degrees += 60.0_degf) { CORRADE_ITERATION(degrees); - Trade::MeshData cubeMesh = MeshTools::copy(Primitives::cubeSolid()); + Trade::MeshData cubeMesh = copy(Primitives::cubeSolid()); constexpr Vector3 translation{1.0f, 2.0f, 3.0f}; - MeshTools::transform3DInPlace(cubeMesh, Matrix4::rotationY(degrees)*Matrix4::translation(translation)); + transform3DInPlace(cubeMesh, Matrix4::rotationY(degrees)*Matrix4::translation(translation)); const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(cubeMesh.attribute(Trade::MeshAttribute::Position)); + boundingSphereBouncingBubble(cubeMesh.attribute(Trade::MeshAttribute::Position)); CORRADE_COMPARE(sphere.second(), Constants::sqrt3()); } } @@ -204,7 +204,7 @@ void BoundingVolumeTest::sphereBouncingBubbleNaN() { /* NaN is ignored except for the first position element */ { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(Containers::stridedArrayView({ + boundingSphereBouncingBubble(Containers::stridedArrayView({ Vector3{1.0f, 1.0f, 1.0f}, Vector3{Constants::nan()}, Vector3{2.0f, 2.0f, 2.0f}, @@ -215,7 +215,7 @@ void BoundingVolumeTest::sphereBouncingBubbleNaN() { } { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(Containers::stridedArrayView({ + boundingSphereBouncingBubble(Containers::stridedArrayView({ Vector3{Constants::nan()}, Vector3{1.0f, 1.0f, 1.0f}, Vector3{2.0f, 2.0f, 2.0f} @@ -238,7 +238,7 @@ void BoundingVolumeTest::benchmarkRange() { Float r = 0.0f; CORRADE_BENCHMARK(50) { - const Range3D box = MeshTools::boundingRange(points); + const Range3D box = boundingRange(points); r += box.size().x(); } @@ -254,7 +254,7 @@ void BoundingVolumeTest::benchmarkSphereBouncingBubble() { Float r = 0.0f; CORRADE_BENCHMARK(50) { const Containers::Pair sphere = - MeshTools::boundingSphereBouncingBubble(points); + boundingSphereBouncingBubble(points); r += sphere.second(); } diff --git a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp index e599794a1..7b0ed76b8 100644 --- a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp +++ b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp @@ -57,7 +57,7 @@ void CombineIndexedArraysTest::wrongIndexCount() { Error redirectError{&ss}; std::vector a{0, 1, 0}; std::vector b{3, 4}; - std::vector result = MeshTools::combineIndexArrays({a, b}); + std::vector result = combineIndexArrays({a, b}); CORRADE_COMPARE(ss.str(), "MeshTools::combineIndexArrays(): the arrays don't have the same size\n"); } @@ -67,7 +67,7 @@ void CombineIndexedArraysTest::indexArrays() { std::vector b{3, 4, 3}; std::vector c{6, 7, 6}; - std::vector result = MeshTools::combineIndexArrays({a, b, c}); + std::vector result = combineIndexArrays({a, b, c}); CORRADE_COMPARE(result, (std::vector{0, 1, 0})); CORRADE_COMPARE(a, (std::vector{0, 1})); CORRADE_COMPARE(b, (std::vector{3, 4})); @@ -82,7 +82,7 @@ void CombineIndexedArraysTest::indexedArrays() { std::vector array2{ 0, 1, 2, 3, 4 }; std::vector array3{ 0, 1, 2, 3, 4, 5, 6, 7 }; - std::vector result = MeshTools::combineIndexedArrays( + std::vector result = combineIndexedArrays( std::make_pair(std::cref(a), std::ref(array1)), std::make_pair(std::cref(b), std::ref(array2)), std::make_pair(std::cref(c), std::ref(array3))); diff --git a/src/Magnum/MeshTools/Test/CombineTest.cpp b/src/Magnum/MeshTools/Test/CombineTest.cpp index 3bffc3c6b..cfad158f7 100644 --- a/src/Magnum/MeshTools/Test/CombineTest.cpp +++ b/src/Magnum/MeshTools/Test/CombineTest.cpp @@ -116,7 +116,7 @@ void CombineTest::indexedAttributes() { internally */ Trade::meshAttributeCustom(22), VertexFormat::Float, 0, 8, sizeof(Float)}}}; - Trade::MeshData result = MeshTools::combineIndexedAttributes({a, b, c}); + Trade::MeshData result = combineIndexedAttributes({a, b, c}); CORRADE_COMPARE(result.primitive(), MeshPrimitive::LineLoop); CORRADE_VERIFY(result.isIndexed()); CORRADE_COMPARE(result.indexType(), MeshIndexType::UnsignedInt); @@ -154,7 +154,7 @@ void CombineTest::indexedAttributesIndicesOnly() { Trade::MeshData c{MeshPrimitive::LineLoop, {}, indicesC, Trade::MeshIndexData{indicesC}, 8}; - Trade::MeshData result = MeshTools::combineIndexedAttributes({a, b, c}); + Trade::MeshData result = combineIndexedAttributes({a, b, c}); CORRADE_COMPARE(result.primitive(), MeshPrimitive::LineLoop); CORRADE_VERIFY(result.isIndexed()); CORRADE_COMPARE(result.indexType(), MeshIndexType::UnsignedInt); @@ -173,7 +173,7 @@ void CombineTest::indexedAttributesSingleMesh() { {}, data, {Trade::MeshAttributeData{ Trade::meshAttributeCustom(22), Containers::arrayView(data)}}}; - Trade::MeshData result = MeshTools::combineIndexedAttributes({a}); + Trade::MeshData result = combineIndexedAttributes({a}); CORRADE_COMPARE(result.primitive(), MeshPrimitive::LineLoop); CORRADE_VERIFY(result.isIndexed()); CORRADE_COMPARE(result.indexType(), MeshIndexType::UnsignedInt); @@ -192,7 +192,7 @@ void CombineTest::indexedAttributesNoMeshes() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineIndexedAttributes({}); + combineIndexedAttributes({}); CORRADE_COMPARE(out.str(), "MeshTools::combineIndexedAttributes(): no meshes passed\n"); } @@ -208,7 +208,7 @@ void CombineTest::indexedAttributesNotIndexed() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineIndexedAttributes({a, b, c}); + combineIndexedAttributes({a, b, c}); CORRADE_COMPARE(out.str(), "MeshTools::combineIndexedAttributes(): data 2 is not indexed\n"); } @@ -223,7 +223,7 @@ void CombineTest::indexedAttributesDifferentPrimitive() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineIndexedAttributes({a, b}); + combineIndexedAttributes({a, b}); CORRADE_COMPARE(out.str(), "MeshTools::combineIndexedAttributes(): data 1 is MeshPrimitive::Points but expected MeshPrimitive::Lines\n"); } @@ -241,7 +241,7 @@ void CombineTest::indexedAttributesDifferentIndexCount() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineIndexedAttributes({a, b, c}); + combineIndexedAttributes({a, b, c}); CORRADE_COMPARE(out.str(), "MeshTools::combineIndexedAttributes(): data 2 has 4 indices but expected 5\n"); } @@ -261,7 +261,7 @@ void CombineTest::indexedAttributesImplementationSpecificIndexType() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineIndexedAttributes({a, b}); + combineIndexedAttributes({a, b}); CORRADE_COMPARE(out.str(), "MeshTools::combineIndexedAttributes(): data 1 has an implementation-specific index type 0xcaca\n"); } @@ -284,7 +284,7 @@ void CombineTest::indexedAttributesImplementationSpecificVertexFormat() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineIndexedAttributes({a, b}); + combineIndexedAttributes({a, b}); CORRADE_COMPARE(out.str(), "MeshTools::combineIndexedAttributes(): attribute 2 of mesh 1 has an implementation-specific format 0xcaca\n"); } @@ -362,9 +362,9 @@ void CombineTest::faceAttributes() { directly, not wrapped in a MeshData */ Containers::Optional combined; if(data.indexed) - combined = MeshTools::combineFaceAttributes(mesh, faceAttributesIndexed); + combined = combineFaceAttributes(mesh, faceAttributesIndexed); else - combined = MeshTools::combineFaceAttributes(mesh, { + combined = combineFaceAttributes(mesh, { Trade::MeshAttributeData{Trade::MeshAttribute::Color, Containers::StridedArrayView1D{faceData, &faceData[0].color, 4, sizeof(FaceData)}}, @@ -417,7 +417,7 @@ void CombineTest::faceAttributesMeshNotIndexed() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineFaceAttributes(mesh, faceAttributes); + combineFaceAttributes(mesh, faceAttributes); CORRADE_COMPARE(out.str(), "MeshTools::combineFaceAttributes(): vertex mesh is not indexed\n"); } @@ -435,8 +435,8 @@ void CombineTest::faceAttributesUnexpectedPrimitive() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineFaceAttributes(a, faceA); - MeshTools::combineFaceAttributes(b, faceB); + combineFaceAttributes(a, faceA); + combineFaceAttributes(b, faceB); CORRADE_COMPARE(out.str(), "MeshTools::combineFaceAttributes(): expected a MeshPrimitive::Triangles mesh and a MeshPrimitive::Faces mesh but got MeshPrimitive::Triangles and MeshPrimitive::Instances\n" "MeshTools::combineFaceAttributes(): expected a MeshPrimitive::Triangles mesh and a MeshPrimitive::Faces mesh but got MeshPrimitive::Lines and MeshPrimitive::Faces\n"); @@ -452,7 +452,7 @@ void CombineTest::faceAttributesUnexpectedFaceCount() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineFaceAttributes(mesh, faceAttributes); + combineFaceAttributes(mesh, faceAttributes); CORRADE_COMPARE(out.str(), "MeshTools::combineFaceAttributes(): expected 1 face entries for 3 indices but got 2\n"); } @@ -484,8 +484,8 @@ void CombineTest::faceAttributesImplementationSpecificIndexType() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineFaceAttributes(triangles, facesImplementationSpecific); - MeshTools::combineFaceAttributes(trianglesImplementationSpecific, faces); + combineFaceAttributes(triangles, facesImplementationSpecific); + combineFaceAttributes(trianglesImplementationSpecific, faces); CORRADE_COMPARE(out.str(), "MeshTools::combineFaceAttributes(): face mesh has an implementation-specific index type 0xcaca\n" "MeshTools::combineFaceAttributes(): vertex mesh has an implementation-specific index type 0xcaca\n"); @@ -524,8 +524,8 @@ void CombineTest::faceAttributesImplementationSpecificVertexFormat() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineFaceAttributes(triangles, facesImplementationSpecific); - MeshTools::combineFaceAttributes(trianglesImplementationSpecific, faces); + combineFaceAttributes(triangles, facesImplementationSpecific); + combineFaceAttributes(trianglesImplementationSpecific, faces); CORRADE_COMPARE(out.str(), "MeshTools::combineFaceAttributes(): attribute 2 of mesh 1 has an implementation-specific format 0xcaca\n" "MeshTools::combineFaceAttributes(): attribute 2 of mesh 0 has an implementation-specific format 0xcaca\n"); @@ -556,7 +556,7 @@ void CombineTest::faceAttributesFacesNotInterleaved() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineFaceAttributes(mesh, faceAttributes); + combineFaceAttributes(mesh, faceAttributes); CORRADE_COMPARE(out.str(), "MeshTools::combineFaceAttributes(): face attributes are not interleaved\n"); } @@ -566,7 +566,7 @@ void CombineTest::faceAttributesFaceAttributeOffsetOnly() { std::ostringstream out; Error redirectError{&out}; - MeshTools::combineFaceAttributes(Trade::MeshData{MeshPrimitive::Triangles, 0}, { + combineFaceAttributes(Trade::MeshData{MeshPrimitive::Triangles, 0}, { Trade::MeshAttributeData{Trade::MeshAttribute::ObjectId, Containers::ArrayView{}}, Trade::MeshAttributeData{Trade::MeshAttribute::Color, diff --git a/src/Magnum/MeshTools/Test/CompileGLTest.cpp b/src/Magnum/MeshTools/Test/CompileGLTest.cpp index 8656c510d..6f325b1d9 100644 --- a/src/Magnum/MeshTools/Test/CompileGLTest.cpp +++ b/src/Magnum/MeshTools/Test/CompileGLTest.cpp @@ -1581,9 +1581,9 @@ void CompileGLTest::morphTargetAttributes() { std::ostringstream out; Warning redirectError{&out}; if(instanceData.flags) - MeshTools::compile(data, instanceData.flags); + compile(data, instanceData.flags); else - MeshTools::compile(data); + compile(data); CORRADE_COMPARE(out.str(), instanceData.flags ? "" : "MeshTools::compile(): ignoring 2 morph target attributes\n"); } @@ -1600,9 +1600,9 @@ void CompileGLTest::customAttribute() { std::ostringstream out; Warning redirectError{&out}; if(instanceData.flags) - MeshTools::compile(data, instanceData.flags); + compile(data, instanceData.flags); else - MeshTools::compile(data); + compile(data); CORRADE_COMPARE(out.str(), instanceData.flags ? "" : "MeshTools::compile(): ignoring unknown/unsupported attribute Trade::MeshAttribute::Custom(115)\n"); } @@ -1622,9 +1622,9 @@ void CompileGLTest::unsupportedAttribute() { std::ostringstream out; Warning redirectError{&out}; if(instanceData.flags) - MeshTools::compile(data, instanceData.flags); + compile(data, instanceData.flags); else - MeshTools::compile(data); + compile(data); /* Warns always, regardless of the flag */ CORRADE_COMPARE(out.str(), "MeshTools::compile(): ignoring unknown/unsupported attribute Trade::MeshAttribute::ObjectId\n"); #endif @@ -1664,9 +1664,9 @@ void CompileGLTest::implementationSpecificAttributeFormat() { std::ostringstream out; Warning redirectError{&out}; if(instanceData.flags) - MeshTools::compile(data, instanceData.flags); + compile(data, instanceData.flags); else - MeshTools::compile(data); + compile(data); CORRADE_COMPARE(out.str(), instanceData.flags ? "" : "MeshTools::compile(): ignoring attribute Trade::MeshAttribute::Position with an implementation-specific format 0xdead\n"); } @@ -1678,7 +1678,7 @@ void CompileGLTest::generateNormalsNoPosition() { std::ostringstream out; Error redirectError{&out}; - MeshTools::compile(data, CompileFlag::GenerateFlatNormals); + compile(data, CompileFlag::GenerateFlatNormals); CORRADE_COMPARE(out.str(), "MeshTools::compile(): the mesh has no positions, can't generate normals\n"); } @@ -1693,7 +1693,7 @@ void CompileGLTest::generateNormals2DPosition() { std::ostringstream out; Error redirectError{&out}; - MeshTools::compile(data, CompileFlag::GenerateFlatNormals); + compile(data, CompileFlag::GenerateFlatNormals); CORRADE_COMPARE(out.str(), "MeshTools::compile(): can't generate normals for VertexFormat::Vector2 positions\n"); } @@ -1710,7 +1710,7 @@ void CompileGLTest::generateNormalsNoFloats() { std::ostringstream out; Error redirectError{&out}; - MeshTools::compile(data, CompileFlag::GenerateFlatNormals); + compile(data, CompileFlag::GenerateFlatNormals); CORRADE_COMPARE(out.str(), "MeshTools::compile(): can't generate normals into VertexFormat::Vector3h\n"); } diff --git a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp index 0de465249..c5753fd9d 100644 --- a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp @@ -242,7 +242,7 @@ void CompressIndicesTest::compressDeprecated() { MeshIndexType type; UnsignedInt start, end; CORRADE_IGNORE_DEPRECATED_PUSH - std::tie(data, type, start, end) = MeshTools::compressIndices( + std::tie(data, type, start, end) = compressIndices( std::vector{1, 256, 0, 5}); CORRADE_IGNORE_DEPRECATED_POP @@ -347,8 +347,8 @@ void CompressIndicesTest::compressMeshDataNonIndexed() { /* Test both r-value and l-value overload */ std::ostringstream out; Error redirectError{&out}; - MeshTools::compressIndices(mesh); - MeshTools::compressIndices(std::move(mesh)); + compressIndices(mesh); + compressIndices(std::move(mesh)); CORRADE_COMPARE(out.str(), "MeshTools::compressIndices(): mesh data not indexed\n" "MeshTools::compressIndices(): mesh data not indexed\n"); @@ -363,8 +363,8 @@ void CompressIndicesTest::compressMeshDataImplementationSpecificIndexType() { /* Test both r-value and l-value overload */ std::ostringstream out; Error redirectError{&out}; - MeshTools::compressIndices(mesh); - MeshTools::compressIndices(std::move(mesh)); + compressIndices(mesh); + compressIndices(std::move(mesh)); CORRADE_COMPARE(out.str(), "MeshTools::compressIndices(): mesh has an implementation-specific index type 0xcaca\n" "MeshTools::compressIndices(): mesh has an implementation-specific index type 0xcaca\n"); @@ -379,7 +379,7 @@ void CompressIndicesTest::compressMeshDataImplementationSpecificAtLeastIndexType std::ostringstream out; Error redirectError{&out}; - MeshTools::compressIndices(mesh, meshIndexTypeWrap(0xcaca)); + compressIndices(mesh, meshIndexTypeWrap(0xcaca)); CORRADE_COMPARE(out.str(), "MeshTools::compressIndices(): can't compress to an implementation-specific index type 0xcaca\n"); } @@ -389,13 +389,13 @@ void CompressIndicesTest::compressAsShort() { CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_IGNORE_DEPRECATED_PUSH - CORRADE_COMPARE_AS(MeshTools::compressIndicesAs({123, 456}), + CORRADE_COMPARE_AS(compressIndicesAs({123, 456}), Containers::arrayView({123, 456}), TestSuite::Compare::Container); std::ostringstream out; Error redirectError{&out}; - MeshTools::compressIndicesAs({65536}); + compressIndicesAs({65536}); CORRADE_COMPARE(out.str(), "MeshTools::compressIndicesAs(): type too small to represent value 65536\n"); CORRADE_IGNORE_DEPRECATED_POP } diff --git a/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp b/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp index 9cab9a50b..694fd0e6c 100644 --- a/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp @@ -131,7 +131,7 @@ void GenerateNormalsTest::flatDeprecated() { std::vector indices; std::vector normals; CORRADE_IGNORE_DEPRECATED_PUSH - std::tie(indices, normals) = MeshTools::generateFlatNormals({ + std::tie(indices, normals) = generateFlatNormals({ 0, 1, 2, 1, 2, 3 }, { diff --git a/src/Magnum/MeshTools/Test/TransformTest.cpp b/src/Magnum/MeshTools/Test/TransformTest.cpp index 7d8948204..2a82f992f 100644 --- a/src/Magnum/MeshTools/Test/TransformTest.cpp +++ b/src/Magnum/MeshTools/Test/TransformTest.cpp @@ -443,25 +443,25 @@ constexpr static std::array points3DRotatedTranslated{{ }}; void TransformTest::transformVectors2D() { - auto matrix = MeshTools::transformVectors(Matrix3::rotation(Deg(90.0f)), points2D); - auto complex = MeshTools::transformVectors(Complex::rotation(Deg(90.0f)), points2D); + auto matrix = transformVectors(Matrix3::rotation(Deg(90.0f)), points2D); + auto complex = transformVectors(Complex::rotation(Deg(90.0f)), points2D); CORRADE_COMPARE(matrix, points2DRotated); CORRADE_COMPARE(complex, points2DRotated); } void TransformTest::transformVectors3D() { - auto matrix = MeshTools::transformVectors(Matrix4::rotationZ(Deg(90.0f)), points3D); - auto quaternion = MeshTools::transformVectors(Quaternion::rotation(Deg(90.0f), Vector3::zAxis()), points3D); + auto matrix = transformVectors(Matrix4::rotationZ(Deg(90.0f)), points3D); + auto quaternion = transformVectors(Quaternion::rotation(Deg(90.0f), Vector3::zAxis()), points3D); CORRADE_COMPARE(matrix, points3DRotated); CORRADE_COMPARE(quaternion, points3DRotated); } void TransformTest::transformPoints2D() { - auto matrix = MeshTools::transformPoints( + auto matrix = transformPoints( Matrix3::translation(Vector2::yAxis(-1.0f))*Matrix3::rotation(Deg(90.0f)), points2D); - auto complex = MeshTools::transformPoints( + auto complex = transformPoints( DualComplex::translation(Vector2::yAxis(-1.0f))*DualComplex::rotation(Deg(90.0f)), points2D); CORRADE_COMPARE(matrix, points2DRotatedTranslated); @@ -469,9 +469,9 @@ void TransformTest::transformPoints2D() { } void TransformTest::transformPoints3D() { - auto matrix = MeshTools::transformPoints( + auto matrix = transformPoints( Matrix4::translation(Vector3::yAxis(-1.0f))*Matrix4::rotationZ(Deg(90.0f)), points3D); - auto quaternion = MeshTools::transformPoints( + auto quaternion = transformPoints( DualQuaternion::translation(Vector3::yAxis(-1.0f))*DualQuaternion::rotation(Deg(90.0f), Vector3::zAxis()), points3D); CORRADE_COMPARE(matrix, points3DRotatedTranslated);