Ignore:
Timestamp:
06/16/06 10:49:49 (18 years ago)
Author:
gumbau
Message:
 
Location:
GTP/trunk/Lib/Geom/shared/GTGeometry/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp

    r1017 r1018  
    4242        long            int                                                     totalRegs       =       0; 
    4343        long            int                                                     RegsCambios; 
    44         ObjList<ObjList<int> >                  TiraOriginal; 
     44        std::vector<std::vector<int> >                  TiraOriginal; 
    4545        LODData                                                                 regLOD; 
    4646        //LODChanges                                                    listaCambios; 
    47         ObjList<LODData>                                                listaCambios; 
     47        std::vector<LODData>                                            listaCambios; 
    4848        float                                                                           percent; 
    4949        float                                                                           increment; 
     
    8989                { 
    9090 
    91                         ObjList<int> & cStripsT = this->cStrips[t]; 
     91                        std::vector<int> & cStripsT = this->cStrips[t]; 
    9292 
    9393                        //      Initialize. 
     
    138138                                        } 
    139139                                         
    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); 
    142142                                        i--; 
    143143                                        r++; 
     
    198198                                        } 
    199199                                         
    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); 
    204204                                        r++; 
    205205                                         
     
    274274        long int k; 
    275275        VECTORVERTEX                            Vertices; 
    276         ObjList<tipoVertice>            NuevosVerts; 
     276        std::vector<tipoVertice>                NuevosVerts; 
    277277        //vector        <VECTORINT>     NuevasTiras; 
    278         ObjList<ObjList<int> > NuevasTiras; 
     278        std::vector<std::vector<int> > NuevasTiras; 
    279279//      VECTORINT                                               tira; 
    280         ObjList<int> tira; 
     280        std::vector<int> tira; 
    281281        vector  <Index>                 mV1Aux; 
    282282        tipoOrden                                               Orden; 
     
    480480                for(t = 0; t < cStrips.size(); t++) 
    481481                { 
    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]; 
    484484                        int cStripsSizeT = thisStrip.size(); 
    485485                        for(i = 0; i < cStripsSizeT; i++) 
     
    975975{ 
    976976        tipoVertice     vAux; 
    977         ObjList<int>            tira; 
     977        std::vector<int>                tira; 
    978978        size_t                  i; 
    979979        size_t                  j; 
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp

    r1014 r1018  
    1717//      Constructors. 
    1818//----------------------------------------------------------------------------- 
    19 LodStripsLibrary::LodStripsLibrary(     std::string     name, 
    20                                                                                                                                                 Mesh                            *geomesh) 
     19LodStripsLibrary::LodStripsLibrary(     std::string     name, Mesh *geomesh, CREATEMULTIINDEXDATAFUNC midfun) 
     20:create_multi_index_data_func(midfun?midfun:DefaultMultiIndexDataCreator) 
    2121{ 
    2222        const   char    *name_of_file; 
     
    3030        //      Sets the global mesh. 
    3131        mGeoMesh = geomesh; 
     32 
     33        dataRetrievalInterface=NULL; 
    3234         
    3335        //      Loads the Level Of Detail file. 
     
    4143{ 
    4244        delete  [] mStrips; 
     45        if (dataRetrievalInterface) 
     46                delete dataRetrievalInterface; 
    4347} 
    4448 
     
    220224        } 
    221225 
     226        UpdateDataRetrievalInterface(); 
    222227        return  return_value; 
    223228} 
     
    321326        mMaxLod =       maxLod; 
    322327} 
    323  
     328/* 
    324329//----------------------------------------------------------------------------- 
    325330//      Get strip count. 
     
    337342        return (uint32) mStrips[istrip].size(); 
    338343} 
    339  
     344*/ 
    340345//----------------------------------------------------------------------------- 
    341346//      Private. 
     
    364369        max                                     =       0; 
    365370        mTotalFaces     =       0; 
    366          
     371 
     372        unsigned int * strip_sizes = new unsigned int[mFileStrips.size()]; 
    367373        for (i = 0; i < mFileStrips.size(); i++) 
    368374        { 
    369                 t       =       int(mFileStrips[i].size()); 
    370                  
     375                strip_sizes[i] = t = int(mFileStrips[i].size()); 
    371376                if (t>max) 
    372                 { 
    373377                        max     =       t; 
    374                 } 
    375  
    376378                mTotalFaces     +=      t - 2; 
    377379        } 
     
    388390         
    389391        //      Copy strips. 
     392        dataRetrievalInterface=create_multi_index_data_func(mFileStrips.size(),strip_sizes); 
     393        dataRetrievalInterface->Begin(); 
    390394        for (i = 0; i < mFileStrips.size(); i++) 
    391395        { 
     
    393397                { 
    394398                        mStrips[i].push_back(mFileStrips[i][j]); 
     399                        dataRetrievalInterface->SetIndex(i,j,mFileStrips[i][j]); 
    395400                } 
    396401                 
     
    398403                mStripsChanges[i]       =       0; 
    399404        } 
     405        dataRetrievalInterface->End(); 
    400406 
    401407        for (i = 0; i < mData.size(); i++) 
     
    411417                mVertex[i]      =       mFileVertices[i]; 
    412418        } 
     419 
     420        delete[] strip_sizes; 
    413421} 
    414422 
     
    435443        SubMesh                                                                                                         *geoSubMesh; 
    436444 
     445 
     446 
    437447        //      For each one of the submeshes. 
    438448        for (unsigned int submesh       =       0; submesh < geomesh->mSubMeshCount; submesh++) 
     
    563573} 
    564574 
     575 
     576void 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  
    6565        assert(trunk); 
    6666//      return trunk->TOTALTIRAS; 
    67         return trunk->GetStripCount(); 
     67        return trunk->dataRetrievalInterface->GetNumPrims(); 
    6868} 
    6969 
     
    7373        assert(trunk); 
    7474//      return trunk->lStripsV[istrip].size(); 
    75         return trunk->GetIndexCountByStrip(istrip); 
     75//      return trunk->GetIndexCountByStrip(istrip); 
     76        return trunk->dataRetrievalInterface->GetNumValidIndices(istrip); 
    7677} 
    7778/* 
     
    168169{  
    169170        return trunk->vertices;  
    170 } 
     171}*/ 
    171172const MultiIndexData* LodTreeLibrary::CurrentLOD_Trunk_Indices(void) const  
    172173{  
    173174//      return (uint32*)trunk->vStrips[istrip];  
    174175//      return trunk->indices_x_tira[istrip]; 
    175         return trunk->indices; 
    176 }*/ 
     176        return trunk->dataRetrievalInterface; 
     177} 
    177178 
    178179 
Note: See TracChangeset for help on using the changeset viewer.