23#ifndef VCL_RENDER_DRAWABLE_MESH_MESH_RENDER_DATA_H
24#define VCL_RENDER_DRAWABLE_MESH_MESH_RENDER_DATA_H
26#include <vclib/render/drawable/mesh/mesh_render_info.h>
27#include <vclib/render/drawable/mesh/mesh_render_settings.h>
29#include <vclib/algorithms/mesh.h>
30#include <vclib/mesh.h>
31#include <vclib/space/complex.h>
79template<
typename MeshRenderDerived>
87 uint vertMaterialId = 0;
88 uint faceMaterialId = 0;
100 uint nWireframeLines = 0;
105 std::vector<std::pair<uint, uint>> mVertWedgeMap;
109 std::list<uint> mVertsToDuplicate;
115 std::list<std::list<std::pair<uint, uint>>> mFacesToReassign;
129 std::vector<TriangleMaterialChunk> mMaterialChunks;
143 using enum MRI::Buffers;
148 updateAuxiliaryData(mesh,
btu);
151 updateVerticesData(mesh,
btu);
154 updateFacesData(mesh,
btu);
157 updateEdgesData(mesh,
btu);
160 updateMeshAdditionalData(mesh,
btu);
163 updateTextureData(mesh,
btu);
200 if (
mrs.isSurface(COLOR_FACE) ||
mrs.isSurface(COLOR_WEDGE_TEX))
201 return mMaterialChunks[
chunkNumber].faceMaterialId;
203 return mMaterialChunks[
chunkNumber].vertMaterialId;
214 void swap(MeshRenderData& other)
217 swap(mNumVerts, other.mNumVerts);
218 swap(mNumTris, other.mNumTris);
219 swap(mVertWedgeMap, other.mVertWedgeMap);
220 swap(mVertsToDuplicate, other.mVertsToDuplicate);
221 swap(mFacesToReassign, other.mFacesToReassign);
222 swap(mIndexMap, other.mIndexMap);
223 swap(mBuffersToFill, other.mBuffersToFill);
224 swap(mMaterialChunks, other.mMaterialChunks);
399 mesh, mVertsToDuplicate, buffer,
fmt);
449 mesh, mVertWedgeMap, mFacesToReassign, buffer);
463 using MeshType = std::decay_t<
decltype(mesh)>;
464 using FaceType = MeshType::FaceType;
469 auto faceComp = [&](
const FaceType&
f1,
const FaceType&
f2) {
471 if (isPerVertexMaterialIndexAvailable(mesh)) {
472 uint
id1 =
f1.vertex(0)->materialIndex();
473 uint
id2 =
f2.vertex(0)->materialIndex();
481 uint
id1 =
f1.materialIndex();
482 uint
id2 =
f2.materialIndex();
491 return f1.index() <
f2.index();
497 sortFaceIndicesByFunction(mesh,
faceComp,
true);
500 mesh, buffer, mIndexMap, MatrixStorageType::ROW_MAJOR, mNumTris);
502 mesh, mVertsToDuplicate, mFacesToReassign, mIndexMap, buffer);
508 permuteTriangulatedFaceVertexIndices(
526 mesh, buffer, mIndexMap, MatrixStorageType::ROW_MAJOR);
564 mesh, buffer, mIndexMap);
951 const MeshRenderDerived& derived()
const
953 return static_cast<const MeshRenderDerived&
>(*this);
956 void updateAuxiliaryData(
957 const MeshConcept
auto& mesh,
958 MeshRenderInfo::BuffersBitSet btu)
960 using MeshType = MeshRenderDerived::MeshType;
961 using enum MRI::Buffers;
963 if (btu[toUnderlying(VERTICES)] || btu[toUnderlying(WEDGE_TEXCOORDS)] ||
964 btu[toUnderlying(TRIANGLES)]) {
965 mVertWedgeMap.clear();
966 mVertsToDuplicate.clear();
967 mFacesToReassign.clear();
969 if constexpr (HasPerFaceWedgeTexCoords<MeshType>) {
970 if (mesh.isPerFaceWedgeTexCoordsEnabled()) {
979 mNumVerts = mesh.vertexCount() + mVertsToDuplicate.size();
982 if constexpr (HasFaces<MeshType>) {
983 if (btu[toUnderlying(TRIANGLES)])
985 if (btu[toUnderlying(WIREFRAME)])
989 if constexpr (HasEdges<MeshType>) {
990 if (btu[toUnderlying(EDGES)])
991 mNumEdges = mesh.edgeCount();
995 void updateVerticesData(
996 const MeshConcept
auto& mesh,
997 MeshRenderInfo::BuffersBitSet btu)
999 using MeshType = MeshRenderDerived::MeshType;
1000 using enum MRI::Buffers;
1002 if (btu[toUnderlying(VERTICES)]) {
1004 derived().setVertexPositionsBuffer(mesh);
1007 if constexpr (HasPerVertexNormal<MeshType>) {
1008 if (isPerVertexNormalAvailable(mesh)) {
1009 if (btu[toUnderlying(VERT_NORMALS)]) {
1011 derived().setVertexNormalsBuffer(mesh);
1016 if constexpr (HasPerVertexColor<MeshType>) {
1017 if (isPerVertexColorAvailable(mesh)) {
1018 if (btu[toUnderlying(VERT_COLORS)]) {
1020 derived().setVertexColorsBuffer(mesh);
1025 if constexpr (HasPerVertexTexCoord<MeshType>) {
1026 if (isPerVertexTexCoordAvailable(mesh)) {
1027 if (btu[toUnderlying(VERT_TEXCOORDS)]) {
1029 derived().setVertexTexCoordsBuffer(mesh);
1034 if constexpr (HasPerVertexTangent<MeshType>) {
1035 if (isPerVertexTangentAvailable(mesh)) {
1036 if (btu[toUnderlying(VERT_TANGENT)]) {
1038 derived().setVertexTangentsBuffer(mesh);
1044 void updateFacesData(
1045 const MeshConcept
auto& mesh,
1046 MeshRenderInfo::BuffersBitSet btu)
1048 using MeshType = MeshRenderDerived::MeshType;
1049 using enum MRI::Buffers;
1051 if constexpr (HasFaces<MeshType>) {
1052 if (btu[toUnderlying(TRIANGLES)]) {
1054 derived().setTriangleIndicesBuffer(mesh);
1057 if constexpr (HasPerFaceWedgeTexCoords<MeshType>) {
1059 if (btu[toUnderlying(WEDGE_TEXCOORDS)]) {
1061 derived().setWedgeTexCoordsBuffer(mesh);
1066 if constexpr (HasPerFaceNormal<MeshType>) {
1068 if (btu[toUnderlying(TRI_NORMALS)]) {
1070 derived().setTriangleNormalsBuffer(mesh);
1075 if constexpr (HasPerFaceColor<MeshType>) {
1077 if (btu[toUnderlying(TRI_COLORS)]) {
1079 derived().setTriangleColorsBuffer(mesh);
1086 if constexpr (HasPerVertexMaterialIndex<MeshType>) {
1087 if (isPerVertexMaterialIndexAvailable(mesh)) {
1088 if (btu[toUnderlying(VERT_TEXCOORDS)]) {
1090 derived().setVertexMaterialIndicesBuffer(mesh);
1095 if constexpr (HasPerFaceMaterialIndex<MeshType>) {
1097 if (btu[toUnderlying(WEDGE_TEXCOORDS)]) {
1099 derived().setFaceMaterialIndicesBuffer(mesh);
1104 if (btu[toUnderlying(WIREFRAME)]) {
1106 derived().setWireframeIndicesBuffer(mesh);
1111 void updateEdgesData(
1112 const MeshConcept
auto& mesh,
1113 MeshRenderInfo::BuffersBitSet btu)
1115 using MeshType = MeshRenderDerived::MeshType;
1116 using enum MRI::Buffers;
1118 if constexpr (HasEdges<MeshType>) {
1119 if (btu[toUnderlying(EDGES)]) {
1121 derived().setEdgeIndicesBuffer(mesh);
1124 if constexpr (HasPerEdgeNormal<MeshType>) {
1126 if (btu[toUnderlying(EDGE_NORMALS)]) {
1128 derived().setEdgeNormalsBuffer(mesh);
1133 if constexpr (HasPerEdgeColor<MeshType>) {
1135 if (btu[toUnderlying(EDGE_COLORS)]) {
1137 derived().setEdgeColorsBuffer(mesh);
1144 void updateMeshAdditionalData(
1145 const MeshConcept
auto& mesh,
1146 MeshRenderInfo::BuffersBitSet btu)
1148 using enum MRI::Buffers;
1150 if (btu[toUnderlying(MESH_ADDITIONAL_DATA)]) {
1152 derived().setMeshAdditionalData(mesh);
1156 void updateTextureData(
1157 const MeshConcept
auto& mesh,
1158 MeshRenderInfo::BuffersBitSet btu)
1160 using MeshType = MeshRenderDerived::MeshType;
1161 using enum MRI::Buffers;
1163 if constexpr (HasMaterials<MeshType>) {
1164 if (btu[toUnderlying(TEXTURES)]) {
1166 derived().setTextures(mesh);
1171 static void permuteTriangulatedFaceVertexIndices(
1173 TriPolyIndexBiMap& indexMap,
1174 const std::vector<uint>& newFaceIndices)
1179 std::vector<uint> oldFaceIndices(newFaceIndices.size());
1180 for (uint i = 0; i < newFaceIndices.size(); ++i) {
1181 oldFaceIndices[newFaceIndices[i]] =
static_cast<uint
>(i);
1188 TriPolyIndexBiMap indexMapCopy;
1191 uint copiedTriangles = 0;
1193 for (uint i = 0; i < oldFaceIndices.size(); ++i) {
1196 uint polyIndex = oldFaceIndices[i];
1201 buffer + firstTri * 3,
1202 buffer + (firstTri + nTris) * 3,
1203 bufferCopy.data() + copiedTriangles * 3);
1205 for (uint t = copiedTriangles; t < copiedTriangles + nTris; ++t) {
1206 indexMapCopy.insert(t, polyIndex);
1209 copiedTriangles += nTris;
1215 bufferCopy.begin() + copiedTriangles * 3,
1217 indexMap = std::move(indexMapCopy);
1220 void fillChuncks(
const FaceMeshConcept
auto& mesh)
1222 using MeshType = std::decay_t<
decltype(mesh)>;
1224 mMaterialChunks.clear();
1233 uint fIndex = mIndexMap.
polygon(i);
1235 if constexpr (HasPerVertexMaterialIndex<MeshType>) {
1236 if (isPerVertexMaterialIndexAvailable(mesh)) {
1237 uint mId = mesh.face(fIndex).vertex(0)->materialIndex();
1238 if (mId != currentVertMatID && n != 0) {
1240 mMaterialChunks.push_back(
1241 {first, n, currentVertMatID, currentFaceMatID});
1245 currentVertMatID = mId;
1249 if constexpr (HasPerFaceMaterialIndex<MeshType>) {
1251 uint mId = mesh.face(fIndex).materialIndex();
1252 if (mId != currentFaceMatID && n != 0) {
1254 mMaterialChunks.push_back(
1255 {first, n, currentVertMatID, currentFaceMatID});
1259 currentFaceMatID = mId;
1267 mMaterialChunks.push_back(
1268 {first, n, currentVertMatID, currentFaceMatID});
The BitSet class allows to treat an integral type as an array of booleans of a guaranteed size.
Definition bit_set.h:52
Format
Color format enumeration.
Definition color.h:77
The MeshRenderData class provides a common interface to automatically update the buffers used to rend...
Definition mesh_render_data.h:81
uint materialIndex(const MeshRenderSettings &mrs, uint chunkNumber) const
Returns the material index for the given triangle chunk, according to the current render settings.
Definition mesh_render_data.h:196
void fillFaceMaterialIndices(const FaceMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the wedge texture indices of the mesh...
Definition mesh_render_data.h:576
void setTriangleIndicesBuffer(const FaceMeshConcept auto &)
Function that sets the content of triangle indices buffer and sends the data to the GPU.
Definition mesh_render_data.h:770
uint triangleChunksNumber() const
Returns the number of triangle chunks.
Definition mesh_render_data.h:174
void setEdgeIndicesBuffer(const EdgeMeshConcept auto &)
Function that sets the content of edge indices buffer and sends the data to the GPU.
Definition mesh_render_data.h:882
uint numWireframeLines() const
Returns the number of wireframe lines that will be used to render the mesh.
Definition mesh_render_data.h:334
void setVertexColorsBuffer(const MeshConcept auto &)
Function that sets the content of vertex colors buffer and sends the data to the GPU.
Definition mesh_render_data.h:693
void setEdgeNormalsBuffer(const EdgeMeshConcept auto &)
Function that sets the content of edge normals buffer and sends the data to the GPU.
Definition mesh_render_data.h:900
void setTextures(const MeshConcept auto &)
Function that sets the textures from the mesh and sends the data to the GPU.
Definition mesh_render_data.h:933
void fillEdgeIndices(const EdgeMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the edge indices of the mesh.
Definition mesh_render_data.h:590
void setEdgeColorsBuffer(const EdgeMeshConcept auto &)
Function that sets the content of edge colors buffer and sends the data to the GPU.
Definition mesh_render_data.h:918
uint numVerts() const
Returns the number of vertices that will be used to render the mesh.
Definition mesh_render_data.h:253
void fillWireframeIndices(const FaceMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the wireframe indices of the mesh.
Definition mesh_render_data.h:636
void fillVertexPositions(const MeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the vertex positions of the mesh.
Definition mesh_render_data.h:347
void fillVertexMaterialIndices(const FaceMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the vertex material indices of the me...
Definition mesh_render_data.h:559
void fillEdgeNormals(const EdgeMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the edge normals of the mesh.
Definition mesh_render_data.h:604
void fillTriangleColors(const FaceMeshConcept auto &mesh, auto *buffer, Color::Format fmt)
Given the mesh and a pointer to a buffer, fills the buffer with the triangle colors of the mesh (each...
Definition mesh_render_data.h:538
uint numTris() const
Returns the number of triangles that will be used to render the mesh.
Definition mesh_render_data.h:281
void fillEdgeColors(const EdgeMeshConcept auto &mesh, auto *buffer, Color::Format fmt)
Given the mesh and a pointer to a buffer, fills the buffer with the edge colors of the mesh (each col...
Definition mesh_render_data.h:618
void setVertexMaterialIndicesBuffer(const FaceMeshConcept auto &)
Function that sets the content of vertex material indices buffer and sends the data to the GPU.
Definition mesh_render_data.h:828
uint numEdges() const
Returns the number of edges that will be used to render the mesh.
Definition mesh_render_data.h:305
void setVertexTexCoordsBuffer(const MeshConcept auto &)
Function that sets the content of vertex texture coordinates buffer and sends the data to the GPU.
Definition mesh_render_data.h:711
void fillTriangleNormals(const FaceMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the triangle normals of the mesh.
Definition mesh_render_data.h:523
void update(const MeshConcept auto &mesh, MRI::BuffersBitSet buffersToUpdate=MRI::BUFFERS_ALL)
Update the buffers used to render the mesh.
Definition mesh_render_data.h:139
void fillVertexTexCoords(const MeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the vertex texcoords of the mesh.
Definition mesh_render_data.h:411
void fillVertexQuadIndices(const MeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the vertex quad indices of the mesh (...
Definition mesh_render_data.h:363
void fillVertexTangents(const MeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the vertex tangent of the mesh.
Definition mesh_render_data.h:426
void setTriangleColorsBuffer(const FaceMeshConcept auto &)
Function that sets the content of triangle colors buffer and sends the data to the GPU.
Definition mesh_render_data.h:806
void setVertexNormalsBuffer(const MeshConcept auto &)
Function that sets the content of vertex normals buffer and sends the data to the GPU.
Definition mesh_render_data.h:675
void setVertexPositionsBuffer(const MeshConcept auto &)
Function that sets the content of vertex positions buffer and sends the data to the GPU.
Definition mesh_render_data.h:657
void setVertexTangentsBuffer(const MeshConcept auto &)
Function that sets the content of vertex tangent buffer and sends the data to the GPU.
Definition mesh_render_data.h:729
TriangleMaterialChunk triangleChunk(uint chunkIndex) const
Returns the triangle material chunk at the given index.
Definition mesh_render_data.h:183
void fillTriangleIndices(const FaceMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the triangle indices of the mesh.
Definition mesh_render_data.h:461
void setWireframeIndicesBuffer(const FaceMeshConcept auto &)
Function that sets the content of wireframe indices buffer and sends the data to the GPU.
Definition mesh_render_data.h:864
void fillVertexNormals(const MeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the vertex normals of the mesh.
Definition mesh_render_data.h:377
void fillWedgeTexCoords(const FaceMeshConcept auto &mesh, auto *buffer)
Given the mesh and a pointer to a buffer, fills the buffer with the wedge texcoors of the mesh.
Definition mesh_render_data.h:446
void setMeshAdditionalData(const MeshConcept auto &)
Function that sets the mesh additional data from the mesh.
Definition mesh_render_data.h:943
void setWedgeTexCoordsBuffer(const MeshConcept auto &)
Function that sets the content of wedge texture coordinates buffer and sends the data to the GPU.
Definition mesh_render_data.h:752
void fillVertexColors(const MeshConcept auto &mesh, auto *buffer, Color::Format fmt)
Given the mesh and a pointer to a buffer, fills the buffer with the vertex colors of the mesh (each c...
Definition mesh_render_data.h:392
void setTriangleNormalsBuffer(const FaceMeshConcept auto &)
Function that sets the content of triangle normals buffer and sends the data to the GPU.
Definition mesh_render_data.h:788
void setFaceMaterialIndicesBuffer(const FaceMeshConcept auto &)
Function that sets the content of face material indices buffer and sends the data to the GPU.
Definition mesh_render_data.h:846
The MeshRenderInfo class is a collection of rendering settings for a Mesh.
Definition mesh_render_info.h:61
Surface
List of possible settings for the surface primitive.
Definition mesh_render_info.h:148
The MeshRenderSettings class allows an easy management of render settings of a Mesh....
Definition mesh_render_settings.h:70
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
uint polygon(uint triangleIndex) const
Returns the index of the polygon mapped to the triangle having the index given as input argument.
Definition tri_poly_index_bimap.h:68
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
uint polygonCount() const
Returns the number of polygons stored in the BiMap.
Definition tri_poly_index_bimap.h:195
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
Concept that checks if a Mesh has the per Face MaterialIndex component.
Definition face_requirements.h:188
Concept that checks if a Mesh has the per Vertex MaterialIndex component.
Definition vertex_requirements.h:141
A concept that checks whether a class is (inherits from) a Mesh class.
Definition mesh.h:2169
void replaceTriangulatedFaceVertexIndicesByVertexDuplicationToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, const std::list< std::list< std::pair< uint, uint > > > &facesToReassign, const TriPolyIndexBiMap &indexMap, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Replace the triangulated face vertex indices in the given buffer with the new indices of the duplicat...
Definition append_replace_to_buffer.h:250
void appendDuplicateVertexPositionsToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Append the positions of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:102
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 appendDuplicateVertexColorsToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, Color::Representation representation=Color::Representation::INT_0_255, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Append the colors of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:456
void appendDuplicateVertexTangentsToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, bool storeHandednessAsW=true, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Append the tangent of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:719
void appendDuplicateVertexNormalsToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Append the normals of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:391
void appendDuplicateVertexTexCoordsToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Append the texture coordinates of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:646
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
bool isPerEdgeColorAvailable(const MeshType &m)
Returns true if the Color component is available (enabled) in the Edge element of the input mesh m.
Definition edge_requirements.h:370
bool isPerEdgeNormalAvailable(const MeshType &m)
Returns true if the Normal component is available (enabled) in the Edge element of the input mesh m.
Definition edge_requirements.h:486
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 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 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 vertexQuadIndicesToBuffer(const MeshType &mesh, auto *buffer)
Export the indices of a quad per vertex to a buffer.
Definition export_buffer.h:110
bool isPerFaceWedgeTexCoordsAvailable(const MeshType &m)
Returns true if the WedgeTexCoords component is available (enabled) in the Face element of the input ...
Definition face_requirements.h:910
bool isPerFaceNormalAvailable(const MeshType &m)
Returns true if the Normal component is available (enabled) in the Face element of the input mesh m.
Definition face_requirements.h:669
bool isPerFaceMaterialIndexAvailable(const MeshType &m)
Returns true if the MaterialIndex component is available (enabled) in the Face element of the input m...
Definition face_requirements.h:608
bool isPerFaceColorAvailable(const MeshType &m)
Returns true if the Color component is available (enabled) in the Face element of the input mesh m.
Definition face_requirements.h:492
uint verticesToDuplicateByWedgeTexCoordsCount(const MeshType &mesh, std::vector< std::pair< uint, uint > > &vertWedgeMap=detail::dummyVectorOfPairs, std::list< uint > &vertsToDuplicate=detail::dummyUintList, std::list< std::list< std::pair< uint, uint > > > &facesToReassign=detail::dummyListOfLists)
This function counts the number of vertices that must be duplicated in a mesh to have a unique texcoo...
Definition topology.h:471
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
Definition mesh_render_data.h:84