Changeset 1078 for GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves
- Timestamp:
- 07/05/06 17:15:14 (19 years ago)
- 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 10 10 // Parameters --> None 11 11 //-------------------------------------------------------------------------------------------------------------------------------- 12 Foliage::Foliage(const Geometry::SubMesh *leavesSubMesh, const char *simpSeq, Geometry::CREATEVERTEXDATAFUNC vdfun, Geometry::CREATEINDEXDATAFUNC idfun):12 Foliage::Foliage(const Geometry::SubMesh *leavesSubMesh, const Geometry::TreeSimplificationSequence & simpSeq, Geometry::CREATEVERTEXDATAFUNC vdfun, Geometry::CREATEINDEXDATAFUNC idfun): 13 13 Acth(NULL), 14 14 create_vertex_data_func(vdfun==NULL?Geometry::DefaultVertexDataCreator:vdfun), … … 304 304 305 305 /// returns the number of total leafs 306 bool Foliage::ReadSimpSeq(const char *simpSeqFile) 307 { 308 FILE* fp_simpli; 306 bool 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; 309 335 char linea[256]; 310 336 int v0, v1, v2, v3, tn, tv1,tv2, e=0; … … 350 376 } 351 377 352 fclose(fp_simpli); 378 fclose(fp_simpli);*/ 353 379 354 380 leafTotal=tn; -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/foliage.h
r1058 r1078 6 6 #include "VertexData.h" 7 7 #include "Leaf.h" 8 #include "GeoTreeSimpSequence.h" 8 9 9 10 class ActiveLeafNode … … 26 27 int active_leaf_count; 27 28 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); 29 30 Foliage (const Foliage *); 30 31 virtual ~Foliage (void); // Destructor … … 56 57 void ReadLeafs(const Geometry::SubMesh *); 57 58 void ReadVertices(const Geometry::SubMesh *); 58 bool ReadSimpSeq(const char*); /// returns true when successful59 bool ReadSimpSeq(const Geometry::TreeSimplificationSequence &); /// returns true when successful 59 60 void FillRoot(void); 60 61
Note: See TracChangeset
for help on using the changeset viewer.