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

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgTerrain/GeometryTechnique.cpp

    r12597 r13041  
    1  /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    3535    setFilterWidth(0.1); 
    3636    setFilterMatrixAs(GAUSSIAN); 
    37      
     37 
    3838} 
    3939 
     
    6666void GeometryTechnique::setFilterMatrix(const osg::Matrix3& matrix) 
    6767{ 
    68     _filterMatrix = matrix;  
     68    _filterMatrix = matrix; 
    6969    if (!_filterMatrixUniform) _filterMatrixUniform = new osg::Uniform("filterMatrix",_filterMatrix); 
    7070    else _filterMatrixUniform->set(_filterMatrix); 
     
    9797{ 
    9898    OSG_INFO<<"Doing GeometryTechnique::init()"<<std::endl; 
    99      
     99 
    100100    if (!_terrainTile) return; 
    101101 
     
    162162    Locator* elevationLocator = elevationLayer ? elevationLayer->getLocator() : 0; 
    163163    Locator* colorLocator = colorLayer ? colorLayer->getLocator() : 0; 
    164      
     164 
    165165    Locator* masterLocator = elevationLocator ? elevationLocator : colorLocator; 
    166166    if (!masterLocator) 
     
    169169        return 0; 
    170170    } 
    171      
     171 
    172172    return masterLocator; 
    173173} 
     
    182182    Locator* elevationLocator = elevationLayer ? elevationLayer->getLocator() : 0; 
    183183    Locator* colorLocator = colorLayer ? colorLayer->getLocator() : 0; 
    184      
     184 
    185185    if (!elevationLocator) elevationLocator = masterLocator; 
    186186    if (!colorLocator) colorLocator = masterLocator; 
     
    188188    osg::Vec3d bottomLeftNDC(DBL_MAX, DBL_MAX, 0.0); 
    189189    osg::Vec3d topRightNDC(-DBL_MAX, -DBL_MAX, 0.0); 
    190      
     190 
    191191    if (elevationLayer) 
    192192    { 
     
    227227    osg::Vec3d centerModel = (bottomLeftNDC + topRightNDC)*0.5; 
    228228    masterLocator->convertLocalToModel(centerNDC, centerModel); 
    229      
     229 
    230230    buffer._transform->setMatrix(osg::Matrix::translate(centerModel)); 
    231      
     231 
    232232    return centerModel; 
    233233} 
     
    465465            { 
    466466                float value = 0.0f; 
    467                 if (sampled) validValue = elevationLayer->getInterpolatedValidValue(ndc.x(), ndc.y(), value);  
     467                if (sampled) validValue = elevationLayer->getInterpolatedValidValue(ndc.x(), ndc.y(), value); 
    468468                else validValue = elevationLayer->getValidValue(i,j,value); 
    469469                ndc.z() = value*_scaleHeight; 
     
    784784        unsigned int originalNumColumns = numColumns; 
    785785        unsigned int originalNumRows = numRows; 
    786      
     786 
    787787        numColumns = std::max((unsigned int) (float(originalNumColumns)*sqrtf(sampleRatio)), minimumNumColumns); 
    788788        numRows = std::max((unsigned int) (float(originalNumRows)*sqrtf(sampleRatio)),minimumNumRows); 
    789789    } 
    790      
    791      
     790 
     791 
    792792 
    793793    bool treatBoundariesToValidDataAsDefaultValue = _terrainTile->getTreatBoundariesToValidDataAsDefaultValue(); 
    794794    OSG_INFO<<"TreatBoundariesToValidDataAsDefaultValue="<<treatBoundariesToValidDataAsDefaultValue<<std::endl; 
    795      
     795 
    796796    float skirtHeight = 0.0f; 
    797797    HeightFieldLayer* hfl = dynamic_cast<HeightFieldLayer*>(elevationLayer); 
    798     if (hfl && hfl->getHeightField())  
     798    if (hfl && hfl->getHeightField()) 
    799799    { 
    800800        skirtHeight = hfl->getHeightField()->getSkirtHeight(); 
    801801    } 
    802      
     802 
    803803    bool createSkirt = skirtHeight != 0.0f; 
    804804 
     
    864864    osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array(1); 
    865865    (*colors)[0].set(1.0f,1.0f,1.0f,1.0f); 
    866      
     866 
    867867    geometry->setColorArray(colors.get()); 
    868868    geometry->setColorBinding(osg::Geometry::BIND_OVERALL); 
     
    10021002    // OSG_NOTICE<<"smallTile = "<<smallTile<<std::endl; 
    10031003 
    1004     osg::ref_ptr<osg::DrawElements> elements = smallTile ?  
     1004    osg::ref_ptr<osg::DrawElements> elements = smallTile ? 
    10051005        static_cast<osg::DrawElements*>(new osg::DrawElementsUShort(GL_TRIANGLES)) : 
    10061006        static_cast<osg::DrawElements*>(new osg::DrawElementsUInt(GL_TRIANGLES)); 
     
    10781078        osg::ref_ptr<osg::Vec3Array> normals = VNG._normals.get(); 
    10791079 
    1080         osg::ref_ptr<osg::DrawElements> skirtDrawElements = smallTile ?  
     1080        osg::ref_ptr<osg::DrawElements> skirtDrawElements = smallTile ? 
    10811081            static_cast<osg::DrawElements*>(new osg::DrawElementsUShort(GL_QUAD_STRIP)) : 
    10821082            static_cast<osg::DrawElements*>(new osg::DrawElementsUInt(GL_QUAD_STRIP)); 
     
    11631163        { 
    11641164            geometry->addPrimitiveSet(skirtDrawElements.get()); 
    1165             skirtDrawElements = smallTile ?  
     1165            skirtDrawElements = smallTile ? 
    11661166                        static_cast<osg::DrawElements*>(new osg::DrawElementsUShort(GL_QUAD_STRIP)) : 
    11671167                        static_cast<osg::DrawElements*>(new osg::DrawElementsUInt(GL_QUAD_STRIP)); 
     
    12051205        { 
    12061206            geometry->addPrimitiveSet(skirtDrawElements.get()); 
    1207             skirtDrawElements = smallTile ?  
     1207            skirtDrawElements = smallTile ? 
    12081208                        static_cast<osg::DrawElements*>(new osg::DrawElementsUShort(GL_QUAD_STRIP)) : 
    12091209                        static_cast<osg::DrawElements*>(new osg::DrawElementsUInt(GL_QUAD_STRIP)); 
     
    12881288    typedef std::map<osgTerrain::Layer*, osg::Texture*> LayerToTextureMap; 
    12891289    LayerToTextureMap layerToTextureMap; 
    1290      
     1290 
    12911291    for(unsigned int layerNum=0; layerNum<_terrainTile->getNumColorLayers(); ++layerNum) 
    12921292    { 
     
    12971297        if (switchLayer) 
    12981298        { 
    1299             if (switchLayer->getActiveLayer()<0 ||  
     1299            if (switchLayer->getActiveLayer()<0 || 
    13001300                static_cast<unsigned int>(switchLayer->getActiveLayer())>=switchLayer->getNumLayers()) 
    13011301            { 
     
    13521352 
    13531353            stateset->setTextureAttributeAndModes(layerNum, texture2D, osg::StateAttribute::ON); 
    1354              
     1354 
    13551355        } 
    13561356        else if (contourLayer) 
     
    13691369                layerToTextureMap[colorLayer] = texture1D; 
    13701370            } 
    1371              
     1371 
    13721372            stateset->setTextureAttributeAndModes(layerNum, texture1D, osg::StateAttribute::ON); 
    13731373 
     
    14781478 
    14791479 
    1480     if (_terrainTile->getDirty())  
     1480    if (_terrainTile->getDirty()) 
    14811481    { 
    14821482        OSG_INFO<<"******* Doing init ***********"<<std::endl;