- Timestamp:
- 06/09/06 08:24:19 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/SimplificationMethod.h
r981 r1007 22 22 int initialFaceCount; 23 23 24 inline qslim::vert_info& vertex_info(qslim::Vertex *v){ return vinfo(v->validID()); } 25 qslim::real pair_mesh_penalty(qslim::Model& M, qslim::Vertex *v1, qslim::Vertex *v2, qslim::Vec3& vnew); 26 int predict_face(qslim::Face& F, qslim::Vertex *v1, qslim::Vertex *v2, qslim::Vec3& vnew, qslim::Vec3& f1, qslim::Vec3& f2, qslim::Vec3& f3); 24 inline qslim::vert_info& vertex_info(qslim::Vertex *v) 25 { 26 return vinfo(v->validID()); 27 } 28 29 qslim::real pair_mesh_penalty(qslim::Model& M, 30 qslim::Vertex *v1, 31 qslim::Vertex *v2, 32 qslim::Vec3& vnew); 33 34 int predict_face(qslim::Face& F, 35 qslim::Vertex *v1, 36 qslim::Vertex *v2, 37 qslim::Vec3& vnew, 38 qslim::Vec3& f1, 39 qslim::Vec3& f2, 40 qslim::Vec3& f3); 41 27 42 bool check_for_pair(qslim::Vertex *v0, qslim::Vertex *v1); 43 28 44 qslim::pair_info *new_pair(qslim::Vertex *v0, qslim::Vertex *v1); 45 29 46 void delete_pair(qslim::pair_info *pair); 47 30 48 void do_contract(qslim::Model& m, qslim::pair_info *pair); 49 31 50 bool decimate_quadric(qslim::Vertex *v, qslim::Mat4& Q); 51 32 52 void decimate_contract(qslim::Model& m); 53 33 54 qslim::real decimate_error(qslim::Vertex *v); 55 34 56 qslim::real decimate_min_error(); 57 35 58 qslim::real decimate_max_error(qslim::Model& m); 59 36 60 void decimate_init(qslim::Model& m, qslim::real limit); 61 37 62 bool pair_is_valid(qslim::Vertex *u, qslim::Vertex *v); 63 38 64 void simplifmethod_run(int, Geometry::TIPOFUNC upb=0); 65 39 66 void simplifmethod_runv(int, Geometry::TIPOFUNC upb=0); 67 40 68 void simplifmethod_init(void); 41 69 42 //To map the mesh with de simplification method structure 43 std::map<int,std::vector<int> > submeshmap; //submeshes which pertains each vertex 44 std::map<int,std::vector<int> > vertexbuffermap; //vertices of the VertexBuffer that point at this vertex of the simplification method 70 // To map the mesh with de simplification method structure. 71 // Submeshes which pertains each vertex. 72 std::map<int,std::vector<int> > submeshmap; 73 74 // Vertices of the VertexBuffer that point 75 // at this vertex of the simplification method. 76 std::map<int,std::vector<int> > vertexbuffermap; 45 77 46 // simplification sequence of the simplification method78 // Simplification sequence of the simplification method. 47 79 std::vector<Geometry::MeshSimplificationSequence::Step> decim_data; 80 48 81 std::string meshName; 82 49 83 void WriteOBJ(void); 84 50 85 unsigned int *first_index_submesh; 86 51 87 //std::vector<qslim::pair_info *> pointers_to_remove; 52 88 53 89 int indexMeshLeaves; 90 54 91 public: 92 55 93 const Geometry::Mesh *objmesh; 56 int number_of_triangles; //total number of triangles of all the submeshes 94 95 // Total number of triangles of all the submeshes. 96 int number_of_triangles; 97 57 98 SimplificationMethod(const Geometry::Mesh *m); 99 58 100 void geomesh2simplifModel(void); 59 Geometry::MeshSimplificationSequence *Decimate(float lod, int simpliftype,Geometry::TIPOFUNC upb=0); 101 102 Geometry::MeshSimplificationSequence *Decimate( float lod, 103 int simpliftype, 104 Geometry::TIPOFUNC upb=0); 105 60 106 void setMeshLeaves(int meshLeaves); 61 107 62 // Gets mesh simplified.108 /// Gets mesh simplified. 63 109 Geometry::Mesh * GetMesh(); 64 110 … … 66 112 ~SimplificationMethod(); 67 113 }; 114
Note: See TracChangeset
for help on using the changeset viewer.