Changeset 1083 for GTP/trunk/Lib/Geom/shared/GTGeometry
- Timestamp:
- 07/05/06 20:18:06 (19 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GTGeometry
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/GTGeometry.vcproj
r1071 r1083 130 130 </File> 131 131 <File 132 RelativePath=".\src\GeoMeshLoader.cpp"> 133 </File> 134 <File 135 RelativePath=".\src\GeoMeshSaver.cpp"> 136 </File> 137 <File 132 138 RelativePath=".\src\GeoMeshSimplifier.cpp"> 133 139 </File> … … 370 376 <File 371 377 RelativePath=".\include\GeoMesh.h"> 378 </File> 379 <File 380 RelativePath=".\include\GeoMeshLoader.h"> 381 </File> 382 <File 383 RelativePath=".\include\GeoMeshSaver.h"> 372 384 </File> 373 385 <File -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodStripsLibrary.h
r1078 r1083 133 133 134 134 // Loads Mesh. 135 void LoadStripMesh(const LodStripsLibraryData &, Mesh *geomesh);135 void LoadStripMesh(const LodStripsLibraryData *, Mesh *geomesh); 136 136 137 137 Geometry::CREATEINDEXDATAFUNC create_index_data_func; … … 139 139 // Strips vector. 140 140 SmallIntVector *mStrips; 141 int *indices_x_submesh; 142 int *offsets_x_submesh; 141 143 142 144 void UpdateDataRetrievalInterface(void); … … 149 151 * including the multiresolution object. 150 152 */ 151 LodStripsLibrary(const LodStripsLibraryData &, Mesh *geomesh, CREATEINDEXDATAFUNC idfun=NULL);153 LodStripsLibrary(const LodStripsLibraryData *, Mesh *geomesh, CREATEINDEXDATAFUNC idfun=NULL); 152 154 153 155 /// Destructor. … … 173 175 uint32 MinVertices(); 174 176 175 int *indices_x_submesh; 177 uint32 GetValidIndexCount(int submeshid) const { return indices_x_submesh[submeshid]; } 178 uint32 GetValidOffset(int submeshid) const { return offsets_x_submesh[submeshid]; } 176 179 }; 177 180 } -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodTreeLibrary.h
r1078 r1083 22 22 /* LodTreeLibrary( const LodTreeLibrary &); 23 23 LodTreeLibrary(LodTreeLibrary*);*/ 24 LodTreeLibrary( const LodStripsLibraryData &,25 const TreeSimplificationSequence &,24 LodTreeLibrary( const LodStripsLibraryData *, 25 const TreeSimplificationSequence *, 26 26 Geometry::Mesh *treeGeoMesh, 27 27 uint32 leafSubMeshID … … 57 57 /* const VertexData* Get_Trunk_VertexData(void) const;*/ 58 58 const IndexData* CurrentLOD_Trunk_Indices(void) const; 59 uint32 GetValidTrunkIndexCount(int isubmesh) const { return trunk->GetValidIndexCount(isubmesh); } 60 uint32 GetValidTrunkOffset(int isubmesh) const { return trunk->GetValidOffset(isubmesh); } 59 61 60 62 // uint32 Get_Foliage_VertexCount(void) const; … … 64 66 const VertexData* Get_Foliage_VertexData(void) const; 65 67 66 // Geometry::IndexData *trunk_all_indices;67 // unsigned int *indices_offsets;68 69 // const Geometry::SmallIntVector & GetStrip(uint32 istrip) const { return trunk->mStrips[istrip]; }70 Geometry::LodStripsLibrary *trunk;71 72 68 private: 73 69 Foliage *foliage; 74 70 Geometry::LodStripsLibrary *trunk; 75 71 }; 76 72 } -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp
r1078 r1083 17 17 // Constructors. 18 18 //----------------------------------------------------------------------------- 19 LodStripsLibrary::LodStripsLibrary(const LodStripsLibraryData &lodstripsdata, Mesh *geomesh, CREATEINDEXDATAFUNC idfun)19 LodStripsLibrary::LodStripsLibrary(const LodStripsLibraryData *lodstripsdata, Mesh *geomesh, CREATEINDEXDATAFUNC idfun) 20 20 :create_index_data_func(idfun?idfun:DefaultIndexDataCreator) 21 21 { … … 33 33 dataRetrievalInterface=NULL; 34 34 indices_x_submesh = NULL; 35 offsets_x_submesh = NULL; 35 36 36 37 // Loads the Level Of Detail file. … … 58 59 if (indices_x_submesh) 59 60 delete[] indices_x_submesh; 61 if (offsets_x_submesh) 62 delete[] offsets_x_submesh; 60 63 } 61 64 … … 430 433 // LoadStripMesh 431 434 //----------------------------------------------------------------------------- 432 void LodStripsLibrary::LoadStripMesh(const LodStripsLibraryData &lodstripsdata, Mesh *geomesh)435 void LodStripsLibrary::LoadStripMesh(const LodStripsLibraryData *lodstripsdata, Mesh *geomesh) 433 436 { 434 437 FILE *fp; … … 451 454 // For each one of the submeshes. 452 455 indices_x_submesh = new int[geomesh->mSubMeshCount]; 456 offsets_x_submesh = new int[geomesh->mSubMeshCount]; 453 457 for (unsigned int submesh = 0; submesh < geomesh->mSubMeshCount; submesh++) 454 458 { … … 492 496 i = 0; 493 497 indices_x_submesh[submesh] = 0; 498 if (submesh==0) 499 offsets_x_submesh[submesh] = 0; 500 else 501 offsets_x_submesh[submesh] = indices_x_submesh[submesh-1]; 502 494 503 // For each index of the strip. 495 504 for (index = indexBegin; index < indexEnd; index++) … … 498 507 indices_x_submesh[submesh]++; 499 508 i++; 500 } 509 } 501 510 } 502 511 } … … 559 568 fclose(fp);*/ 560 569 561 mFileVertices = lodstripsdata .mFileVertices;562 mFileChangesLOD = lodstripsdata .mFileChangesLOD;563 mData = lodstripsdata .mData;564 p_changes = lodstripsdata .p_changes;570 mFileVertices = lodstripsdata->mFileVertices; 571 mFileChangesLOD = lodstripsdata->mFileChangesLOD; 572 mData = lodstripsdata->mData; 573 p_changes = lodstripsdata->p_changes; 565 574 566 575 … … 602 611 { 603 612 indices_x_submesh[target_submesh] = counter; 613 if (target_submesh==0) 614 offsets_x_submesh[target_submesh] = 0; 615 else 616 offsets_x_submesh[target_submesh] = indices_x_submesh[target_submesh-1] + offsets_x_submesh[target_submesh-1]; 617 604 618 counter = 0; 605 619 strip_count = 0; … … 617 631 { 618 632 indices_x_submesh[target_submesh] = counter; 633 if (target_submesh==0) 634 offsets_x_submesh[target_submesh] = 0; 635 else 636 offsets_x_submesh[target_submesh] = indices_x_submesh[target_submesh-1] + offsets_x_submesh[target_submesh-1]; 637 619 638 counter = 0; 620 639 strip_count = 0; -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodTreeLibrary.cpp
r1078 r1083 5 5 using namespace Geometry; 6 6 7 Geometry::LodTreeLibrary::LodTreeLibrary(const LodStripsLibraryData &lodstripsdata,8 const TreeSimplificationSequence &simpseq,7 Geometry::LodTreeLibrary::LodTreeLibrary(const LodStripsLibraryData *lodstripsdata, 8 const TreeSimplificationSequence *simpseq, 9 9 Geometry::Mesh *treeGeoMesh, 10 10 uint32 leafSubMeshID/* -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/foliage.cpp
r1078 r1083 10 10 // Parameters --> None 11 11 //-------------------------------------------------------------------------------------------------------------------------------- 12 Foliage::Foliage(const Geometry::SubMesh *leavesSubMesh, const Geometry::TreeSimplificationSequence &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 Geometry::TreeSimplificationSequence &simpSeq)306 bool Foliage::ReadSimpSeq(const Geometry::TreeSimplificationSequence * simpSeq) 307 307 { 308 308 int tn, tv1,tv2, e=0; 309 309 310 310 tn = leafCount; 311 for (std::vector<Geometry::TreeSimplificationSequence::Step>::const_iterator it = simpSeq .mSteps.begin(); it != simpSeq.mSteps.end(); it++)311 for (std::vector<Geometry::TreeSimplificationSequence::Step>::const_iterator it = simpSeq->mSteps.begin(); it != simpSeq->mSteps.end(); it++) 312 312 { 313 313 Leaves[tn].vertsLeaf[0] = it->mNewQuad[0]; -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/foliage.h
r1078 r1083 27 27 int active_leaf_count; 28 28 29 Foliage (const Geometry::SubMesh *, const Geometry::TreeSimplificationSequence &, Geometry::CREATEVERTEXDATAFUNC vdfun=NULL, Geometry::CREATEINDEXDATAFUNC idfun=NULL);29 Foliage (const Geometry::SubMesh *, const Geometry::TreeSimplificationSequence *, Geometry::CREATEVERTEXDATAFUNC vdfun=NULL, Geometry::CREATEINDEXDATAFUNC idfun=NULL); 30 30 Foliage (const Foliage *); 31 31 virtual ~Foliage (void); // Destructor … … 57 57 void ReadLeafs(const Geometry::SubMesh *); 58 58 void ReadVertices(const Geometry::SubMesh *); 59 bool ReadSimpSeq(const Geometry::TreeSimplificationSequence &); /// returns true when successful59 bool ReadSimpSeq(const Geometry::TreeSimplificationSequence *); /// returns true when successful 60 60 void FillRoot(void); 61 61
Note: See TracChangeset
for help on using the changeset viewer.