Moved some code from header to cc file
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@846 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -94,6 +94,35 @@ void ArrayKernel::assign_connectivity(const ArrayKernel& _other)
|
|||||||
#undef COPY_STATUS_PROPERTY
|
#undef COPY_STATUS_PROPERTY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- handle -> item ---
|
||||||
|
VertexHandle ArrayKernel::handle(const Vertex& _v) const
|
||||||
|
{
|
||||||
|
return VertexHandle(&_v - &vertices_.front());
|
||||||
|
}
|
||||||
|
|
||||||
|
HalfedgeHandle ArrayKernel::handle(const Halfedge& _he) const
|
||||||
|
{
|
||||||
|
// Calculate edge belonging to given halfedge
|
||||||
|
// There are two halfedges stored per edge
|
||||||
|
// Get memory position inside edge vector and devide by size of an edge
|
||||||
|
// to get the corresponding edge for the requested halfedge
|
||||||
|
unsigned int eh = ( (char*)&_he - (char*)&edges_.front() ) / sizeof(Edge) ;
|
||||||
|
assert((&_he == &edges_[eh].halfedges_[0]) ||
|
||||||
|
(&_he == &edges_[eh].halfedges_[1]));
|
||||||
|
return ((&_he == &edges_[eh].halfedges_[0]) ?
|
||||||
|
HalfedgeHandle(eh<<1) : HalfedgeHandle((eh<<1)+1));
|
||||||
|
}
|
||||||
|
|
||||||
|
EdgeHandle ArrayKernel::handle(const Edge& _e) const
|
||||||
|
{
|
||||||
|
return EdgeHandle(&_e - &edges_.front());
|
||||||
|
}
|
||||||
|
|
||||||
|
FaceHandle ArrayKernel::handle(const Face& _f) const
|
||||||
|
{
|
||||||
|
return FaceHandle(&_f - &faces_.front());
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int ArrayKernel::delete_isolated_vertices()
|
unsigned int ArrayKernel::delete_isolated_vertices()
|
||||||
{
|
{
|
||||||
assert(has_vertex_status());//this function requires vertex status property
|
assert(has_vertex_status());//this function requires vertex status property
|
||||||
|
|||||||
@@ -109,30 +109,16 @@ public:
|
|||||||
copies only the connectivity, i.e. vertices, edges, faces and their status fields.
|
copies only the connectivity, i.e. vertices, edges, faces and their status fields.
|
||||||
NOTE: The geometry (the points property) is NOT copied. Poly/TriConnectivity
|
NOTE: The geometry (the points property) is NOT copied. Poly/TriConnectivity
|
||||||
override(and hide) that function to provide connectivity consistence.*/
|
override(and hide) that function to provide connectivity consistence.*/
|
||||||
void assign_connectivity(const ArrayKernel& _other);
|
void assign_connectivity(const ArrayKernel& _other);
|
||||||
|
|
||||||
// --- handle -> item ---
|
// --- handle -> item ---
|
||||||
VertexHandle handle(const Vertex& _v) const
|
VertexHandle handle(const Vertex& _v) const;
|
||||||
{return VertexHandle(&_v - &vertices_.front()); }
|
|
||||||
|
|
||||||
HalfedgeHandle handle(const Halfedge& _he) const
|
HalfedgeHandle handle(const Halfedge& _he) const;
|
||||||
{
|
|
||||||
// Calculate edge belonging to given halfedge
|
|
||||||
// There are two halfedges stored per edge
|
|
||||||
// Get memory position inside edge vector and devide by size of an edge
|
|
||||||
// to get the corresponding edge for the requested halfedge
|
|
||||||
unsigned int eh = ( (char*)&_he - (char*)&edges_.front() ) / sizeof(Edge) ;
|
|
||||||
assert((&_he == &edges_[eh].halfedges_[0]) ||
|
|
||||||
(&_he == &edges_[eh].halfedges_[1]));
|
|
||||||
return ((&_he == &edges_[eh].halfedges_[0]) ?
|
|
||||||
HalfedgeHandle(eh<<1) : HalfedgeHandle((eh<<1)+1));
|
|
||||||
}
|
|
||||||
|
|
||||||
EdgeHandle handle(const Edge& _e) const
|
EdgeHandle handle(const Edge& _e) const;
|
||||||
{ return EdgeHandle(&_e - &edges_.front()); }
|
|
||||||
|
|
||||||
FaceHandle handle(const Face& _f) const
|
FaceHandle handle(const Face& _f) const;
|
||||||
{ return FaceHandle(&_f - &faces_.front()); }
|
|
||||||
|
|
||||||
#define SIGNED(x) signed( (x) )
|
#define SIGNED(x) signed( (x) )
|
||||||
//checks handle validity - useful for debugging
|
//checks handle validity - useful for debugging
|
||||||
|
|||||||
Reference in New Issue
Block a user