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/osg/NodeVisitor

    r12080 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*/ 
     
    5050 
    5151/** Visitor for type safe operations on osg::Nodes. 
    52     Based on GOF's Visitor pattern. The NodeVisitor  
     52    Based on GOF's Visitor pattern. The NodeVisitor 
    5353    is useful for developing type safe operations to nodes 
    5454    in the scene graph (as per Visitor pattern), and adds to this 
     
    6262    myVisitor.apply(*root).  The later method will bypass the double 
    6363    dispatch and the appropriate NodeVisitor::apply(..) method will 
    64     not be called. */  
     64    not be called. */ 
    6565class OSG_EXPORT NodeVisitor : public virtual Referenced 
    6666{ 
     
    7474            TRAVERSE_ACTIVE_CHILDREN 
    7575        }; 
    76          
     76 
    7777        enum VisitorType 
    7878        { 
     
    8585 
    8686        NodeVisitor(TraversalMode tm=TRAVERSE_NONE); 
    87          
     87 
    8888        NodeVisitor(VisitorType type,TraversalMode tm=TRAVERSE_NONE); 
    89          
     89 
    9090        virtual ~NodeVisitor(); 
    91          
     91 
    9292        /** return the library name/namespapce of the visitor's. Should be defined by derived classes.*/ 
    9393        virtual const char* libraryName() const { return "osg"; } 
     
    9797 
    9898        /** Method to call to reset visitor. Useful if your visitor accumulates 
    99             state during a traversal, and you plan to reuse the visitor.  
     99            state during a traversal, and you plan to reuse the visitor. 
    100100            To flush that state for the next traversal: call reset() prior 
    101101            to each traversal.*/ 
     
    107107          * to select which behaviour to use for different types of traversal/visitors.*/ 
    108108        inline void setVisitorType(VisitorType type) { _visitorType = type; } 
    109          
     109 
    110110        /** Get the VisitorType.*/ 
    111111        inline VisitorType getVisitorType() const { return _visitorType; } 
     
    113113        /** Set the traversal number. Typically used to denote the frame count.*/ 
    114114        inline void setTraversalNumber(unsigned int fn) { _traversalNumber = fn; } 
    115          
     115 
    116116        /** Get the traversal number. Typically used to denote the frame count.*/ 
    117117        inline unsigned int getTraversalNumber() const { return _traversalNumber; } 
     
    119119        /** Set the FrameStamp that this traversal is associated with.*/ 
    120120        inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; } 
    121          
     121 
    122122        /** Get the FrameStamp that this traversal is associated with.*/ 
    123123        inline const FrameStamp* getFrameStamp() const { return _frameStamp.get(); } 
     
    139139 
    140140        /** Set the NodeMaskOverride mask. 
    141           * Used in validNodeMask() to determine whether to operate on a node or its  
     141          * Used in validNodeMask() to determine whether to operate on a node or its 
    142142          * subgraph, by OR'ing NodeVisitor::_nodeMaskOverride with the Node's own Node::_nodeMask. 
    143143          * Typically used to force on nodes which may have 
     
    147147        /** Get the NodeMaskOverride mask.*/ 
    148148        inline Node::NodeMask getNodeMaskOverride() const { return _nodeMaskOverride; } 
    149          
     149 
    150150        /** Method to called by Node and its subclass' Node::accept() method, if the result is true 
    151151          * it is used to cull operations of nodes and their subgraphs. 
     
    159159        } 
    160160 
    161         /** Set the traversal mode for Node::traverse() to use when  
     161        /** Set the traversal mode for Node::traverse() to use when 
    162162            deciding which children of a node to traverse. If a 
    163163            NodeVisitor has been attached via setTraverseVisitor() 
     
    165165            visitor is detached. Default mode is TRAVERSE_NONE.*/ 
    166166        inline void setTraversalMode(TraversalMode mode) { _traversalMode = mode; } 
    167          
     167 
    168168        /** Get the traversal mode.*/ 
    169169        inline TraversalMode getTraversalMode() const { return _traversalMode; } 
     
    171171        /** 
    172172         * Set user data, data must be subclassed from Referenced to allow 
    173          * automatic memory handling.  If your own data isn't directly  
     173         * automatic memory handling.  If your own data isn't directly 
    174174         * subclassed from Referenced then create an adapter object 
    175175         * which points to your own objects and handles the memory addressing. 
    176176         */ 
    177177        inline void setUserData(Referenced* obj) { _userData = obj; } 
    178          
     178 
    179179        /** Get user data.*/ 
    180180        inline Referenced* getUserData() { return _userData.get(); } 
    181          
     181 
    182182        /** Get const user data.*/ 
    183183        inline const Referenced* getUserData() const { return _userData.get(); } 
     
    185185 
    186186        /** Method for handling traversal of a nodes. 
    187             If you intend to use the visitor for actively traversing  
     187            If you intend to use the visitor for actively traversing 
    188188            the scene graph then make sure the accept() methods call 
    189189            this method unless they handle traversal directly.*/ 
     
    193193            else if (_traversalMode!=TRAVERSE_NONE) node.traverse(*this); 
    194194        } 
    195          
     195 
    196196        /** Method called by osg::Node::accept() method before 
    197197          * a call to the NodeVisitor::apply(..).  The back of the list will, 
    198198          * therefore, be the current node being visited inside the apply(..), 
    199           * and the rest of the list will be the parental sequence of nodes  
     199          * and the rest of the list will be the parental sequence of nodes 
    200200          * from the top most node applied down the graph to the current node. 
    201201          * Note, the user does not typically call pushNodeOnPath() as it 
    202202          * will be called automatically by the Node::accept() method.*/ 
    203203        inline void pushOntoNodePath(Node* node) { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.push_back(node); else _nodePath.insert(_nodePath.begin(),node); } 
    204          
     204 
    205205        /** Method called by osg::Node::accept() method after 
    206206          * a call to NodeVisitor::apply(..). 
     
    208208          * will be called automatically by the Node::accept() method.*/ 
    209209        inline void popFromNodePath()            { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.pop_back(); else _nodePath.erase(_nodePath.begin()); } 
    210          
     210 
    211211        /** Get the non const NodePath from the top most node applied down 
    212212          * to the current Node being visited.*/ 
     
    216216          * to the current Node being visited.*/ 
    217217        const NodePath& getNodePath() const { return _nodePath; } 
    218          
     218 
    219219        /** Get the eye point in local coordinates. 
    220220          * Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement.*/ 
     
    239239          * If the getDistanceToViewPoint(pos) is not implemented then a default value of 0.0 is returned.*/ 
    240240        virtual float getDistanceToViewPoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; } 
    241          
     241 
    242242 
    243243        virtual void apply(Node& node); 
    244          
     244 
    245245        virtual void apply(Geode& node); 
    246246        virtual void apply(Billboard& node); 
    247          
     247 
    248248        virtual void apply(Group& node); 
    249249 
     
    301301        { 
    302302        public: 
    303          
     303 
    304304            ImageRequestHandler(): 
    305305                Referenced(true) {} 
    306306 
    307307            virtual double getPreLoadTime() const = 0; 
    308              
     308 
    309309            virtual osg::Image* readImageFile(const std::string& fileName) = 0; 
    310          
     310 
    311311            virtual void requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const FrameStamp* framestamp) = 0; 
    312              
     312 
    313313        protected: 
    314314            virtual ~ImageRequestHandler() {} 
    315315        }; 
    316          
     316 
    317317        /** Set the handler for image requests.*/ 
    318318        void setImageRequestHandler(ImageRequestHandler* handler) { _imageRequestHandler = handler; } 
    319          
     319 
    320320        /** Get the handler for image requests.*/ 
    321321        ImageRequestHandler* getImageRequestHandler() { return _imageRequestHandler.get(); } 
     
    330330        VisitorType                     _visitorType; 
    331331        unsigned int                    _traversalNumber; 
    332          
     332 
    333333        ref_ptr<FrameStamp>             _frameStamp; 
    334          
     334 
    335335        TraversalMode                   _traversalMode; 
    336336        Node::NodeMask                  _traversalMask; 
    337337        Node::NodeMask                  _nodeMaskOverride; 
    338          
     338 
    339339        NodePath                        _nodePath; 
    340340 
     
    347347 
    348348 
    349 /** Convenience functor for assisting visiting of arrays of osg::Node's.*/  
     349/** Convenience functor for assisting visiting of arrays of osg::Node's.*/ 
    350350class NodeAcceptOp 
    351351{