Improved comment/documentation. Changed throws in require

This commit is contained in:
Paolo Cignoni 2013-03-13 14:00:29 +00:00
parent 9e45730d93
commit 6950be4594
1 changed files with 41 additions and 41 deletions

View File

@ -215,7 +215,7 @@ static void AllocateEdge(MeshType &m)
/// \brief Update the Face-Face topological relation by allowing to retrieve for each face what other faces shares their edges.
static void FaceFace(MeshType &m)
{
if(!HasFFAdjacency(m)) throw vcg::MissingComponentException("FFAdjacency");
RequireFFAdjacency(m);
if( m.fn == 0 ) return;
std::vector<PEdge> e;
@ -258,22 +258,22 @@ static void FaceFace(MeshType &m)
/// \brief Update the Vertex-Face topological relation.
/**
The function allows to retrieve for each vertex the list of faces sharing this vertex.
After this call all the VF component are initialized. Isolated vertices have a null list of faces.
\sa vcg::vertex::VFAdj
\sa vcg::face::VFAdj
*/
static void VertexFace(MeshType &m)
{
if(!HasVFAdjacency(m)) throw vcg::MissingComponentException("VFAdjacency");
RequireVFAdjacency(m);
VertexIterator vi;
FaceIterator fi;
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi)
{
(*vi).VFp() = 0;
(*vi).VFi() = 0;
(*vi).VFi() = 0; // note that (0,-1) means uninitiazlied while 0,0 is the valid initialized values for isolated vertices.
}
for(fi=m.face.begin();fi!=m.face.end();++fi)
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi)
if( ! (*fi).IsD() )
{
for(int j=0;j<(*fi).VN();++j)
@ -346,14 +346,14 @@ In other words F1->FFp(i) == F2 iff F1 and F2 have the same tex coords along edg
static void FaceFaceFromTexCoord(MeshType &m)
{
if(!HasPerWedgeTexCoord(m)) throw vcg::MissingComponentException("PerWedgeTexCoord");
if(!HasFFAdjacency(m)) throw vcg::MissingComponentException("FFAdjacency");
RequireFFAdjacency(m);
RequirePerFaceWedgeTexCoord(m);
std::vector<PEdgeTex> e;
FaceIterator pf;
typename std::vector<PEdgeTex>::iterator p;
FaceIterator pf;
typename std::vector<PEdgeTex>::iterator p;
if( m.fn == 0 ) return;
if( m.fn == 0 ) return;
// e.resize(m.fn*3); // Alloco il vettore ausiliario
FaceIterator fi;
@ -416,7 +416,7 @@ static void FaceFaceFromTexCoord(MeshType &m)
/// \brief Test correctness of VFtopology
static void TestVertexFace(MeshType &m)
{
SimpleTempData<typename MeshType::VertContainer, int > numVertex(m.vert,0);
SimpleTempData<typename MeshType::VertContainer, int > numVertex(m.vert,0);
assert(tri::HasPerVertexVFAdjacency(m));
@ -464,11 +464,11 @@ static void TestFaceFace(MeshType &m)
assert(HasFFAdjacency(m));
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi)
{
{
if (!fi->IsD())
{
{
for (int i=0;i<(*fi).VN();i++)
{
{
FaceType *ffpi=fi->FFp(i);
int e=fi->FFi(i);
//invariant property of FF topology for two manifold meshes
@ -485,7 +485,7 @@ static void TestFaceFace(MeshType &m)
assert( (ffv0i==v0i) || (ffv0i==v1i) );
assert( (ffv1i==v0i) || (ffv1i==v1i) );
}
}
}
}
@ -521,7 +521,7 @@ inline bool operator != ( const PVertexEdge & pe ) const { return ( v!=pe.v );
static void EdgeEdge(MeshType &m)
{
if(!HasEEAdjacency(m)) throw vcg::MissingComponentException("EEAdjacency");
RequireEEAdjacency(m);
std::vector<PVertexEdge> v;
if( m.en == 0 ) return;
@ -573,7 +573,7 @@ static void EdgeEdge(MeshType &m)
static void VertexEdge(MeshType &m)
{
if(!HasVEAdjacency(m)) throw vcg::MissingComponentException("VEAdjacency");
RequireVEAdjacency(m);
VertexIterator vi;
EdgeIterator ei;