Ignore:
Timestamp:
07/05/06 17:15:14 (19 years ago)
Author:
gumbau
Message:

Extended Mesh implementation

Location:
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/foliage.cpp

    r1058 r1078  
    1010// Parameters --> None 
    1111//-------------------------------------------------------------------------------------------------------------------------------- 
    12 Foliage::Foliage(const Geometry::SubMesh *leavesSubMesh, const char *simpSeq, Geometry::CREATEVERTEXDATAFUNC vdfun, Geometry::CREATEINDEXDATAFUNC idfun):  
     12Foliage::Foliage(const Geometry::SubMesh *leavesSubMesh, const Geometry::TreeSimplificationSequence & simpSeq, Geometry::CREATEVERTEXDATAFUNC vdfun, Geometry::CREATEINDEXDATAFUNC idfun):  
    1313Acth(NULL), 
    1414create_vertex_data_func(vdfun==NULL?Geometry::DefaultVertexDataCreator:vdfun), 
     
    304304 
    305305/// returns the number of total leafs 
    306 bool Foliage::ReadSimpSeq(const char *simpSeqFile) 
    307 { 
    308         FILE* fp_simpli; 
     306bool Foliage::ReadSimpSeq(const Geometry::TreeSimplificationSequence & simpSeq) 
     307{ 
     308        int tn, tv1,tv2, e=0; 
     309 
     310        tn = leafCount; 
     311        for (std::vector<Geometry::TreeSimplificationSequence::Step>::const_iterator it = simpSeq.mSteps.begin(); it != simpSeq.mSteps.end(); it++) 
     312        { 
     313                Leaves[tn].vertsLeaf[0] = it->mNewQuad[0]; 
     314                Leaves[tn].vertsLeaf[1] = it->mNewQuad[1]; 
     315                Leaves[tn].vertsLeaf[2] = it->mNewQuad[2]; 
     316                Leaves[tn].vertsLeaf[3] = it->mNewQuad[3]; 
     317 
     318                Leaves[tn].visible = 0; 
     319 
     320                GetNormalH  (Leaves[tn]); 
     321 
     322                tv1 = it->mV0/2; 
     323                tv2 = it->mT0/2; 
     324 
     325                Leaves[tn].childLeft= tv1; 
     326                Leaves[tn].childRight= tv2; 
     327 
     328                Leaves[tv1].parent = tn; 
     329                Leaves[tv2].parent = tn;                 
     330 
     331                tn++; 
     332        } 
     333 
     334/*      FILE* fp_simpli; 
    309335        char linea[256]; 
    310336        int v0, v1, v2, v3, tn, tv1,tv2, e=0; 
     
    350376        } 
    351377 
    352         fclose(fp_simpli); 
     378        fclose(fp_simpli);*/ 
    353379 
    354380        leafTotal=tn; 
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/foliage.h

    r1058 r1078  
    66#include "VertexData.h" 
    77#include "Leaf.h" 
     8#include "GeoTreeSimpSequence.h" 
    89 
    910class ActiveLeafNode 
     
    2627                int active_leaf_count; 
    2728 
    28                 Foliage (const Geometry::SubMesh *, const char *simpSeq, Geometry::CREATEVERTEXDATAFUNC vdfun=NULL, Geometry::CREATEINDEXDATAFUNC idfun=NULL); 
     29                Foliage (const Geometry::SubMesh *, const Geometry::TreeSimplificationSequence &, Geometry::CREATEVERTEXDATAFUNC vdfun=NULL, Geometry::CREATEINDEXDATAFUNC idfun=NULL); 
    2930                Foliage (const Foliage *); 
    3031                virtual ~Foliage (void); // Destructor 
     
    5657                void ReadLeafs(const Geometry::SubMesh *); 
    5758                void ReadVertices(const Geometry::SubMesh *); 
    58                 bool ReadSimpSeq(const char*); /// returns true when successful 
     59                bool ReadSimpSeq(const Geometry::TreeSimplificationSequence &); /// returns true when successful 
    5960                void FillRoot(void); 
    6061 
Note: See TracChangeset for help on using the changeset viewer.