Ignore:
Timestamp:
05/25/06 14:26:04 (19 years ago)
Author:
gumbau
Message:
 
File:
1 edited

Legend:

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

    r985 r986  
    2626SimplificationMethod::~SimplificationMethod() 
    2727{ 
    28         /*      for (std::vector<qslim::pair_info*>::iterator it=pointers_to_remove.begin(); it!=pointers_to_remove.end(); it++) 
    29                         { 
    30                         if (*it!=NULL) 
    31                         { 
    32                         delete *it; 
    33          *it=NULL; 
    34          } 
    35          } 
    36          */ 
    37          
    3828        delete heap; 
    3929        delete [] first_index_submesh; 
     
    10121002 
    10131003        mGeoMesh->mSubMeshCount = objmesh->mSubMeshCount; 
    1014          
     1004 
    10151005        //      Memory allocation for the submeshes. 
    10161006        mGeoMesh->mSubMesh = new SubMesh[objmesh->mSubMeshCount]; 
     
    10301020        { 
    10311021                mGeoMesh->hasSkeleton   =       true; 
    1032                  
     1022 
    10331023                strcpy(mGeoMesh->mSkeletonName,objmesh->mSkeletonName); 
    10341024        } 
     
    10471037        for (size_t     i = 0;  i < objmesh->mSubMeshCount;     i++) 
    10481038        { 
    1049                 mGeoMesh->mSubMesh[i].mSharedVertexBuffer       =       false;  
    10501039                mGeoMesh->mSubMesh[i].mStripCount                                       =       0; 
    10511040                mGeoMesh->mSubMesh[i].mStrip                                                    =       NULL; 
    10521041 
     1042                mGeoMesh-> 
     1043                        mSubMesh[i].mSharedVertexBuffer =       false; 
     1044 
    10531045                strcpy( mGeoMesh->mSubMesh[i].mMaterialName, 
    1054                                                 objmesh->mSubMesh[i].mMaterialName); 
     1046                                objmesh->mSubMesh[i].mMaterialName); 
    10551047 
    10561048                //      Copy submesh bones. 
     
    10601052                        { 
    10611053                                mGeoMesh->mSubMesh[i].mBones.push_back(objmesh-> 
    1062                                                                                                                                                                                                 mSubMesh[i].mBones[j]); 
     1054                                                mSubMesh[i].mBones[j]); 
    10631055                        } 
    10641056                } 
     
    10691061                        mGeoMesh->mSubMesh[i].mIndexCount       =       ver_inds_rep_by_geo[i].size(); 
    10701062                        mGeoMesh->mSubMesh[i].mIndex                    =       new Index[mGeoMesh-> 
    1071                                                                                                                                                                                                                 mSubMesh[i].mIndexCount]; 
     1063                                mSubMesh[i].mIndexCount]; 
    10721064 
    10731065                        //      Store the indices. 
     
    11041096                        mGeoMesh->mSubMesh[i].mVertexBuffer->mTexCoords =       new Vector2[mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount]; 
    11051097 
    1106                         for (MAPAINDIND::iterator mapit = unique_verts_inds_by_geo[i].begin(); mapit != unique_verts_inds_by_geo[i].end(); mapit++) 
     1098                        for (   MAPAINDIND::iterator mapit = unique_verts_inds_by_geo[i].begin(); 
     1099                                                mapit != unique_verts_inds_by_geo[i].end(); 
     1100                                                mapit++) 
    11071101                        { 
    11081102                                //      Key and value. 
     
    11331127 
    11341128                        //      Copy the leaves submesh indexes. 
    1135                         for (unsigned int j=0; j<mGeoMesh->mSubMesh[i].mIndexCount; j++)  
     1129                        for (unsigned int j=0; j<mGeoMesh->mSubMesh[i].mIndexCount; j++) 
    11361130                        {        
    11371131                                mGeoMesh->mSubMesh[i].mIndex[j]=objmesh->mSubMesh[i].mIndex[j]; 
     
    11471141                        mGeoMesh->mSubMesh[i].mVertexBuffer->mNormal=new Vector3[mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount]; 
    11481142                        mGeoMesh->mSubMesh[i].mVertexBuffer->mTexCoords=new Vector2[mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount]; 
    1149                          
     1143 
    11501144                        for (   unsigned int j = 0; 
    1151                                                 j < mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount; 
    1152                                                 j++) 
     1145                                        j < mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount; 
     1146                                        j++) 
    11531147                        { 
    11541148                                //      Position. 
     
    11751169        //      Store the simplification steps in MeshSimplificationSequence. 
    11761170        int acum        =       0; 
    1177          
     1171 
    11781172        for (size_t i   =       0; i < objmesh->mSubMeshCount; i++) 
    11791173        { 
     
    11861180                        first_index_submesh[i]  =       acum; 
    11871181                } 
    1188                  
     1182 
    11891183                acum    +=      (int)objmesh->mSubMesh[i].mVertexBuffer->mVertexCount; 
    11901184        } 
    1191          
     1185 
    11921186        MeshSimplificationSequence::Step stepaux, newstep; 
    11931187        vector<int> v0,v1,submesh0,submesh1; 
    11941188        MeshSimplificationSequence *msimpseq; 
    1195          
     1189 
    11961190        msimpseq        =       new MeshSimplificationSequence(); 
    11971191 
     
    12031197                v1                              =       vertexbuffermap[stepaux.mV1]; 
    12041198                submesh1        =       submeshmap[stepaux.mV1]; 
    1205                  
     1199 
    12061200                for (unsigned j = 0;    j < v0.size();  j++) 
    12071201                { 
     
    12151209                                newstep.y               =       stepaux.y; 
    12161210                                newstep.z               =       stepaux.z; 
    1217                                  
     1211 
    12181212                                // mT0 y mT1 are unique triangles identifiers 
    12191213                                // returned by the simplification method 
    12201214                                newstep.mT0     =       stepaux.mT0; 
    12211215                                newstep.mT1     =       stepaux.mT1; 
    1222                                  
     1216 
    12231217                                if (j == v0.size() - 1 && k == v1.size() - 1) 
    12241218                                { 
     
    12291223                                        newstep.obligatorio     =       1; 
    12301224                                } 
    1231                                  
     1225 
    12321226                                if (j == 0 && k == 0) 
    12331227                                { 
     
    12401234                                { 
    12411235                                        std::vector<Index>      vvacio; 
    1242                                          
     1236 
    12431237                                        newstep.mModfaces       =       vvacio; 
    12441238                                } 
Note: See TracChangeset for help on using the changeset viewer.