Ignore:
Timestamp:
06/09/06 08:24:19 (18 years ago)
Author:
gumbau
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoTreeSimplifier.h

    r774 r1007  
    66#include "Hoja.h" 
    77 
    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 
     11class LeafOctree; 
    1012 
    1113namespace Geometry 
     
    3436        public: 
    3537                /// 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); 
    3839 
    3940                /// Class destructor. 
    4041                ~TreeSimplifier(void); 
    41  
    42                 /// Copy constructor 
    43                 //TreeSimplifier(const TreeSimplifier&); 
    44  
    45                 /// Assignment operator 
    46                 //TreeSimplifier& operator =(const TreeSimplifier&); 
    4742 
    4843                /// Starts the simplification process. Receives as a parameter the LOD factor in a range of [0,1]. 
     
    5550                TreeSimplificationSequence *GetSimplificationSequence(); 
    5651 
    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); 
    6460 
    65                 float max(float, float); 
    66                 float min(float, float); 
     61                float max(float, float) const; 
     62                float min(float, float) const; 
    6763 
    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); 
    7875 
    79                 void Mesh2Estructura(   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; 
    8380 
    84                 Mesh                    *mesh; // objeto mesh simplificado (para la salida) 
     81                Mesh                    *mesh; // simplified mesh object (for output) 
    8582                const                   Mesh *objmesh; 
    8683                float                   (*Vertex)[3]; 
    87                 Hoja                    *Hojasa;  // las activas 
    88                 long int        activas, counth; 
     84                Hoja                    *Leaves; 
     85                long int        activeLeaves, countLeaves; 
    8986                TreeSimplificationSequence      *mtreesimpsequence; 
    9087                 
    91         private: 
    9288                //      Update progress bar. 
    9389                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 
    94100        }; 
    95101} 
Note: See TracChangeset for help on using the changeset viewer.