Changed all the MeshType::HasSomething() into the now standard tri::HasSomething(MeshType &m)
This commit is contained in:
parent
f45e0cec3a
commit
e9d476e93c
|
@ -83,7 +83,7 @@ static void PerVertexClear(ComputeMeshType &m, bool ClearAllVertNormal=false)
|
||||||
|
|
||||||
static void PerFace(ComputeMeshType &m)
|
static void PerFace(ComputeMeshType &m)
|
||||||
{
|
{
|
||||||
if( !m.HasPerFaceNormal()) return;
|
if( !HasPerFaceNormal(m)) return;
|
||||||
FaceIterator f;
|
FaceIterator f;
|
||||||
for(f=m.face.begin();f!=m.face.end();++f)
|
for(f=m.face.begin();f!=m.face.end();++f)
|
||||||
if( !(*f).IsD() ) face::ComputeNormal(*f);
|
if( !(*f).IsD() ) face::ComputeNormal(*f);
|
||||||
|
@ -95,7 +95,7 @@ static void PerFace(ComputeMeshType &m)
|
||||||
*/
|
*/
|
||||||
static void PerVertexFromCurrentFaceNormal(ComputeMeshType &m)
|
static void PerVertexFromCurrentFaceNormal(ComputeMeshType &m)
|
||||||
{
|
{
|
||||||
if( !m.HasPerVertexNormal()) return;
|
if( !HasPerVertexNormal(m)) return;
|
||||||
|
|
||||||
VertexIterator vi;
|
VertexIterator vi;
|
||||||
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
||||||
|
@ -220,7 +220,7 @@ static void PerVertex(ComputeMeshType &m)
|
||||||
|
|
||||||
static void PerVertexPerFace(ComputeMeshType &m)
|
static void PerVertexPerFace(ComputeMeshType &m)
|
||||||
{
|
{
|
||||||
if( !m.HasPerVertexNormal() || !m.HasPerFaceNormal()) return;
|
if( !HasPerVertexNormal(m) || !HasPerFaceNormal(m)) return;
|
||||||
|
|
||||||
PerFace(m);
|
PerFace(m);
|
||||||
PerVertexClear(m);
|
PerVertexClear(m);
|
||||||
|
@ -283,7 +283,7 @@ static void PerVertexNormalizedPerFaceNormalized(ComputeMeshType &m)
|
||||||
|
|
||||||
static void PerFaceRW(ComputeMeshType &m, bool normalize=false)
|
static void PerFaceRW(ComputeMeshType &m, bool normalize=false)
|
||||||
{
|
{
|
||||||
if( !m.HasPerFaceNormal()) return;
|
if( !HasPerFaceNormal(m)) return;
|
||||||
|
|
||||||
FaceIterator f;
|
FaceIterator f;
|
||||||
bool cn = true;
|
bool cn = true;
|
||||||
|
@ -317,7 +317,7 @@ static void PerFaceRW(ComputeMeshType &m, bool normalize=false)
|
||||||
|
|
||||||
static void PerFaceNormalized(ComputeMeshType &m)
|
static void PerFaceNormalized(ComputeMeshType &m)
|
||||||
{
|
{
|
||||||
if( !m.HasPerFaceNormal()) return;
|
if( !HasPerFaceNormal(m)) return;
|
||||||
FaceIterator f;
|
FaceIterator f;
|
||||||
for(f=m.face.begin();f!=m.face.end();++f)
|
for(f=m.face.begin();f!=m.face.end();++f)
|
||||||
if( !(*f).IsD() ) face::ComputeNormalizedNormal(*f);
|
if( !(*f).IsD() ) face::ComputeNormalizedNormal(*f);
|
||||||
|
@ -325,7 +325,7 @@ static void PerFaceNormalized(ComputeMeshType &m)
|
||||||
|
|
||||||
static void PerBitQuadFaceNormalized(ComputeMeshType &m)
|
static void PerBitQuadFaceNormalized(ComputeMeshType &m)
|
||||||
{
|
{
|
||||||
if( !m.HasPerFaceNormal()) return;
|
if( !HasPerFaceNormal(m)) return;
|
||||||
PerFace(m);
|
PerFace(m);
|
||||||
|
|
||||||
FaceIterator f;
|
FaceIterator f;
|
||||||
|
@ -343,7 +343,7 @@ static void PerBitQuadFaceNormalized(ComputeMeshType &m)
|
||||||
/// \brief Calculates the vertex normal.
|
/// \brief Calculates the vertex normal.
|
||||||
static void PerVertexNormalized(ComputeMeshType &m)
|
static void PerVertexNormalized(ComputeMeshType &m)
|
||||||
{
|
{
|
||||||
if( !m.HasPerVertexNormal()) return;
|
if( !HasPerVertexNormal(m)) return;
|
||||||
PerVertex(m);
|
PerVertex(m);
|
||||||
for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi)
|
for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi)
|
||||||
if( !(*vi).IsD() && (*vi).IsRW() )
|
if( !(*vi).IsD() && (*vi).IsRW() )
|
||||||
|
@ -356,7 +356,7 @@ static void PerVertexMatrix(ComputeMeshType &m, const Matrix44<ScalarType> &mat,
|
||||||
|
|
||||||
Matrix33<ScalarType> mat33(mat,3);
|
Matrix33<ScalarType> mat33(mat,3);
|
||||||
|
|
||||||
if( !m.HasPerVertexNormal()) return;
|
if( !HasPerVertexNormal(m)) return;
|
||||||
|
|
||||||
if(remove_scaling){
|
if(remove_scaling){
|
||||||
scale = pow(mat33.Determinant(),(ScalarType)(1.0/3.0));
|
scale = pow(mat33.Determinant(),(ScalarType)(1.0/3.0));
|
||||||
|
@ -376,7 +376,7 @@ static void PerFaceMatrix(ComputeMeshType &m, const Matrix44<ScalarType> &mat, b
|
||||||
|
|
||||||
Matrix33<ScalarType> mat33(mat,3);
|
Matrix33<ScalarType> mat33(mat,3);
|
||||||
|
|
||||||
if( !m.HasPerFaceNormal()) return;
|
if( !HasPerFaceNormal(m)) return;
|
||||||
|
|
||||||
if(remove_scaling){
|
if(remove_scaling){
|
||||||
scale = pow(mat33.Determinant(),ScalarType(1.0/3.0));
|
scale = pow(mat33.Determinant(),ScalarType(1.0/3.0));
|
||||||
|
|
|
@ -64,10 +64,10 @@ static void Matrix(ComputeMeshType &m, const Matrix44<ScalarType> &M, bool updat
|
||||||
if(!(*vi).IsD()) (*vi).P()=M*(*vi).cP();
|
if(!(*vi).IsD()) (*vi).P()=M*(*vi).cP();
|
||||||
|
|
||||||
if(update_also_normals){
|
if(update_also_normals){
|
||||||
if(m.HasPerVertexNormal()){
|
if(HasPerVertexNormal(m)){
|
||||||
UpdateNormals<ComputeMeshType>::PerVertexMatrix(m,M);
|
UpdateNormals<ComputeMeshType>::PerVertexMatrix(m,M);
|
||||||
}
|
}
|
||||||
if(m.HasPerFaceNormal()){
|
if(HasPerFaceNormal(m)){
|
||||||
UpdateNormals<ComputeMeshType>::PerFaceMatrix(m,M);
|
UpdateNormals<ComputeMeshType>::PerFaceMatrix(m,M);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,8 +108,8 @@ The geodesic distance is approximated by allowing to walk only along edges of th
|
||||||
static void VertexGeodesicFromBorder(MeshType &m) // R1
|
static void VertexGeodesicFromBorder(MeshType &m) // R1
|
||||||
{
|
{
|
||||||
//Requirements
|
//Requirements
|
||||||
assert(m.HasVFTopology());
|
assert(HasPerVertexVFAdjacency(m) && HasPerFaceVFAdjacency(m));
|
||||||
assert(m.HasPerVertexQuality());
|
assert(HasPerVertexQuality(m));
|
||||||
|
|
||||||
std::vector< VQualityHeap > heap;
|
std::vector< VQualityHeap > heap;
|
||||||
VertexIterator v;
|
VertexIterator v;
|
||||||
|
|
Loading…
Reference in New Issue