|
Visual Computing Library
devel
|
List Import Mesh from Matrix algorithms. More...

Functions | |
| template<EdgeMeshConcept MeshType, MatrixConcept ECMatrix> | |
| void | vcl::edgeColorsFromMatrix (MeshType &mesh, const ECMatrix &edgeColors) |
Sets the edge colors of the given input mesh from the input edge colors matrix. | |
| template<EdgeMeshConcept MeshType, Range R> | |
| void | vcl::edgeColorsFromRange (MeshType &mesh, R &&colors, Color::Format colorFormat) |
Sets the edge colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<EdgeMeshConcept MeshType, MatrixConcept EMatrix> | |
| void | vcl::edgeIndicesFromMatrix (MeshType &mesh, const EMatrix &edges, bool clearBeforeSet=true) |
Sets the edge indices of the given input mesh from the input edge matrix. | |
| template<EdgeMeshConcept MeshType, MatrixConcept ENMatrix> | |
| void | vcl::edgeNormalsFromMatrix (MeshType &mesh, const ENMatrix &edgeNormals) |
Sets the edge normals of the given input mesh from the input edge normals matrix. | |
| template<EdgeMeshConcept MeshType, Range R> | |
| void | vcl::edgeQualityFromRange (MeshType &mesh, R &&quality) |
Sets the edge quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<EdgeMeshConcept MeshType, Range R> | |
| void | vcl::edgeSelectionFromRange (MeshType &mesh, R &&selection) |
Sets the edge selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.). | |
| template<uint ELEM_ID, MeshConcept MeshType, MatrixConcept CMatrix> | |
| void | vcl::elementColorsFromMatrix (MeshType &mesh, const CMatrix &colors) |
Sets the element identified by ELEM_ID colors of the given input mesh from the input colors matrix. | |
| template<uint ELEM_ID, MeshConcept MeshType, Range R> | |
| void | vcl::elementColorsFromRange (MeshType &mesh, R &&colors, Color::Format colorFormat) |
Sets the element identified by ELEM_ID colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<uint ELEM_ID, MeshConcept MeshType, MatrixConcept NMatrix> | |
| void | vcl::elementNormalsFromMatrix (MeshType &mesh, const NMatrix &normals) |
Sets the element identified by ELEM_ID normals of the given input mesh from the input normals matrix. | |
| template<uint ELEM_ID, MeshConcept MeshType, Range R> | |
| void | vcl::elementQualityFromRange (MeshType &mesh, R &&quality) |
Sets the element identified by ELEM_ID quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<uint ELEM_ID, MeshConcept MeshType, Range R> | |
| void | vcl::elementSelectionFromRange (MeshType &mesh, R &&selection) |
Sets the element identified by ELEM_ID selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.). | |
| template<FaceMeshConcept MeshType, MatrixConcept FCMatrix> | |
| void | vcl::faceColorsFromMatrix (MeshType &mesh, const FCMatrix &faceColors) |
Sets the face colors of the given input mesh from the input face colors matrix. | |
| template<FaceMeshConcept MeshType, Range R> | |
| void | vcl::faceColorsFromRange (MeshType &mesh, R &&colors, Color::Format colorFormat) |
Sets the face colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<FaceMeshConcept MeshType, MatrixConcept FMatrix> | |
| void | vcl::faceIndicesFromMatrix (MeshType &mesh, const FMatrix &faces, bool clearBeforeSet=true) |
Sets the face indices of the given input mesh from the input face matrix. | |
| template<FaceMeshConcept MeshType, Range R> | |
| void | vcl::faceMaterialIndicesFromRange (MeshType &mesh, R &&texCoordIndices) |
Sets the face material indices of the given input mesh from the input material indices range (that could be anything that satisfies the Range concept: e.g. std::vector<uint>, std::array<uint, N>, Eigen::VectorXi, etc.). | |
| template<FaceMeshConcept MeshType, MatrixConcept FNMatrix> | |
| void | vcl::faceNormalsFromMatrix (MeshType &mesh, const FNMatrix &faceNormals) |
Sets the face normals of the given input mesh from the input face normals matrix. | |
| template<FaceMeshConcept MeshType, Range R> | |
| void | vcl::faceQualityFromRange (MeshType &mesh, R &&quality) |
Sets the face quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<FaceMeshConcept MeshType, Range R> | |
| void | vcl::faceSelectionFromRange (MeshType &mesh, R &&selection) |
Sets the face selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.). | |
| template<FaceMeshConcept MeshType, MatrixConcept FTMatrix> | |
| void | vcl::faceWedgeTexCoordsFromMatrix (MeshType &mesh, const FTMatrix &faceWedgeTexCoords) |
Sets the face wedge texcoords of the given input mesh from the input face wedge texcoords matrix. | |
| template<MeshConcept MeshType, MatrixConcept VMatrix, MatrixConcept FMatrix = Eigen::MatrixX3i, MatrixConcept EMatrix = Eigen::MatrixX2i> | |
| MeshType | vcl::meshFromMatrices (const VMatrix &vertices, const FMatrix &faces=FMatrix(), const EMatrix &edges=EMatrix()) |
| Creates and returns a new mesh from the input matrices that are given as arguments. | |
| template<MeshConcept MeshType, MatrixConcept VMatrix, MatrixConcept FMatrix = Eigen::MatrixX3i, MatrixConcept EMatrix = Eigen::MatrixX2i> | |
| void | vcl::meshFromMatrices (MeshType &mesh, const VMatrix &vertices, const FMatrix &faces=FMatrix(), const EMatrix &edges=EMatrix()) |
Sets the given input mesh from the input matrices that are given as arguments. | |
| template<MeshConcept MeshType, MatrixConcept VCMatrix> | |
| void | vcl::vertexColorsFromMatrix (MeshType &mesh, const VCMatrix &vertexColors) |
Sets the vertex colors of the given input mesh from the input vertex colors matrix. | |
| template<MeshConcept MeshType, Range R> | |
| void | vcl::vertexColorsFromRange (MeshType &mesh, R &&colors, Color::Format colorFormat) |
Sets the vertex colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<MeshConcept MeshType, Range R> | |
| void | vcl::vertexMaterialIndicesFromRange (MeshType &mesh, R &&materialIndices) |
Sets the vertex material indices of the given input mesh from the input material indices range (that could be anything that satisfies the Range concept: e.g. std::vector<uint>, std::array<uint, N>, Eigen::VectorXi, etc.). | |
| template<MeshConcept MeshType, MatrixConcept VNMatrix> | |
| void | vcl::vertexNormalsFromMatrix (MeshType &mesh, const VNMatrix &vertexNormals) |
Sets the vertex normals of the given input mesh from the input vertex normals matrix. | |
| template<MeshConcept MeshType, MatrixConcept VMatrix> | |
| void | vcl::vertexPositionsFromMatrix (MeshType &mesh, const VMatrix &vertices, bool clearBeforeSet=true) |
Sets the vertex positions of the given input mesh from the input vertex matrix. | |
| template<MeshConcept MeshType, Range R> | |
| void | vcl::vertexQualityFromRange (MeshType &mesh, R &&quality) |
Sets the vertex quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.). | |
| template<MeshConcept MeshType, Range R> | |
| void | vcl::vertexSelectionFromRange (MeshType &mesh, R &&selection) |
Sets the vertex selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.). | |
| template<MeshConcept MeshType, MatrixConcept VTMatrix> | |
| void | vcl::vertexTexCoordsFromMatrix (MeshType &mesh, const VTMatrix &vertexTexCoords) |
Sets the vertex texcoords of the given input mesh from the input vertex texcoords matrix. | |
List Import Mesh from Matrix algorithms.
They allow to import mesh data from matrices.
| void vcl::edgeColorsFromMatrix | ( | MeshType & | mesh, |
| const ECMatrix & | edgeColors | ||
| ) |
Sets the edge colors of the given input mesh from the input edge colors matrix.
The number of rows of the input matrix must be equal to the number of edges of the mesh, otherwise an exception is thrown.
The input matrix can have 3 or 4 columns. If it has 3 columns, the alpha channel is set to 255 (1.0f).
The input matrix can have integral or floating point scalar type. If it has integral scalar type, the color components are expected to be in range [0, 255]. If it has floating point scalar type, the color components are expected to be in range [0.0f, 1.0f].
The function enables the per-face color component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the EdgeMeshConcept. |
| ECMatrix | the type of the input edge colors matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input edge colors. | |
| [in] | edgeColors | a #E*3 or #E*4 matrix containing the colors of the edges of the mesh. |
| void vcl::edgeColorsFromRange | ( | MeshType & | mesh, |
| R && | colors, | ||
| Color::Format | colorFormat | ||
| ) |
Sets the edge colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
Each color of the input range is interpeted as a packed 32-bit unsigned integer in the given colorFormat.
The number of elements of the input range must be equal to the number of edges of the mesh, otherwise an exception is thrown.
The function enables the per-edge quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the EdgeMeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input edge color. | |
| [in] | colors | the input edge color range. |
| [in] | colorFormat | the format used to pack the color in a single 32 bit value. |
| void vcl::edgeIndicesFromMatrix | ( | MeshType & | mesh, |
| const EMatrix & | edges, | ||
| bool | clearBeforeSet = true |
||
| ) |
Sets the edge indices of the given input mesh from the input edge matrix.
If the argument clearBeforeSet is set to true (default), the function clears the edge container of the mesh and then adds a number of edges that depends on the number of rows of the input edge matrix. In this scenario, all the old edges with their components stored in the mesh before calling this function are lost.
If the argument clearBeforeSet is set to false, the function checks that the number of rows of the input edge matrix is equal to the number of edges of the mesh. If this is not the case, an exception is thrown. Then, the function sets the indices of the edges of the mesh from the input edge matrix. In this scenario, all the components (except the indices) of the edges stored in the mesh before calling this function are preserved.
All the other containers of the mesh are left as they are. Pointers to edges stored in the other containers of the mesh are still valid only if the number of edges is not changed (same allocation policy of the std::vector).
| MeshType | the type of the mesh to be filled. It must satisfy the EdgeMeshConcept. |
| EMatrix | the type of the input edge matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input edges. | |
| [in] | edges | a #E*2 matrix containing the indices of the vertices of the edges of the mesh. |
| [in] | clearBeforeSet | if true, the function clears the container of the edges of the mesh before adding the edges from the input matrix. If false, the function sets the indices in the input matrix to the edges of the mesh, leaving all the other components untouched. |
| void vcl::edgeNormalsFromMatrix | ( | MeshType & | mesh, |
| const ENMatrix & | edgeNormals | ||
| ) |
Sets the edge normals of the given input mesh from the input edge normals matrix.
The number of rows of the input matrix must be equal to the number of edges of the mesh, otherwise an exception is thrown.
The function enables the per-edge normal component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the EdgeMeshConcept. |
| ENMatrix | the type of the input edge normals matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input edge normals. | |
| [in] | edgeNormals | a #E*3 matrix containing the normals of the edges of the mesh. |
| void vcl::edgeQualityFromRange | ( | MeshType & | mesh, |
| R && | quality | ||
| ) |
Sets the edge quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
The number of elements of the input range must be equal to the number of edges of the mesh, otherwise an exception is thrown.
The function enables the per-edge quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the EdgeMeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input edge quality. | |
| [in] | quality | the input edge quality range. |
| void vcl::edgeSelectionFromRange | ( | MeshType & | mesh, |
| R && | selection | ||
| ) |
Sets the edge selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.).
The number of elements of the input range must be equal to the number of edges of the mesh, otherwise an exception is thrown.
| MeshType | the type of the mesh to be filled. It must satisfy the EdgeMeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input edge selection. | |
| [in] | selection | the input edge selection range. |
| void vcl::elementColorsFromMatrix | ( | MeshType & | mesh, |
| const CMatrix & | colors | ||
| ) |
Sets the element identified by ELEM_ID colors of the given input mesh from the input colors matrix.
The number of rows of the input matrix must be equal to the number of elements of the mesh, otherwise an exception is thrown.
The input matrix can have 3 or 4 columns. If it has 3 columns, the alpha channel is set to 255 (1.0f).
The input matrix can have integral or floating point scalar type. If it has integral scalar type, the color components are expected to be in range [0, 255]. If it has floating point scalar type, the color components are expected to be in range [0.0f, 1.0f].
The function enables the per-element color component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| CMatrix | the type of the input colors matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input colors. | |
| [in] | colors | a #V*3 or #V*4 matrix containing the colors of the elements of the mesh. |
| void vcl::elementColorsFromRange | ( | MeshType & | mesh, |
| R && | colors, | ||
| Color::Format | colorFormat | ||
| ) |
Sets the element identified by ELEM_ID colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
Each color of the input range is interpeted as a packed 32-bit unsigned integer in the given colorFormat.
The number of elements of the input range must be equal to the number of ELEM_ID elements of the mesh, otherwise an exception is thrown.
The function enables the per-element quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input element color. | |
| [in] | colors | the input element color range. |
| [in] | colorFormat | the format used to pack the color in a single 32 bit value. |
| void vcl::elementNormalsFromMatrix | ( | MeshType & | mesh, |
| const NMatrix & | normals | ||
| ) |
Sets the element identified by ELEM_ID normals of the given input mesh from the input normals matrix.
The number of rows of the input matrix must be equal to the number of ELEM_ID elements of the mesh, otherwise an exception is thrown.
The function enables the per-element normal component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| NMatrix | the type of the input normals matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input element normals. | |
| [in] | normals | a #E*3 matrix containing the normals of the elements of the mesh. |
| void vcl::elementQualityFromRange | ( | MeshType & | mesh, |
| R && | quality | ||
| ) |
Sets the element identified by ELEM_ID quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
The number of elements of the input range must be equal to the number of ELEM_ID elements of the mesh, otherwise an exception is thrown.
The function enables the per-element quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input element quality. | |
| [in] | quality | the input element quality range. |
| void vcl::elementSelectionFromRange | ( | MeshType & | mesh, |
| R && | selection | ||
| ) |
Sets the element identified by ELEM_ID selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.).
The number of elements of the input range must be equal to the number of ELEM_ID elements of the mesh, otherwise an exception is thrown.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input element selection. | |
| [in] | selection | the input element selection range. |
| void vcl::faceColorsFromMatrix | ( | MeshType & | mesh, |
| const FCMatrix & | faceColors | ||
| ) |
Sets the face colors of the given input mesh from the input face colors matrix.
The number of rows of the input matrix must be equal to the number of faces of the mesh, otherwise an exception is thrown.
The input matrix can have 3 or 4 columns. If it has 3 columns, the alpha channel is set to 255 (1.0f).
The input matrix can have integral or floating point scalar type. If it has integral scalar type, the color components are expected to be in range [0, 255]. If it has floating point scalar type, the color components are expected to be in range [0.0f, 1.0f].
The function enables the per-face color component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| FCMatrix | the type of the input face colors matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input face colors. | |
| [in] | faceColors | a #F*3 or #F*4 matrix containing the colors of the faces of the mesh. |
| void vcl::faceColorsFromRange | ( | MeshType & | mesh, |
| R && | colors, | ||
| Color::Format | colorFormat | ||
| ) |
Sets the face colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
Each color of the input range is interpeted as a packed 32-bit unsigned integer in the given colorFormat.
The number of elements of the input range must be equal to the number of faces of the mesh, otherwise an exception is thrown.
The function enables the per-face quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input face color. | |
| [in] | colors | the input face color range. |
| [in] | colorFormat | the format used to pack the color in a single 32 bit value. |
| void vcl::faceIndicesFromMatrix | ( | MeshType & | mesh, |
| const FMatrix & | faces, | ||
| bool | clearBeforeSet = true |
||
| ) |
Sets the face indices of the given input mesh from the input face matrix.
If the MeshType is not a polygonal mesh (e.g. a triangle mesh), the number of columns of the input face matrix must be equal to the number of vertices of each face of the mesh (e.g. 3 for triangle meshes, 4 for quad meshes, etc.). If this condition is not satisfied, an exception is thrown.
If the MeshType is a polygonal mesh, the size of each polygonal face is determined by counting the number of valid vertex indices in each row of the input face matrix. Valid vertex indices are non-negative and not equal to UINT_NULL.
If the argument clearBeforeSet is set to true (default), the function clears the face container of the mesh and then adds a number of faces that depends on the number of rows of the input face matrix. In this scenario, all the old faces with their components stored in the mesh before calling this function are lost.
If the argument clearBeforeSet is set to false, the function checks that the number of rows of the input face matrix is equal to the number of faces of the mesh. If this is not the case, an exception is thrown. Then, the function sets the indices of the faces of the mesh from the input face matrix. In this scenario, all the components (except the indices) of the faces stored in the mesh before calling this function are preserved.
All the other containers of the mesh are left as they are. Pointers to faces stored in the other containers of the mesh are still valid only if the number of faces is not changed (same allocation policy of the std::vector).
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| FMatrix | the type of the input face matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input faces. | |
| [in] | faces | a #F*K matrix containing the indices of the vertices of the faces of the mesh. If the mesh is not a polygonal mesh (e.g. a triangle mesh), K must be equal to the number of vertices of each face of the mesh (e.g. 3 for triangle meshes, 4 for quad meshes, etc.). If this condition is not satisfied, an exception is thrown. |
| [in] | clearBeforeSet | if true, the function clears the container of the faces of the mesh before adding the faces from the input matrix. If false, the function sets the indices from the input matrix to the faces of the mesh, leaving all the other components untouched. |
| void vcl::faceMaterialIndicesFromRange | ( | MeshType & | mesh, |
| R && | texCoordIndices | ||
| ) |
Sets the face material indices of the given input mesh from the input material indices range (that could be anything that satisfies the Range concept: e.g. std::vector<uint>, std::array<uint, N>, Eigen::VectorXi, etc.).
The number of elements of the input range must be equal to the number of faces of the mesh, otherwise an exception is thrown.
The function enables the per-face material index component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input face material indices. | |
| [in] | texCoordIndices | the input face material indices range. |
| void vcl::faceNormalsFromMatrix | ( | MeshType & | mesh, |
| const FNMatrix & | faceNormals | ||
| ) |
Sets the face normals of the given input mesh from the input face normals matrix.
The number of rows of the input matrix must be equal to the number of faces of the mesh, otherwise an exception is thrown.
The function enables the per-face normal component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| FNMatrix | the type of the input face normals matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input face normals. | |
| [in] | faceNormals | a #F*3 matrix containing the normals of the faces of the mesh. |
| void vcl::faceQualityFromRange | ( | MeshType & | mesh, |
| R && | quality | ||
| ) |
Sets the face quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
The number of elements of the input range must be equal to the number of faces of the mesh, otherwise an exception is thrown.
The function enables the per-face quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input face quality. | |
| [in] | quality | the input face quality range. |
| void vcl::faceSelectionFromRange | ( | MeshType & | mesh, |
| R && | selection | ||
| ) |
Sets the face selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.).
The number of elements of the input range must be equal to the number of faces of the mesh, otherwise an exception is thrown.
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input face selection. | |
| [in] | selection | the input face selection range. |
| void vcl::faceWedgeTexCoordsFromMatrix | ( | MeshType & | mesh, |
| const FTMatrix & | faceWedgeTexCoords | ||
| ) |
Sets the face wedge texcoords of the given input mesh from the input face wedge texcoords matrix.
The number of rows of the input matrix must be equal to the number of faces of the mesh, otherwise an exception is thrown.
The number of columns is expected to be equal to 2 * K, where K is the number of vertices of the largest face of the mesh. If the mesh has fixed face size (e.g. triangle mesh, quad mesh, etc.), K is equal to the number of vertices of each face of the mesh.
The function enables the per-face wedge texcoords component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the FaceMeshConcept. |
| FTMatrix | the type of the input face wedge texcoords matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input face wedge texcoords. | |
| [in] | faceWedgeTexCoords | a #F*(K*2) matrix containing the wedge texcoords of the faces of the mesh. |
| MeshType vcl::meshFromMatrices | ( | const VMatrix & | vertices, |
| const FMatrix & | faces = FMatrix(), |
||
| const EMatrix & | edges = EMatrix() |
||
| ) |
Creates and returns a new mesh from the input matrices that are given as arguments.
The function accepts several input matrices, that are used only if their number of rows is different from zero. It tries to fill all the data contained in the non-empty input matrices into the Mesh:
| vcl::WrongSizeException | if the sizes of the non-empty input matrices have not the expected sizes. |
| MeshType | the type of the mesh to be created. It must satisfy the MeshConcept. |
| VMatrix | the type of the input vertex matrix. It must satisfy the MatrixConcept. |
| FMatrix | the type of the input face matrix. It must satisfy the MatrixConcept. |
| EMatrix | the type of the input edge matrix. It must satisfy the MatrixConcept. |
| [in] | vertices | a #V*3 matrix containing the positions of the vertices of the mesh. |
| [in] | faces | a #F*K matrix containing the indices of the vertices of the faces of the mesh. If the MeshType has no faces, the function will ignore this matrix. If the mesh is not a polygonal mesh (e.g. a triangle mesh), K must be equal to the number of vertices of each face of the mesh (e.g. 3 for triangle meshes, 4 for quad meshes, etc.). If this condition is not satisfied, an exception is thrown. |
| [in] | edges | a #E*2 matrix containing the indices of the vertices of the edges of the mesh. If the MeshType has no edges, the function will ignore this matrix. |
| void vcl::meshFromMatrices | ( | MeshType & | mesh, |
| const VMatrix & | vertices, | ||
| const FMatrix & | faces = FMatrix(), |
||
| const EMatrix & | edges = EMatrix() |
||
| ) |
Sets the given input mesh from the input matrices that are given as arguments.
The function accepts several input matrices, that are used only if their number of rows is different from zero. It tries to fill all the data contained in the non-empty input matrices into the Mesh:
The mesh is cleared and all the optional components are disabled before adding the data from the input matrices.
| vcl::WrongSizeException | if the sizes of the non-empty input matrices have not the expected sizes. |
| MeshType | the type of the mesh to be created. It must satisfy the MeshConcept. |
| VMatrix | the type of the input vertex matrix. It must satisfy the MatrixConcept. |
| FMatrix | the type of the input face matrix. It must satisfy the MatrixConcept. |
| EMatrix | the type of the input edge matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import all the input data from the matrices. | |
| [in] | vertices | a #V*3 matrix containing the positions of the vertices of the mesh. |
| [in] | faces | a #F*K matrix containing the indices of the vertices of the faces of the mesh. If the MeshType has no faces, the function will ignore this matrix. If the mesh is not a polygonal mesh (e.g. a triangle mesh), K must be equal to the number of vertices of each face of the mesh (e.g. 3 for triangle meshes, 4 for quad meshes, etc.). If this condition is not satisfied, an exception is thrown. |
| [in] | edges | a #E*2 matrix containing the indices of the vertices of the edges of the mesh. If the MeshType has no edges, the function will ignore this matrix. |
| void vcl::vertexColorsFromMatrix | ( | MeshType & | mesh, |
| const VCMatrix & | vertexColors | ||
| ) |
Sets the vertex colors of the given input mesh from the input vertex colors matrix.
The number of rows of the input matrix must be equal to the number of vertices of the mesh, otherwise an exception is thrown.
The input matrix can have 3 or 4 columns. If it has 3 columns, the alpha channel is set to 255 (1.0f).
The input matrix can have integral or floating point scalar type. If it has integral scalar type, the color components are expected to be in range [0, 255]. If it has floating point scalar type, the color components are expected to be in range [0.0f, 1.0f].
The function enables the per-vertex color component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| VCMatrix | the type of the input vertex colors matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input vertex colors. | |
| [in] | vertexColors | a #V*3 or #V*4 matrix containing the colors of the vertices of the mesh. |
| void vcl::vertexColorsFromRange | ( | MeshType & | mesh, |
| R && | colors, | ||
| Color::Format | colorFormat | ||
| ) |
Sets the vertex colors of the given input mesh from the input color range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
Each color of the input range is interpeted as a packed 32-bit unsigned integer in the given colorFormat.
The number of elements of the input range must be equal to the number of vertices of the mesh, otherwise an exception is thrown.
The function enables the per-vertex quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input vertex color. | |
| [in] | colors | the input vertex color range. |
| [in] | colorFormat | the format used to pack the color in a single 32 bit value. |
| void vcl::vertexMaterialIndicesFromRange | ( | MeshType & | mesh, |
| R && | materialIndices | ||
| ) |
Sets the vertex material indices of the given input mesh from the input material indices range (that could be anything that satisfies the Range concept: e.g. std::vector<uint>, std::array<uint, N>, Eigen::VectorXi, etc.).
The number of elements of the input range must be equal to the number of vertices of the mesh, otherwise an exception is thrown.
The function enables the per-vertex material indices component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input vertex material indices. | |
| [in] | materialIndices | the input vertex material indices range. |
| void vcl::vertexNormalsFromMatrix | ( | MeshType & | mesh, |
| const VNMatrix & | vertexNormals | ||
| ) |
Sets the vertex normals of the given input mesh from the input vertex normals matrix.
The number of rows of the input matrix must be equal to the number of vertices of the mesh, otherwise an exception is thrown.
The function enables the per-vertex normal component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| VNMatrix | the type of the input vertex normals matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input vertex normals. | |
| [in] | vertexNormals | a #V*3 matrix containing the normals of the vertices of the mesh. |
| void vcl::vertexPositionsFromMatrix | ( | MeshType & | mesh, |
| const VMatrix & | vertices, | ||
| bool | clearBeforeSet = true |
||
| ) |
Sets the vertex positions of the given input mesh from the input vertex matrix.
If the argument clearBeforeSet is set to true (default), the function clears the vertex container of the mesh and then adds a number of vertices that depends on the number of rows of the input vertex matrix. In this scenario, all the old vertices with their components stored in the mesh before calling this function are lost.
If the argument clearBeforeSet is set to false, the function checks that the number of rows of the input vertex matrix is equal to the number of vertices of the mesh. If this is not the case, an exception is thrown. Then, the function sets the positions of the vertices of the mesh from the input vertex matrix. In this scenario, all the components (except the positions) of the vertices stored in the mesh before calling this function are preserved.
All the other containers of the mesh are left as they are. Pointers to vertices stored in the other containers of the mesh are still valid only if the number of vertices is not changed (same allocation policy of the std::vector).
| vcl::WrongSizeException | if the sizes of the input matrix are not valid (e.g. columns != 3 or rows != mesh.vertexNumber()). |
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| VMatrix | the type of the input vertex matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input vertices. | |
| [in] | vertices | a #V*3 matrix containing the positions of the vertices of the mesh. |
| [in] | clearBeforeSet | if true, the function clears the container of the vertices of the mesh before adding the vertices from the input matrix. If false, the function sets the positions in the input matrix to the vertices of the mesh, leaving all the other components untouched. |
| void vcl::vertexQualityFromRange | ( | MeshType & | mesh, |
| R && | quality | ||
| ) |
Sets the vertex quality of the given input mesh from the input quality range (that could be anything that satisfies the Range concept: e.g. std::vector<double>, std::array<double, N>, Eigen::VectorXd, etc.).
The number of elements of the input range must be equal to the number of vertices of the mesh, otherwise an exception is thrown.
The function enables the per-vertex quality component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input vertex quality. | |
| [in] | quality | the input vertex quality range. |
| void vcl::vertexSelectionFromRange | ( | MeshType & | mesh, |
| R && | selection | ||
| ) |
Sets the vertex selection of the given input mesh from the input selection range (that could be anything that satisfies the Range concept: e.g. std::vector<bool>, std::array<bool, N>, Eigen::VectorXi, etc.).
The number of elements of the input range must be equal to the number of vertices of the mesh, otherwise an exception is thrown.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| R | the type of the input range. It must satisfy the Range concept. |
| [in/out] | mesh: the mesh on which import the input vertex selection. | |
| [in] | selection | the input vertex selection range. |
| void vcl::vertexTexCoordsFromMatrix | ( | MeshType & | mesh, |
| const VTMatrix & | vertexTexCoords | ||
| ) |
Sets the vertex texcoords of the given input mesh from the input vertex texcoords matrix.
The number of rows of the input matrix must be equal to the number of vertices of the mesh, otherwise an exception is thrown.
The function enables the per-vertex texcoords component if it is not already enabled.
| MeshType | the type of the mesh to be filled. It must satisfy the MeshConcept. |
| VTMatrix | the type of the input vertex texcoords matrix. It must satisfy the MatrixConcept. |
| [in/out] | mesh: the mesh on which import the input vertex texcoords. | |
| [in] | vertexTexCoords | a #V*2 matrix containing the texcoords of the vertices of the mesh. |