23#ifndef VCL_ALGORITHMS_MESH_UTILITY_H
24#define VCL_ALGORITHMS_MESH_UTILITY_H
26#include <vclib/base.h>
27#include <vclib/mesh.h>
29namespace vcl::detail {
34std::vector<uint> elemCompactIndices(
const auto& mesh,
bool wantCompact)
36 std::vector<uint> elemCompIndices;
38 bool isCompact = mesh.template number<ELEM_ID>() ==
39 mesh.template containerSize<ELEM_ID>();
42 elemCompIndices = mesh.template compactIndices<ELEM_ID>();
43 return elemCompIndices;
48std::vector<uint> vertCompactIndices(
const auto& mesh,
bool wantCompact)
50 return elemCompactIndices<ElemId::VERTEX>(mesh, wantCompact);
54auto vIndexLambda(
const auto& mesh,
const std::vector<uint>& vertCompIndices)
57 auto vIndex = [&vertCompIndices](
const auto& f, uint i) {
58 if (vertCompIndices.size() > 0)
59 return vertCompIndices[f.vertexIndex(i)];
61 return f.vertexIndex(i);
69std::vector<uint> faceCompactIndices(
const auto& mesh,
bool wantCompact)
71 return elemCompactIndices<ElemId::FACE>(mesh, wantCompact);
bool isCompact(const MeshType &m)
Checks if a Mesh is compact, that is if it does not contains deleted elements.
Definition mesh_requirements.h:194