source: GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/vmi/include/simplify.h @ 2090

Revision 2090, 1.9 KB checked in by gumbau, 17 years ago (diff)
Line 
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
11using   namespace       std;
12
13namespace       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, GLuint numDemandedTri);
22
23
24        extern void bh_mydump(Mesh *mesh, bheap_t *h);
25        extern GLdouble computeEdgeLength(Vertex *vertices, int u, int v);
26
27        extern void chooseBestEndPoints(Mesh *mesh, int e);
28
29        extern void     initVertexMultimap(     Mesh *mesh,
30                                                                                                                                        multimap<int,int> &vertexMultimap);
31        /////////////////////////////////////////////////////////////////////////////
32        //      Coordinates class.
33        /////////////////////////////////////////////////////////////////////////////
34        class _float3_
35        {
36                public:
37
38                        float x,y,z;
39
40                        _float3_(float x=0.0f, float y=0.0f, float z=0.0f)
41                        {
42                                this->x = x; this->y = y; this->z = z;
43                        }
44
45                        _float3_(const _float3_ &f)
46                        {
47                                x=f.x; y=f.y; z=f.z;
48                        }
49
50                        _float3_ & operator=(const _float3_ &f)
51                        {
52                                x=f.x; y=f.y; z=f.z; return *this;
53                        }
54
55                        bool operator<(const _float3_ &f) const
56                        {
57                                if (x<f.x) return true;
58                                if (x>f.x) return false;
59                                if (y<f.y) return true;
60                                if (y>f.y) return false;
61                                if (z<f.z) return true;
62                                if (z>f.z) return false;
63                                return false;
64                        }
65        };
66
67        extern int extractValidEdge(Mesh *mesh, bheap_t *h);
68
69        extern int      isValidEdge(Mesh        *mesh,  int edge);
70
71        void    deleteVertexOfMap(Mesh  *mesh, int u);
72        bool    compareVertices(Vertex *vertices,int    u,      int v);
73        void    contractInitialMesh(Mesh        *mesh);
74        void    contractTwinVertices(Mesh       *mesh,  int     u,      int     v);
75
76        //      Vectors of positions, normals and texture coordinates.
77        extern  vector<Geometry::Vector3>       vPositions;
78        extern  vector<Geometry::Vector3>       vNormals;
79        extern  vector<Geometry::Vector2>       vTexCoords;
80}
81
82#endif
Note: See TracBrowser for help on using the repository browser.