23#ifndef VCL_ALGORITHMS_MESH_IMPORT_EXPORT_EXPORT_MATRIX_H
24#define VCL_ALGORITHMS_MESH_IMPORT_EXPORT_EXPORT_MATRIX_H
26#include "export_buffer.h"
28#include <vclib/algorithms/mesh/stat/topology.h>
29#include <vclib/concepts/space/matrix.h>
30#include <vclib/mesh/requirements.h>
31#include <vclib/space/core/matrix.h>
74template<MatrixConcept Matrix, MeshConcept MeshType>
75Matrix vertexCoordsMatrix(
const MeshType& mesh)
77 Matrix vM(mesh.vertexNumber(), 3);
118template<
typename Vect, FaceMeshConcept MeshType>
119Vect faceSizesVector(
const MeshType& mesh)
121 requireVertexContainerCompactness(mesh);
123 Vect fM(mesh.faceNumber());
161template<
typename Vect, FaceMeshConcept MeshType>
164 requireVertexContainerCompactness(mesh);
166 uint
nIndices = countPerFaceVertexReferences(mesh);
208template<MatrixConcept Matrix, FaceMeshConcept MeshType>
209Matrix faceIndicesMatrix(
const MeshType& mesh)
211 requireVertexContainerCompactness(mesh);
213 uint fMaxSize = largestFaceSize(mesh);
215 Matrix fM(mesh.faceNumber(), fMaxSize);
250template<MatrixConcept Matrix, FaceMeshConcept MeshType>
251Matrix triangulatedFaceIndicesMatrix(
252 const MeshType& mesh,
253 TriPolyIndexBiMap& indexMap = detail::indexMap)
255 requireVertexContainerCompactness(mesh);
257 uint tNumber = vcl::countTriangulatedTriangles(mesh);
259 Matrix tM(tNumber, 3);
298template<MatrixConcept Matrix, EdgeMeshConcept MeshType>
301 requireVertexContainerCompactness(mesh);
341template<u
int ELEM_ID,
typename Vect, MeshConcept MeshType>
342Vect elementSelectionVector(
const MeshType& mesh)
344 Vect sV(mesh.template number<ELEM_ID>());
377template<
typename Vect, MeshConcept MeshType>
378Vect vertexSelectionVector(
const MeshType& mesh)
380 return elementSelectionVector<ElemId::VERTEX, Vect>(mesh);
411template<
typename Vect, FaceMeshConcept MeshType>
412Vect faceSelectionVector(
const MeshType& mesh)
414 return elementSelectionVector<ElemId::FACE, Vect>(mesh);
446template<u
int ELEM_ID, MatrixConcept Matrix, MeshConcept MeshType>
484template<MatrixConcept Matrix, MeshConcept MeshType>
516template<MatrixConcept Matrix, FaceMeshConcept MeshType>
551template<u
int ELEM_ID, MatrixConcept Matrix, MeshConcept MeshType>
597template<u
int ELEM_ID,
typename Vect, MeshConcept MeshType>
635template<MatrixConcept Matrix, MeshConcept MeshType>
671template<
typename Vect, MeshConcept MeshType>
703template<MatrixConcept Matrix, FaceMeshConcept MeshType>
739template<
typename Vect, MeshConcept MeshType>
775template<u
int ELEM_ID,
typename Vect, MeshConcept MeshType>
814template<
typename Vect, MeshConcept MeshType>
847template<
typename Vect, FaceMeshConcept MeshType>
Format
Color format enumeration.
Definition color.h:77
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
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
void edgeIndicesToBuffer(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:451
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
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
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:149
Matrix vertexColorsMatrix(const MeshType &mesh)
Get a #V*4 Matrix of integers containing the colors of the vertices of a Mesh. The function is templa...
Definition export_matrix.h:636
Vect vertexQualityVector(const MeshType &mesh)
Get a #V Vector of scalars containing the quality of the vertices of a Mesh. The function is template...
Definition export_matrix.h:815
Matrix elementNormalsMatrix(const MeshType &mesh)
Get a #E Vector of booleans (or integers) containing the selection status of the elements identified ...
Definition export_matrix.h:447
Vect vertexColorsVector(const MeshType &mesh, Color::Format colorFormat)
Get a #V Vector of integers containing the colors of the vertices of a Mesh. The function is template...
Definition export_matrix.h:672
Vect faceIndicesVector(const MeshType &mesh)
Get a #V*3 Matrix of scalars containing the coordinates of the vertices of a Mesh....
Definition export_matrix.h:162
Matrix faceColorsMatrix(const MeshType &mesh)
Get a #F*4 Matrix of integers containing the colors of the faces of a Mesh. The function is templated...
Definition export_matrix.h:704
Matrix faceNormalsMatrix(const MeshType &mesh)
Get a #F*3 Matrix of scalars containing the normals of the faces of a Mesh. The function is templated...
Definition export_matrix.h:517
Vect faceQualityVector(const MeshType &mesh)
Get a #F Vector of scalars containing the quality of the faces of a Mesh. The function is templated o...
Definition export_matrix.h:848
Vect elementQualityVector(const MeshType &mesh)
Get a #E Vector of scalars containing the quality of the elements identified by ELEM_ID of a Mesh....
Definition export_matrix.h:776
Vect elementColorsVector(const MeshType &mesh, Color::Format colorFormat)
Get a #E Vector of integers containing the colors of the elements identified by ELEM_ID of a Mesh....
Definition export_matrix.h:598
Matrix edgeIndicesMatrix(const MeshType &mesh)
Get a #F*max(size(F)) Matrix of integers containing the vertex indices for each face of a Mesh.
Definition export_matrix.h:299
Matrix elementColorsMatrix(const MeshType &mesh)
Get a #E*4 Matrix of integers containing the colors of the elements identified by ELEM_ID of a Mesh....
Definition export_matrix.h:552
Matrix vertexNormalsMatrix(const MeshType &mesh)
Get a #V*3 Matrix of scalars containing the normals of the vertices of a Mesh. The function is templa...
Definition export_matrix.h:485
Vect faceColorsVector(const MeshType &mesh, Color::Format colorFormat)
Get a #F Vector of integers containing the colors of the faces of a Mesh. The function is templated o...
Definition export_matrix.h:740
MatrixStorageType
A simple type that enumerates the main storage types for matrices (row or column major).
Definition base.h:76