23#ifndef VCL_ALGORITHMS_MESH_UPDATE_SELECTION_H
24#define VCL_ALGORITHMS_MESH_UPDATE_SELECTION_H
26#include <vclib/algorithms/mesh/clean.h>
27#include <vclib/algorithms/mesh/stat.h>
28#include <vclib/concepts/range.h>
29#include <vclib/mesh/requirements.h>
36void clearSelection(Rng&& r)
45template<MeshConcept MeshType>
46void clearVertexSelection(MeshType& m)
48 detail::clearSelection(m.vertices());
51template<FaceMeshConcept MeshType>
52void clearFaceSelection(MeshType& m)
54 detail::clearSelection(m.faces());
57template<FaceMeshConcept MeshType>
58void clearFaceEdgesSelection(MeshType& m)
60 for (
auto& f : m.
faces()) {
61 for (uint i = 0; i < f.vertexNumber(); ++i) {
62 f.edgeSelected(i) =
false;
67template<EdgeMeshConcept MeshType>
68void clearEdgeSelection(MeshType& m)
70 detail::clearSelection(m.edges());
73template<FaceMeshConcept MeshType>
74void selectNonManifoldVertices(MeshType& m,
bool clearSelectionFirst)
76 std::vector<bool> nonManifoldVertices =
77 detail::nonManifoldVerticesVectorBool(m);
79 using VertexType = MeshType::VertexType;
82 if (nonManifoldVertices[m.index(v)]) {
85 else if (clearSelectionFirst) {
91template<FaceMeshConcept MeshType>
92void selectCreaseFaceEdges(
96 bool alsoBorderEdges =
false)
98 clearFaceEdgesSelection(m);
100 std::vector<std::pair<uint, uint>> creaseEdges =
101 creaseFaceEdges(m, angleRadNeg, angleRadPos, alsoBorderEdges);
103 for (
const auto& [fi, ei] : creaseEdges) {
104 m.face(fi).edgeSelected(ei) =
true;
constexpr detail::FacesView faces
A view that allows to iterate overt the Face elements of an object.
Definition face.h:52
constexpr detail::VerticesView vertices
A view that allows to iterate over the Vertex elements of an object.
Definition vertex.h:60