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;
83 for (uint
i = 0;
const auto&
p : mesh.vertices() | views::positions) {
109template<MeshConcept MeshType>
125 for (uint
i = 0;
const auto& v : mesh.vertices()) {
162template<FaceMeshConcept MeshType>
166 for (uint
i = 0;
const auto& f : mesh.faces()) {
167 buffer[
i] = f.vertexCount();
168 sum += f.vertexCount();
224template<FaceMeshConcept MeshType>
226 const MeshType& mesh,
236 for (uint
i = 0;
const auto& f : mesh.faces()) {
237 for (uint
j = 0;
j < f.vertexCount(); ++
j) {
290template<FaceMeshConcept MeshType>
292 const MeshType& mesh,
299 using namespace detail;
309 for (uint
i = 0;
const auto& f : mesh.faces()) {
312 j < f.vertexCount() ?
vIndex(f,
j) : -1;
364template<FaceMeshConcept MeshType>
366 const MeshType& mesh,
373 using namespace detail;
383 indexMap.
reserve(mesh.faceCount(), mesh.faceContainerSize());
387 for (uint t = 0;
const auto& f : mesh.faces()) {
389 indexMap.
insert(t, f.index());
401 storage == MatrixStorageType::COLUMN_MAJOR &&
402 mesh.faceCount() > 0) {
405 for (uint t = 0;
const auto& f : mesh.faces()) {
409 for (uint
vi = 0;
vi <
vind.size();
vi += 3) {
411 indexMap.
insert(t, f.index());
413 for (uint
k = 0;
k < 3; ++
k)
454template<EdgeMeshConcept MeshType>
456 const MeshType& mesh,
462 using namespace detail;
472 for (uint
i = 0;
const auto& e : mesh.edges()) {
509template<FaceMeshConcept MeshType>
511 const MeshType& mesh,
517 using namespace detail;
528 for (uint
i = 0;
const auto& f : mesh.faces()) {
529 for (uint
j = 0;
j < f.vertexCount(); ++
j) {
531 uint v1 =
vIndex(f, (
j + 1) % f.vertexCount());
568template<u
int ELEM_ID, MeshConcept MeshType>
569void elementSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
571 for (uint i = 0;
const auto& e : mesh.template elements<ELEM_ID>()) {
572 buffer[i] = e.selected();
602template<MeshConcept MeshType>
603void vertexSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
605 elementSelectionToBuffer<ElemId::VERTEX>(mesh, buffer);
633template<FaceMeshConcept MeshType>
634void faceSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
636 elementSelectionToBuffer<ElemId::FACE>(mesh, buffer);
664template<EdgeMeshConcept MeshType>
665void edgeSelectionToBuffer(
const MeshType& mesh,
auto* buffer)
667 elementSelectionToBuffer<ElemId::EDGE>(mesh, buffer);
692template<u
int ELEM_ID, MeshConcept MeshType>
693void elementNormalsToBuffer(
694 const MeshType& mesh,
699 using namespace detail;
701 requirePerElementComponent<ELEM_ID, CompId::NORMAL>(mesh);
703 const uint NUM_ROWS =
704 numRows ==
UINT_NULL ? mesh.template count<ELEM_ID>() : numRows;
707 const auto& n : mesh.template elements<ELEM_ID>() | views::normals) {
708 at(buffer, i, 0, NUM_ROWS, 3, storage) = n.x();
709 at(buffer, i, 1, NUM_ROWS, 3, storage) = n.y();
710 at(buffer, i, 2, NUM_ROWS, 3, storage) = n.z();
737template<MeshConcept MeshType>
738void vertexNormalsToBuffer(
739 const MeshType& mesh,
744 elementNormalsToBuffer<ElemId::VERTEX>(mesh, buffer, storage, numRows);
767template<FaceMeshConcept MeshType>
768void faceNormalsToBuffer(
769 const MeshType& mesh,
774 elementNormalsToBuffer<ElemId::FACE>(mesh, buffer, storage, numRows);
801template<FaceMeshConcept MeshType>
802void triangulatedFaceNormalsToBuffer(
803 const MeshType& mesh,
805 const TriPolyIndexBiMap& indexMap,
809 using namespace detail;
813 const uint NUM_ROWS =
816 for (
const auto& f : mesh.
faces()) {
817 const auto& n = f.normal();
820 for (uint t = first; t < last; ++t) {
821 at(buffer, t, 0, NUM_ROWS, 3, storage) = n.x();
822 at(buffer, t, 1, NUM_ROWS, 3, storage) = n.y();
823 at(buffer, t, 2, NUM_ROWS, 3, storage) = n.z();
848template<EdgeMeshConcept MeshType>
849void edgeNormalsToBuffer(
850 const MeshType& mesh,
855 elementNormalsToBuffer<ElemId::EDGE>(mesh, buffer, storage, numRows);
882template<u
int ELEM_ID, MeshConcept MeshType>
883void elementColorsToBuffer(
884 const MeshType& mesh,
890 using namespace detail;
892 requirePerElementComponent<ELEM_ID, CompId::COLOR>(mesh);
894 const bool R_INT = representation == Color::Representation::INT_0_255;
896 const uint NUM_ROWS =
897 numRows ==
UINT_NULL ? mesh.template count<ELEM_ID>() : numRows;
900 const auto& c : mesh.template elements<ELEM_ID>() | views::colors) {
901 at(buffer, i, 0, NUM_ROWS, 4, storage) = R_INT ? c.red() : c.redF();
902 at(buffer, i, 1, NUM_ROWS, 4, storage) = R_INT ? c.green() : c.greenF();
903 at(buffer, i, 2, NUM_ROWS, 4, storage) = R_INT ? c.blue() : c.blueF();
904 at(buffer, i, 3, NUM_ROWS, 4, storage) = R_INT ? c.alpha() : c.alphaF();
931template<u
int ELEM_ID, MeshConcept MeshType>
932void elementColorsToBuffer(
933 const MeshType& mesh,
937 requirePerElementComponent<ELEM_ID, CompId::COLOR>(mesh);
940 const auto& c : mesh.template elements<ELEM_ID>() | views::colors) {
941 switch (colorFormat) {
943 case ABGR: buffer[i] = c.abgr();
break;
944 case ARGB: buffer[i] = c.argb();
break;
945 case RGBA: buffer[i] = c.rgba();
break;
946 case BGRA: buffer[i] = c.bgra();
break;
976template<MeshConcept MeshType>
977void vertexColorsToBuffer(
978 const MeshType& mesh,
984 elementColorsToBuffer<ElemId::VERTEX>(
985 mesh, buffer, storage, representation, numRows);
1008template<MeshConcept MeshType>
1009void vertexColorsToBuffer(
1010 const MeshType& mesh,
1014 elementColorsToBuffer<ElemId::VERTEX>(mesh, buffer, colorFormat);
1040template<FaceMeshConcept MeshType>
1041void faceColorsToBuffer(
1042 const MeshType& mesh,
1048 elementColorsToBuffer<ElemId::FACE>(
1049 mesh, buffer, storage, representation, numRows);
1078template<FaceMeshConcept MeshType>
1079void triangulatedFaceColorsToBuffer(
1080 const MeshType& mesh,
1082 const TriPolyIndexBiMap& indexMap,
1087 using namespace detail;
1091 const bool R_INT = representation == Color::Representation::INT_0_255;
1093 const uint NUM_ROWS =
1096 for (
const auto& f : mesh.
faces()) {
1097 const auto& c = f.color();
1100 for (uint t = first; t < last; ++t) {
1101 at(buffer, t, 0, NUM_ROWS, 4, storage) = R_INT ? c.red() : c.redF();
1102 at(buffer, t, 1, NUM_ROWS, 4, storage) =
1103 R_INT ? c.green() : c.greenF();
1104 at(buffer, t, 2, NUM_ROWS, 4, storage) =
1105 R_INT ? c.blue() : c.blueF();
1106 at(buffer, t, 3, NUM_ROWS, 4, storage) =
1107 R_INT ? c.alpha() : c.alphaF();
1132template<FaceMeshConcept MeshType>
1133void faceColorsToBuffer(
1134 const MeshType& mesh,
1138 elementColorsToBuffer<ElemId::FACE>(mesh, buffer, colorFormat);
1164template<FaceMeshConcept MeshType>
1165void triangulatedFaceColorsToBuffer(
1166 const MeshType& mesh,
1168 const TriPolyIndexBiMap& indexMap,
1171 requirePerElementComponent<ElemId::FACE, CompId::COLOR>(mesh);
1173 for (
const auto& f : mesh.
faces()) {
1174 const auto& c = f.color();
1177 for (uint t = first; t < last; ++t) {
1178 switch (colorFormat) {
1180 case ABGR: buffer[t] = c.abgr();
break;
1181 case ARGB: buffer[t] = c.argb();
break;
1182 case RGBA: buffer[t] = c.rgba();
break;
1183 case BGRA: buffer[t] = c.bgra();
break;
1212template<EdgeMeshConcept MeshType>
1213void edgeColorsToBuffer(
1214 const MeshType& mesh,
1220 elementColorsToBuffer<ElemId::EDGE>(
1221 mesh, buffer, storage, representation, numRows);
1244template<EdgeMeshConcept MeshType>
1245void edgeColorsToBuffer(
1246 const MeshType& mesh,
1250 elementColorsToBuffer<ElemId::EDGE>(mesh, buffer, colorFormat);
1272template<u
int ELEM_ID, MeshConcept MeshType>
1273void elementQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1275 requirePerElementComponent<ELEM_ID, CompId::QUALITY>(mesh);
1278 const auto& q : mesh.template elements<ELEM_ID>() | views::quality) {
1302template<MeshConcept MeshType>
1303void vertexQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1305 elementQualityToBuffer<ElemId::VERTEX>(mesh, buffer);
1325template<MeshConcept MeshType>
1326void faceQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1328 elementQualityToBuffer<ElemId::FACE>(mesh, buffer);
1348template<MeshConcept MeshType>
1349void edgeQualityToBuffer(
const MeshType& mesh,
auto* buffer)
1351 elementQualityToBuffer<ElemId::FACE>(mesh, buffer);
1380template<MeshConcept MeshType>
1381void vertexTangentsToBuffer(
1382 const MeshType& mesh,
1384 bool storeHandednessAsW =
true,
1388 using namespace detail;
1390 requirePerVertexTangent(mesh);
1392 const uint NUM_ROWS = numRows ==
UINT_NULL ? mesh.vertexCount() : numRows;
1393 const uint NUM_COLS = storeHandednessAsW ? 4 : 3;
1395 for (uint i = 0;
const auto& v : mesh.vertices()) {
1396 at(buffer, i, 0, NUM_ROWS, NUM_COLS, storage) = v.tangent().x();
1397 at(buffer, i, 1, NUM_ROWS, NUM_COLS, storage) = v.tangent().y();
1398 at(buffer, i, 2, NUM_ROWS, NUM_COLS, storage) = v.tangent().z();
1399 if (storeHandednessAsW) {
1400 at(buffer, i, 3, NUM_ROWS, NUM_COLS, storage) =
1401 v.tangentRightHanded() ? 1.0 : -1.0;
1429template<MeshConcept MeshType>
1430void vertexTexCoordsToBuffer(
1431 const MeshType& mesh,
1436 using namespace detail;
1438 requirePerVertexTexCoord(mesh);
1440 const uint NUM_ROWS = numRows ==
UINT_NULL ? mesh.vertexCount() : numRows;
1442 for (uint i = 0;
const auto& t : mesh.vertices() | views::texCoords) {
1443 at(buffer, i, 0, NUM_ROWS, 2, storage) = t.u();
1444 at(buffer, i, 1, NUM_ROWS, 2, storage) = t.v();
1468template<MeshConcept MeshType>
1469void vertexMaterialIndicesToBuffer(
const MeshType& mesh,
auto* buffer)
1471 requirePerVertexMaterialIndex(mesh);
1473 for (uint i = 0;
const auto& v : mesh.vertices()) {
1474 buffer[i] = v.materialIndex();
1502template<FaceMeshConcept MeshType>
1503void vertexMaterialIndicesAsFaceMaterialIndicesToBuffer(
1504 const MeshType& mesh,
1507 requirePerVertexMaterialIndex(mesh);
1509 for (uint i = 0;
const auto& f : mesh.faces()) {
1510 ushort ti = f.vertex(0)->materialIndex();
1540template<FaceMeshConcept MeshType>
1541void vertexMaterialIndicesAsTriangulatedFaceMaterialIndicesToBuffer(
1542 const MeshType& mesh,
1544 const TriPolyIndexBiMap& indexMap)
1546 requirePerVertexMaterialIndex(mesh);
1548 for (
const auto& f : mesh.
faces()) {
1549 ushort ti = f.vertex(0)->materialIndex();
1552 for (uint t = first; t < last; ++t) {
1595template<FaceMeshConcept MeshType>
1597 const MeshType& mesh,
1607 for (uint
i = 0;
const auto& f : mesh.faces()) {
1611 if (
storage == MatrixStorageType::COLUMN_MAJOR)
1613 if (
fi < f.vertexCount()) {
1614 const auto& w = f.wedgeTexCoord(
fi);
1616 buffer[index] = w.u();
1618 buffer[index] = w.v();
1646template<FaceMeshConcept MeshType>
1651 for (uint
i = 0;
const auto& f : mesh.faces()) {
1652 buffer[
i] = f.materialIndex();
1678template<FaceMeshConcept MeshType>
1680 const MeshType& mesh,
1686 for (
const auto& f : mesh.faces()) {
1689 for (uint t = first; t <
last; ++t) {
1690 buffer[t] = f.materialIndex();
1739template<FaceMeshConcept MeshType>
1741 const MeshType& mesh,
1742 const std::vector<std::pair<vcl::uint, vcl::uint>>&
vertWedgeMap,
1743 const std::list<std::list<std::pair<vcl::uint, vcl::uint>>>&
1748 using namespace detail;
1749 using TexCoordType =
typename MeshType::FaceType::WedgeTexCoordType;
1758 for (
const auto& v : mesh.vertices()) {
1765 w = mesh.face(
fInd).wedgeTexCoord(
wInd);
1776 assert(list.begin() != list.end());
1777 const auto&
p = list.front();
1778 uint
fInd =
p.first;
1779 uint
wInd =
p.second;
1781 const auto& w = mesh.face(
fInd).wedgeTexCoord(
wInd);
1831template<FaceMeshConcept MeshType>
1833 const MeshType& mesh,
1834 const std::vector<std::pair<vcl::uint, vcl::uint>>&
vertWedgeMap,
1835 const std::list<std::list<std::pair<vcl::uint, vcl::uint>>>&
1846 for (
const auto& v : mesh.vertices()) {
1856 assert(list.begin() != list.end());
1857 const auto&
p = list.front();
1858 uint
fInd =
p.first;
1895template<MeshConcept MeshType>
1897 const MeshType& mesh,
1903 using namespace detail;
1905 requireVertexContainerCompactness(mesh);
1906 requirePerVertexAdjacentVertices(mesh);
1912 for (uint
i = 0;
const auto& v : mesh.vertices()) {
1914 for (
const auto*
a : v.adjVertices()) {
1955template<u
int ELEM_ID, FaceMeshConcept MeshType>
1957 const MeshType& mesh,
1963 using namespace detail;
1975 for (
const auto*
a : v.adjFaces()) {
2016template<FaceMeshConcept MeshType>
2018 const MeshType& mesh,
2049template<FaceMeshConcept MeshType>
2051 const MeshType& mesh,
2089template<FaceMeshConcept MeshType>
2091 const MeshType& mesh,
2129template<u
int ELEM_ID, EdgeMeshConcept MeshType>
2131 const MeshType& mesh,
2137 using namespace detail;
2149 for (
const auto*
a : v.adjEdges()) {
2190template<EdgeMeshConcept MeshType>
2192 const MeshType& mesh,
2230template<EdgeMeshConcept MeshType>
2232 const MeshType& mesh,
2270template<EdgeMeshConcept MeshType>
2272 const MeshType& mesh,
Format
Color format enumeration.
Definition color.h:77
Representation
Color representation enumeration.
Definition color.h:64
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:41
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 triangleCount(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:1740
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:1832
MatrixStorageType
A simple type that enumerates the main storage types for matrices (row or column major).
Definition base.h:89
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:49
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 edgeAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=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:2090
void wireframeVertexIndicesToBuffer(const MeshType &mesh, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, bool getIndicesAsIfContainerCompact=true, uint numRows=UINT_NULL)
Export into a buffer the vertex indices for each edge that composes the wireframe of the Mesh (i....
Definition export_buffer.h:510
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:365
void elementAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=UINT_NULL)
Export into a buffer the adjacent edges indices for each ELEM_ID element of a Mesh....
Definition export_buffer.h:2130
void edgeAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=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:2271
void edgeVertexIndicesToBuffer(const MeshType &mesh, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, bool getIndicesAsIfContainerCompact=true, uint numRows=UINT_NULL)
Export into a buffer the vertex indices for each edge of a Mesh.
Definition export_buffer.h:455
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:1679
void faceAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=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:2231
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:225
void vertexPositionsToBuffer(const MeshType &mesh, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=UINT_NULL)
Export the vertex positions of a mesh to a buffer.
Definition export_buffer.h:74
void faceWedgeTexCoordsToBuffer(const MeshType &mesh, auto *buffer, uint largestFaceSize=3, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=UINT_NULL)
Export the selection status of the elements identified by ELEM_ID of a mesh to a buffer.
Definition export_buffer.h:1596
void elementAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=UINT_NULL)
Export into a buffer the adjacent faces indices for each ELEM_ID element of a Mesh....
Definition export_buffer.h:1956
void vertexAdjacentVerticesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentVerticesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=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:1896
void vertexQuadIndicesToBuffer(const MeshType &mesh, auto *buffer)
Export the indices of a quad per vertex to a buffer.
Definition export_buffer.h:110
void vertexAdjacentEdgesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentEdgesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=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:2191
void vertexAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestAdjacentFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=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:2017
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:163
void faceAdjacentFacesToBuffer(const MeshType &mesh, auto *buffer, uint largestFacesSize, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint numRows=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:2050
void faceMaterialIndicesToBuffer(const MeshType &mesh, auto *buffer)
Export into a buffer the per face material indices of a mesh.
Definition export_buffer.h:1647
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 faceVertexReferencesCount(const FaceMeshConcept auto &mesh)
Count the total number of vertex references in the mesh faces.
Definition topology.h:182
uint triangulatedFaceCount(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
uint largestFaceSize(const FaceMeshConcept auto &mesh)
Returns the largest face size in the mesh.
Definition topology.h:212
constexpr detail::FacesView faces
A view that allows to iterate overt the Face elements of an object.
Definition face.h:84