Ignore:
Timestamp:
01/13/09 12:43:51 (15 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/VisibilitySolutionConverter/VisibilitySolutionConverter.cpp

    r3272 r3273  
    5252{ 
    5353        vector<string> triples; 
     54 
    5455        char *next_token; 
    5556 
     
    6061        { 
    6162                string s(pch); 
    62                 //s += "\n", 
    6363                triples.push_back(s); 
    6464                 
     
    6666        } 
    6767 
     68        // throw away last symbol (\n) 
     69        triples.back().resize(triples.back().size() - 1); 
     70 
    6871        vector<int> indices; 
    6972        vector<int> nIndices; 
    7073        vector<int> tIndices; 
    7174 
    72         char seps[] = " /\t\n"; 
     75        char seps[] = " "; 
     76        char seps2[] = "/"; 
    7377 
    7478        for (size_t i = 0; i < triples.size(); ++ i) 
    7579        { 
    76                 static int dummy = 0; 
    77  
    7880                size_t found; 
    79                 found = triples[i].find_first_of(seps); 
     81                found = triples[i].find_first_of(seps2); 
    8082                size_t prevfound = 0; 
    81                 // vertex, normal, texture indices 
     83 
     84                // extract vertex, normal, texture indices 
    8285                string str = triples[i].substr(prevfound, found); 
    8386 
    8487                int index = (int)strtol(str.c_str(), NULL, 10) - 1; 
    85  
    8688                int tIndex = index; 
    8789                int nIndex = index;      
    8890                 
    89                 prevfound = found; 
    90                 found = triples[i].find_first_of(seps, found + 1);   
     91                // try to extract texture and normal indices 
     92                prevfound = found + 1; 
     93                found = triples[i].find_first_of(seps2, prevfound);   
    9194 
    9295                if (found != string::npos) 
     
    97100                        if (idx > 0) tIndex = idx; 
    98101                } 
    99  
    100                 if ((found + 1) < triples[i].size()) 
     102                 
     103                if (found != string::npos) 
    101104                { 
    102105                        str = triples[i].substr(found + 1); 
Note: See TracChangeset for help on using the changeset viewer.