Show
Ignore:
Timestamp:
03/21/12 18:36:20 (3 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/3ds/ReaderWriter3DS.cpp

    r12997 r13041  
    274274    { 
    275275        std::istringstream iss(options->getOptionString()); 
    276         std::string opt;  
    277         while (iss >> opt)  
     276        std::string opt; 
     277        while (iss >> opt) 
    278278        { 
    279279            if (opt == "noMatrixTransforms") 
     
    391391            // faces into smoothing groups is only correct for faces 
    392392            // belonging to a single smoothing group. The smoothing group 
    393             // value is actually a bitmask for all the smoothing groups that  
    394             // a face may belong to.  
     393            // value is actually a bitmask for all the smoothing groups that 
     394            // a face may belong to. 
    395395            smoothingFaceMap[mesh->faces[*flitr].smoothing_group].push_back(*flitr); 
    396396        } 
     
    570570    if (group) 
    571571    { 
    572         if (strcmp(node->name, "$$$DUMMY") == 0)  
     572        if (strcmp(node->name, "$$$DUMMY") == 0) 
    573573        { 
    574574            if (node->type == LIB3DS_NODE_MESH_INSTANCE) 
    575                 group->setName(reinterpret_cast<Lib3dsMeshInstanceNode *>(node)->instance_name);  
     575                group->setName(reinterpret_cast<Lib3dsMeshInstanceNode *>(node)->instance_name); 
    576576        } 
    577577        else if (node->type == LIB3DS_NODE_MESH_INSTANCE && strlen(reinterpret_cast<Lib3dsMeshInstanceNode *>(node)->instance_name) != 0) 
     
    851851{ 
    852852    VertexParams() : matrix(NULL), smoothNormals(false), scaleUV(1.f, 1.f), offsetUV(0.f, 0.f) { } 
    853     const osg::Matrix* matrix;  
     853    const osg::Matrix* matrix; 
    854854    bool smoothNormals; 
    855855    osg::Vec2f scaleUV; 
     
    859859static bool isFaceValid(const Lib3dsMesh* mesh, const Lib3dsFace* face) 
    860860{ 
    861     return  
     861    return 
    862862        face->index[0] < mesh->nvertices && 
    863863        face->index[1] < mesh->nvertices && 
     
    875875  */ 
    876876static void addVertex( 
    877     const Lib3dsMesh* mesh,  
    878     RemappedFace& remappedFace,  
     877    const Lib3dsMesh* mesh, 
     878    RemappedFace& remappedFace, 
    879879    unsigned short int i, 
    880880    osg::Geometry* geometry, 
    881881    std::vector<int>& origToNewMapping, 
    882     std::vector<int>& splitVertexChain,  
     882    std::vector<int>& splitVertexChain, 
    883883    const VertexParams& params) 
    884884{ 
     
    962962 
    963963static bool addFace( 
    964     const Lib3dsMesh* mesh,  
    965     RemappedFace& remappedFace,  
    966     osg::Geometry* geometry,  
    967     std::vector<int>& origToNewMapping,  
    968     std::vector<int>& splitVertexChain,  
     964    const Lib3dsMesh* mesh, 
     965    RemappedFace& remappedFace, 
     966    osg::Geometry* geometry, 
     967    std::vector<int>& origToNewMapping, 
     968    std::vector<int>& splitVertexChain, 
    969969    const VertexParams& params) 
    970970{ 
     
    10191019        osg_texCoords->reserve(m->nvertices); 
    10201020        geom->setTexCoordArray(0, osg_texCoords.get()); 
    1021   
     1021 
    10221022        // Texture 0 parameters (only one texture supported for now) 
    10231023        if (ssi.lib3dsmat && *(ssi.lib3dsmat->texture1_map.name))     // valid texture = name not empty 
     
    10281028            if (tex3ds.rotation != 0) OSG_NOTICE << "3DS texture rotation not supported yet" << std::endl; 
    10291029            //TODO: tint_1, tint_2, tint_r, tint_g, tint_b 
    1030         }    
     1030        } 
    10311031    } 
    10321032 
     
    10441044        itr != faceList.end(); 
    10451045        ++itr, ++faceIndex) 
    1046     {         
     1046    { 
    10471047        osg::Vec3 normal = copyLib3dsVec3ToOsgVec3(normals[*itr]); 
    10481048        if (matrix) normal = osg::Matrix::transform3x3(normal, *(params.matrix)); 
     
    10511051        Lib3dsFace& face = m->faces[*itr]; 
    10521052        remappedFaces[faceIndex].face = &face; 
    1053         remappedFaces[faceIndex].normal = normal;  
     1053        remappedFaces[faceIndex].normal = normal; 
    10541054        if (addFace(m, remappedFaces[faceIndex], geom, origToNewMapping, splitVertexChain, params)) 
    10551055        { 
     
    10581058    } 
    10591059 
    1060     // 'Shrink to fit' all vertex arrays because potentially faceList refers to fewer vertices than the whole mesh.  
     1060    // 'Shrink to fit' all vertex arrays because potentially faceList refers to fewer vertices than the whole mesh. 
    10611061    // This will almost certainly be the case where mesh has been broken down into smoothing groups. 
    10621062    if (osg_vertices.valid() && osg_vertices->size() < osg_vertices->capacity()) osg_vertices->trim(); 
     
    10641064    if (osg_texCoords.valid() && osg_texCoords->size() < osg_texCoords->capacity()) osg_texCoords->trim(); 
    10651065 
    1066     // Set geometry color to white.  
     1066    // Set geometry color to white. 
    10671067    osg::ref_ptr<osg::Vec4ubArray> osg_colors = new osg::Vec4ubArray(1); 
    10681068    (*osg_colors)[0].set(255,255,255,255); 
     
    12151215            texenv->setConstantColor(osg::Vec4(factor, factor, factor, factor)); 
    12161216            stateset->setTextureAttributeAndModes(unit, texenv, osg::StateAttribute::ON); 
    1217         }  
    1218         else  
     1217        } 
     1218        else 
    12191219        { 
    12201220            // from an email from Eric Hamil, September 30, 2003. 
     
    12391239            specular.set(0.0f,0.0f,0.0f); 
    12401240#endif 
    1241         }         
     1241        } 
    12421242 
    12431243        unit++; 
     
    12501250        if(texture1_map->getImage()->isImageTranslucent()) 
    12511251        { 
    1252             transparency = true;  
     1252            transparency = true; 
    12531253 
    12541254            stateset->setTextureAttributeAndModes(unit, opacity_map, osg::StateAttribute::ON); 
    12551255 
    12561256            double factor = mat->opacity_map.percent; 
    1257              
     1257 
    12581258                osg::TexEnvCombine* texenv = new osg::TexEnvCombine(); 
    12591259                texenv->setCombine_Alpha(osg::TexEnvCombine::INTERPOLATE); 
     
    12631263                texenv->setConstantColor(osg::Vec4(factor, factor, factor, 1.0 - factor)); 
    12641264                stateset->setTextureAttributeAndModes(unit, texenv, osg::StateAttribute::ON); 
    1265              
     1265 
    12661266            unit++; 
    1267         }  
     1267        } 
    12681268        else 
    12691269        { 
     
    12891289 
    12901290    // Set back face culling state if single sided material applied. 
    1291     // This seems like a reasonable assumption given that the backface cull option  
     1291    // This seems like a reasonable assumption given that the backface cull option 
    12921292    // doesn't appear to be encoded directly in the 3DS format, and also because 
    12931293    // it mirrors the effect of code in 3DS writer which uses the the face culling 
     
    13681368    io.write_func = fileo_write_func; 
    13691369    io.log_func = fileio_log_func; 
    1370      
     1370 
    13711371    Lib3dsFile * file3ds = lib3ds_file_new(); 
    13721372    if (!file3ds) return WriteResult(WriteResult::ERROR_IN_WRITING_FILE);