Added VVStarVE and VEStarVE functions (to get stars of vertexes and edges when working with edge meshes) to edge topology.

This commit is contained in:
Paolo Cignoni 2012-04-27 09:23:01 +00:00
parent 761172501b
commit e532ec9751
2 changed files with 30 additions and 1 deletions

View File

@ -35,11 +35,16 @@ created
#ifndef __VCG_EDGE_POS
#define __VCG_EDGE_POS
#include <vcg/simplex/edge/topology.h>
namespace vcg {
namespace edge {
// Needed Prototypes (pos is include before topology)
template <class EDGETYPE>
bool IsEdgeBorder(EDGETYPE const & e, const int j );
template <class EDGETYPE>
bool IsEdgeManifold(EDGETYPE const & e, const int j );
/*
Vertex_Edge: run over the fan of a vertex (no order is specified)
*/

View File

@ -56,6 +56,30 @@ inline bool IsEdgeBorder(EdgeType const & e, const int j )
return true;
}
template <class EdgeType>
void VVStarVE(typename EdgeType::VertexType* vp, std::vector<typename EdgeType::VertexType *> &starVec)
{
typedef typename EdgeType::VertexType* VertexPointer;
starVec.clear();
edge::VEIterator<EdgeType> vei(vp);
while(!vei.End())
{
starVec.push_back(vei.V1());
++vei;
}
}
template <class EdgeType>
void VEStarVE(typename EdgeType::VertexType* vp, std::vector<EdgeType *> &starVec)
{
starVec.clear();
edge::VEIterator<EdgeType> vei(vp);
while(!vei.End())
{
starVec.push_back(vei.E());
++vei;
}
}
} // end namespace edge
} // end namespace vcg