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/include/osgUtil/CullVisitor

    r12833 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 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*/ 
     
    4444 * sorted opaque bin.  The opaque bin is rendered first, and then the 
    4545 * transparent bin is rendered in order from the furthest osg::Drawable 
    46  * from the eye to the one nearest the eye.  
     46 * from the eye to the one nearest the eye. 
    4747 */ 
    4848class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStack 
    4949{ 
    5050    public: 
    51      
     51 
    5252        typedef osg::Matrix::value_type value_type; 
    53      
     53 
    5454 
    5555        CullVisitor(); 
    56          
     56 
    5757        /// Copy constructor that does a shallow copy. 
    5858        CullVisitor(const CullVisitor&); 
     
    6565        /** get the prototype singleton used by CullVisitor::create().*/ 
    6666        static osg::ref_ptr<CullVisitor>& prototype(); 
    67          
     67 
    6868        /** create a CullVisitor by cloning CullVisitor::prototype().*/ 
    6969        static CullVisitor* create(); 
     
    131131            } 
    132132        } 
    133          
     133 
    134134        /** Pop the top state set and hence associated state group. 
    135135          * Move the current state group to the parent of the popped 
     
    157157            _currentStateGraph = _currentStateGraph->_parent; 
    158158        } 
    159          
     159 
    160160        inline void setStateGraph(StateGraph* rg) 
    161161        { 
     
    207207        void setCalculatedNearPlane(value_type value) { _computed_znear = value; } 
    208208        inline value_type getCalculatedNearPlane() const { return _computed_znear; } 
    209          
     209 
    210210        void setCalculatedFarPlane(value_type value) { _computed_zfar = value; } 
    211211        inline value_type getCalculatedFarPlane() const { return _computed_zfar; } 
     
    217217 
    218218        bool updateCalculatedNearFar(const osg::Matrix& matrix,const osg::Drawable& drawable, bool isBillboard=false); 
    219          
     219 
    220220        void updateCalculatedNearFar(const osg::Vec3& pos); 
    221          
     221 
    222222        /** Add a drawable to current render graph.*/ 
    223223        inline void addDrawable(osg::Drawable* drawable,osg::RefMatrix* matrix); 
     
    234234 
    235235        /** compute near plane based on the polgon intersection of primtives in near plane candidate list of drawables. 
    236           * Note, you have to set ComputeNearFarMode to COMPUTE_NEAR_FAR_USING_PRIMITIVES to be able to near plane candidate drawables to be recorded by the cull traversal. */  
     236          * Note, you have to set ComputeNearFarMode to COMPUTE_NEAR_FAR_USING_PRIMITIVES to be able to near plane candidate drawables to be recorded by the cull traversal. */ 
    237237        void computeNearPlane(); 
    238238 
     
    240240          * the computed near and far.*/ 
    241241        virtual void popProjectionMatrix(); 
    242          
     242 
    243243 
    244244        /** CullVisitor's default clamping of the projection float matrix to computed near and far values. 
     
    266266                return true; 
    267267            } 
    268             else  
     268            else 
    269269                return false; 
    270270        } 
     
    287287                return true; 
    288288            } 
    289             else  
     289            else 
    290290                return false; 
    291291        } 
    292          
     292 
    293293 
    294294        void setState(osg::State* state) { _renderInfo.setState(state); } 
     
    306306        /** Prevent unwanted copy operator.*/ 
    307307        CullVisitor& operator = (const CullVisitor&) { return *this; } 
    308          
     308 
    309309        inline void handle_cull_callbacks_and_traverse(osg::Node& node) 
    310310        { 
     
    324324        StateGraph*                                                _currentStateGraph; 
    325325 
    326         osg::ref_ptr<RenderStage>                                   _rootRenderStage;         
     326        osg::ref_ptr<RenderStage>                                   _rootRenderStage; 
    327327        RenderBin*                                                  _currentRenderBin; 
    328328        std::vector<RenderBin*>                                     _renderBinStack; 
     
    332332        value_type               _computed_znear; 
    333333        value_type               _computed_zfar; 
    334          
    335          
     334 
     335 
    336336        typedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList; 
    337337        RenderLeafList _reuseRenderLeafList; 
    338338        unsigned int _currentReuseRenderLeafIndex; 
    339      
     339 
    340340        inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* matrix, float depth=0.0f); 
    341          
     341 
    342342        unsigned int _numberOfEncloseOverrideRenderBinDetails; 
    343343 
     
    351351            { 
    352352            } 
    353              
     353 
    354354            void set(const osg::Matrix& matrix, const osg::Drawable* drawable, const osg::Polytope& frustum) 
    355355            { 
     
    357357                _drawable = drawable; 
    358358                if (!_planes.empty()) _planes.clear(); 
    359                  
     359 
    360360                // create a new list of planes from the active walls of the frustum. 
    361361                osg::Polytope::ClippingMask result_mask = frustum.getResultMask(); 
     
    366366                { 
    367367                    if (result_mask&selector_mask) _planes.push_back(*itr); 
    368                     selector_mask <<= 1;  
     368                    selector_mask <<= 1; 
    369369                } 
    370370            } 
    371              
     371 
    372372            MatrixPlanesDrawables(const MatrixPlanesDrawables& mpd): 
    373373                _matrix(mpd._matrix), 
    374374                _drawable(mpd._drawable), 
    375375                _planes(mpd._planes) {} 
    376                  
     376 
    377377            MatrixPlanesDrawables& operator = (const MatrixPlanesDrawables& mpd) 
    378378            { 
     
    382382                return *this; 
    383383            } 
    384              
     384 
    385385            osg::Matrix                 _matrix; 
    386386            const osg::Drawable*        _drawable; 
    387387            osg::Polytope::PlaneList    _planes; 
    388388        }; 
    389          
     389 
    390390        typedef std::multimap<value_type, MatrixPlanesDrawables>   DistanceMatrixDrawableMap; 
    391391        DistanceMatrixDrawableMap                                  _nearPlaneCandidateMap; 
     
    437437{ 
    438438    // Skips any already reused renderleaf. 
    439     while (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size() &&  
     439    while (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size() && 
    440440           _reuseRenderLeafList[_currentReuseRenderLeafIndex]->referenceCount()>1) 
    441441    {