added PerEdgeQualityRamp function
This commit is contained in:
parent
2b367da917
commit
c0bc236482
vcg/complex/algorithms/update
|
@ -59,6 +59,8 @@ public:
|
||||||
typedef typename MeshType::FaceType FaceType;
|
typedef typename MeshType::FaceType FaceType;
|
||||||
typedef typename MeshType::FacePointer FacePointer;
|
typedef typename MeshType::FacePointer FacePointer;
|
||||||
typedef typename MeshType::FaceIterator FaceIterator;
|
typedef typename MeshType::FaceIterator FaceIterator;
|
||||||
|
typedef typename MeshType::EdgeIterator EdgeIterator;
|
||||||
|
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
typedef typename MeshType::ScalarType ScalarType;
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
|
|
||||||
|
@ -202,6 +204,26 @@ public:
|
||||||
(*fi).C().SetColorRamp(minq,maxq,(*fi).Q());
|
(*fi).C().SetColorRamp(minq,maxq,(*fi).Q());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! \brief This function colores all the edges of a mesh with a hue color shade dependent on the quality.
|
||||||
|
|
||||||
|
If no range of quality is passed it is automatically computed.
|
||||||
|
*/
|
||||||
|
static void PerEdgeQualityRamp(MeshType &m, float minq=0, float maxq=0, bool selected=false)
|
||||||
|
{
|
||||||
|
RequirePerEdgeColor(m);
|
||||||
|
RequirePerEdgeQuality(m);
|
||||||
|
|
||||||
|
if(minq==maxq)
|
||||||
|
{
|
||||||
|
std::pair<float,float> minmax = Stat<MeshType>::ComputePerEdgeQualityMinMax(m);
|
||||||
|
minq=minmax.first;
|
||||||
|
maxq=minmax.second;
|
||||||
|
}
|
||||||
|
for(EdgeIterator ei=m.edge.begin();ei!=m.edge.end();++ei) if(!(*ei).IsD())
|
||||||
|
if(!selected || (*ei).IsS())
|
||||||
|
(*ei).C().SetColorRamp(minq,maxq,(*ei).Q());
|
||||||
|
}
|
||||||
|
|
||||||
/*! \brief This function colores all the vertices of a mesh with a gray shade dependent on the quality.
|
/*! \brief This function colores all the vertices of a mesh with a gray shade dependent on the quality.
|
||||||
|
|
||||||
If no range of quality is passed it is automatically computed.
|
If no range of quality is passed it is automatically computed.
|
||||||
|
|
Loading…
Reference in New Issue