コード例 #1
0
ファイル: OverlayDecorator.cpp プロジェクト: JohnDr/osgearth
void
OverlayDecorator::onInstall( TerrainEngineNode* engine )
{
    _engine = engine;

    // establish the earth's major axis:
    MapInfo info(engine->getMap());
    _isGeocentric = info.isGeocentric();
    _srs = info.getProfile()->getSRS();
    _ellipsoid = info.getProfile()->getSRS()->getEllipsoid();

    // the maximum extent (for projected maps only)
    if ( !_isGeocentric )
    {
        const GeoExtent& extent = info.getProfile()->getExtent();
        _maxProjectedMapExtent = osg::maximum( extent.width(), extent.height() );
    }

    //todo: need this? ... probably not anymore
    _useShaders = 
        Registry::capabilities().supportsGLSL() && 
        engine->getTextureCompositor()->usesShaderComposition();

    for(Techniques::iterator t = _techniques.begin(); t != _techniques.end(); ++t )
    {
        t->get()->onInstall( engine );
    }
}
コード例 #2
0
void
OverlayDecorator::setTerrainEngine(TerrainEngineNode* engine)
{
    if (engine)
    {
        _engine = engine;

        // establish the earth's major axis:
        MapInfo info(engine->getMap());
        _isGeocentric = info.isGeocentric();
        _srs = info.getProfile()->getSRS();
        _ellipsoid = info.getProfile()->getSRS()->getEllipsoid();

        for(Techniques::iterator t = _techniques.begin(); t != _techniques.end(); ++t )
        {
            t->get()->onInstall( engine );
        }
    }

    else
    {
        for (Techniques::iterator t = _techniques.begin(); t != _techniques.end(); ++t)
        {
            t->get()->onUninstall(engine);
        }
    }
}
コード例 #3
0
ファイル: OverlayDecorator.cpp プロジェクト: JohnDr/osgearth
void
OverlayDecorator::onUninstall( TerrainEngineNode* engine )
{
    for(Techniques::iterator t = _techniques.begin(); t != _techniques.end(); ++t )
    {
        t->get()->onUninstall( engine );
    }

    _engine = 0L;
}
コード例 #4
0
void
OverlayDecorator::onInstall( TerrainEngineNode* engine )
{
    _engine = engine;

    // establish the earth's major axis:
    MapInfo info(engine->getMap());
    _isGeocentric = info.isGeocentric();
    _srs = info.getProfile()->getSRS();
    _ellipsoid = info.getProfile()->getSRS()->getEllipsoid();

    //todo: need this? ... probably not anymore
    _useShaders = 
        Registry::capabilities().supportsGLSL() && (
            !engine->getTextureCompositor() ||
            engine->getTextureCompositor()->usesShaderComposition() );

    for(Techniques::iterator t = _techniques.begin(); t != _techniques.end(); ++t )
    {
        t->get()->onInstall( engine );
    }
}