Changeset 2307


Ignore:
Timestamp:
04/02/07 11:52:04 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp

    r2176 r2307  
    8080{ 
    8181        char *pch = strtok(str + 1, " "); 
    82          
     82          
    8383        VertexIndexContainer indices; 
    84          
     84        int i = 0; 
    8585        while (pch != NULL) 
    86         { 
     86        {++ i; 
    8787          const int index = (int)strtol(pch, NULL, 10) - 1; 
    8888                                                 
    8989          // store vertex in hash table 
    9090          //hashTable[index] = vertices[index]; 
    91           if (index>=0) 
     91          if (index >= 0) 
    9292                indices.push_back(index); 
    9393                 
    94           //if (line == 451703) 
    95           //    cout << index + 1 << " "; 
    96            
    9794          pch = strtok(NULL, " "); 
    9895           
     
    106103                                                                                  vertices[indices[index_2]],            
    107104                                                                                  vertices[indices[index_3]])); 
    108                         indices.clear(); 
    109105                } 
    110106        } 
     
    129125                { 
    130126                        // go through indices 
    131                         const int index = *vit;             
    132                         //Debug << "old idx: " << (*vit) << endl; 
     127                        const int index = *vit; 
    133128                        map<int, Vector3>::const_iterator hit = hashTable.find(index); 
    134129 
    135130                        // correct face index (nust be relative to start of verices) 
    136131                        (*vit) = (int)distance(hashTable.begin(), hit); 
    137                         //Debug << "new idx: " << (*vit) << endl; 
    138132                } 
    139133        } 
     
    228222        int line = 0; 
    229223 
    230         char str[1000]; 
     224        char str[100000]; 
    231225        int meshGrouping; 
    232226        Environment::GetSingleton()->GetIntValue("ObjParser.meshGrouping", meshGrouping); 
     
    234228        int nMaxFaces = meshGrouping; 
    235229 
    236         while (fgets(str, 1000, file) != NULL) 
    237         { 
    238                 ++ line; 
     230        while (fgets(str, 100000, file) != NULL) 
     231        { 
    239232          switch (str[0])  
    240233                { 
     
    264257                                        faces.push_back(face); 
    265258 
    266                                         if (faces.size() >= nMaxFaces) 
     259                                        if ((int)faces.size() >= nMaxFaces) 
    267260                                        { 
    268261                                                ProcessMesh(faces, hashTable, root, parents); 
     
    271264                                else 
    272265                                { 
     266                                        ++ line; 
    273267                                        vector<Triangle3> triangles; 
    274268                                         
     
    291285                } 
    292286        } 
    293         //cout << "\n** " << root->mGeometry.size() << " " << " lines: " << line << endl; 
     287         
     288        //cout << "\n**** " << root->mGeometry.size() << " " << " lines: " << line << endl; 
    294289        if (loadMeshes) 
    295290        { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2198 r2307  
    356356                  if (index >= (int)mObjects.size())  
    357357                  { 
    358                           cerr<<"Warning: triangle  index out of range! " << index << endl; 
     358                          cerr<<"Warning: triangle index out of range! " << index << " of " << (int)mObjects.size() << endl; 
    359359                          return NULL; 
    360360                  } 
Note: See TracChangeset for help on using the changeset viewer.