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/include/osgShadow/ViewDependentShadowTechnique

    r12188 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 * 
     
    2525/** 
    2626    META_ViewDependentShadowTechniqueData macro defines initViewDependentData 
    27     method used by derived shadow techniques to initialize their specific  
    28     ViewData objects. initViewDependentData will be called from  
    29     ViewDependentShadowTechnique base class to init derived class  
     27    method used by derived shadow techniques to initialize their specific 
     28    ViewData objects. initViewDependentData will be called from 
     29    ViewDependentShadowTechnique base class to init derived class 
    3030*/ 
    3131#define META_ViewDependentShadowTechniqueData( ShadowTechnique, TechniqueData )\ 
     
    4040 
    4141/** 
    42     ViewDependentShadowTechnique is a base class for all  
    43     View Dependent Shadow techniques. It defines fundamental object structure  
     42    ViewDependentShadowTechnique is a base class for all 
     43    View Dependent Shadow techniques. It defines fundamental object structure 
    4444    and methods to manage separate shadow resources for each view of the scene. 
    45     By view we understand osg::View or SceneView instance and their associated  
    46     Camera. Typical osg application has one or more such views. View Dependent  
     45    By view we understand osg::View or SceneView instance and their associated 
     46    Camera. Typical osg application has one or more such views. View Dependent 
    4747    Shadow techniques manage shadow generation for them. 
    4848 
    49     View Dependent Shadow techniques are used to optimize shadow algorithms for  
    50     part of the scene seen on the view. If rest of the scene is behind view  
    51     frustum, there is no sense in computing shadows for it. Since in practice we  
    52     often use 3d databases extending far beyond current camera frustum View  
    53     Dependent Shadow approach may produce much better shadows.  
    54  
    55     The other goal is to provide framework for thread safe rendering of  
     49    View Dependent Shadow techniques are used to optimize shadow algorithms for 
     50    part of the scene seen on the view. If rest of the scene is behind view 
     51    frustum, there is no sense in computing shadows for it. Since in practice we 
     52    often use 3d databases extending far beyond current camera frustum View 
     53    Dependent Shadow approach may produce much better shadows. 
     54 
     55    The other goal is to provide framework for thread safe rendering of 
    5656    the shadows. It allows to use shadows with different OSG threading models. 
    5757 
    5858    Conceptually ViewDependentShadowTechnique is similar to osgSim::OverlayNode. 
    59     Its a container class for number of ViewData (or ViewData derived) objects  
    60     doing actual shadow work for each of the scene views.  
    61  
    62     But ViewDependentShadowTechnique is intended as foundation layer for all  
     59    Its a container class for number of ViewData (or ViewData derived) objects 
     60    doing actual shadow work for each of the scene views. 
     61 
     62    But ViewDependentShadowTechnique is intended as foundation layer for all 
    6363    derived classes so in some way it extends osgSim::OverlayNode approach a bit. 
    6464 
     
    6767    ViewDependendentShadowTechnique is derived from osgShadow::ShadowTechnique 
    6868    and as such overrides virtual methods of osgShadow::ShadowTechnique. 
    69     But most of the shadow dirty work is done by ViewData objects,  
     69    But most of the shadow dirty work is done by ViewData objects, 
    7070    ViewDependendentShadowTechnique::cull is the only osgShadow::ShadowTechnique 
    7171    method where ViewDependendentShadowTechnique does something significant: 
    7272 
    73     What ViewDependentShadowTechnique::cull( CullVisitor & cv ) does ?  
    74     It identifies View. CullVisitor ptr is used as View identificator.  
    75     In practice we do not check and interpret what are actual Views and SceneViews  
    76     set up by application. We focus on Camera and CullVisitors as a identificators  
    77     of views. We can safely do this because each such view will have associated  
     73    What ViewDependentShadowTechnique::cull( CullVisitor & cv ) does ? 
     74    It identifies View. CullVisitor ptr is used as View identificator. 
     75    In practice we do not check and interpret what are actual Views and SceneViews 
     76    set up by application. We focus on Camera and CullVisitors as a identificators 
     77    of views. We can safely do this because each such view will have associated 
    7878    unique CullVisitor used to cull the scene in every frame. 
    79         
    80     Based on CullVisitor ptr passed to cull method, associated Technique::ViewData  
    81     object is created (if neccessary) and then seleced. Then control is passed to  
    82     this ViewData object. So, each view has its associated unique ViewData  
    83     (or derived) object performing dirty work of shadow resources management and  
     79 
     80    Based on CullVisitor ptr passed to cull method, associated Technique::ViewData 
     81    object is created (if neccessary) and then seleced. Then control is passed to 
     82    this ViewData object. So, each view has its associated unique ViewData 
     83    (or derived) object performing dirty work of shadow resources management and 
    8484    shadow generation for the view. 
    8585 
    86     To support creation of classes derived from ViewDependentShadowTechnique it  
    87     was neccessary to provide mechanism to override ViewData and allow for  
    88     initialization of new derived ViewData objects. Creation and initialization  
     86    To support creation of classes derived from ViewDependentShadowTechnique it 
     87    was neccessary to provide mechanism to override ViewData and allow for 
     88    initialization of new derived ViewData objects. Creation and initialization 
    8989    is performed when ViewDependendentShadowTechnique::cull gets called with 
    90     CullVistor ptr which does not yet have associated ViewData object. When it  
    91     happens, virtual initViewDependentData method is called to give  
    92     derived techniques a chance to allocate and iniitalize its specific  
    93     resources as new ViewData derived instance. In practice initViewDependentData  
     90    CullVistor ptr which does not yet have associated ViewData object. When it 
     91    happens, virtual initViewDependentData method is called to give 
     92    derived techniques a chance to allocate and iniitalize its specific 
     93    resources as new ViewData derived instance. In practice initViewDependentData 
    9494    in derived techniques should look the same as in base class so as a convenience 
    9595    it was defined as META_ViewDependentShadowTechnique macro. Derived techniques 
    9696    use this macro to override initViewDependentData method for their usage. 
    9797 
    98     After ViewData derived object is construted and selected, control is passed  
    99     to this object by call to virtual ViewData::cull method. The rest of work  
    100     is the done by this object. ViewDependentShadowTechnique::ViewData is intended  
    101     as a base class so it does nothing. In practice the rest of dirty work will  
     98    After ViewData derived object is construted and selected, control is passed 
     99    to this object by call to virtual ViewData::cull method. The rest of work 
     100    is the done by this object. ViewDependentShadowTechnique::ViewData is intended 
     101    as a base class so it does nothing. In practice the rest of dirty work will 
    102102    do new ViewData classes implemented in derived techniques. 
    103103*/ 
    104104class OSGSHADOW_EXPORT ViewDependentShadowTechnique 
    105     : public osgShadow::ShadowTechnique  
     105    : public osgShadow::ShadowTechnique 
    106106{ 
    107107    public: 
    108108        /** 
    109         osgShadow::ShadowTechnique equivalent methods for view dependent techniques   
     109        osgShadow::ShadowTechnique equivalent methods for view dependent techniques 
    110110        */ 
    111111 
     
    114114 
    115115        /** Classic OSG cloning constructor */ 
    116         ViewDependentShadowTechnique(  
    117             const ViewDependentShadowTechnique& vdst,  
     116        ViewDependentShadowTechnique( 
     117            const ViewDependentShadowTechnique& vdst, 
    118118            const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY ); 
    119119 
     
    144144        ~ViewDependentShadowTechnique( void ); 
    145145 
    146         /**  
    147         Base container class for view dependent shadow resources.  
     146        /** 
     147        Base container class for view dependent shadow resources. 
    148148        Techniques based on ViewDependentShadowTechnique will usually define 
    149149        similar struct and derive it from ViewData to contain their specufic resources. 
     
    160160 
    161161            /** 
    162             Method called by ViewDependentShadowTechnique to allow ViewData  
     162            Method called by ViewDependentShadowTechnique to allow ViewData 
    163163            do the hard work computing shadows for its associated view 
    164164            */ 
    165165            virtual void cull(); 
    166166 
    167             /**  
    168             Dirty is called by parent ViewDependentShadowTechnique to force  
     167            /** 
     168            Dirty is called by parent ViewDependentShadowTechnique to force 
    169169            update of resources after some of them were modified in parent technique 
    170170            */ 
     
    177177 
    178178            /** 
    179             Mutex used to guard _dirty flag from override in case when parent technique calls  
     179            Mutex used to guard _dirty flag from override in case when parent technique calls 
    180180            dirty() simultaneously with ViewData while it is updating resources inside init method. 
    181181            */ 
     
    183183 
    184184            /** 
    185             Dirty flag tells this instance to update its resources  
     185            Dirty flag tells this instance to update its resources 
    186186            */ 
    187187            bool                                              _dirty; 
    188188 
    189             /**  
    190             View's CullVisitor associated with this ViewData instance  
     189            /** 
     190            View's CullVisitor associated with this ViewData instance 
    191191            */ 
    192192            osg::observer_ptr< osgUtil::CullVisitor >         _cv; 
    193193 
    194194            /** 
    195             Parent ViewDependentShadowTechnique  
     195            Parent ViewDependentShadowTechnique 
    196196            */ 
    197197            osg::observer_ptr< ViewDependentShadowTechnique > _st; 
     
    199199        }; 
    200200 
    201         /**  
    202         Map of view dependent data per view cull visitor (CVs are used as indices)  
     201        /** 
     202        Map of view dependent data per view cull visitor (CVs are used as indices) 
    203203        ViewDependentShadowTechnique uses this map to find VieData for each cull vitior 
    204204        */ 
     
    221221        virtual void       setViewDependentData( osgUtil::CullVisitor * cv, ViewDependentShadowTechnique::ViewData * data ); 
    222222 
    223         /**  
    224         Declare standard initViewDependentData method.  
     223        /** 
     224        Declare standard initViewDependentData method. 
    225225        */ 
    226226        META_ViewDependentShadowTechniqueData( ViewDependentShadowTechnique, ViewData )