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 ); } }
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); } } }
void OverlayDecorator::onUninstall( TerrainEngineNode* engine ) { for(Techniques::iterator t = _techniques.begin(); t != _techniques.end(); ++t ) { t->get()->onUninstall( engine ); } _engine = 0L; }
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 ); } }