#ifndef __simplify_h_ #define __simplify_h_ #include "GL/glut.h" #include "change.h" #include "bheap.h" #include using namespace std; namespace VMI { extern GLdouble computeEdgeCost(Mesh *mesh, int e); extern bheap_t *initHeap(Mesh *mesh); extern bheap_t *updateHeap(bheap_t *h, Mesh *mesh, Change *c); extern void simplifyModel(Mesh *mesh, int numDemandedTri); extern void bh_mydump(Mesh *mesh, bheap_t *h); extern void chooseBestEndPoints(Mesh *mesh, int e); extern void initVertexMultimap( Mesh *mesh, multimap &vertexMultimap); ///////////////////////////////////////////////////////////////////////// // Coordinates class. ///////////////////////////////////////////////////////////////////////// class _float3_ { public: float x,y,z; _float3_(float x=0.0f, float y=0.0f, float z=0.0f) { this->x = x; this->y = y; this->z = z; } _float3_(const _float3_ &f) { x=f.x; y=f.y; z=f.z; } _float3_ & operator=(const _float3_ &f) { x=f.x; y=f.y; z=f.z; return *this; } bool operator<(const _float3_ &f) const { if (xf.x) return false; if (yf.y) return false; if (zf.z) return false; return false; } }; extern int extractValidEdge(Mesh *mesh, bheap_t *h); extern int isValidEdge(Mesh *mesh, int edge); void deleteVertexOfMap(Mesh *mesh, int u); bool compareVertices(Vertex *vertices,int u, int v); void contractInitialMesh(Mesh *mesh); void contractTwinVertices(Mesh *mesh, int u, int v); // Vectors of positions, normals and texture coordinates. extern vector vPositions; extern vector vNormals; extern vector vTexCoords; } #endif