assert -> throw exception

This commit is contained in:
Paolo Cignoni 2012-11-08 18:37:10 +00:00
parent 3170472174
commit e1fb5617ff
1 changed files with 10 additions and 4 deletions

View File

@ -162,7 +162,7 @@ wrapping function.
VertexPointer farthest=0,pw,pw1; VertexPointer farthest=0,pw,pw1;
//Requirements //Requirements
assert(HasPerVertexVFAdjacency(m) && HasPerFaceVFAdjacency(m)); if(!HasVFAdjacency(m)) throw vcg::MissingComponentException("VFAdjacency");
assert(!seedVec.empty()); assert(!seedVec.empty());
TempDataType TD(m.vert, std::numeric_limits<ScalarType>::max()); TempDataType TD(m.vert, std::numeric_limits<ScalarType>::max());
@ -288,6 +288,10 @@ To allocate the attributes:
typename MeshType::template PerVertexAttributeHandle<VertexPointer> parentHandle; typename MeshType::template PerVertexAttributeHandle<VertexPointer> parentHandle;
parentHandle = tri::Allocator<CMeshO>::AddPerVertexAttribute<MeshType::VertexPointer> (m,"parent"); parentHandle = tri::Allocator<CMeshO>::AddPerVertexAttribute<MeshType::VertexPointer> (m,"parent");
\endcode \endcode
It requires VF adjacency relation (e.g. vertex::VFAdj and face::VFAdj components)
\warning that this function has ALWAYS at least a linear cost (it use additional attributes that have a linear initialization) \warning that this function has ALWAYS at least a linear cost (it use additional attributes that have a linear initialization)
\todo make it O(output) by using incremental mark and persistent attributes. \todo make it O(output) by using incremental mark and persistent attributes.
*/ */
@ -309,8 +313,10 @@ To allocate the attributes:
return true; return true;
} }
/* /* \brief Assigns to each vertex of the mesh its distance to the closest vertex on the boundary
Assigns to each vertex of the mesh its distance to the closest vertex on the border
It is just a simple wrapper of the basic Compute()
Note: update the field Q() of the vertices Note: update the field Q() of the vertices
Note: it needs the border bit set. Note: it needs the border bit set.
*/ */