- Timestamp:
- 06/09/06 08:24:19 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoTreeSimplifier.h
r774 r1007 6 6 #include "Hoja.h" 7 7 8 #define K1 0.8f //distancia 9 #define K2 0.2f // coplanar 8 #define K1 0.8f //distance factor 9 #define K2 0.2f //coplanar factor 10 11 class LeafOctree; 10 12 11 13 namespace Geometry … … 34 36 public: 35 37 /// Class constructor. Retrieves a pointer to a valid Mesh object to simplify 36 TreeSimplifier( const Geometry::Mesh *, 37 Geometry::TIPOFUNC upb=0); 38 TreeSimplifier(const Geometry::Mesh *, Geometry::TIPOFUNC upb=0); 38 39 39 40 /// Class destructor. 40 41 ~TreeSimplifier(void); 41 42 /// Copy constructor43 //TreeSimplifier(const TreeSimplifier&);44 45 /// Assignment operator46 //TreeSimplifier& operator =(const TreeSimplifier&);47 42 48 43 /// Starts the simplification process. Receives as a parameter the LOD factor in a range of [0,1]. … … 55 50 TreeSimplificationSequence *GetSimplificationSequence(); 56 51 57 //private: 58 void Centroh(Hoja &); 59 void GetNormal(Hoja &); 60 void DistanciaEntreHojas(void); 61 void CoplanarEntreHojas(FILE*); 62 float DiametroEsferaEnvolvente(); 63 void EstableceCriterio(float); 52 private: 53 void CalculateLeafCenter(Hoja &); 54 void CalculateLeafNormal(Hoja &); 55 float CalculateLeafArea(Hoja &) const; 56 void CoplanarBetweenLeaves(void); 57 float BoundingSphereDiameter() const; 58 // void SetCriteria(float); // to be erased: obsolete! 59 void SetCriteriaOptimized(float); 64 60 65 float max(float, float) ;66 float min(float, float) ;61 float max(float, float) const; 62 float min(float, float) const; 67 63 68 //long int Colapsa (TreeSimplificationSequence *, float); 69 long int Colapsa(float); 70 void DosMayores(float*, int* ); 71 void ElijeVertices(Hoja& , Hoja& , long int); 72 float Hausdorff(Hoja &, Hoja&); 73 float distan(float, float, float, float, float, float); 74 long int MinimaDistancia(void); 75 void NormalizaDistancia(float diametro); 76 void EstableceCriterio2(float, long int); 77 long int MinimoCriterio(void); 64 long int Collapse(float); 65 void TwoGreater(float*, int* ); 66 void ChooseVertices(Hoja& , Hoja& , long int); 67 float HausdorffOptimized(const Hoja &, const Hoja&) const; 68 float DistanceFromCenters(const Hoja &, const Hoja &) const; 69 float distan(float, float, float, float, float, float) const; 70 long int MinDistance(void); 71 void NormalizeDistance(float diametro); 72 // void SetCriteria2(float, long int); obsolete! 73 void SetCriteria2Optimized(float, long int); 74 long int MinCriteria(void); 78 75 79 void Mesh2 Estructura( const Geometry::Mesh *,80 Index);81 82 void EscribeMesh(int);76 void Mesh2Structure(const Geometry::Mesh *,Index); 77 void BuildOutputMesh(int); 78 void CrossProduct(const float *v1, const float *v2, float *res) const; 79 float SquaredModule(const float *v) const; 83 80 84 Mesh *mesh; // objeto mesh simplificado (para la salida)81 Mesh *mesh; // simplified mesh object (for output) 85 82 const Mesh *objmesh; 86 83 float (*Vertex)[3]; 87 Hoja * Hojasa; // las activas88 long int activ as, counth;84 Hoja *Leaves; 85 long int activeLeaves, countLeaves; 89 86 TreeSimplificationSequence *mtreesimpsequence; 90 87 91 private:92 88 // Update progress bar. 93 89 Geometry::TIPOFUNC mUPB; 90 91 // the octree used to speed up the simplification process 92 LeafOctree *octree; 93 void RecursiveCreateLeafOctree(LeafOctree*, int deep); // this is called from CreateLeafNode 94 void RecursiveFillOctreeWithLeaves(LeafOctree*); 95 LeafOctree* CreateLeafOctree(int deep); // generates a new leaf octree and returns its root node 96 int vertex_count; 97 LeafOctree ** octree_owning_leaf; 98 LeafOctree *GetMinOctreeNodeForLeaf(LeafOctree *start, const Hoja &leaf); 99 bool PruneOctree(LeafOctree *); // erases one octree level and translates its leaves to the parent. Returns true if the node itself was pruned 94 100 }; 95 101 }
Note: See TracChangeset
for help on using the changeset viewer.