[983] | 1 | #ifndef __simplify_h_ |
---|
| 2 | #define __simplify_h_ |
---|
| 3 | |
---|
| 4 | #include "GL/glut.h" |
---|
| 5 | |
---|
| 6 | #include "change.h" |
---|
| 7 | #include "bheap.h" |
---|
| 8 | |
---|
[2090] | 9 | #include <map> |
---|
| 10 | |
---|
| 11 | using namespace std; |
---|
| 12 | |
---|
[1007] | 13 | namespace VMI |
---|
[983] | 14 | { |
---|
[2090] | 15 | extern GLdouble computeEdgeCost(Mesh *mesh, int e); |
---|
[983] | 16 | |
---|
[2090] | 17 | extern bheap_t *initHeap(Mesh *mesh); |
---|
[983] | 18 | |
---|
[2090] | 19 | extern bheap_t *updateHeap(bheap_t *h, Mesh *mesh, Change *c); |
---|
[983] | 20 | |
---|
[2127] | 21 | extern void simplifyModel(Mesh *mesh, int numDemandedTri); |
---|
[983] | 22 | |
---|
| 23 | |
---|
[2090] | 24 | extern void bh_mydump(Mesh *mesh, bheap_t *h); |
---|
[983] | 25 | |
---|
[2090] | 26 | extern void chooseBestEndPoints(Mesh *mesh, int e); |
---|
[983] | 27 | |
---|
[2090] | 28 | extern void initVertexMultimap( Mesh *mesh, |
---|
| 29 | multimap<int,int> &vertexMultimap); |
---|
[2194] | 30 | ///////////////////////////////////////////////////////////////////////// |
---|
[2090] | 31 | // Coordinates class. |
---|
[2194] | 32 | ///////////////////////////////////////////////////////////////////////// |
---|
[2090] | 33 | class _float3_ |
---|
| 34 | { |
---|
| 35 | public: |
---|
| 36 | |
---|
| 37 | float x,y,z; |
---|
| 38 | |
---|
| 39 | _float3_(float x=0.0f, float y=0.0f, float z=0.0f) |
---|
| 40 | { |
---|
| 41 | this->x = x; this->y = y; this->z = z; |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | _float3_(const _float3_ &f) |
---|
| 45 | { |
---|
| 46 | x=f.x; y=f.y; z=f.z; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | _float3_ & operator=(const _float3_ &f) |
---|
| 50 | { |
---|
| 51 | x=f.x; y=f.y; z=f.z; return *this; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | bool operator<(const _float3_ &f) const |
---|
| 55 | { |
---|
| 56 | if (x<f.x) return true; |
---|
| 57 | if (x>f.x) return false; |
---|
| 58 | if (y<f.y) return true; |
---|
| 59 | if (y>f.y) return false; |
---|
| 60 | if (z<f.z) return true; |
---|
| 61 | if (z>f.z) return false; |
---|
| 62 | return false; |
---|
| 63 | } |
---|
| 64 | }; |
---|
| 65 | |
---|
| 66 | extern int extractValidEdge(Mesh *mesh, bheap_t *h); |
---|
| 67 | |
---|
| 68 | extern int isValidEdge(Mesh *mesh, int edge); |
---|
| 69 | |
---|
| 70 | void deleteVertexOfMap(Mesh *mesh, int u); |
---|
| 71 | bool compareVertices(Vertex *vertices,int u, int v); |
---|
| 72 | void contractInitialMesh(Mesh *mesh); |
---|
| 73 | void contractTwinVertices(Mesh *mesh, int u, int v); |
---|
| 74 | |
---|
| 75 | // Vectors of positions, normals and texture coordinates. |
---|
| 76 | extern vector<Geometry::Vector3> vPositions; |
---|
| 77 | extern vector<Geometry::Vector3> vNormals; |
---|
| 78 | extern vector<Geometry::Vector2> vTexCoords; |
---|
[983] | 79 | } |
---|
| 80 | |
---|
| 81 | #endif |
---|