• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ osg::NodeVisitor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中osg::NodeVisitor的典型用法代码示例。如果您正苦于以下问题:C++ NodeVisitor类的具体用法?C++ NodeVisitor怎么用?C++ NodeVisitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了NodeVisitor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: lock

void
TerrainEngineNode::traverse( osg::NodeVisitor& nv )
{
    if ( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR )
    {
        // see if we need to set up the Terrain object with an update ops queue.
        if ( !_terrainInterface->_updateOperationQueue.valid() )
        {
            static Threading::Mutex s_opqlock;
            Threading::ScopedMutexLock lock(s_opqlock);
            if ( !_terrainInterface->_updateOperationQueue.valid() ) // double check pattern
            {
                //TODO: think, will this work with >1 view?
                osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>( &nv );
                if ( cv->getCurrentCamera() )
                {
                    osgViewer::View* view = dynamic_cast<osgViewer::View*>(cv->getCurrentCamera()->getView());
                    if ( view && view->getViewerBase() )
                    {
                        osg::OperationQueue* q = view->getViewerBase()->getUpdateOperations();
                        if ( !q ) {
                            q = new osg::OperationQueue();
                            view->getViewerBase()->setUpdateOperations( q );
                        }
                        _terrainInterface->_updateOperationQueue = q;
                    }
                }                        
            }
        }


        if ( Registry::instance()->getCapabilities().supportsGLSL() )
        {
            _updateLightingUniformsHelper.cullTraverse( this, &nv );

            osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>( &nv );
            if ( cv )
            {
                osg::Vec3d eye = cv->getEyePoint();

                float elevation;
                if ( _map->isGeocentric() )
                    elevation = eye.length() - osg::WGS_84_RADIUS_EQUATOR;
                else
                    elevation = eye.z();

                _cameraElevationUniform->set( elevation );
            }
        }
    }

    else if ( nv.getVisitorType() == osg::NodeVisitor::EVENT_VISITOR )
    {
        _dirtyCount = 0;
    }

    osg::CoordinateSystemNode::traverse( nv );
}
开发者ID:chuckshaw,项目名称:osgearth,代码行数:58,代码来源:TerrainEngineNode.cpp


示例2: traverse

void ElevationLOD::traverse( osg::NodeVisitor& nv)
{
    if (nv.getVisitorType()   == osg::NodeVisitor::CULL_VISITOR &&
        nv.getTraversalMode() == osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN )
    {
        bool rangeOK     = true;
        bool altitudeOK  = true;

        // first test the range:
        if ( _minRange.isSet() || _maxRange.isSet() )
        {
            float range = nv.getDistanceToViewPoint( getBound().center(), true );
            rangeOK =
                (!_minRange.isSet() || (range >= *_minRange)) &&
                (!_maxRange.isSet() || (range <= *_maxRange));
        }

        if ( rangeOK )
        {
            if ( _minElevation.isSet() || _maxElevation.isSet() )
            {
                double alt;

                // first see if we have a precalculated elevation:
                osgUtil::CullVisitor* cv = Culling::asCullVisitor(nv);

                osg::Vec3d eye = cv->getViewPoint();

                if ( _srs && !_srs->isProjected() )
                {
                    GeoPoint mapPoint;
                    mapPoint.fromWorld( _srs.get(), eye );
                    alt = mapPoint.z();
                }
                else
                {
                    alt = eye.z();
                }

                // account for the LOD scale
                alt *= cv->getLODScale();

                altitudeOK =
                    (!_minElevation.isSet() || (alt >= *_minElevation)) &&
                    (!_maxElevation.isSet() || (alt <= *_maxElevation));
            }

            if ( altitudeOK )
            {
                std::for_each(_children.begin(),_children.end(),osg::NodeAcceptOp(nv));
            }
        }
    }
    else
    {
        osg::Group::traverse( nv );
    }
}
开发者ID:2php,项目名称:osgearth,代码行数:58,代码来源:ElevationLOD.cpp


示例3: if

void
HTMNode::traverse(osg::NodeVisitor& nv)
{
    if ( nv.getVisitorType() == nv.CULL_VISITOR )
    {
        //OE_INFO << getName() << std::endl;
#if 0
        if ( _isLeaf )
        {
            if (_settings._debugFrame != nv.getFrameStamp()->getFrameNumber())
            {
                OE_NOTICE << "Frame " << _settings._debugFrame << ": " << _settings._debugCount << std::endl;
                _settings._debugCount = 0;
                _settings._debugFrame = nv.getFrameStamp()->getFrameNumber();
            }
            _settings._debugCount += getNumChildren();
        }
#endif

        const osg::BoundingSphere& bs = getBound();

        float range = nv.getDistanceToViewPoint(bs.center(), true);
        bool inRange = false;

        if (_settings._maxRange.isSet() == false)
        {
            inRange = range < (bs.radius() * _settings._rangeFactor.get());
        }
        else
        {
            inRange = range < (bs.radius() + _settings._maxRange.get());
        }

        if ( inRange )
        {
            osg::Group::traverse( nv );
            
            if (_debug.valid() && _isLeaf)
            {
                _debug->accept(nv);
            }
        }
        else if (_debug.valid())
        {
            _debug->accept(nv);
        }
    }
    else
    {
        if (_debug.valid())
        {
            _debug->accept(nv);
        }

        osg::Group::traverse( nv );        
    }
}
开发者ID:aroth-fastprotect,项目名称:osgearth,代码行数:57,代码来源:HTM.cpp


示例4: if

void
OrthoNode::traverse( osg::NodeVisitor& nv )
{
    osgUtil::CullVisitor* cv = 0L;

    if ( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR )
    {
        cv = Culling::asCullVisitor(nv);

        // make sure that we're NOT using the AutoTransform if this node is in the decluttering bin;
        // the decluttering bin automatically manages screen space transformation.
        bool declutter = cv->getCurrentRenderBin()->getName() == OSGEARTH_DECLUTTER_BIN;
        if ( declutter && _switch->getValue(0) == 1 )
        {
            _switch->setSingleChildOn( 1 );
        }
        else if ( !declutter && _switch->getValue(0) == 0 )
        {
            _switch->setSingleChildOn( 0 );
        }

        // If decluttering is enabled, update the auto-transform but not its children.
        // This is necessary to support picking/selection. An optimization would be to
        // disable this pass when picking is not in use
        if ( declutter )
        {
            static_cast<AnnotationUtils::OrthoNodeAutoTransform*>(_autoxform)->acceptCullNoTraverse( cv );
        }

        // turn off small feature culling
        cv->setSmallFeatureCullingPixelSize(0.0f);

        AnnotationNode::traverse( nv );

        if ( this->getCullingActive() == false )
            this->setCullingActive( true );
    }
    
    // For an intersection visitor, ALWAYS traverse the autoxform instead of the 
    // matrix transform. The matrix transform is only used in combination with the 
    // decluttering engine, so it cannot properly support picking of decluttered
    // objects
    else if ( 
        nv.getVisitorType() == osg::NodeVisitor::NODE_VISITOR &&
        dynamic_cast<osgUtil::IntersectionVisitor*>( &nv ) )
    {
        if ( static_cast<AnnotationUtils::OrthoNodeAutoTransform*>(_autoxform)->okToIntersect() )
        {
            _autoxform->accept( nv );
        }
    }

    else
    {
        AnnotationNode::traverse( nv );
    }
}
开发者ID:dlsyaim,项目名称:osgEarthX,代码行数:57,代码来源:OrthoNode.cpp


示例5: getPerViewData

void
OverlayDecorator::traverse( osg::NodeVisitor& nv )
{
    if ( _overlayGraph.valid() && _textureUnit.isSet() )
    {
        // in the CULL traversal, find the per-view data associated with the 
        // cull visitor's current camera view and work with that:
        if ( nv.getVisitorType() == nv.CULL_VISITOR )
        {
            osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>( &nv );
            osg::Camera* camera = cv->getCurrentCamera();
            if ( camera != 0L && (_rttTraversalMask & nv.getTraversalMask()) != 0 )
            {
                PerViewData& pvd = getPerViewData( camera );

                if (checkNeedsUpdate(pvd))
                {
                    updateRTTCamera(pvd);
                }

                if ( pvd._texGen.valid() )
                {
                    // FFP path only
                    cv->getCurrentRenderBin()->getStage()->addPositionedTextureAttribute(
                        *_textureUnit, cv->getModelViewMatrix(), pvd._texGen.get() );
                }

                cull( cv, pvd );

                pvd._rttCamera->accept( nv );
            }
            else
            {
                osg::Group::traverse(nv);
            }

            // debug-- (draws the overlay at its native location as well)
            //_overlayGraph->accept(nv);
        }

        else
        {
            // Some other type of visitor (like update or intersection). Skip the RTT camera
            // and traverse the overlay graph directly.
            if ( _overlayGraph.valid() )
            {
                _overlayGraph->accept( nv );
            }

            osg::Group::traverse( nv );
        }
    }
    else
    {
        osg::Group::traverse( nv );
    }
}
开发者ID:ReWeb3D,项目名称:osgearth,代码行数:57,代码来源:OverlayDecorator.cpp


示例6: if

void
SilverLiningContextNode::traverse(osg::NodeVisitor& nv)
{
    if ( _SL && _SL->ready() )
    {
        if ( nv.getVisitorType() == nv.UPDATE_VISITOR )
        {
			int frameNumber = nv.getFrameStamp()->getFrameNumber();
            _skyDrawable->dirtyBound();

            if( _cloudsDrawable )
            {
                if ( _lastAltitude <= *_options.cloudsMaxAltitude() )
                {
                    if ( _cloudsDrawable->getNumParents() == 0 )
                        _geode->addDrawable( _cloudsDrawable.get() );

                    _cloudsDrawable->dirtyBound();
                }
                else
                {
                    if ( _cloudsDrawable->getNumParents() > 0 )
                        _geode->removeDrawable( _cloudsDrawable.get() );
                }
            }
        }

        else if ( nv.getVisitorType() == nv.CULL_VISITOR )
        {
			osgUtil::CullVisitor* cv = Culling::asCullVisitor(nv);
			osg::Camera* camera  = cv->getCurrentCamera();
			if ( camera )
			{
#ifndef SL_USE_CULL_MASK
				//Check if this is the target camera for this context
				if(getTargetCamera() == camera)
#endif
     			{
					// TODO: make this multi-camera safe
					_SL->setCameraPosition( nv.getEyePoint() );

					_lastAltitude = _SL->getSRS()->isGeographic() ?
						cv->getEyePoint().length() - _SL->getSRS()->getEllipsoid()->getRadiusEquator() :
					cv->getEyePoint().z();

					_SL->updateLocation();
					_SL->updateLight();
				}
			}
        }
    }

    if ( _geode.valid() )
    {
        _geode->accept(nv);
    }
}
开发者ID:aroth-fastprotect,项目名称:osgearth,代码行数:57,代码来源:SilverLiningContextNode.cpp


示例7:

void
TritonNode::traverse(osg::NodeVisitor& nv)
{
    if ( nv.getVisitorType() == nv.UPDATE_VISITOR && _TRITON->ready() )
    {
        _TRITON->update(nv.getFrameStamp()->getSimulationTime());
    }
    osgEarth::Util::OceanNode::traverse(nv);
}
开发者ID:Brucezhou1979,项目名称:osgearth,代码行数:9,代码来源:TritonNode.cpp


示例8:

void
GeoCell::traverse( osg::NodeVisitor& nv )
{
    bool isCull = nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR;

    if ( _depth > 0 )
    {
        if ( isCull )
        {
            // process boundary geometry, if present.
            if ( _boundaryGeode.valid() ) 
            {
                if ( _count > 0 )
                    (*_boundaryColor)[0].set(1,0,0,0.35);
                else
                    (*_boundaryColor)[0].set(1,1,1,0.25);
                _boundaryColor->dirty();

                _boundaryGeode->accept( nv );
            }

            // custom BSP culling function. this checks that the set of boundary points
            // for this cell intersects the viewing frustum.
            osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>( &nv );
            if ( cv && !intersects( cv->getCurrentCullingSet().getFrustum() ) )
            {
                return;
            }

            // passed cull, so record the framestamp.
            _frameStamp = cv->getFrameStamp()->getFrameNumber();
        }

        if ( _objects.size() > 0 )
        {
            for( GeoObjectCollection::iterator i = _objects.begin(); i != _objects.end(); ++i )
            {
                osg::Node* node = i->second->getNode();
                if ( node )
                    node->accept( nv );
            }
        }

        if ( _clusterGeode.valid() )
            _clusterGeode->accept( nv );
    }

    else
    {
        if ( isCull )
            _frameStamp = nv.getFrameStamp()->getFrameNumber();
    }

    osg::LOD::traverse( nv );
}
开发者ID:airwzz999,项目名称:osgearth-for-android,代码行数:55,代码来源:SpatialData.cpp


示例9:

void
TilePagedLOD::traverse(osg::NodeVisitor& nv)
{
    if (_progress.valid() && 
        nv.getVisitorType() == nv.CULL_VISITOR && 
        nv.getFrameStamp() )
    {
        _progress->update( nv.getFrameStamp()->getFrameNumber() );
    }
    
    osg::PagedLOD::traverse(nv);
}
开发者ID:DavidLeehome,项目名称:osgearth,代码行数:12,代码来源:TilePagedLOD.cpp


示例10:

void
GeoCell::traverse( osg::NodeVisitor& nv )
{
    bool isCull = nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR;

    if ( _depth > 0 )
    {
        if ( isCull )
        {
            // process boundary geometry, if present.
            if ( _boundaryGeode.valid() )
            {
                if ( _count > 0 )
                    (*_boundaryColor)[0].set(1,0,0,0.35);
                else
                    (*_boundaryColor)[0].set(1,1,1,0.25);
                _boundaryColor->dirty();

                _boundaryGeode->accept( nv );
            }

            osgUtil::CullVisitor* cv = Culling::asCullVisitor(nv);
            if ( cv )
            {
                // passed cull, so record the framestamp.
                _frameStamp = cv->getFrameStamp()->getFrameNumber();
            }
        }

        if ( _objects.size() > 0 )
        {
            for( GeoObjectCollection::iterator i = _objects.begin(); i != _objects.end(); ++i )
            {
                osg::Node* node = i->second->getNode();
                if ( node )
                    node->accept( nv );
            }
        }

        if ( _clusterGeode.valid() )
            _clusterGeode->accept( nv );
    }

    else
    {
        if ( isCull )
            _frameStamp = nv.getFrameStamp()->getFrameNumber();
    }

    osg::LOD::traverse( nv );
}
开发者ID:JD31,项目名称:osgearth,代码行数:51,代码来源:SpatialData.cpp


示例11: updateFocus

void Widget::traverseImplementation(osg::NodeVisitor& nv)
{
    if (!_graphicsInitialized && nv.getVisitorType()!=osg::NodeVisitor::CULL_VISITOR) createGraphics();

    osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(&nv);
    if (ev)
    {
        if (_visible && _enabled)
        {

            updateFocus(nv);

            // OSG_NOTICE<<"EventTraversal getHasEventFocus()="<<getHasEventFocus()<<std::endl;

            // signify that event has been taken by widget with focus

            osgGA::EventQueue::Events& events = ev->getEvents();
            for(osgGA::EventQueue::Events::iterator itr = events.begin();
                itr != events.end();
                ++itr)
            {
                if (handle(ev, itr->get()))
                {
                    (*itr)->setHandled(true);
                    ev->setEventHandled(true);
                }
            }

            osg::Group::traverse(nv);
        }
    }
    else if (_visible ||
            (nv.getVisitorType()!=osg::NodeVisitor::UPDATE_VISITOR && nv.getVisitorType()!=osg::NodeVisitor::CULL_VISITOR && nv.getVisitorType()!=osg::NodeVisitor::INTERSECTION_VISITOR) )
    {
        GraphicsSubgraphMap::iterator itr = _graphicsSubgraphMap.begin();
        while(itr!= _graphicsSubgraphMap.end() && itr->first<=0)
        {
            itr->second->accept(nv);
            ++itr;
        }

        Group::traverse(nv);

        while(itr!= _graphicsSubgraphMap.end())
        {
            itr->second->accept(nv);
            ++itr;
        }
    }
}
开发者ID:geoffmcl,项目名称:osg,代码行数:50,代码来源:Widget.cpp


示例12: lock

void
TileNode::load(osg::NodeVisitor& nv)
{
    // Access the context:
    EngineContext* context = static_cast<EngineContext*>( nv.getUserData() );

    // Create a new load request on demand:
    if ( !_loadRequest.valid() )
    {
        Threading::ScopedMutexLock lock(_mutex);
        if ( !_loadRequest.valid() )
        {
            _loadRequest = new LoadTileData( this, context );
            _loadRequest->setName( _key.str() );
            _loadRequest->setTileKey( _key );
        }
    }

#if 0
    double range0, range1;
    int lod = getTileKey().getLOD();
    if ( lod > context->getOptions().firstLOD().get() )
        range0 = context->getSelectionInfo().visParameters(lod-1)._visibilityRange;
    else
        range0 = 0.0;
    double range1 = context->getSelectionInfo().visParameters(lod)._visibilityRange;

    priority = 
#endif

    // Prioritize by LOD. (negated because lower order gets priority)
    float priority = - (float)getTileKey().getLOD();

    if ( context->getOptions().highResolutionFirst() == true )
    {
        priority = context->getSelectionInfo().numLods() - priority;
        //priority = -priority;
    }

    // then sort by distance within each LOD.
    float distance = nv.getDistanceToViewPoint( getBound().center(), true );
    priority = 10.0f*priority - log10(distance);

    // testing intermediate loading idea...
    //if ( getTileKey().getLOD() == 5 )
    //    priority += 100.0f;

    // Submit to the loader.
    context->getLoader()->load( _loadRequest.get(), priority, nv );
}
开发者ID:caomw,项目名称:osgearth,代码行数:50,代码来源:TileNode.cpp


示例13: if

void
DrapeableNode::traverse( osg::NodeVisitor& nv )
{
    if ( !_overlayProxyContainer.valid() )
    {
        osg::Group::traverse( nv );
    }
    else
    {
        if ( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR )
        {
            if ( _draped )
            {
                // for a draped node, inform the proxy that we are visible. But do NOT traverse the
                // child graph (since it will be traversed by the OverlayDecorator).
                CullNodeByFrameNumber* cb = static_cast<CullNodeByFrameNumber*>(_overlayProxyContainer->getCullCallback());
                if (cb)
                {
                    cb->_frame = nv.getFrameStamp()->getFrameNumber();
                }
            }
            else
            {
                // for a non-draped node, just traverse children as usual.
                osg::Group::traverse( nv );
            }
        }

        else if ( nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR )
        {
            if ( _dirty )
            {
                applyChanges();
                _dirty = false;
                ADJUST_UPDATE_TRAV_COUNT( this, -1 );
            }
            
            // traverse children directly, regardles of draped status
            osg::Group::traverse( nv );
        }

        // handle other visitor types (like intersections, etc) by simply
        // traversing the child graph.
        else // if ( nv.getNodeVisitor() == osg::NodeVisitor::NODE_VISITOR )
        {
            osg::Group::traverse( nv );
        }
    }
}
开发者ID:ender35,项目名称:osgearth,代码行数:49,代码来源:DrapeableNode.cpp


示例14: OSG_MIN_VERSION_REQUIRED

void MultiPassTerrainTechnique::traverse(osg::NodeVisitor& nv)
{
    if (!_tile) return;

    // initialize the terrain tile on startup
    if (_tile->getDirty() && !_terrainTileInitialized) 
    {
        _tile->init();
        _terrainTileInitialized = true;

#if 0
#if OSG_MIN_VERSION_REQUIRED(2,9,8)
        _terrainTile->init(~0x0, true);
#else
        _terrainTile->init();
#endif

        _terrainTileInitialized = true;
#endif
    }
    
    if ( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR )
    {
        updateTransparency();
    }

    // traverse the dynamically-generated geometry.
    if (_transform.valid()) 
        _transform->accept(nv);
}
开发者ID:ender35,项目名称:osgearth,代码行数:30,代码来源:MultiPassTerrainTechnique.cpp


示例15: QuickReleaseGLObjects

void
TerrainNode::traverse( osg::NodeVisitor &nv )
{
    if ( nv.getVisitorType() == nv.UPDATE_VISITOR )
    {
        // if the terrain engine requested "quick release", install the quick release
        // draw callback now.
        if ( !_quickReleaseCallbackInstalled && _tilesToQuickRelease.valid() )
        {
            osg::Camera* cam = findFirstParentOfType<osg::Camera>( this );
            if ( cam )
            {
                // get the installed PDC so we can nest them:
                osg::Camera::DrawCallback* cbToNest = cam->getPostDrawCallback();

                // if it's another QR callback, we'll just replace it.
                QuickReleaseGLObjects* previousQR = dynamic_cast<QuickReleaseGLObjects*>(cbToNest);
                if ( previousQR )
                    cbToNest = previousQR->_next.get();

                cam->setPostDrawCallback( new QuickReleaseGLObjects(
                                              _tilesToQuickRelease.get(),
                                              cbToNest ) );

                _quickReleaseCallbackInstalled = true;
                OE_INFO << LC << "Quick release enabled" << std::endl;

                // knock down the trav count set in the constructor.
                ADJUST_UPDATE_TRAV_COUNT( this, -1 );
            }
        }
    }

    osg::Group::traverse( nv );
}
开发者ID:wlhm1984,项目名称:osgEarthX,代码行数:35,代码来源:TerrainNode.cpp


示例16: lock

void ossimPlanetAnnotationLayer::traverse(osg::NodeVisitor& nv)
{
   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theGraphMutex);
   switch(nv.getVisitorType())
	{
		case osg::NodeVisitor::UPDATE_VISITOR:
		{
         {
				OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theNodesToRemoveListMutex);
           ossimPlanetNode::NodeListType::iterator iter = theNodesToRemoveList.begin();
            while(iter != theNodesToRemoveList.end())
            {
               ossimPlanetNode::remove((*iter).get());
               ++iter;
            }
            theNodesToRemoveList.clear();
         }
			break;
		}
		default:
		{
			break;
		}
	}
	ossimPlanetLayer::traverse(nv);
}
开发者ID:ossimlabs,项目名称:ossim-planet,代码行数:26,代码来源:ossimPlanetAnnotationLayer.cpp


示例17: exclusive

void
TilePagedLOD::traverse(osg::NodeVisitor& nv)
{
    // Only traverse the TileNode if our neighbors (the other members of
    // our group of four) are ready as well.
    if ( _children.size() > 0 )
    {
        _children[0]->setNodeMask( _familyReady ? ~0 : 0 );

        // find our tile node:
        TileNode* tilenode = dynamic_cast<TileGroup*>(_children[0].get()) ? 
            static_cast<TileGroup*>(_children[0].get())->getTileNode() :
            static_cast<TileNode*>(_children[0].get());

        // Check whether the TileNode is marked dirty. If so, install a new pager request 
        // to reload and replace the TileNode.
        if (nv.getVisitorType() == nv.CULL_VISITOR &&
            this->getNumFileNames() < 2 && 
            tilenode->isOutOfDate() )
        {
            // lock keeps multiple CullVisitors from doing the same thing
            Threading::ScopedMutexLock exclusive( _updateMutex );

            if ( this->getNumFileNames() < 2 ) // double-check pattern
            {
                //OE_WARN << LC << "Queuing request for replacement: " << _container->getTileNode()->getKey().str() << std::endl;
                this->setFileName( 1, Stringify() << _prefix << ".osgearth_engine_mp_standalone_tile" );
                this->setRange( 1, 0, FLT_MAX );
            }
        }
    }

    osg::PagedLOD::traverse( nv );
}
开发者ID:flybpc,项目名称:osgearth,代码行数:34,代码来源:TilePagedLOD.cpp


示例18: switch

void ossimPlanetLayer::traverse(osg::NodeVisitor& nv)
{
   switch(nv.getVisitorType())
   {
      case osg::NodeVisitor::EVENT_VISITOR:
      {
         if(redrawFlag())
         {
            osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(&nv);
            if(ev)
            {
               if(ev->getActionAdapter())
               {
                  ev->getActionAdapter()->requestRedraw();
                  setRedrawFlag(false);
               }
            }
         }
         return;
      }
      case osg::NodeVisitor::UPDATE_VISITOR:
      {
         if(!thePlanet)
         {
            setPlanet(ossimPlanet::findPlanet(this));
         }
         break;
      }
      default:
      {
         
      }
   }
   ossimPlanetNode::traverse(nv);
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:35,代码来源:ossimPlanetLayer.cpp


示例19: setMapNode

void
AnnotationNode::traverse(osg::NodeVisitor& nv)
{
    if (nv.getVisitorType() == nv.UPDATE_VISITOR)
    {
        // MapNode auto discovery.
        if (_mapNodeRequired)
        {
            if (getMapNode() == 0L)
            {
                MapNode* mapNode = osgEarth::findInNodePath<MapNode>(nv);
                if (mapNode)
                {
                    setMapNode(mapNode);
                }
            }

            if (getMapNode() != 0L)
            {
                _mapNodeRequired = false;
                ADJUST_UPDATE_TRAV_COUNT(this, -1);
            }
        }
    }
    osg::Group::traverse(nv);
}
开发者ID:XenonofArcticus,项目名称:osgearth,代码行数:26,代码来源:AnnotationNode.cpp


示例20:

void
TerrainEngineNode::traverse( osg::NodeVisitor& nv )
{
    if ( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR )
    {
        if ( Registry::instance()->getCapabilities().supportsGLSL() )
        {
            _updateLightingUniformsHelper.cullTraverse( this, &nv );

            osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>( &nv );
            if ( cv )
            {
                osg::Vec3d eye = cv->getEyePoint();

                float elevation;
                if ( _map->isGeocentric() )
                    elevation = eye.length() - osg::WGS_84_RADIUS_EQUATOR;
                else
                    elevation = eye.z();

                _cameraElevationUniform->set( elevation );
            }
        }
    }

    //else if ( nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR )
    //{
    //    if ( Registry::instance()->getCapabilities().supportsGLSL() )
    //        _updateLightingUniformsHelper.updateTraverse( this );
    //}

    osg::CoordinateSystemNode::traverse( nv );
}
开发者ID:hulumogu,项目名称:osgearth,代码行数:33,代码来源:TerrainEngineNode.cpp



注:本文中的osg::NodeVisitor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ osg::PagedLOD类代码示例发布时间:2022-05-31
下一篇:
C++ osg::NodeUnrecPtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap