Visual Computing Library
|
List of Mesh Update algorithms. More...
Functions | |
template<HasBoundingBox MeshType> | |
void | vcl::updateBoundingBox (MeshType &m) |
Updates the bounding box of the mesh. | |
template<MeshConcept MeshType> | |
void | vcl::setPerVertexColor (MeshType &m, Color c=Color::White, bool onlySelected=false) |
Sets the color of the vertices. If the onlySelected flag is set to true , only the color of the selected vertices will be set. Otherwise, all the vertices will have the same color. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerFaceColor (MeshType &m, Color c=Color::White, bool onlySelected=false) |
Sets the color of the faces. If the onlySelected flag is set to true , only the color of the selected faces will be set. Otherwise, all the faces will have the same color. | |
template<EdgeMeshConcept MeshType> | |
void | vcl::setPerEdgeColor (MeshType &m, Color c=Color::White, bool onlySelected=false) |
Sets the color of the edges. If the onlySelected flag is set to true , only the color of the selected edges will be set. Otherwise, all the edges will have the same color. | |
template<HasColor MeshType> | |
void | vcl::setMeshColor (MeshType &m, Color c=Color::White) |
Sets the color component of a mesh. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerVertexColorFromFaceColor (MeshType &m) |
Sets the vertex colors from its incident face colors, computing a plain average of the face colors. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerFaceColorFromVertexColor (MeshType &m) |
Sets the face colors from its incident vertex colors, computing a plain average of the vertex colors. | |
template<EdgeMeshConcept MeshType> | |
void | vcl::setPerEdgeColorFromVertexColor (MeshType &m) |
Sets the edge colors from its incident vertex colors, computing a plain average of the vertex colors. | |
template<MeshConcept MeshType> | |
void | vcl::setPerVertexColorFromQuality (MeshType &m, Color::ColorMap colorMap=Color::ColorMap::RedBlue, typename MeshType::VertexType::QualityType minQuality=0, typename MeshType::VertexType::QualityType maxQuality=0) |
Sets the vertex colors from the quality values by computing a shading in the given color map (default is Red to Blue color map), in the given interval [minQuality, maxQuality]. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerFaceColorFromQuality (MeshType &m, Color::ColorMap colorMap=Color::ColorMap::RedBlue, typename MeshType::FaceType::QualityType minQuality=0, typename MeshType::FaceType::QualityType maxQuality=0) |
Sets the face colors from the quality values by computing a shading in the given color map (default is Red to Blue color map), in the given interval [minQuality, maxQuality]. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerVertexColorFromFaceBorderFlag (MeshType &m, Color borderColor=Color::Blue, Color internalColor=Color::White, Color mixColor=Color::Cyan) |
Color the vertices of the mesh that are on border, using the border flags of the faces. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerFaceColorFromConnectedComponents (MeshType &m, const std::vector< std::set< uint > > &connectedComponents) |
Given an already computed vector of sets of connected components (see vcl::connectedComponents(m) in vclib/algorithms/clean.h ), sets face colors according from connected components of the mesh. Each connected component will have a different per face color. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerFaceColorFromConnectedComponents (MeshType &m) |
Sets face colors according from connected components of the mesh. Each connected component will have a different per face color. Since this function will need to compute connected components of the mesh, also per Face AdjacentFaces component is required. | |
template<FaceMeshConcept MeshType> | |
void | vcl::setPerFaceColorScattering (MeshType &m, uint nColors=50, bool checkFauxEdges=true) |
This function colors each face of the mesh using a given number of scattering colors (default number is 50). By default, colors uniformely adjacent faces having faux edges in common. This check is made only if the option checkFauxEdges is set to true, and if the per Face AdjacentFaces component is available in the mesh. | |
template<MeshConcept MeshType, PointConcept PointType> | |
void | vcl::setPerVertexColorPerlinNoise (MeshType &m, PointType period, PointType offset=PointType(0, 0, 0), bool onSelected=false) |
Set the vertex color according to a perlin noise computed on the vertex coordinates. | |
template<MeshConcept MeshType, PointConcept PointType> | |
void | vcl::setPerVertexPerlinColor (MeshType &m, double period, PointType offset=PointType(0, 0, 0), Color color1=Color::Black, Color color2=Color::White, bool onSelected=false) |
Simple Perlin color mixing. color1 and color2 are mixed according the perlin noise function, with period and offset . | |
List of Mesh Update algorithms.
They allow to update components and properties of a mesh.
You can access these algorithms by including #include <vclib/algorithms/mesh/update.h>
Sets the color component of a mesh.
MeshType | type of the input mesh. It must satisfy the HasColor concept. |
[in,out] | m | the mesh on which set the color. |
[in] | c | the color to set to the mesh. |
void vcl::setPerEdgeColor | ( | MeshType & | m, |
Color | c = Color::White , |
||
bool | onlySelected = false |
||
) |
Sets the color of the edges. If the onlySelected
flag is set to true
, only the color of the selected edges will be set. Otherwise, all the edges will have the same color.
vcl::MissingComponentException | if the mesh does not have the per edge color component available. |
MeshType | type of the input mesh. It must satisfy the EdgeMeshConcept. |
[in,out] | m | the mesh on which set the edge color. |
[in] | c | the color to set to the edges of the mesh. |
[in] | onlySelected | if true , the color will be set just on the selected edges. |
void vcl::setPerEdgeColorFromVertexColor | ( | MeshType & | m | ) |
void vcl::setPerFaceColor | ( | MeshType & | m, |
Color | c = Color::White , |
||
bool | onlySelected = false |
||
) |
Sets the color of the faces. If the onlySelected
flag is set to true
, only the color of the selected faces will be set. Otherwise, all the faces will have the same color.
vcl::MissingComponentException | if the mesh does not have the per face color component available. |
MeshType | type of the input mesh. It must satisfy the FaceMeshConcept. |
[in,out] | m | the mesh on which set the face color. |
[in] | c | the color to set to the faces of the mesh. |
[in] | onlySelected | if true , the color will be set just on the selected faces. |
void vcl::setPerFaceColorFromConnectedComponents | ( | MeshType & | m | ) |
Sets face colors according from connected components of the mesh. Each connected component will have a different per face color. Since this function will need to compute connected components of the mesh, also per Face AdjacentFaces component is required.
Requirements:
[in,out] | m | the mesh on which set the face colors according to its connected components. |
void vcl::setPerFaceColorFromConnectedComponents | ( | MeshType & | m, |
const std::vector< std::set< uint > > & | connectedComponents | ||
) |
Given an already computed vector of sets of connected components (see vcl::connectedComponents(m) in vclib/algorithms/clean.h
), sets face colors according from connected components of the mesh. Each connected component will have a different per face color.
Requirements:
[in,out] | m | the mesh on which set the face colors according to its connected components. |
[in] | connectedComponents | a vector of sets, each one of them containing the face ids of a connected component. |
void vcl::setPerFaceColorFromQuality | ( | MeshType & | m, |
Color::ColorMap | colorMap = Color::ColorMap::RedBlue , |
||
typename MeshType::FaceType::QualityType | minQuality = 0 , |
||
typename MeshType::FaceType::QualityType | maxQuality = 0 |
||
) |
Sets the face colors from the quality values by computing a shading in the given color map (default is Red to Blue color map), in the given interval [minQuality, maxQuality].
If minQuality and maxQuality are not set (or if they are equal), the range is automatically computed.
Requirements:
[in,out] | m | mesh on which compute the face color. |
[in] | colorMap | the colormap to use to color the faces of the mesh (default: RedBlue). |
[in] | minQuality | the minimum value of the range to use for coloring (default: 0). |
[in] | maxQuality | the maximum value of the range to use for coloring (default: 0). |
void vcl::setPerFaceColorFromVertexColor | ( | MeshType & | m | ) |
void vcl::setPerFaceColorScattering | ( | MeshType & | m, |
uint | nColors = 50 , |
||
bool | checkFauxEdges = true |
||
) |
This function colors each face of the mesh using a given number of scattering colors (default number is 50). By default, colors uniformely adjacent faces having faux edges in common. This check is made only if the option checkFauxEdges
is set to true, and if the per Face AdjacentFaces component is available in the mesh.
Requirements:
Optional:
[in,out] | m | mesh on which set the face colors. |
[in] | nColors | number of colors used for the scattering (default 50). |
[in] | checkFauxEdges | if true, colors uniformely adjacent faces with faux edges (default true ). |
void vcl::setPerVertexColor | ( | MeshType & | m, |
Color | c = Color::White , |
||
bool | onlySelected = false |
||
) |
Sets the color of the vertices. If the onlySelected
flag is set to true
, only the color of the selected vertices will be set. Otherwise, all the vertices will have the same color.
vcl::MissingComponentException | if the mesh does not have the per vertex color component available. |
MeshType | type of the input mesh. It must satisfy the MeshConcept. |
[in,out] | m | the mesh on which set the vertex color. |
[in] | c | the color to set to the vertices of the mesh. |
[in] | onlySelected | if true , the color will be set just on the selected vertices. |
void vcl::setPerVertexColorFromFaceBorderFlag | ( | MeshType & | m, |
Color | borderColor = Color::Blue , |
||
Color | internalColor = Color::White , |
||
Color | mixColor = Color::Cyan |
||
) |
Color the vertices of the mesh that are on border, using the border flags of the faces.
Before using this function, you should update the face border flags accordingly.
Requirements:
[in,out] | m | the mesh on which update the vertex color from the border face flags. |
[in] | borderColor | the color of the vertices that are part of edges that are all marked as on border. |
[in] | internalColor | the color of the vertices that are part of edges that are all marked as non on border. |
[in] | mixColor | the color of vertices that are part of edges that are both on border and non on border. |
void vcl::setPerVertexColorFromFaceColor | ( | MeshType & | m | ) |
void vcl::setPerVertexColorFromQuality | ( | MeshType & | m, |
Color::ColorMap | colorMap = Color::ColorMap::RedBlue , |
||
typename MeshType::VertexType::QualityType | minQuality = 0 , |
||
typename MeshType::VertexType::QualityType | maxQuality = 0 |
||
) |
Sets the vertex colors from the quality values by computing a shading in the given color map (default is Red to Blue color map), in the given interval [minQuality, maxQuality].
If minQuality and maxQuality are not set (or if they are equal), the range is automatically computed.
Requirements:
[in,out] | m | mesh on which compute the vertex color. |
[in] | colorMap | the colormap to use to color the vertices of the mesh (default: RedBlue). |
[in] | minQuality | the minimum value of the range to use for coloring (default: 0). |
[in] | maxQuality | the maximum value of the range to use for coloring (default: 0). |
void vcl::setPerVertexColorPerlinNoise | ( | MeshType & | m, |
PointType | period, | ||
PointType | offset = PointType(0, 0, 0) , |
||
bool | onSelected = false |
||
) |
Set the vertex color according to a perlin noise computed on the vertex coordinates.
To make things weirder each color band can have its own offset and frequency. Period is expressed in absolute terms. So as period it is meaningful could be to use something in the range of 1/10 of the bbox diag.
vcl::MissingComponentException | if the mesh does not have a per vertex color component. |
MeshType | the type of the mesh. It must satisfy the MeshConcept. |
m | |
period | |
offset | |
onSelected |
void vcl::setPerVertexPerlinColor | ( | MeshType & | m, |
double | period, | ||
PointType | offset = PointType(0, 0, 0) , |
||
Color | color1 = Color::Black , |
||
Color | color2 = Color::White , |
||
bool | onSelected = false |
||
) |
Simple Perlin color mixing. color1
and color2
are mixed according the perlin noise function, with period
and offset
.
vcl::MissingComponentException | if the mesh does not have a per vertex color component. |
MeshType | the type of the mesh. It must satisfy the MeshConcept. |
m | |
period | |
offset | |
color1 | |
color2 | |
onSelected |
void vcl::updateBoundingBox | ( | MeshType & | m | ) |
Updates the bounding box of the mesh.
MeshType | type of the input mesh. It must satisfy the HasBoundingBox concept. |
[in] | m | input mesh on which the bounding box is computed and updated. |