Changeset 1018 for GTP/trunk/Lib/Geom/shared/GTGeometry
- Timestamp:
- 06/16/06 10:49:49 (19 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GTGeometry
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodStripsConstructor.h
r1017 r1018 85 85 int NumVertsRepetidos; 86 86 87 ObjList<tipoVertice> cVerts;88 ObjList<ObjList<int> > cStrips;87 std::vector<tipoVertice> cVerts; 88 std::vector<std::vector<int> > cStrips; 89 89 90 90 VECTORINT *lStripsV; … … 92 92 tipoVertice *vVerts; 93 93 94 ObjList<tipoOrden> Ordenacion;94 std::vector<tipoOrden> Ordenacion; 95 95 96 96 uint32 *pCurrentData; … … 98 98 LODData *vCambios; 99 99 //vector <LODData> cCambios; 100 ObjList<LODData> cCambios;100 std::vector<LODData> cCambios; 101 101 //VECTORUNINT cDatos; 102 ObjList<int32> cDatos;102 std::vector<int32> cDatos; 103 103 uint32 *vDatos; 104 104 -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodStripsLibrary.h
r1014 r1018 16 16 #include <vector> 17 17 #include <time.h> 18 #include "VertexData.h" 18 19 19 20 namespace Geometry … … 124 125 void LoadStripMesh(char *name, Mesh *geomesh); 125 126 126 public:127 Geometry::CREATEMULTIINDEXDATAFUNC create_multi_index_data_func; 127 128 128 129 // Strips vector. 129 130 SmallIntVector *mStrips; 131 132 void UpdateDataRetrievalInterface(void); 133 134 public: 135 136 MultiIndexData *dataRetrievalInterface; 130 137 131 138 /** Constructor, receives as a parameter the name of the file 132 139 * including the multiresolution object. 133 140 */ 134 LodStripsLibrary(std::string, Mesh *geomesh );141 LodStripsLibrary(std::string, Mesh *geomesh, CREATEMULTIINDEXDATAFUNC midfun=NULL); 135 142 136 143 /// Destructor. … … 154 161 /// Establishes the new LOD range. 155 162 /// Only the LODs in that range are stored and used. 156 void 163 void TrimByLod(uint32, uint32); 157 164 158 165 /// Returns the number of triangles of the highest LOD. … … 168 175 uint32 MinVertices(); 169 176 170 // (New) Get the number of strips.177 /* // (New) Get the number of strips. 171 178 uint32 GetStripCount() const; 172 uint32 GetIndexCountByStrip(uint32) const; 179 uint32 GetIndexCountByStrip(uint32) const;*/ 173 180 }; 174 181 } -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodTreeLibrary.h
r895 r1018 50 50 // uint32 CurrentLOD_Trunk_IndexCount(void) const; 51 51 uint32 CurrentLOD_Trunk_IndexCountByStrip(uint32 istrip) const; 52 /* const VertexData* Get_Trunk_VertexData(void) const; 53 // const MultiIndexData* CurrentLOD_Trunk_Indices(void) const;*/ 52 /* const VertexData* Get_Trunk_VertexData(void) const;*/ 53 const MultiIndexData* CurrentLOD_Trunk_Indices(void) const; 54 54 55 55 // uint32 Get_Foliage_VertexCount(void) const; … … 62 62 // unsigned int *indices_offsets; 63 63 64 const Geometry::SmallIntVector & GetStrip(uint32 istrip) const { return trunk->mStrips[istrip]; }64 // const Geometry::SmallIntVector & GetStrip(uint32 istrip) const { return trunk->mStrips[istrip]; } 65 65 66 66 private: -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp
r1017 r1018 42 42 long int totalRegs = 0; 43 43 long int RegsCambios; 44 ObjList<ObjList<int> > TiraOriginal;44 std::vector<std::vector<int> > TiraOriginal; 45 45 LODData regLOD; 46 46 //LODChanges listaCambios; 47 ObjList<LODData> listaCambios;47 std::vector<LODData> listaCambios; 48 48 float percent; 49 49 float increment; … … 89 89 { 90 90 91 ObjList<int> & cStripsT = this->cStrips[t];91 std::vector<int> & cStripsT = this->cStrips[t]; 92 92 93 93 // Initialize. … … 138 138 } 139 139 140 cStripsT.eraseAtPos(i);141 //this->cStrips[t].erase(this->cStrips[t].begin()+i);140 //cStripsT.eraseAtPos(i); 141 cStripsT.erase(this->cStrips[t].begin()+i); 142 142 i--; 143 143 r++; … … 198 198 } 199 199 200 cStripsT.eraseAtPos(i);201 //this->cStrips[t].erase(this->cStrips[t].begin()+i);202 cStripsT.eraseAtPos(i);203 //this->cStrips[t].erase(this->cStrips[t].begin()+i);200 //cStripsT.eraseAtPos(i); 201 cStripsT.erase(this->cStrips[t].begin()+i); 202 //cStripsT.eraseAtPos(i); 203 cStripsT.erase(this->cStrips[t].begin()+i); 204 204 r++; 205 205 … … 274 274 long int k; 275 275 VECTORVERTEX Vertices; 276 ObjList<tipoVertice> NuevosVerts;276 std::vector<tipoVertice> NuevosVerts; 277 277 //vector <VECTORINT> NuevasTiras; 278 ObjList<ObjList<int> > NuevasTiras;278 std::vector<std::vector<int> > NuevasTiras; 279 279 // VECTORINT tira; 280 ObjList<int> tira;280 std::vector<int> tira; 281 281 vector <Index> mV1Aux; 282 282 tipoOrden Orden; … … 480 480 for(t = 0; t < cStrips.size(); t++) 481 481 { 482 ObjList<int> & thisStrip = cStrips[t];483 ObjList<int> & NuevasTirasT = NuevasTiras[t];482 std::vector<int> & thisStrip = cStrips[t]; 483 std::vector<int> & NuevasTirasT = NuevasTiras[t]; 484 484 int cStripsSizeT = thisStrip.size(); 485 485 for(i = 0; i < cStripsSizeT; i++) … … 975 975 { 976 976 tipoVertice vAux; 977 ObjList<int> tira;977 std::vector<int> tira; 978 978 size_t i; 979 979 size_t j; -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp
r1014 r1018 17 17 // Constructors. 18 18 //----------------------------------------------------------------------------- 19 LodStripsLibrary::LodStripsLibrary( std::string name, 20 Mesh *geomesh)19 LodStripsLibrary::LodStripsLibrary( std::string name, Mesh *geomesh, CREATEMULTIINDEXDATAFUNC midfun) 20 :create_multi_index_data_func(midfun?midfun:DefaultMultiIndexDataCreator) 21 21 { 22 22 const char *name_of_file; … … 30 30 // Sets the global mesh. 31 31 mGeoMesh = geomesh; 32 33 dataRetrievalInterface=NULL; 32 34 33 35 // Loads the Level Of Detail file. … … 41 43 { 42 44 delete [] mStrips; 45 if (dataRetrievalInterface) 46 delete dataRetrievalInterface; 43 47 } 44 48 … … 220 224 } 221 225 226 UpdateDataRetrievalInterface(); 222 227 return return_value; 223 228 } … … 321 326 mMaxLod = maxLod; 322 327 } 323 328 /* 324 329 //----------------------------------------------------------------------------- 325 330 // Get strip count. … … 337 342 return (uint32) mStrips[istrip].size(); 338 343 } 339 344 */ 340 345 //----------------------------------------------------------------------------- 341 346 // Private. … … 364 369 max = 0; 365 370 mTotalFaces = 0; 366 371 372 unsigned int * strip_sizes = new unsigned int[mFileStrips.size()]; 367 373 for (i = 0; i < mFileStrips.size(); i++) 368 374 { 369 t = int(mFileStrips[i].size()); 370 375 strip_sizes[i] = t = int(mFileStrips[i].size()); 371 376 if (t>max) 372 {373 377 max = t; 374 }375 376 378 mTotalFaces += t - 2; 377 379 } … … 388 390 389 391 // Copy strips. 392 dataRetrievalInterface=create_multi_index_data_func(mFileStrips.size(),strip_sizes); 393 dataRetrievalInterface->Begin(); 390 394 for (i = 0; i < mFileStrips.size(); i++) 391 395 { … … 393 397 { 394 398 mStrips[i].push_back(mFileStrips[i][j]); 399 dataRetrievalInterface->SetIndex(i,j,mFileStrips[i][j]); 395 400 } 396 401 … … 398 403 mStripsChanges[i] = 0; 399 404 } 405 dataRetrievalInterface->End(); 400 406 401 407 for (i = 0; i < mData.size(); i++) … … 411 417 mVertex[i] = mFileVertices[i]; 412 418 } 419 420 delete[] strip_sizes; 413 421 } 414 422 … … 435 443 SubMesh *geoSubMesh; 436 444 445 446 437 447 // For each one of the submeshes. 438 448 for (unsigned int submesh = 0; submesh < geomesh->mSubMeshCount; submesh++) … … 563 573 } 564 574 575 576 void LodStripsLibrary::UpdateDataRetrievalInterface(void) 577 { 578 dataRetrievalInterface->Begin(); 579 for (int i=0; i<mTotalStrips; i++) 580 { 581 unsigned int j=0; 582 for (SmallIntVector::iterator it=mStrips[i].begin(); it!=mStrips[i].end(); it++, j++) 583 dataRetrievalInterface->SetIndex(i,j,*it); 584 dataRetrievalInterface->SetNumValidIndices(i,j); 585 } 586 dataRetrievalInterface->End(); 587 } -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodTreeLibrary.cpp
r985 r1018 65 65 assert(trunk); 66 66 // return trunk->TOTALTIRAS; 67 return trunk-> GetStripCount();67 return trunk->dataRetrievalInterface->GetNumPrims(); 68 68 } 69 69 … … 73 73 assert(trunk); 74 74 // return trunk->lStripsV[istrip].size(); 75 return trunk->GetIndexCountByStrip(istrip); 75 // return trunk->GetIndexCountByStrip(istrip); 76 return trunk->dataRetrievalInterface->GetNumValidIndices(istrip); 76 77 } 77 78 /* … … 168 169 { 169 170 return trunk->vertices; 170 } 171 }*/ 171 172 const MultiIndexData* LodTreeLibrary::CurrentLOD_Trunk_Indices(void) const 172 173 { 173 174 // return (uint32*)trunk->vStrips[istrip]; 174 175 // return trunk->indices_x_tira[istrip]; 175 return trunk-> indices;176 } */176 return trunk->dataRetrievalInterface; 177 } 177 178 178 179
Note: See TracChangeset
for help on using the changeset viewer.