Visual Computing Library
Loading...
Searching...
No Matches
Append/Replace Mesh Data to Existing

Append missing data or Replace existing data to already allocated and partially filled buffers. More...

Collaboration diagram for Append/Replace Mesh Data to Existing:

Functions

template<MeshConcept MeshType>
void vcl::appendDuplicateVertexCoordsToBuffer (const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
 Append the coordinates of the duplicated vertices to the given buffer.
 
template<FaceMeshConcept MeshType>
void vcl::replaceFaceIndicesByVertexDuplicationToBuffer (const MeshType &mesh, const std::list< uint > &vertsToDuplicate, const std::list< std::list< std::pair< uint, uint > > > &facesToReassign, auto *buffer, uint largestFaceSize=3, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
 Replace the face vertex indices in the given buffer with the new indices of the duplicated vertices.
 
template<FaceMeshConcept MeshType>
void vcl::replaceTriangulatedFaceIndicesByVertexDuplicationToBuffer (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 duplicated vertices.
 
template<MeshConcept MeshType>
void vcl::appendDuplicateVertexSelectionToBuffer (const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer)
 Append the selection of the duplicated vertices to the given buffer.
 
template<MeshConcept MeshType>
void vcl::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.
 
template<MeshConcept MeshType>
void vcl::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.
 
template<MeshConcept MeshType>
void vcl::appendDuplicateVertexColorsToBuffer (const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, Color::Format colorFormat)
 Append the color (packed in a single 32 bit value using the provided format) of the duplicated vertices to the given buffer.
 
template<MeshConcept MeshType>
void vcl::appendDuplicateVertexQualityToBuffer (const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer)
 Append the quality of the duplicated vertices to the given buffer.
 
template<MeshConcept MeshType>
void vcl::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.
 
template<MeshConcept MeshType>
void vcl::appendDuplicateVertexTexCoordIndicesToBuffer (const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer)
 Append the texture coordinate indices of the duplicated vertices to the given buffer.
 
template<FaceMeshConcept MeshType>
void vcl::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.
 
template<FaceMeshConcept MeshType>
void vcl::wedgeTexCoordIndicesAsDuplicatedVertexTexCoordIndicesToBuffer (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 wedge texture coordinate indices to a buffer of the duplicated vertex texture coordinate indices.
 

Detailed Description

Append missing data or Replace existing data to already allocated and partially filled buffers.

Buffer Algorithms

These algorithms are useful when you already have allocated and filled buffers with mesh data, and you want to append missing data to them or replace existing data with new data.

An example of missing data are the duplicate vertices that are necessary to render a mesh with wedge texture coordinates. In this scenario, an example of workflow is:

0. Compute all the required data necessary to know the number of duplicated vertices and which vertices are duplicated;

  1. Allocate the buffers having the correct size for the vertices (including the duplicates);
  2. Fill the non-duplicated vertices using the algorithms defined in Export Mesh to Buffer Algorithms;
  3. Use the algorithms defined in this module to append the duplicated vertices and the texture coordinates.

You can access these algorithms by including #include <vclib/algorithms/mesh/import_export.h>

Function Documentation

◆ appendDuplicateVertexColorsToBuffer() [1/2]

template<MeshConcept MeshType>
void vcl::appendDuplicateVertexColorsToBuffer ( const MeshType &  mesh,
const std::list< uint > &  vertsToDuplicate,
auto buffer,
Color::Format  colorFormat 
)

Append the color (packed in a single 32 bit value using the provided format) of the duplicated vertices to the given buffer.

Given the list of vertices to duplicate, this function appends to the given buffer the color (packed in a single 32 bit value using the provided format) of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexColorToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<double> buffer(mesh.vertexNumber() + nV);
vertexColorToBuffer(mesh, buffer.data(), Color::Format::RGBA);
Color::Format::RGBA);
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Note
The buffer must be preallocated with the correct size (total number of vertices).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the colors.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[out]bufferThe buffer where to append the duplicated vertex color.

◆ appendDuplicateVertexColorsToBuffer() [2/2]

template<MeshConcept MeshType>
void vcl::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.

Given the list of vertices to duplicate, this function appends to the given buffer the colors of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexColorsToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<uint> buffer((mesh.vertexNumber() + nV) * 4);
vertexColorsToBuffer(mesh, buffer.data());
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:467
Note
The buffer must be preallocated with the correct size (total number of vertices times 4).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the colors.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[out]bufferThe buffer where to append the duplicated vertex colors.
[in]representationThe representation of the color in the buffer.
[in]storageThe storage type of the matrix (row or column major).

◆ appendDuplicateVertexCoordsToBuffer()

template<MeshConcept MeshType>
void vcl::appendDuplicateVertexCoordsToBuffer ( const MeshType &  mesh,
const std::list< uint > &  vertsToDuplicate,
auto buffer,
MatrixStorageType  storage = MatrixStorageType::ROW_MAJOR 
)

Append the coordinates of the duplicated vertices to the given buffer.

Given the list of vertices to duplicate, this function appends to the given buffer the coordinates of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexCoordsToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<double> buffer((mesh.vertexNumber() + nV) * 3);
vertexCoordsToBuffer(mesh, buffer.data());
void appendDuplicateVertexCoordsToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Append the coordinates of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:101
void vertexCoordsToBuffer(const MeshType &mesh, auto *buffer, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR, uint rowNumber=UINT_NULL)
Export the vertex coordinates of a mesh to a buffer.
Definition export_buffer.h:101
Note
The buffer must be preallocated with the correct size (total number of vertices times 3).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the coordinates.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[in/out]buffer: The buffer where to append the duplicated vertices.
[in]storageThe storage type of the matrix (row or column major).

◆ appendDuplicateVertexNormalsToBuffer()

template<MeshConcept MeshType>
void vcl::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.

Given the list of vertices to duplicate, this function appends to the given buffer the normals of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexNormalsToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<double> buffer((mesh.vertexNumber() + nV) * 3);
vertexNormalsToBuffer(mesh, buffer.data());
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:398
Note
The buffer must be preallocated with the correct size (total number of vertices times 3).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the normals.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[out]bufferThe buffer where to append the duplicated vertex normals.
[in]storageThe storage type of the matrix (row or column major).

◆ appendDuplicateVertexQualityToBuffer()

template<MeshConcept MeshType>
void vcl::appendDuplicateVertexQualityToBuffer ( const MeshType &  mesh,
const std::list< uint > &  vertsToDuplicate,
auto buffer 
)

Append the quality of the duplicated vertices to the given buffer.

Given the list of vertices to duplicate, this function appends to the given buffer the quality of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexQualityToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<double> buffer(mesh.vertexNumber() + nV);
vertexQualityToBuffer(mesh, buffer.data());
void appendDuplicateVertexQualityToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer)
Append the quality of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:603
Note
The buffer must be preallocated with the correct size (total number of vertices).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the quality.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[out]bufferThe buffer where to append the duplicated vertex quality.

◆ appendDuplicateVertexSelectionToBuffer()

template<MeshConcept MeshType>
void vcl::appendDuplicateVertexSelectionToBuffer ( const MeshType &  mesh,
const std::list< uint > &  vertsToDuplicate,
auto buffer 
)

Append the selection of the duplicated vertices to the given buffer.

Given the list of vertices to duplicate, this function appends to the given buffer the selection of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexSelectionToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<uint> buffer(mesh.vertexNumber() + nV);
vertexSelectionToBuffer(mesh, buffer.data());
Note
The buffer must be preallocated with the correct size (total number of vertices).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the selection.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[out]bufferThe buffer where to append the duplicated vertex selection.

◆ appendDuplicateVertexTexCoordIndicesToBuffer()

template<MeshConcept MeshType>
void vcl::appendDuplicateVertexTexCoordIndicesToBuffer ( const MeshType &  mesh,
const std::list< uint > &  vertsToDuplicate,
auto buffer 
)

Append the texture coordinate indices of the duplicated vertices to the given buffer.

Given the list of vertices to duplicate, this function appends to the given buffer the vertex texture coordinate indices of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexTexCoordIndicesToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<ushort> buffer(mesh.vertexNumber() + nV);
vertexTexCoordIndicesToBuffer(mesh, buffer.data());
buffer.data());
void appendDuplicateVertexTexCoordIndicesToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, auto *buffer)
Append the texture coordinate indices of the duplicated vertices to the given buffer.
Definition append_replace_to_buffer.h:732
Note
The buffer must be preallocated with the correct size (total number of vertices).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the vertex texture coordinate indices.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[out]bufferThe buffer where to append the duplicated vertex texture coordinate indices.

◆ appendDuplicateVertexTexCoordsToBuffer()

template<MeshConcept MeshType>
void vcl::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.

Given the list of vertices to duplicate, this function appends to the given buffer the vertex texture coordinates of the vertices listed in the input list.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with the vertexTexCoordsToBuffer function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<double> buffer((mesh.vertexNumber() + nV) * 2);
vertexTexCoordsToBuffer(mesh, buffer.data());
buffer.data());
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:662
Note
The buffer must be preallocated with the correct size (total number of vertices times 2).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the vertex texture coordinates.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be appended to the buffer.
[out]bufferThe buffer where to append the duplicated vertex texture coordinates.
[in]storageThe storage type of the matrix (row or column major).

◆ replaceFaceIndicesByVertexDuplicationToBuffer()

template<FaceMeshConcept MeshType>
void vcl::replaceFaceIndicesByVertexDuplicationToBuffer ( const MeshType &  mesh,
const std::list< uint > &  vertsToDuplicate,
const std::list< std::list< std::pair< uint, uint > > > &  facesToReassign,
auto buffer,
uint  largestFaceSize = 3,
MatrixStorageType  storage = MatrixStorageType::ROW_MAJOR 
)

Replace the face vertex indices in the given buffer with the new indices of the duplicated vertices.

Given a buffer containing the vertex indices of the faces of a mesh (stored in row-major order, and with a fixed face size), this function updates the indices of the vertices that have been duplicated, according to the data stored in the input lists.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with any of the functions defined in Export Mesh to Buffer Algorithms that export face indices. e.g.:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
uint lfs = vcl::largestFaceSize(mesh);
std::vector<uint> buffer(mesh.faceNumber() * lfs);
faceIndicesToBuffer(mesh, buffer.data(), lfs);
faceToReassign, buffer.data(), lfs);
void replaceFaceIndicesByVertexDuplicationToBuffer(const MeshType &mesh, const std::list< uint > &vertsToDuplicate, const std::list< std::list< std::pair< uint, uint > > > &facesToReassign, auto *buffer, uint largestFaceSize=3, MatrixStorageType storage=MatrixStorageType::ROW_MAJOR)
Replace the face vertex indices in the given buffer with the new indices of the duplicated vertices.
Definition append_replace_to_buffer.h:176
void faceIndicesToBuffer(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:211
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe input mesh.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be replaced in the buffer.
[in]facesToReassignThe list of lists of pairs face/vertex index in the face that must be reassigned to the duplicated vertices. Each list of pairs is the list of faces that must be reassigned to the corresponding duplicated vertex.
[out]bufferThe buffer where to replace the vertex indices.
[in]largestFaceSizeThe size of the largest face in the mesh (that corresponds to the number of columns in the buffer)
[in]storageThe storage type of the matrix (row or column major).

◆ replaceTriangulatedFaceIndicesByVertexDuplicationToBuffer()

template<FaceMeshConcept MeshType>
void vcl::replaceTriangulatedFaceIndicesByVertexDuplicationToBuffer ( 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 duplicated vertices.

Given a buffer containing the vertex indices of the triangles of a mesh that has been triangulated (stored in row-major order), this function updates the indices of the vertices that have been duplicated, according to the data stored in the input lists.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function and along with triangulatedFaceIndicesToBuffer function that export triangulated face indices. e.g.:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
uint numTris = vcl::countTriangulatedTriangles(myMesh);
std::vector<uint> buffer(mesh.faceNumber() * numTris);
triangulatedFaceIndicesToBuffer(mesh, buffer.data(), indexMap);
vertsToDuplicate, faceToReassign, indexMap, buffer.data());
The TriPolyIndexBiMap class allows to store a bidirectional mapping between a Polygon Mesh and a Tria...
Definition tri_poly_index_bimap.h:50
void replaceTriangulatedFaceIndicesByVertexDuplicationToBuffer(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:253
void triangulatedFaceIndicesToBuffer(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:357
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe input mesh.
[in]vertsToDuplicateThe list of vertices to duplicate: each element is the index of a vertex in the mesh, that must be replaced in the buffer.
[in]facesToReassignThe list of lists of pairs face/vertex index in the face that must be reassigned to the duplicated vertices. Each list of pairs is the list of faces that must be reassigned to the corresponding duplicated vertex.
[in]indexMapThe map from triangle index to face index.
[out]bufferThe buffer where to replace the vertex indices.
[in]storageThe storage type of the matrix (row or column major).

◆ wedgeTexCoordIndicesAsDuplicatedVertexTexCoordIndicesToBuffer()

template<FaceMeshConcept MeshType>
void vcl::wedgeTexCoordIndicesAsDuplicatedVertexTexCoordIndicesToBuffer ( 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 wedge texture coordinate indices to a buffer of the duplicated vertex texture coordinate indices.

Given the list of vertices to duplicate, this function exports to the given buffer the wedge texture indices as if they were vertex texture indices, and appending only the texture indices of the vertices to duplicate.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<ushort> buffer(mesh.vertexNumber() + nV);
vertWedgeMap, facesToReassign, buffer.data());
void wedgeTexCoordIndicesAsDuplicatedVertexTexCoordIndicesToBuffer(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 wedge texture coordinate indices to a buffer of the duplicated vertex texture coordinate indic...
Definition export_buffer.h:1813
Note
The buffer must be preallocated with the correct size (total number of vertices).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the wedge texture coordinate indices.
[in]vertWedgeMapThe map from non-duplicated vertex index to face index and wedge index in the face.
[in]facesToReassignThe list of lists of pairs face/vertex index in the face that must be reassigned to the duplicated vertices. Each list of pairs is the list of faces that must be reassigned to the corresponding duplicated vertex.
[out]bufferThe buffer where to export the vertex wedge texture coordinate indices.

◆ wedgeTexCoordsAsDuplicatedVertexTexCoordsToBuffer()

template<FaceMeshConcept MeshType>
void vcl::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.

Given the list of vertices to duplicate, this function exports to the given buffer the wedge texture coordinates as if they were vertex texture coordinates, and appending only the texture coordinates of the vertices to duplicate.

Typical usage of this function is after the countVerticesToDuplicateByWedgeTexCoords function:

std::vector<std::pair<uint, uint>> vertWedgeMap;
std::list<uint> vertsToDuplicate;
std::list<std::list<std::pair<uint, uint>>> facesToReassign;
uint nV = countVerticesToDuplicateByWedgeTexCoords(mesh, vertWedgeMap,
std::vector<double> buffer((mesh.vertexNumber() + nV) * 2);
facesToReassign, buffer.data());
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:1710
Note
The buffer must be preallocated with the correct size (total number of vertices times 2).
Template Parameters
MeshTypeThe type of the mesh.
Parameters
[in]meshThe mesh from which take the wedge texture coordinates.
[in]vertWedgeMapThe map from non-duplicated vertex index to face index and wedge index in the face.
[in]facesToReassignThe list of lists of pairs face/vertex index in the face that must be reassigned to the duplicated vertices. Each list of pairs is the list of faces that must be reassigned to the corresponding duplicated vertex.
[out]bufferThe buffer where to export the vertex wedge texture coordinates.
[in]storageThe storage type of the matrix (row or column major).