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>
91 uint nWireframeLines = 0;
96 std::vector<std::pair<uint, uint>> mVertWedgeMap;
100 std::list<uint> mVertsToDuplicate;
106 std::list<std::list<std::pair<uint, uint>>> mFacesToReassign;
125 uint vertMaterialId = 0;
126 uint faceMaterialId = 0;
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 updateMeshData(mesh,
btu);
163 updateTextureData(mesh,
btu);
174 void swap(MeshRenderData& other)
177 swap(mNumVerts, other.mNumVerts);
178 swap(mNumTris, other.mNumTris);
179 swap(mVertWedgeMap, other.mVertWedgeMap);
180 swap(mVertsToDuplicate, other.mVertsToDuplicate);
181 swap(mFacesToReassign, other.mFacesToReassign);
182 swap(mIndexMap, other.mIndexMap);
183 swap(mBuffersToFill, other.mBuffersToFill);
184 swap(mMaterialChunks, other.mMaterialChunks);
308 if (
mrs.isSurface(COLOR_FACE) ||
mrs.isSurface(COLOR_WEDGE_TEX))
309 return mMaterialChunks[
chunkNumber].faceMaterialId;
311 return mMaterialChunks[
chunkNumber].vertMaterialId;
377 mesh, mVertsToDuplicate, buffer,
fmt);
427 mesh, mVertWedgeMap, mFacesToReassign, buffer);
441 using MeshType = std::decay_t<
decltype(mesh)>;
442 using FaceType = MeshType::FaceType;
447 auto faceComp = [&](
const FaceType&
f1,
const FaceType&
f2) {
449 if (isPerVertexMaterialIndexAvailable(mesh)) {
450 uint
id1 =
f1.vertex(0)->materialIndex();
451 uint
id2 =
f2.vertex(0)->materialIndex();
459 uint
id1 =
f1.materialIndex();
460 uint
id2 =
f2.materialIndex();
469 return f1.index() <
f2.index();
475 sortFaceIndicesByFunction(mesh,
faceComp,
true);
478 mesh, buffer, mIndexMap, MatrixStorageType::ROW_MAJOR, mNumTris);
480 mesh, mVertsToDuplicate, mFacesToReassign, mIndexMap, buffer);
486 permuteTriangulatedFaceVertexIndices(
504 mesh, buffer, mIndexMap, MatrixStorageType::ROW_MAJOR);
542 mesh, buffer, mIndexMap);
929 const MeshRenderDerived& derived()
const
931 return static_cast<const MeshRenderDerived&
>(*this);
934 void updateAuxiliaryData(
935 const MeshConcept
auto& mesh,
936 MeshRenderInfo::BuffersBitSet btu)
938 using MeshType = MeshRenderDerived::MeshType;
939 using enum MRI::Buffers;
941 if (btu[toUnderlying(VERTICES)] || btu[toUnderlying(WEDGE_TEXCOORDS)] ||
942 btu[toUnderlying(TRIANGLES)]) {
943 mVertWedgeMap.clear();
944 mVertsToDuplicate.clear();
945 mFacesToReassign.clear();
947 if constexpr (HasPerFaceWedgeTexCoords<MeshType>) {
948 if (mesh.isPerFaceWedgeTexCoordsEnabled()) {
957 mNumVerts = mesh.vertexNumber() + mVertsToDuplicate.size();
960 if constexpr (HasFaces<MeshType>) {
961 if (btu[toUnderlying(TRIANGLES)])
963 if (btu[toUnderlying(WIREFRAME)])
967 if constexpr (HasEdges<MeshType>) {
968 if (btu[toUnderlying(EDGES)])
969 mNumEdges = mesh.edgeNumber();
973 void updateVerticesData(
974 const MeshConcept
auto& mesh,
975 MeshRenderInfo::BuffersBitSet btu)
977 using MeshType = MeshRenderDerived::MeshType;
978 using enum MRI::Buffers;
980 if (btu[toUnderlying(VERTICES)]) {
982 derived().setVertexPositionsBuffer(mesh);
985 if constexpr (HasPerVertexNormal<MeshType>) {
986 if (isPerVertexNormalAvailable(mesh)) {
987 if (btu[toUnderlying(VERT_NORMALS)]) {
989 derived().setVertexNormalsBuffer(mesh);
994 if constexpr (HasPerVertexColor<MeshType>) {
995 if (isPerVertexColorAvailable(mesh)) {
996 if (btu[toUnderlying(VERT_COLORS)]) {
998 derived().setVertexColorsBuffer(mesh);
1003 if constexpr (HasPerVertexTexCoord<MeshType>) {
1004 if (isPerVertexTexCoordAvailable(mesh)) {
1005 if (btu[toUnderlying(VERT_TEXCOORDS)]) {
1007 derived().setVertexTexCoordsBuffer(mesh);
1012 if constexpr (HasPerVertexTangent<MeshType>) {
1013 if (isPerVertexTangentAvailable(mesh)) {
1014 if (btu[toUnderlying(VERT_TANGENT)]) {
1016 derived().setVertexTangentsBuffer(mesh);
1022 void updateFacesData(
1023 const MeshConcept
auto& mesh,
1024 MeshRenderInfo::BuffersBitSet btu)
1026 using MeshType = MeshRenderDerived::MeshType;
1027 using enum MRI::Buffers;
1029 if constexpr (HasFaces<MeshType>) {
1030 if (btu[toUnderlying(TRIANGLES)]) {
1032 derived().setTriangleIndicesBuffer(mesh);
1035 if constexpr (HasPerFaceWedgeTexCoords<MeshType>) {
1037 if (btu[toUnderlying(WEDGE_TEXCOORDS)]) {
1039 derived().setWedgeTexCoordsBuffer(mesh);
1044 if constexpr (HasPerFaceNormal<MeshType>) {
1046 if (btu[toUnderlying(TRI_NORMALS)]) {
1048 derived().setTriangleNormalsBuffer(mesh);
1053 if constexpr (HasPerFaceColor<MeshType>) {
1055 if (btu[toUnderlying(TRI_COLORS)]) {
1057 derived().setTriangleColorsBuffer(mesh);
1064 if constexpr (HasPerVertexMaterialIndex<MeshType>) {
1065 if (isPerVertexMaterialIndexAvailable(mesh)) {
1066 if (btu[toUnderlying(VERT_TEXCOORDS)]) {
1068 derived().setVertexMaterialIndicesBuffer(mesh);
1073 if constexpr (HasPerFaceMaterialIndex<MeshType>) {
1075 if (btu[toUnderlying(WEDGE_TEXCOORDS)]) {
1077 derived().setFaceMaterialIndicesBuffer(mesh);
1082 if (btu[toUnderlying(WIREFRAME)]) {
1084 derived().setWireframeIndicesBuffer(mesh);
1089 void updateEdgesData(
1090 const MeshConcept
auto& mesh,
1091 MeshRenderInfo::BuffersBitSet btu)
1093 using MeshType = MeshRenderDerived::MeshType;
1094 using enum MRI::Buffers;
1096 if constexpr (HasEdges<MeshType>) {
1097 if (btu[toUnderlying(EDGES)]) {
1099 derived().setEdgeIndicesBuffer(mesh);
1102 if constexpr (HasPerEdgeNormal<MeshType>) {
1104 if (btu[toUnderlying(EDGE_NORMALS)]) {
1106 derived().setEdgeNormalsBuffer(mesh);
1111 if constexpr (HasPerEdgeColor<MeshType>) {
1113 if (btu[toUnderlying(EDGE_COLORS)]) {
1115 derived().setEdgeColorsBuffer(mesh);
1122 void updateMeshData(
1123 const MeshConcept
auto& mesh,
1124 MeshRenderInfo::BuffersBitSet btu)
1126 using enum MRI::Buffers;
1128 if (btu[toUnderlying(MESH_UNIFORMS)]) {
1130 derived().setMeshUniforms(mesh);
1134 void updateTextureData(
1135 const MeshConcept
auto& mesh,
1136 MeshRenderInfo::BuffersBitSet btu)
1138 using MeshType = MeshRenderDerived::MeshType;
1139 using enum MRI::Buffers;
1141 if constexpr (HasMaterials<MeshType>) {
1142 if (btu[toUnderlying(TEXTURES)]) {
1144 derived().setTextures(mesh);
1149 static void permuteTriangulatedFaceVertexIndices(
1151 TriPolyIndexBiMap& indexMap,
1152 const std::vector<uint>& newFaceIndices)
1157 std::vector<uint> oldFaceIndices(newFaceIndices.size());
1158 for (uint i = 0; i < newFaceIndices.size(); ++i) {
1159 oldFaceIndices[newFaceIndices[i]] =
static_cast<uint
>(i);
1166 TriPolyIndexBiMap indexMapCopy;
1167 indexMapCopy.reserve(
1170 uint copiedTriangles = 0;
1172 for (uint i = 0; i < oldFaceIndices.size(); ++i) {
1175 uint polyIndex = oldFaceIndices[i];
1180 buffer + firstTri * 3,
1181 buffer + (firstTri + nTris) * 3,
1182 bufferCopy.data() + copiedTriangles * 3);
1184 for (uint t = copiedTriangles; t < copiedTriangles + nTris; ++t) {
1185 indexMapCopy.insert(t, polyIndex);
1188 copiedTriangles += nTris;
1194 bufferCopy.begin() + copiedTriangles * 3,
1196 indexMap = std::move(indexMapCopy);
1199 void fillChuncks(
const FaceMeshConcept
auto& mesh)
1201 using MeshType = std::decay_t<
decltype(mesh)>;
1203 mMaterialChunks.clear();
1212 uint fIndex = mIndexMap.
polygon(i);
1214 if constexpr (HasPerVertexMaterialIndex<MeshType>) {
1215 if (isPerVertexMaterialIndexAvailable(mesh)) {
1216 uint mId = mesh.face(fIndex).vertex(0)->materialIndex();
1217 if (mId != currentVertMatID && n != 0) {
1219 mMaterialChunks.push_back(
1220 {first, n, currentVertMatID, currentFaceMatID});
1224 currentVertMatID = mId;
1228 if constexpr (HasPerFaceMaterialIndex<MeshType>) {
1230 uint mId = mesh.face(fIndex).materialIndex();
1231 if (mId != currentFaceMatID && n != 0) {
1233 mMaterialChunks.push_back(
1234 {first, n, currentVertMatID, currentFaceMatID});
1238 currentFaceMatID = mId;
1246 mMaterialChunks.push_back(
1247 {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
A class representing a box in N-dimensional space.
Definition box.h:46
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:304
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:554
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:748
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:860
uint numWireframeLines() const
Returns the number of wireframe lines that will be used to render the mesh.
Definition mesh_render_data.h:294
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:671
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:878
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:911
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:568
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:896
uint numVerts() const
Returns the number of vertices that will be used to render the mesh.
Definition mesh_render_data.h:213
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:614
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:325
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:537
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:582
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:516
uint numTris() const
Returns the number of triangles that will be used to render the mesh.
Definition mesh_render_data.h:241
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:596
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:806
uint numEdges() const
Returns the number of edges that will be used to render the mesh.
Definition mesh_render_data.h:265
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:689
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:501
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:389
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:341
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:404
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:784
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:653
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:635
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:707
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:439
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:842
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:355
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:424
void setMeshUniforms(const MeshConcept auto &)
Function that sets the mesh uniforms from the mesh.
Definition mesh_render_data.h:921
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:730
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:370
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:766
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:824
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
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 polygonNumber() const
Returns the number of polygons stored in the BiMap.
Definition tri_poly_index_bimap.h:195
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
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:1743
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:48
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 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 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 vertexQuadIndicesToBuffer(const MeshType &mesh, auto *buffer)
Export the indices of a quad per vertex to a buffer.
Definition export_buffer.h:111
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 countVerticesToDuplicateByWedgeTexCoords(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 countPerFaceVertexReferences(const FaceMeshConcept auto &mesh)
Count the number of references to vertices in the mesh faces.
Definition topology.h:182
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
Definition mesh_render_data.h:122