added BasicVertexPair templated class to store as less as possible of an edge...

This commit is contained in:
Paolo Cignoni 2011-06-05 23:37:43 +00:00
parent a7e4270ddb
commit 23d9ad9684
1 changed files with 13 additions and 0 deletions

View File

@ -31,6 +31,19 @@
namespace vcg{
namespace tri{
template < class VERTEX_TYPE>
class BasicVertexPair {
public:
inline BasicVertexPair() {};
inline BasicVertexPair( VERTEX_TYPE * v0, VERTEX_TYPE * v1){V(0) = v0; V(1) = v1; };
void Sort() {if(V(0)<V(0)) std::swap(V(0),V(0)); }
VERTEX_TYPE *&V(int i) { return v[i]; }
VERTEX_TYPE *cV(int i) const { return v[i]; }
private:
VERTEX_TYPE *v[2];
};
/** \addtogroup trimesh */
/*@{*/
/** This a static utility class for the edge collapse.