Changeset 996


Ignore:
Timestamp:
05/31/06 09:17:58 (18 years ago)
Author:
gumbau
Message:
 
File:
1 edited

Legend:

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

    r993 r996  
    1414        float   percent; 
    1515 
    16         percent =       10; 
    1716 
    1817        this->GenerarModeloV(upb); 
     
    2019 
    2120        //      Last updtate of the progress bar. 
     21        percent =       100.0; 
    2222        upb(percent); 
    2323} 
     
    3232        long            int                                                     k; 
    3333        long            int                                                     i; 
    34         unsigned long           int                                     t; 
     34        unsigned long           int             t; 
    3535        long            int                                                     r; 
    36         unsigned long           int                                     v; 
     36        unsigned long           int             v; 
    3737        long            int                                                     p0; 
    3838        long            int                                                     lod     =       0; 
     
    4545        LODChanges                                                      listaCambios; 
    4646        float                                                                           percent; 
     47        float                                                                           increment; 
    4748        long            int                                                     update; 
    4849 
    49         //      Guardamos copia original. 
    50         TiraOriginal    =       this->cStrips; 
     50        //      Saves original copy. 
     51        TiraOriginal                    =       this->cStrips; 
    5152 
    5253        this->MARCAVACIO        =       int(10 * this->cVerts.size()); 
     
    5455        listaCambios.clear(); 
    5556 
    56         update  =       0; 
     57        //      Initialize increment. 
     58        increment       =       0.0; 
    5759         
    5860        for     (lod = 0; ((this->cVerts[lod].Next) != -1); lod++) 
    5961        { 
    60                 update++; 
    61         } 
    62  
    63         update  =       update  / 20; 
    64         percent =       0.5; 
     62                increment       +=      1.0; 
     63        } 
     64 
     65        update          =       -1; 
     66        increment       =       (float)30.0     /       increment; 
     67        percent         =       1.0; 
    6568         
    6669        this->LodsDisp  =       this->TOTALCAMBIOS      =       lod; 
     
    6871        pCambios[0]                     =       0; 
    6972         
    70         //      5 min. 
    7173        for     (lod = 0; ((this->cVerts[lod].Next) != -1); lod++) 
    7274        { 
    73                 if ((lod % update) == 0) 
    74                 { 
     75                if (update      != (int)(increment * lod)) 
     76                { 
     77                        update  =       (int)(increment * lod); 
    7578                        upb(percent); 
    76                 } 
     79                }                        
    7780                 
    7881                RegsCambios                             =       0; 
     
    8184                for(t = 0; t < this->cStrips.size(); t++) 
    8285                { 
    83                         //Inicializar 
     86                        //      Initialize. 
    8487                        regLOD.strip    =       this->MARCAVACIO; 
    8588 
    86                         //PRIMERO: los cambios de los vertices 
     89                        //      Change vertices. 
    8790                        totalRegs               =       0; 
    8891                         
    8992                        for (v = 0; v < this->cStrips[t].size(); v++) 
    9093                        { 
    91                                 //      RESOLUCION VARIABLE MAL. 
    9294                                if (this->cStrips[t][v] == lod)  
    9395                                {  
    94                                         //Gestion de Tiras. 
     96                                        //      Strips. 
    9597                                        if (regLOD.strip == this->MARCAVACIO) 
    9698                                        { 
     
    108110                        regLOD.nP       =       char(totalRegs); 
    109111 
    110                         //SEGUNDO: Simplificaciones de Longitud 1 
    111                         // Cambio para simplifaciones de nivel 1 mayores de 2 
     112                        //      Simplifications length 1. 
     113                        //      Changes for simplification of level 1 to greater than 2. 
    112114                        totalRegs       =       0; 
    113115                        i                                       =       0; 
     
    123125                                                ) 
    124126                                {  
    125                                         //      Salvar el inicio de la repeticion. 
     127                                        //      Saves beginning of repetition. 
    126128                                        if (!r) 
    127129                                        { 
     
    271273        long    int                                             c2; 
    272274        //      Progress bar 
    273         float   percent; 
     275        float                   percent; 
     276        float                   increment; 
    274277        long    int     update; 
    275278 
    276279        bEncontrado = false; 
    277280 
    278         c1      =       0; 
    279         c2      =       0; 
    280          
    281         update  =       long(geoMeshSQ->mSteps.size() / 20); 
    282         percent =       0.5; 
     281        c1                                      =       0; 
     282        c2                                      =       0; 
     283         
     284        update                  =       -1; 
     285        percent                 =       1.0; 
     286        increment               =       (float)(10.0) / (float)(geoMeshSQ->mSteps.size()); 
    283287         
    284288        for     (i = 0; i < this->geoMeshSQ->mSteps.size(); i++) 
    285289        { 
    286                 if ((i % update) == 0) 
    287                 { 
     290                if (update      != (int)(i * increment)) 
     291                { 
     292                        update  =       (int)(i * increment); 
    288293                        upb(percent); 
    289294                } 
     
    305310        this->NumVertsRepetidos = c2; 
    306311 
    307         update  =       long(Ordenacion.size() / 20); 
    308         percent =       0.5; 
    309  
    310         //      1 min. 
     312        update          =       -1; 
     313        increment       =       (float)(10.0) / (float)(Ordenacion.size()); 
     314        percent         =       1.0; 
     315 
    311316        //      Change all vertices that have x != 0. 
    312         for(i=0;i<Ordenacion.size();i++) 
    313         { 
    314                 if ((i % update) == 0) 
    315                 { 
     317        for(i   =       0;      i < Ordenacion.size();  i++) 
     318        { 
     319                if (update      != (int)(i * increment)) 
     320                { 
     321                        update  = (int)(i * increment); 
    316322                        upb(percent); 
    317323                } 
    318  
     324                 
    319325                Ord     =       &(Ordenacion[i]); 
    320326 
     
    342348        } 
    343349 
    344         update  =       long(Ordenacion.size() / 20); 
    345         percent =       0.5; 
     350        update          =       -1; 
     351        increment       =       (float)(10.0) / (float)(Ordenacion.size()); 
     352        percent         =       1.0; 
    346353 
    347354        //      3 seg. 
     
    349356        for(i = 0; i < Ordenacion.size(); i++) 
    350357        { 
    351                 if ((i % update) == 0) 
    352                 { 
     358                if (update      !=      (int)(i * increment)) 
     359                { 
     360                        update  =       (int)(i * increment); 
    353361                        upb(percent); 
    354362                } 
     
    386394        } 
    387395 
    388         update  =       long(Ordenacion.size() / 20); 
    389         percent =       0.5; 
     396        update          =       -1; 
     397        increment       =       (float)(10.0)   /       (float)(Ordenacion.size()); 
     398        percent         =       1.0; 
    390399         
    391400        //      2 min. 
     
    393402        for (i = 0; i < Ordenacion.size(); i++) 
    394403        { 
    395                 if ((i % update) == 0) 
    396                 { 
     404                if (update      !=      (int)(i * increment)) 
     405                { 
     406                        update  =       (int)(i * increment); 
    397407                        upb(percent); 
    398408                } 
    399  
     409                 
    400410                v       =       Ordenacion[i].vQslimNext; 
    401411 
     
    430440        } 
    431441 
    432         update  =       long(NuevosVerts.size() / 40); 
    433         percent =       0.5; 
     442        update          =       -1; 
     443        increment       =       (float)(20.0) / (float)(NuevosVerts.size()); 
     444        percent         =       1.0; 
    434445 
    435446        k       =       0; 
     
    439450        for(v = 0; v < NuevosVerts.size(); v++) 
    440451        { 
    441                 if ((v % update) == 0) 
    442                 { 
     452                if (update != (int)(v * increment)) 
     453                { 
     454                        update  =       (int)(v * increment); 
    443455                        upb(percent); 
    444456                } 
    445  
     457                 
    446458                for(t = 0; t < this->cStrips.size(); t++) 
    447459                { 
     
    469481        this->cVerts    =       NuevosVerts; 
    470482 
    471         percent =       10; 
    472         upb(percent); 
    473 }                
     483        //percent       =       100.0; 
     484        //upb(percent); 
     485} 
    474486 
    475487//----------------------------------------------------------------------------- 
     
    541553{ 
    542554        unsigned int    i, j; 
    543         int k=0; 
    544         char    simp[256]; 
     555        int                                             k       =       0; 
     556        char                                    simp[256]; 
    545557 
    546558        //******************  1º CONSTRUCCION DEL FICHERO.LOD ********************* 
     
    11141126} 
    11151127 
    1116 ///     GetMesh: Return de current Mesh. 
     1128//      GetMesh: Return de current Mesh. 
    11171129Mesh    *       LodStripsConstructor::GetMesh() 
    11181130{ 
Note: See TracChangeset for help on using the changeset viewer.