Changeset 10341

Show
Ignore:
Timestamp:
06/12/09 12:08:15 (4 years ago)
Author:
robert
Message:

From Mathias Froehlich, "attached is a change to the ProxyNode? that also includes ProxyNode? local
database options like recently added to PagedLOD.

Also there is a change to the traverse method:
The previous ProxyNode? checks the VisitorType? to be a CULL_VISITOR and the
presence of a request handler to submit a database request.
In contrast to that PagedLOD uses the request handler if it is there - even if
the visitor type is not a cull visitor.
The change removes the cull visitor test from the ProxyNode? so that it behaves
like the PagedLOD.
I believe that the presence of a request handler in a visitor might be
sufficient to trigger the requests as this is done in the PagedLOD anyway.

Based on rev 10332."

Location:
OpenSceneGraph/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/ProxyNode

    r8325 r10341  
    4141         
    4242        virtual bool removeChildren(unsigned int pos,unsigned int numChildrenToRemove); 
     43 
     44 
     45        /** Set the optional database osgDB::Options object to use when loaded children.*/ 
     46        void setDatabaseOptions(osg::Referenced* options) { _databaseOptions = options; } 
     47 
     48        /** Get the optional database osgDB::Options object used when loaded children.*/ 
     49        osg::Referenced* getDatabaseOptions() { return _databaseOptions.get(); } 
     50 
     51        /** Get the optional database osgDB::Options object used when loaded children.*/ 
     52        const osg::Referenced* getDatabaseOptions() const { return _databaseOptions.get(); } 
     53 
    4354 
    4455        /** Set the database path to prepend to children's filenames.*/ 
     
    115126 
    116127        FileNameDatabaseRequestList     _filenameList; 
     128        ref_ptr<Referenced>             _databaseOptions; 
    117129        std::string                     _databasePath; 
    118130         
  • OpenSceneGraph/trunk/src/osg/ProxyNode.cpp

    r8325 r10341  
    2828    Group(proxynode,copyop), 
    2929    _filenameList(proxynode._filenameList), 
     30    _databaseOptions(proxynode._databaseOptions), 
     31    _databasePath(proxynode._databasePath), 
    3032    _loadingExtReference(proxynode._loadingExtReference), 
    3133    _centerMode(proxynode._centerMode), 
     
    5860{ 
    5961    if (nv.getDatabaseRequestHandler() && _filenameList.size()>_children.size() && 
    60         nv.getVisitorType()==NodeVisitor::CULL_VISITOR && 
    6162        _loadingExtReference!=NO_AUTOMATIC_LOADING) 
    6263    { 
    6364        for(unsigned int i=_children.size(); i<_filenameList.size(); ++i) 
    6465        { 
    65             nv.getDatabaseRequestHandler()->requestNodeFile(_databasePath+_filenameList[i].first, this, 1.0f, nv.getFrameStamp(), _filenameList[i].second); 
     66            nv.getDatabaseRequestHandler()->requestNodeFile(_databasePath+_filenameList[i].first, this, 1.0f, nv.getFrameStamp(), _filenameList[i].second, _databaseOptions.get()); 
    6667        } 
    6768    }