How i can count not outward oriented faces? The following code does not work. It is implemented in vcg lib and it is based in IsCoherentlyOrientedMesh() of clean.h:
int countNotOutwardOrientedFaces(PMesh &pm)
{
tri::UpdateSelection<PMesh>::FaceClear(pm);
for (PMesh::FaceIterator f = pm.face.begin(); f != pm.face.end(); ++f)
{
bool oriented = true;
for (int i = 0; i < 3; ++i)
{
if (!face::CheckOrientation(*f, i))
{
oriented = false;
break;
}
}
if (!oriented)
{
f->SetS();
}
}
PMesh::FaceIterator f;
f = pm.face.begin();
std::vector<PFace*> sf;
for (; f != pm.face.end(); ++f)
{
if (f->IsS())
{
sf.push_back(&(*f));
}
}
return sf.size();
}