Visual Computing Library  devel
Loading...
Searching...
No Matches
face_container.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_MESH_CONTAINERS_FACE_CONTAINER_H
24#define VCL_MESH_CONTAINERS_FACE_CONTAINER_H
25
26#include "base/element_container.h"
27
28#include <vclib/mesh/elem_algorithms.h>
29#include <vclib/mesh/elements/face.h>
30#include <vclib/mesh/elements/face_components.h>
31
32#include <vclib/algorithms/core.h>
33
34namespace vcl {
35namespace mesh {
36
53template<FaceConcept T>
55{
56 template<FaceConcept U>
57 friend class FaceContainer;
58
61
62public:
63 using Face = T;
64 using FaceType = T;
65 using FaceIterator = Base::ElementIterator;
66 using ConstFaceIterator = Base::ConstElementIterator;
67
71 FaceContainer() = default;
72
83 const FaceType& face(uint i) const { return Base::element(i); }
84
95 FaceType& face(uint i) { return Base::element(i); }
96
106 uint faceNumber() const { return Base::elementNumber(); }
107
117 uint faceContainerSize() const { return Base::elementContainerSize(); }
118
125 uint deletedFaceNumber() const { return Base::deletedElementNumber(); }
126
136 uint addFace() { return Base::addElement(); }
137
138 template<typename... V>
139 uint addFace(V... args) requires (sizeof...(args) >= 3)
140 {
141 uint fid = addFace();
142 Face& f = face(fid);
143
144 constexpr uint n = sizeof...(args);
145
146 if constexpr (T::VERTEX_NUMBER < 0) {
147 f.resizeVertices(n);
148 }
149 else {
150 static_assert(
151 n == T::VERTEX_NUMBER,
152 "Wrong number of vertices in Mesh::addFace.");
153 }
154
155 addFaceHelper(f, args...);
156 return fid;
157 }
158
159 template<Range Rng>
160 uint addFace(Rng&& r) requires (
161 InputRange<Rng, typename Face::VertexType*> || InputRange<Rng, uint>)
162 {
163 auto begin = std::ranges::begin(r);
164 auto end = std::ranges::end(r);
165
166 if (begin == end)
167 return UINT_NULL;
168 uint n = std::distance(begin, end);
169
170 uint fid = UINT_NULL;
171
172 assert(n >= 3);
173 if (n < 3)
174 return UINT_NULL;
175
176 if constexpr (T::VERTEX_NUMBER < 0) {
177 fid = addFace();
178 face(fid).resizeVertices(n);
179 }
180 else {
181 assert(n == T::VERTEX_NUMBER);
182 if (n == T::VERTEX_NUMBER)
183 fid = addFace();
184 }
185
186 if (fid != UINT_NULL) {
187 Face& f = face(fid);
188
189 unsigned int i = 0;
190 for (auto it = begin; it != end; ++it) {
191 f.setVertex(i, *it);
192 ++i;
193 }
194 }
195 return fid;
196 }
197
212 uint addFaces(uint n) { return Base::addElements(n); }
213
230 void clearFaces() { Base::clearElements(); }
231
260 void resizeFaces(uint n) { Base::resizeElements(n); }
261
280 void reserveFaces(uint n) { Base::reserveElements(n); }
281
288 void compactFaces() { Base::compactElements(); }
289
302 void deleteFace(uint i) { Base::deleteElement(i); }
303
317 void deleteFace(const FaceType* f) { Base::deleteElement(f); }
318
333 {
334 return Base::elementIndexIfCompact(i);
335 }
336
348 std::vector<uint> faceCompactIndices() const
349 {
350 return Base::elementCompactIndices();
351 }
352
377 void updateFaceReferences(const std::vector<uint>& newIndices)
378 {
379 Base::updateElementReferences(newIndices);
380 }
381
393 FaceIterator faceBegin(bool jumpDeleted = true)
394 {
395 return Base::elementBegin(jumpDeleted);
396 }
397
402 FaceIterator faceEnd() { return Base::elementEnd(); }
403
415 ConstFaceIterator faceBegin(bool jumpDeleted = true) const
416 {
417 return Base::elementBegin(jumpDeleted);
418 }
419
424 ConstFaceIterator faceEnd() const { return Base::elementEnd(); }
425
448 auto faces(bool jumpDeleted = true) { return Base::elements(jumpDeleted); }
449
474 auto faces(uint begin, uint end = UINT_NULL)
475 {
476 return Base::elements(begin, end);
477 }
478
501 auto faces(bool jumpDeleted = true) const
502 {
503 return Base::elements(jumpDeleted);
504 }
505
530 auto faces(uint begin, uint end = UINT_NULL) const
531 {
532 return Base::elements(begin, end);
533 }
534
540 {
541 Base::enableAllOptionalComponents();
542 }
543
549 {
550 Base::disableAllOptionalComponents();
551 }
552
553 // AdjacentEdges
554
564 requires face::HasOptionalAdjacentEdges<T>
565 {
566 return Base::template isOptionalComponentEnabled<
567 typename T::AdjacentEdges>();
568 }
569
581 void enablePerFaceAdjacentEdges() requires face::HasOptionalAdjacentEdges<T>
582 {
584 }
585
593 requires face::HasOptionalAdjacentEdges<T>
594 {
596 }
597
598 // AdjacentFaces
599
609 requires face::HasOptionalAdjacentFaces<T>
610 {
611 return Base::template isOptionalComponentEnabled<
612 typename T::AdjacentFaces>();
613 }
614
626 void enablePerFaceAdjacentFaces() requires face::HasOptionalAdjacentFaces<T>
627 {
629 }
630
638 requires face::HasOptionalAdjacentFaces<T>
639 {
641 }
642
643 // Color
644
653 bool isPerFaceColorEnabled() const requires face::HasOptionalColor<T>
654 {
655 return Base::template isOptionalComponentEnabled<typename T::Color>();
656 }
657
664 void enablePerFaceColor() requires face::HasOptionalColor<T>
665 {
667 }
668
675 void disablePerFaceColor() requires face::HasOptionalColor<T>
676 {
678 }
679
680 // Mark
681
690 bool isPerFaceMarkEnabled() const requires face::HasOptionalMark<T>
691 {
692 return Base::template isOptionalComponentEnabled<typename T::Mark>();
693 }
694
701 void enablePerFaceMark() requires face::HasOptionalMark<T>
702 {
704 }
705
712 void disablePerFaceMark() requires face::HasOptionalMark<T>
713 {
715 }
716
717 // MaterialIndex
718
728 requires face::HasOptionalMaterialIndex<T>
729 {
730 return Base::template isOptionalComponentEnabled<
731 typename T::MaterialIndex>();
732 }
733
740 void enablePerFaceMaterialIndex() requires face::HasOptionalMaterialIndex<T>
741 {
743 }
744
752 requires face::HasOptionalMaterialIndex<T>
753 {
755 }
756
757 // Normal
758
767 bool isPerFaceNormalEnabled() const requires face::HasOptionalNormal<T>
768 {
770 }
771
778 void enablePerFaceNormal() requires face::HasOptionalNormal<T>
779 {
781 }
782
789 void disablePerFaceNormal() requires face::HasOptionalNormal<T>
790 {
792 }
793
794 // PrincipalCurvature
795
806 requires face::HasOptionalPrincipalCurvature<T>
807 {
808 return Base::template isOptionalComponentEnabled<
809 typename T::PrincipalCurvature>();
810 }
811
819 requires face::HasOptionalPrincipalCurvature<T>
820 {
821 Base::template enableOptionalComponent<
822 typename T::PrincipalCurvature>();
823 }
824
832 requires face::HasOptionalPrincipalCurvature<T>
833 {
834 Base::template disableOptionalComponent<
835 typename T::PrincipalCurvature>();
836 }
837
838 // Quality
839
848 bool isPerFaceQualityEnabled() const requires face::HasOptionalQuality<T>
849 {
851 }
852
859 void enablePerFaceQuality() requires face::HasOptionalQuality<T>
860 {
862 }
863
870 void disablePerFaceQuality() requires face::HasOptionalQuality<T>
871 {
873 }
874
875 // WedgeColors
876
886 requires face::HasOptionalWedgeColors<T>
887 {
888 return Base::template isOptionalComponentEnabled<
889 typename T::WedgeColors>();
890 }
891
903 void enablePerFaceWedgeColors() requires face::HasOptionalWedgeColors<T>
904 {
906 }
907
914 void disablePerFaceWedgeColors() requires face::HasOptionalWedgeColors<T>
915 {
917 }
918
919 // WedgeTexCoords
920
930 requires face::HasOptionalWedgeTexCoords<T>
931 {
932 return Base::template isOptionalComponentEnabled<
933 typename T::WedgeTexCoords>();
934 }
935
948 requires face::HasOptionalWedgeTexCoords<T>
949 {
951 }
952
960 requires face::HasOptionalWedgeTexCoords<T>
961 {
963 }
964
965 // Custom Components
966
979 bool hasPerFaceCustomComponent(const std::string& name) const
981 {
982 return Base::hasElemCustomComponent(name);
983 }
984
995 std::vector<std::string> perFaceCustomComponentNames() const
997 {
998 return Base::elemCustomComponentNames();
999 }
1000
1026 template<typename K>
1027 bool isPerFaceCustomComponentOfType(const std::string& name) const
1029 {
1030 return Base::template isElemCustomComponentOfType<K>(name);
1031 }
1032
1048 std::type_index perFaceCustomComponentType(const std::string& name) const
1050 {
1051 return Base::elemComponentType(name);
1052 }
1053
1073 template<typename K>
1074 std::vector<std::string> perFaceCustomComponentNamesOfType() const
1076 {
1077 return Base::template elemCustomComponentNamesOfType<K>();
1078 }
1079
1090 template<typename K>
1091 void addPerFaceCustomComponent(const std::string& name)
1093 {
1094 Base::template addElemCustomComponent<K>(name);
1095 }
1096
1109 void deletePerFaceCustomComponent(const std::string& name)
1111 {
1112 Base::deleteElemCustomComponent(name);
1113 }
1114
1156 template<typename K>
1158 const std::string& name) requires face::HasCustomComponents<T>
1159 {
1160 return Base::template customComponentVectorHandle<K>(name);
1161 }
1162
1204 template<typename K>
1206 const std::string& name) const requires face::HasCustomComponents<T>
1207 {
1208 return Base::template customComponentVectorHandle<K>(name);
1209 }
1210
1221 template<typename K>
1224 {
1226 }
1227
1238 template<typename K>
1241 {
1243 }
1244
1245protected:
1252 template<typename OthMesh>
1254 {
1255 using ParentMesh = Base::ParentMeshType;
1256 using VertexType = ParentMesh::VertexType;
1257 using MVertexType = OthMesh::VertexType;
1258 using MFaceType = OthMesh::FaceType;
1259
1260 using VertexContainer = ParentMesh::VertexContainer;
1261
1262 // if this is not a triangle mesh nor a polygon mesh (meaning that we
1263 // can't control the number of vertex pointers in this mesh), and this
1264 // mesh does not have the same number of vertex pointers of the other,
1265 // it means that we don't know how to convert these type of meshes (e.g.
1266 // we don't know how to convert a polygon mesh into a quad mesh, or
1267 // convert a quad mesh into a pentagonal mesh...)
1268 static_assert(
1269 !(FaceType::VERTEX_NUMBER != 3 && FaceType::VERTEX_NUMBER > 0 &&
1270 FaceType::VERTEX_NUMBER != MFaceType::VERTEX_NUMBER),
1271 "Cannot import from that type of Mesh. Don't know how to "
1272 "convert faces.");
1273
1274 // we need to manage conversion from poly or faces with cardinality > 3
1275 // (e.g. quads) to triangle meshes. In this case, we triangulate the
1276 // polygon using the earcut algorithm.
1277 if constexpr (
1278 FaceType::VERTEX_NUMBER == 3 &&
1279 (MFaceType::VERTEX_NUMBER > 3 || MFaceType::VERTEX_NUMBER < 0)) {
1280 VertexType* base = &Base::mParentMesh->vertex(0);
1281 const MVertexType* mvbase = &m.vertex(0);
1282
1283 for (const MFaceType& mf : m.faces()) {
1284 // if the current face has the same number of vertices of this
1285 // faces (3), then the vertex pointers have been correctly
1286 // imported from the import pointers function. The import
1287 // pointers function does nothing when importing from a face
1288 // with at least 4 vertices
1289 if (mf.vertexNumber() != FaceType::VERTEX_NUMBER) {
1290 // triangulate mf; the first triangle of the triangulation
1291 // will be this->face(m.index(mf)); the other triangles will
1292 // be added at the end of the container
1293 std::vector<uint> tris =
1294 earCut(mf.vertices() | views::positions);
1295 FaceType& f = face(m.index(mf));
1296 importTriPointersHelper(f, mf, base, mvbase, tris, 0);
1297
1298 // number of other faces to add
1299 uint nf = tris.size() / 3 - 1;
1300 uint fid = addFaces(nf);
1301
1302 uint i = 3; // index that cycles into tris
1303 for (; fid < faceContainerSize(); ++fid) {
1304 FaceType& f = face(fid);
1305 importTriPointersHelper(f, mf, base, mvbase, tris, i);
1306 i += 3;
1307 }
1308 }
1309 }
1310 }
1311 }
1312
1313private:
1314 void addFaceHelper(T& f) { /* base case: no need to add vertices */ }
1315
1316 template<typename... V>
1317 void addFaceHelper(T& f, typename T::VertexType* v, V... args)
1318 {
1319 // position on which add the vertex
1320 const std::size_t n = f.vertexNumber() - sizeof...(args) - 1;
1321 f.setVertex(n, v); // set the vertex
1322 // set the remanining vertices, recursive variadics
1323 addFaceHelper(f, args...);
1324 }
1325
1326 template<typename... V>
1327 void addFaceHelper(T& f, uint vid, V... args)
1328 {
1329 // position on which add the vertex
1330 const std::size_t n = f.vertexNumber() - sizeof...(args) - 1;
1331 f.setVertex(n, vid); // set the vertex
1332 // set the remanining vertices, recursive variadics
1333 addFaceHelper(f, args...);
1334 }
1335
1336 template<typename MFaceType, typename VertexType, typename MVertexType>
1337 static void importTriPointersHelper(
1338 FaceType& f,
1339 const MFaceType& mf,
1340 VertexType* base,
1341 const MVertexType* mvbase,
1342 const std::vector<uint>& tris,
1343 uint basetri)
1344 {
1345 f.importFrom(mf); // import all the components from mf
1346 for (uint i = basetri, j = 0; i < basetri + 3; i++, j++) {
1347 f.setVertex(j, base + (mf.vertex(tris[i]) - mvbase));
1348
1349 // wedge colors
1350 if constexpr (
1351 face::HasWedgeColors<FaceType> &&
1352 face::HasWedgeColors<MFaceType>) {
1353 if (comp::isWedgeColorsAvailableOn(f) &&
1354 comp::isWedgeColorsAvailableOn(mf)) {
1355 f.wedgeColor(j) = mf.wedgeColor(tris[i]);
1356 }
1357 }
1358
1359 // wedge texcoords
1360 if constexpr (
1361 face::HasWedgeTexCoords<FaceType> &&
1362 face::HasWedgeTexCoords<MFaceType>) {
1363 if (comp::isWedgeTexCoordsAvailableOn(f) &&
1364 comp::isWedgeTexCoordsAvailableOn(mf)) {
1365 using ST = typename FaceType::WedgeTexCoordType::ScalarType;
1366 f.wedgeTexCoord(j) =
1367 mf.wedgeTexCoord(tris[i]).template cast<ST>();
1368 }
1369 }
1370 }
1371 }
1372};
1373
1374/* Concepts */
1375
1388template<typename T>
1389concept HasFaceContainer = std::derived_from< // same type or derived type
1390 std::remove_cvref_t<T>,
1391 FaceContainer<typename RemoveRef<T>::FaceType>>;
1392
1393} // namespace mesh
1394
1428template<typename... Args>
1430
1431} // namespace vcl
1432
1433#endif // VCL_MESH_CONTAINERS_FACE_CONTAINER_H
A class representing a box in N-dimensional space.
Definition box.h:46
PointT size() const
Computes the size of the box.
Definition box.h:267
The Face class represents an Face element of the vcl::Mesh class.
Definition face.h:48
void resizeVertices(uint n)
Resize the number of Vertex Pointers of the Face, taking care of updating also the other components o...
Definition face.h:140
Definition element.h:64
The FaceContainer class represents a container of Face elements that can be used in a Mesh class.
Definition face_container.h:55
FaceType & face(uint i)
Returns a reference of the Face at the i-th position in the Face Container of the Mesh,...
Definition face_container.h:95
void disablePerFacePrincipalCurvature()
Disables the Optional PrincipalCurvature of the Face.
Definition face_container.h:831
ConstFaceIterator faceEnd() const
Returns a const iterator to the end of the container.
Definition face_container.h:424
void enablePerFaceQuality()
Enable the Optional Quality of the Face.
Definition face_container.h:859
FaceIterator faceBegin(bool jumpDeleted=true)
Returns an iterator to the beginning of the container.
Definition face_container.h:393
void disablePerFaceAdjacentEdges()
Disables the Optional AdjacentEdges of the Face.
Definition face_container.h:592
std::vector< std::string > perFaceCustomComponentNames() const
Returns a vector containing all the names of the custom components of any type associated to the Face...
Definition face_container.h:995
bool isPerFaceMarkEnabled() const
Checks if the Face Optional Mark is enabled.
Definition face_container.h:690
bool isPerFaceAdjacentFacesEnabled() const
Checks if the Face Optional AdjacentFaces is enabled.
Definition face_container.h:608
void disablePerFaceAdjacentFaces()
Disables the Optional AdjacentFaces of the Face.
Definition face_container.h:637
FaceIterator faceEnd()
Returns an iterator to the end of the container.
Definition face_container.h:402
bool isPerFaceWedgeColorsEnabled() const
Checks if the Face Optional WedgeColors is enabled.
Definition face_container.h:885
void disablePerFaceQuality()
Disables the Optional Quality of the Face.
Definition face_container.h:870
CustomComponentVectorHandle< K > perFaceCustomComponentVectorHandle(const std::string &name)
Returns a vector handle to the custom component having the type K and the given name.
Definition face_container.h:1157
void enablePerFacePrincipalCurvature()
Enable the Optional PrincipalCurvature of the Face.
Definition face_container.h:818
bool isPerFacePrincipalCurvatureEnabled() const
Checks if the Face Optional PrincipalCurvature is enabled.
Definition face_container.h:805
uint faceContainerSize() const
Returns the number of Faces (also deleted) contained in the Face container of the Mesh.
Definition face_container.h:117
std::vector< uint > faceCompactIndices() const
Returns a vector that tells, for each actual Face index, the new index that the Face would have in a ...
Definition face_container.h:348
auto faces(bool jumpDeleted=true) const
Returns a small view object that allows to iterate over the Faces of the containers,...
Definition face_container.h:501
bool hasPerFaceCustomComponent(const std::string &name) const
Checks if Faces have a custom component with the given name.
Definition face_container.h:979
void disablePerFaceWedgeTexCoords()
Disables the Optional WedgeTexCoords of the Face.
Definition face_container.h:959
void enablePerFaceColor()
Enable the Optional Color of the Face.
Definition face_container.h:664
void addPerFaceCustomComponent(const std::string &name)
Adds a custom component of type K to the Face, having the given name.
Definition face_container.h:1091
auto faces(bool jumpDeleted=true)
Returns a small view object that allows to iterate over the Faces of the containers,...
Definition face_container.h:448
FaceContainer()=default
Empty constructor that creates an empty container of Faces.
void clearFaces()
Clears the Face container of the Mesh, deleting all the Faces.
Definition face_container.h:230
void disableAllPerFaceOptionalComponents()
Disables all the optional components associated to the Face type contained in the FaceContainer.
Definition face_container.h:548
void enablePerFaceMaterialIndex()
Enable the Optional MaterialIndex of the Face.
Definition face_container.h:740
bool isPerFaceQualityEnabled() const
Checks if the Face Optional Quality is enabled.
Definition face_container.h:848
void disablePerFaceMark()
Disables the Optional Mark of the Face.
Definition face_container.h:712
void updateFaceReferences(const std::vector< uint > &newIndices)
Updates all the indices and pointers of the Faces of this container that are stored in any container ...
Definition face_container.h:377
bool isPerFaceNormalEnabled() const
Checks if the Face Optional Normal is enabled.
Definition face_container.h:767
void deserializePerFaceCustomComponentsOfType(std::istream &is)
Deserializes in the given input stream all the custom components of the Face Element of type K.
Definition face_container.h:1239
auto faces(uint begin, uint end=UINT_NULL) const
Returns a view object that allows to iterate over the Faces of the container in the given range:
Definition face_container.h:530
void reserveFaces(uint n)
Reserve a number of Faces in the container of Faces. This is useful when you know (or you have an ide...
Definition face_container.h:280
uint deletedFaceNumber() const
Returns the number of deleted Faces in the Face container, that is faceContainerSize() - faceNumber()...
Definition face_container.h:125
void deleteFace(const FaceType *f)
Marks as deleted the given Face, before asserting that the Face belongs to this container.
Definition face_container.h:317
std::vector< std::string > perFaceCustomComponentNamesOfType() const
Returns a vector containing all the names of the custom components associated to the Edge Element hav...
Definition face_container.h:1074
void deleteFace(uint i)
Marks as deleted the Face with the given id.
Definition face_container.h:302
void disablePerFaceColor()
Disables the Optional Color of the Face.
Definition face_container.h:675
auto faces(uint begin, uint end=UINT_NULL)
Returns a view object that allows to iterate over the Faces of the container in the given range:
Definition face_container.h:474
bool isPerFaceCustomComponentOfType(const std::string &name) const
Checks if the custom component of the Face Element having the given name has the same type of the giv...
Definition face_container.h:1027
void enablePerFaceNormal()
Enable the Optional Normal of the Face.
Definition face_container.h:778
void disablePerFaceWedgeColors()
Disables the Optional WedgeColors of the Face.
Definition face_container.h:914
bool isPerFaceWedgeTexCoordsEnabled() const
Checks if the Face Optional WedgeTexCoords is enabled.
Definition face_container.h:929
void deletePerFaceCustomComponent(const std::string &name)
Deletes the custom component of the given name from the Face Element.
Definition face_container.h:1109
void disablePerFaceNormal()
Disables the Optional Normal of the Face.
Definition face_container.h:789
ConstCustomComponentVectorHandle< K > perFaceCustomComponentVectorHandle(const std::string &name) const
Returns a const vector handle to the custom component having type K and the given name.
Definition face_container.h:1205
void compactFaces()
Compacts the FaceContainer, removing all the Faces marked as deleted. Faces indices will change accor...
Definition face_container.h:288
std::type_index perFaceCustomComponentType(const std::string &name) const
Returns the std::type_index of the custom component of the Face Element having the given input name.
Definition face_container.h:1048
ConstFaceIterator faceBegin(bool jumpDeleted=true) const
Returns a const iterator to the beginning of the container.
Definition face_container.h:415
void enablePerFaceWedgeTexCoords()
Enable the Optional WedgeTexCoords of the Face.
Definition face_container.h:947
void enablePerFaceAdjacentFaces()
Enable the Optional AdjacentFaces of the Face.
Definition face_container.h:626
uint faceNumber() const
Returns the number of non-deleted Faces contained in the Face container of the Mesh.
Definition face_container.h:106
void manageImportTriFromPoly(const OthMesh &m)
This function manages the case where we try to import into a TriMesh a PolyMesh Faces have been alrea...
Definition face_container.h:1253
void enablePerFaceWedgeColors()
Enable the Optional WedgeColors of the Face.
Definition face_container.h:903
bool isPerFaceMaterialIndexEnabled() const
Checks if the Face Optional MaterialIndex is enabled.
Definition face_container.h:727
uint addFaces(uint n)
Add an arbitrary number of n Faces, returning the id of the first added Face.
Definition face_container.h:212
void disablePerFaceMaterialIndex()
Disables the Optional MaterialIndex of the Face.
Definition face_container.h:751
uint faceIndexIfCompact(uint i) const
This is an utility member function that returns the index of an element if the container would be com...
Definition face_container.h:332
void enablePerFaceMark()
Enable the Optional Mark of the Face.
Definition face_container.h:701
uint addFace()
Add a Face to the container, returning its index.
Definition face_container.h:136
bool isPerFaceAdjacentEdgesEnabled() const
Checks if the Face Optional AdjacentEdges is enabled.
Definition face_container.h:563
void enablePerFaceAdjacentEdges()
Enable the Optional AdjacentEdges of the Face.
Definition face_container.h:581
void enableAllPerFaceOptionalComponents()
Enables all the optional components associated to the Face type contained in the FaceContainer.
Definition face_container.h:539
bool isPerFaceColorEnabled() const
Checks if the Face Optional Color is enabled.
Definition face_container.h:653
const FaceType & face(uint i) const
Returns a const reference of the Face at the i-th position in the Face Container of the Mesh,...
Definition face_container.h:83
void serializePerFaceCustomComponentsOfType(std::ostream &os) const
Serializes in the given output stream all the custom components of the Face Element of type K.
Definition face_container.h:1222
void resizeFaces(uint n)
Resizes the Face container to contain n Faces.
Definition face_container.h:260
The Vertex Container class, will be used when the template argument given to the Mesh is a Vertex.
Definition vertex_container.h:52
const VertexType & vertex(uint i) const
Returns a const reference of the vertex at the i-th position in the Vertex Container of the Mesh,...
Definition vertex_container.h:81
HasFaces concepts is satisfied when at least one of its template types is (or inherits from) a vcl::m...
Definition face_container.h:1429
Definition face_components.h:83
Definition mesh_components.h:51
A concept that checks whether a class has (inherits from) an FaceContainer class.
Definition face_container.h:1389
constexpr uint UINT_NULL
The UINT_NULL value represent a null value of uint that is the maximum value that can be represented ...
Definition base.h:48
std::vector< uint > earCut(Iterator begin, Iterator end)
Triangulates a simple polygon with no holes using the ear-cutting algorithm.
Definition ear_cut.h:90