23#ifndef VCL_ALGORITHMS_MESH_IMPORT_EXPORT_EXPORT_BUFFER_H
24#define VCL_ALGORITHMS_MESH_IMPORT_EXPORT_EXPORT_BUFFER_H
28#include <vclib/algorithms/mesh/utility.h>
30#include <vclib/algorithms/core.h>
31#include <vclib/mesh.h>
32#include <vclib/space/complex.h>
48inline TriPolyIndexBiMap indexMap;
73template<MeshConcept MeshType>
80 using namespace detail;
84 for (uint
i = 0;
const auto&
p : mesh.vertices() | views::positions) {
110template<MeshConcept MeshType>
126 for (uint
i = 0;
const auto& v : mesh.vertices()) {
163template<FaceMeshConcept MeshType>
167 for (uint
i = 0;
const auto& f : mesh.faces()) {
168 buffer[
i] = f.vertexNumber();
169 sum += f.vertexNumber();
225template<FaceMeshConcept MeshType>
227 const MeshType& mesh,
237 for (uint
i = 0;
const auto& f : mesh.faces()) {
238 for (uint
j = 0;
j < f.vertexNumber(); ++
j) {
291template<FaceMeshConcept MeshType>
293 const MeshType& mesh,
300 using namespace detail;
310 for (uint
i = 0;
const auto& f : mesh.faces()) {
313 j < f.vertexNumber() ?
vIndex(f,
j) : -1;
365template<FaceMeshConcept MeshType>
367 const MeshType& mesh,
374 using namespace detail;
384 indexMap.
reserve(mesh.faceNumber(), mesh.faceContainerSize());
388 for (uint t = 0;
const auto& f : mesh.faces()) {
390 indexMap.
insert(t, f.index());
402 storage == MatrixStorageType::COLUMN_MAJOR &&
403 mesh.faceNumber() > 0) {
406 for (uint t = 0;
const auto& f : mesh.faces()) {
412 indexMap.
insert(t, f.index());
414 for (uint
k = 0;
k < 3; ++
k)
455template<EdgeMeshConcept MeshType>
457 const MeshType& mesh,
463 using namespace detail;
473 for (uint
i = 0;
const auto& e : mesh.edges()) {
510template<FaceMeshConcept MeshType>
512 const MeshType& mesh,
518 using namespace detail;
529 for (uint
i = 0;
const auto& f : mesh.faces()) {
530 for (uint
j = 0;
j < f.vertexNumber(); ++
j) {
532 uint v1 =
vIndex(f, (
j + 1) % f.vertexNumber());
569template<u
int ELEM_ID, MeshConcept MeshType>
570void elementSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
572 for (uint i = 0;
const auto& e : mesh.template elements<ELEM_ID>()) {
573 buffer[i] = e.selected();
603template<MeshConcept MeshType>
604void vertexSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
606 elementSelectionToBuffer<ElemId::VERTEX>(mesh, buffer);
634template<FaceMeshConcept MeshType>
635void faceSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
637 elementSelectionToBuffer<ElemId::FACE>(mesh, buffer);
665template<EdgeMeshConcept MeshType>
666void edgeSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
668 elementSelectionToBuffer<ElemId::EDGE>(mesh, buffer);
693template<u
int ELEM_ID, MeshConcept MeshType>
694void elementNormalsToBuffer(
695 const MeshType& mesh,
700 using namespace detail;
702 requirePerElementComponent<ELEM_ID, CompId::NORMAL>(mesh);
705 rowNumber ==
UINT_NULL ? mesh.template number<ELEM_ID>() : rowNumber;
708 const auto& n : mesh.template elements<ELEM_ID>() | views::normals) {
709 at(buffer, i, 0, ROW_NUM, 3, storage) = n.x();
710 at(buffer, i, 1, ROW_NUM, 3, storage) = n.y();
711 at(buffer, i, 2, ROW_NUM, 3, storage) = n.z();
738template<MeshConcept MeshType>
739void vertexNormalsToBuffer(
740 const MeshType& mesh,
745 elementNormalsToBuffer<ElemId::VERTEX>(mesh, buffer, storage, rowNumber);
768template<FaceMeshConcept MeshType>
769void faceNormalsToBuffer(
770 const MeshType& mesh,
775 elementNormalsToBuffer<ElemId::FACE>(mesh, buffer, storage, rowNumber);
802template<FaceMeshConcept MeshType>
803void triangulatedFaceNormalsToBuffer(
804 const MeshType& mesh,
806 const TriPolyIndexBiMap& indexMap,
810 using namespace detail;
817 for (
const auto& f : mesh.
faces()) {
818 const auto& n = f.normal();
821 for (uint t = first; t < last; ++t) {
822 at(buffer, t, 0, ROW_NUM, 3, storage) = n.x();
823 at(buffer, t, 1, ROW_NUM, 3, storage) = n.y();
824 at(buffer, t, 2, ROW_NUM, 3, storage) = n.z();
849template<EdgeMeshConcept MeshType>
850void edgeNormalsToBuffer(
851 const MeshType& mesh,
856 elementNormalsToBuffer<ElemId::EDGE>(mesh, buffer, storage, rowNumber);
883template<u
int ELEM_ID, MeshConcept MeshType>
884void elementColorsToBuffer(
885 const MeshType& mesh,
891 using namespace detail;
893 requirePerElementComponent<ELEM_ID, CompId::COLOR>(mesh);
895 const bool R_INT = representation == Color::Representation::INT_0_255;
898 rowNumber ==
UINT_NULL ? mesh.template number<ELEM_ID>() : rowNumber;
901 const auto& c : mesh.template elements<ELEM_ID>() | views::colors) {
902 at(buffer, i, 0, ROW_NUM, 4, storage) = R_INT ? c.red() : c.redF();
903 at(buffer, i, 1, ROW_NUM, 4, storage) = R_INT ? c.green() : c.greenF();
904 at(buffer, i, 2, ROW_NUM, 4, storage) = R_INT ? c.blue() : c.blueF();
905 at(buffer, i, 3, ROW_NUM, 4, storage) = R_INT ? c.alpha() : c.alphaF();
932template<u
int ELEM_ID, MeshConcept MeshType>
933void elementColorsToBuffer(
934 const MeshType& mesh,
938 requirePerElementComponent<ELEM_ID, CompId::COLOR>(mesh);
941 const auto& c : mesh.template elements<ELEM_ID>() | views::colors) {
942 switch (colorFormat) {
944 case ABGR: buffer[i] = c.abgr();
break;
945 case ARGB: buffer[i] = c.argb();
break;
946 case RGBA: buffer[i] = c.rgba();
break;
947 case BGRA: buffer[i] = c.bgra();
break;
977template<MeshConcept MeshType>
978void vertexColorsToBuffer(
979 const MeshType& mesh,
985 elementColorsToBuffer<ElemId::VERTEX>(
986 mesh, buffer, storage, representation, rowNumber);
1009template<MeshConcept MeshType>
1010void vertexColorsToBuffer(
1011 const MeshType& mesh,
1015 elementColorsToBuffer<ElemId::VERTEX>(mesh, buffer, colorFormat);
1041template<FaceMeshConcept MeshType>
1042void faceColorsToBuffer(
1043 const MeshType& mesh,
1049 elementColorsToBuffer<ElemId::FACE>(
1050 mesh, buffer, storage, representation, rowNumber);
1079template<FaceMeshConcept MeshType>
1080void triangulatedFaceColorsToBuffer(
1081 const MeshType& mesh,
1083 const TriPolyIndexBiMap& indexMap,
1088 using namespace detail;
1092 const bool R_INT = representation == Color::Representation::INT_0_255;
1094 const uint ROW_NUM =
1097 for (
const auto& f : mesh.
faces()) {
1098 const auto& c = f.color();
1101 for (uint t = first; t < last; ++t) {
1102 at(buffer, t, 0, ROW_NUM, 4, storage) = R_INT ? c.red() : c.redF();
1103 at(buffer, t, 1, ROW_NUM, 4, storage) =
1104 R_INT ? c.green() : c.greenF();
1105 at(buffer, t, 2, ROW_NUM, 4, storage) =
1106 R_INT ? c.blue() : c.blueF();
1107 at(buffer, t, 3, ROW_NUM, 4, storage) =
1108 R_INT ? c.alpha() : c.alphaF();
1133template<FaceMeshConcept MeshType>
1134void faceColorsToBuffer(
1135 const MeshType& mesh,
1139 elementColorsToBuffer<ElemId::FACE>(mesh, buffer, colorFormat);
1165template<FaceMeshConcept MeshType>
1166void triangulatedFaceColorsToBuffer(
1167 const MeshType& mesh,
1169 const TriPolyIndexBiMap& indexMap,
1172 requirePerElementComponent<ElemId::FACE, CompId::COLOR>(mesh);
1174 for (
const auto& f : mesh.
faces()) {
1175 const auto& c = f.color();
1178 for (uint t = first; t < last; ++t) {
1179 switch (colorFormat) {
1181 case ABGR: buffer[t] = c.abgr();
break;
1182 case ARGB: buffer[t] = c.argb();
break;
1183 case RGBA: buffer[t] = c.rgba();
break;
1184 case BGRA: buffer[t] = c.bgra();
break;
1213template<EdgeMeshConcept MeshType>
1214void edgeColorsToBuffer(
1215 const MeshType& mesh,
1221 elementColorsToBuffer<ElemId::EDGE>(
1222 mesh, buffer, storage, representation, rowNumber);
1245template<EdgeMeshConcept MeshType>
1246void edgeColorsToBuffer(
1247 const MeshType& mesh,
1251 elementColorsToBuffer<ElemId::EDGE>(mesh, buffer, colorFormat);
1273template<u
int ELEM_ID, MeshConcept MeshType>
1274void elementQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1276 requirePerElementComponent<ELEM_ID, CompId::QUALITY>(mesh);
1279 const auto& q : mesh.template elements<ELEM_ID>() | views::quality) {
1303template<MeshConcept MeshType>
1304void vertexQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1306 elementQualityToBuffer<ElemId::VERTEX>(mesh, buffer);
1326template<MeshConcept MeshType>
1327void faceQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1329 elementQualityToBuffer<ElemId::FACE>(mesh, buffer);
1349template<MeshConcept MeshType>
1350void edgeQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1352 elementQualityToBuffer<ElemId::FACE>(mesh, buffer);
1381template<MeshConcept MeshType>
1382void vertexTangentsToBuffer(
1383 const MeshType& mesh,
1385 bool storeHandednessAsW =
true,
1389 using namespace detail;
1391 requirePerVertexTangent(mesh);
1393 const uint ROW_NUM =
1394 rowNumber ==
UINT_NULL ? mesh.vertexNumber() : rowNumber;
1395 const uint COL_NUM = storeHandednessAsW ? 4 : 3;
1397 for (uint i = 0;
const auto& v : mesh.vertices()) {
1398 at(buffer, i, 0, ROW_NUM, COL_NUM, storage) = v.tangent().x();
1399 at(buffer, i, 1, ROW_NUM, COL_NUM, storage) = v.tangent().y();
1400 at(buffer, i, 2, ROW_NUM, COL_NUM, storage) = v.tangent().z();
1401 if (storeHandednessAsW) {
1402 at(buffer, i, 3, ROW_NUM, COL_NUM, storage) =
1403 v.tangentRightHanded() ? 1.0 : -1.0;
1431template<MeshConcept MeshType>
1432void vertexTexCoordsToBuffer(
1433 const MeshType& mesh,
1438 using namespace detail;
1440 requirePerVertexTexCoord(mesh);
1442 const uint ROW_NUM =
1443 rowNumber ==
UINT_NULL ? mesh.vertexNumber() : rowNumber;
1445 for (uint i = 0;
const auto& t : mesh.vertices() | views::texCoords) {
1446 at(buffer, i, 0, ROW_NUM, 2, storage) = t.u();
1447 at(buffer, i, 1, ROW_NUM, 2, storage) = t.v();
1471template<MeshConcept MeshType>
1472void vertexMaterialIndicesToBuffer(
const MeshType& mesh,
auto* buffer)
1474 requirePerVertexMaterialIndex(mesh);
1476 for (uint i = 0;
const auto& v : mesh.vertices()) {
1477 buffer[i] = v.materialIndex();
1505template<FaceMeshConcept MeshType>
1506void vertexMaterialIndicesAsFaceMaterialIndicesToBuffer(
1507 const MeshType& mesh,
1510 requirePerVertexMaterialIndex(mesh);
1512 for (uint i = 0;
const auto& f : mesh.faces()) {
1513 ushort ti = f.vertex(0)->materialIndex();
1543template<FaceMeshConcept MeshType>
1544void vertexMaterialIndicesAsTriangulatedFaceMaterialIndicesToBuffer(
1545 const MeshType& mesh,
1547 const TriPolyIndexBiMap& indexMap)
1549 requirePerVertexMaterialIndex(mesh);
1551 for (
const auto& f : mesh.
faces()) {
1552 ushort ti = f.vertex(0)->materialIndex();
1555 for (uint t = first; t < last; ++t) {
1598template<FaceMeshConcept MeshType>
1600 const MeshType& mesh,
1610 for (uint
i = 0;
const auto& f : mesh.faces()) {
1614 if (
storage == MatrixStorageType::COLUMN_MAJOR)
1616 if (
fi < f.vertexNumber()) {
1617 const auto& w = f.wedgeTexCoord(
fi);
1619 buffer[index] = w.u();
1621 buffer[index] = w.v();
1649template<FaceMeshConcept MeshType>
1654 for (uint
i = 0;
const auto& f : mesh.faces()) {
1655 buffer[
i] = f.materialIndex();
1681template<FaceMeshConcept MeshType>
1683 const MeshType& mesh,
1689 for (
const auto& f : mesh.faces()) {
1692 for (uint t = first; t <
last; ++t) {
1693 buffer[t] = f.materialIndex();
1742template<FaceMeshConcept MeshType>
1744 const MeshType& mesh,
1745 const std::vector<std::pair<vcl::uint, vcl::uint>>&
vertWedgeMap,
1746 const std::list<std::list<std::pair<vcl::uint, vcl::uint>>>&
1751 using namespace detail;
1752 using TexCoordType =
typename MeshType::FaceType::WedgeTexCoordType;
1761 for (
const auto& v : mesh.vertices()) {
1768 w = mesh.face(
fInd).wedgeTexCoord(
wInd);
1779 assert(list.begin() != list.end());
1780 const auto&
p = list.front();
1781 uint
fInd =
p.first;
1782 uint
wInd =
p.second;
1784 const auto& w = mesh.face(
fInd).wedgeTexCoord(
wInd);
1834template<FaceMeshConcept MeshType>
1836 const MeshType& mesh,
1837 const std::vector<std::pair<vcl::uint, vcl::uint>>&
vertWedgeMap,
1838 const std::list<std::list<std::pair<vcl::uint, vcl::uint>>>&
1849 for (
const auto& v : mesh.vertices()) {
1859 assert(list.begin() != list.end());
1860 const auto&
p = list.front();
1861 uint
fInd =
p.first;
1898template<MeshConcept MeshType>
1900 const MeshType& mesh,
1906 using namespace detail;
1908 requireVertexContainerCompactness(mesh);
1909 requirePerVertexAdjacentVertices(mesh);
1916 for (uint
i = 0;
const auto& v : mesh.vertices()) {
1918 for (
const auto*
a : v.adjVertices()) {
1959template<u
int ELEM_ID, FaceMeshConcept MeshType>
1961 const MeshType& mesh,
1967 using namespace detail;
1979 for (
const auto*
a : v.adjFaces()) {
2020template<FaceMeshConcept MeshType>
2022 const MeshType& mesh,
2053template<FaceMeshConcept MeshType>
2055 const MeshType& mesh,
2093template<FaceMeshConcept MeshType>
2095 const MeshType& mesh,
2133template<u
int ELEM_ID, EdgeMeshConcept MeshType>
2135 const MeshType& mesh,
2141 using namespace detail;
2153 for (
const auto*
a : v.adjEdges()) {
2194template<EdgeMeshConcept MeshType>
2196 const MeshType& mesh,
2234template<EdgeMeshConcept MeshType>
2236 const MeshType& mesh,
2274template<EdgeMeshConcept MeshType>
2276 const MeshType& mesh,
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
Format
Color format enumeration.
Definition color.h:77
Representation
Color representation enumeration.
Definition color.h:64
The TriPolyIndexBiMap class allows to store a bidirectional mapping between a Polygon Mesh and a Tria...
Definition tri_poly_index_bimap.h:50
void reserve(uint nTriangles, uint nPolygons)
Reserves enogh memory for the BiMap. Allows fast insertions.
Definition tri_poly_index_bimap.h:141
void insert(uint triangleIndex, uint polygonIndex)
Performs an insertion into the BiMap, and associates:
Definition tri_poly_index_bimap.h:162
void clear()
Clears the BiMap.
Definition tri_poly_index_bimap.h:127
uint triangleBegin(uint polygonIndex) const
Returns the smallest index of set of triangles mapped to the polygon having the index given as input ...
Definition tri_poly_index_bimap.h:84
uint triangleNumber(uint polygonIndex) const
Returns the number of (consecutive index) triangles mapped to a polygon.
Definition tri_poly_index_bimap.h:113
The EdgeMeshConcept is evaluated true if the type T is a Mesh (it satisfies the vcl::MeshConcept) and...
Definition edge_requirements.h:58
The FaceMeshConcept is evaluated true if the type T is a Mesh (it satisfies the vcl::MeshConcept) and...
Definition face_requirements.h:70
Definition face_requirements.h:73
void wedgeTexCoordsAsDuplicatedVertexTexCoordsToBuffer(const MeshType &mesh, const std::vector< std::pair< vcl::uint, vcl::uint > > &vertWedgeMap, const std::list< std::list< std::pair< vcl::uint, vcl::uint > > > &facesToReassign, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Export wedge texture coordinates to a buffer of the duplicated vertex texture coordinates.
Definition export_buffer.h:1743
void faceMaterialIndicesAsDuplicatedVertexMaterialIndicesToBuffer(const MeshType &mesh, const std::vector< std::pair< vcl::uint, vcl::uint > > &vertWedgeMap, const std::list< std::list< std::pair< vcl::uint, vcl::uint > > > &facesToReassign, auto *buffer)
Export face material indices to a buffer of the duplicated vertex material indices.
Definition export_buffer.h:1835
MatrixStorageType
A simple type that enumerates the main storage types for matrices (row or column major).
Definition base.h:88
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
void requireEdgeContainerCompactness(const MeshType &m)
This function asserts that a Mesh has the EdgeContainer compact (no elements flagged as deleted).
Definition edge_requirements.h:597
void vertexPositionsToBuffer(const MeshType &mesh, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export the vertex positions of a mesh to a buffer.
Definition export_buffer.h:74
void edgeVertexIndicesToBuffer(const MeshType &mesh, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, bool getIndicesAsIfContainerCompact=true, uint rowNumber=UINT_NULL)
Export into a buffer the vertex indices for each edge of a Mesh.
Definition export_buffer.h:456
void wireframeVertexIndicesToBuffer(const MeshType &mesh, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, bool getIndicesAsIfContainerCompact=true, uint rowNumber=UINT_NULL)
Export into a buffer the vertex indices for each edge that composes the wireframe of the Mesh (i....
Definition export_buffer.h:511
void triangulatedFaceVertexIndicesToBuffer(const MeshType &mesh, auto *buffer, TriPolyIndexBiMap &indexMap=detail::indexMap, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numTriangles=UINT_NULL, bool getIndicesAsIfContainerCompact=true)
Export into a buffer the vertex indices for each triangle computed by triangulating the faces of a Me...
Definition export_buffer.h:366
void vertexAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent edges indices for each vertex of a Mesh. The number of adjacent edg...
Definition export_buffer.h:2195
void faceAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent edges indices for each face of a Mesh. The number of adjacent edges...
Definition export_buffer.h:2235
void elementAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent edges indices for each ELEM_ID element of a Mesh....
Definition export_buffer.h:2134
void vertexAdjacentVerticesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentVerticesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent vertex indices for each vertex of a Mesh. The number of adjacent ve...
Definition export_buffer.h:1899
void faceAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent faces indices for each face of a Mesh. The number of adjacent faces...
Definition export_buffer.h:2054
void edgeAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent faces indices for each edge of a Mesh. The number of adjacent faces...
Definition export_buffer.h:2094
void vertexAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent faces indices for each vertex of a Mesh. The number of adjacent fac...
Definition export_buffer.h:2021
void triangulatedFaceMaterialIndicesToBuffer(const MeshType &mesh, auto *buffer, const TriPolyIndexBiMap &indexMap)
Export into a buffer the per triangle material indices of a mesh. Triangles are computed by triangula...
Definition export_buffer.h:1682
void faceVertexIndicesToBuffer(const MeshType &mesh, auto *buffer, bool getIndicesAsIfContainerCompact=true)
Export into a buffer the vertex indices for each face of a Mesh. Faces can be polygons.
Definition export_buffer.h:226
void edgeAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent edges indices for each edge of a Mesh. The number of adjacent edges...
Definition export_buffer.h:2275
void faceWedgeTexCoordsToBuffer(const MeshType &mesh, auto *buffer, uint largestFaceSize=3, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export the selection status of the elements identified by ELEM_ID of a mesh to a buffer.
Definition export_buffer.h:1599
void vertexQuadIndicesToBuffer(const MeshType &mesh, auto *buffer)
Export the indices of a quad per vertex to a buffer.
Definition export_buffer.h:111
uint faceSizesToBuffer(const MeshType &mesh, auto *buffer)
Export into a buffer the sizes of the faces of a Mesh, and return the sum of the sizes.
Definition export_buffer.h:164
void elementAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export into a buffer the adjacent faces indices for each ELEM_ID element of a Mesh....
Definition export_buffer.h:1960
void faceMaterialIndicesToBuffer(const MeshType &mesh, auto *buffer)
Export into a buffer the per face material indices of a mesh.
Definition export_buffer.h:1650
void requirePerFaceWedgeTexCoords(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a WedgeTexCoords Component,...
Definition face_requirements.h:1322
void requirePerFaceMaterialIndex(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a MaterialIndex Component,...
Definition face_requirements.h:1143
void requireFaceContainerCompactness(const MeshType &m)
This function asserts that a Mesh has the FaceContainer compact (no elements flagged as deleted).
Definition face_requirements.h:966
void requirePerFaceNormal(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a Normal Component,...
Definition face_requirements.h:1179
void requirePerFaceColor(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a Color Component,...
Definition face_requirements.h:1073
uint countPerFaceVertexReferences(const FaceMeshConcept auto &mesh)
Count the number of references to vertices in the mesh faces.
Definition topology.h:182
uint largestFaceSize(const FaceMeshConcept auto &mesh)
Returns the largest face size in the mesh.
Definition topology.h:212
uint countTriangulatedTriangles(const FaceMeshConcept auto &mesh)
Counts the number of resulting triangles if the input mesh would be triangulated by splitting each fa...
Definition topology.h:240
constexpr detail::FacesView faces
A view that allows to iterate overt the Face elements of an object.
Definition face.h:84