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
|
||||
}
|
||||
|
||||
// --- 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()
|
||||
{
|
||||
assert(has_vertex_status());//this function requires vertex status property
|
||||
|
||||
@@ -112,27 +112,13 @@ public:
|
||||
void assign_connectivity(const ArrayKernel& _other);
|
||||
|
||||
// --- handle -> item ---
|
||||
VertexHandle handle(const Vertex& _v) const
|
||||
{return VertexHandle(&_v - &vertices_.front()); }
|
||||
VertexHandle handle(const Vertex& _v) 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));
|
||||
}
|
||||
HalfedgeHandle handle(const Halfedge& _he) const;
|
||||
|
||||
EdgeHandle handle(const Edge& _e) const
|
||||
{ return EdgeHandle(&_e - &edges_.front()); }
|
||||
EdgeHandle handle(const Edge& _e) const;
|
||||
|
||||
FaceHandle handle(const Face& _f) const
|
||||
{ return FaceHandle(&_f - &faces_.front()); }
|
||||
FaceHandle handle(const Face& _f) const;
|
||||
|
||||
#define SIGNED(x) signed( (x) )
|
||||
//checks handle validity - useful for debugging
|
||||
|
||||
Reference in New Issue
Block a user