1 | #ifndef __simplify_h_ |
---|
2 | #define __simplify_h_ |
---|
3 | |
---|
4 | #include "GL/glut.h" |
---|
5 | |
---|
6 | #include "change.h" |
---|
7 | #include "bheap.h" |
---|
8 | |
---|
9 | #include <map> |
---|
10 | |
---|
11 | using namespace std; |
---|
12 | |
---|
13 | namespace VMI |
---|
14 | { |
---|
15 | extern GLdouble computeEdgeCost(Mesh *mesh, int e); |
---|
16 | |
---|
17 | extern bheap_t *initHeap(Mesh *mesh); |
---|
18 | |
---|
19 | extern bheap_t *updateHeap(bheap_t *h, Mesh *mesh, Change *c); |
---|
20 | |
---|
21 | extern void simplifyModel(Mesh *mesh, int numDemandedTri); |
---|
22 | |
---|
23 | |
---|
24 | extern void bh_mydump(Mesh *mesh, bheap_t *h); |
---|
25 | |
---|
26 | extern void chooseBestEndPoints(Mesh *mesh, int e); |
---|
27 | |
---|
28 | extern void initVertexMultimap( Mesh *mesh, |
---|
29 | multimap<int,int> &vertexMultimap); |
---|
30 | ///////////////////////////////////////////////////////////////////////// |
---|
31 | // Coordinates class. |
---|
32 | ///////////////////////////////////////////////////////////////////////// |
---|
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; |
---|
79 | } |
---|
80 | |
---|
81 | #endif |
---|