本文整理汇总了C++中TileSource::isDynamic方法的典型用法代码示例。如果您正苦于以下问题:C++ TileSource::isDynamic方法的具体用法?C++ TileSource::isDynamic怎么用?C++ TileSource::isDynamic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TileSource
的用法示例。
在下文中一共展示了TileSource::isDynamic方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
CompositeTileSource::initialize( const std::string& referenceURI, const Profile* overrideProfile )
{
osg::ref_ptr<const Profile> profile = overrideProfile;
for(CompositeTileSourceOptions::ComponentVector::iterator i = _options._components.begin();
i != _options._components.end();
++i)
{
TileSource* source = i->_tileSourceInstance.get();
if ( source )
{
osg::ref_ptr<const Profile> localOverrideProfile = overrideProfile;
const TileSourceOptions& opt = source->getOptions();
if ( opt.profile().isSet() )
localOverrideProfile = Profile::create( opt.profile().value() );
source->initialize( referenceURI, localOverrideProfile.get() );
if ( !profile.valid() )
{
// assume the profile of the first source to be the overall profile.
profile = source->getProfile();
}
else if ( !profile->isEquivalentTo( source->getProfile() ) )
{
// if sub-sources have different profiles, print a warning because this is
// not supported!
OE_WARN << LC << "Components with differing profiles are not supported. "
<< "Visual anomalies may result." << std::endl;
}
_dynamic = _dynamic || source->isDynamic();
// gather extents
const DataExtentList& extents = source->getDataExtents();
for( DataExtentList::const_iterator j = extents.begin(); j != extents.end(); ++j )
{
getDataExtents().push_back( *j );
}
}
}
setProfile( profile.get() );
_initialized = true;
}
示例2: getTileSource
bool
TerrainLayer::isDynamic() const
{
TileSource* ts = getTileSource();
return ts ? ts->isDynamic() : false;
}
示例3: if
TileSource::Status
CompositeTileSource::initialize(const osgDB::Options* dbOptions)
{
_dbOptions = Registry::instance()->cloneOrCreateOptions(dbOptions);
osg::ref_ptr<const Profile> profile = getProfile();
for(CompositeTileSourceOptions::ComponentVector::iterator i = _options._components.begin();
i != _options._components.end(); )
{
if ( i->_imageLayerOptions.isSet() )
{
if ( !i->_tileSourceInstance.valid() )
{
i->_tileSourceInstance = TileSourceFactory::create( i->_imageLayerOptions->driver().value() );
if ( !i->_tileSourceInstance.valid() )
{
OE_WARN << LC << "Could not find a TileSource for driver [" << i->_imageLayerOptions->driver()->getDriver() << "]" << std::endl;
}
}
}
if ( !i->_tileSourceInstance.valid() )
{
OE_WARN << LC << "A component has no valid TileSource ... removing." << std::endl;
i = _options._components.erase( i );
}
else
{
TileSource* source = i->_tileSourceInstance.get();
if ( source )
{
osg::ref_ptr<const Profile> localOverrideProfile = profile.get();
const TileSourceOptions& opt = source->getOptions();
if ( opt.profile().isSet() )
{
localOverrideProfile = Profile::create( opt.profile().value() );
source->setProfile( localOverrideProfile.get() );
}
// initialize the component tile source:
TileSource::Status compStatus = source->startup( _dbOptions.get() );
if ( compStatus == TileSource::STATUS_OK )
{
if ( !profile.valid() )
{
// assume the profile of the first source to be the overall profile.
profile = source->getProfile();
}
else if ( !profile->isEquivalentTo( source->getProfile() ) )
{
// if sub-sources have different profiles, print a warning because this is
// not supported!
OE_WARN << LC << "Components with differing profiles are not supported. "
<< "Visual anomalies may result." << std::endl;
}
_dynamic = _dynamic || source->isDynamic();
// gather extents
const DataExtentList& extents = source->getDataExtents();
for( DataExtentList::const_iterator j = extents.begin(); j != extents.end(); ++j )
{
getDataExtents().push_back( *j );
}
}
else
{
// if even one of the components fails to initialize, the entire
// composite tile source is invalid.
return Status::Error("At least one component is invalid");
}
}
}
++i;
}
// set the new profile that was derived from the components
setProfile( profile.get() );
_initialized = true;
return STATUS_OK;
}
示例4: if
Status
CompositeTileSource::initialize(const osgDB::Options* dbOptions)
{
_dbOptions = Registry::instance()->cloneOrCreateOptions(dbOptions);
osg::ref_ptr<const Profile> profile = getProfile();
for(CompositeTileSourceOptions::ComponentVector::iterator i = _options._components.begin();
i != _options._components.end(); )
{
if ( i->_imageLayerOptions.isSet() && !i->_layer.valid() )
{
// Disable the l2 cache for composite layers so that we don't get run out of memory on very large datasets.
i->_imageLayerOptions->driver()->L2CacheSize() = 0;
osg::ref_ptr< ImageLayer > layer = new ImageLayer(*i->_imageLayerOptions);
layer->setReadOptions(_dbOptions.get());
Status status = layer->open();
if (status.isOK())
{
i->_layer = layer;
_imageLayers.push_back( layer );
OE_INFO << LC << " .. added image layer " << layer->getName() << " (" << i->_imageLayerOptions->driver()->getDriver() << ")\n";
}
else
{
OE_WARN << LC << "Could not open image layer (" << layer->getName() << ") ... " << status.message() << std::endl;
}
}
else if (i->_elevationLayerOptions.isSet() && !i->_layer.valid())
{
// Disable the l2 cache for composite layers so that we don't get run out of memory on very large datasets.
i->_elevationLayerOptions->driver()->L2CacheSize() = 0;
osg::ref_ptr< ElevationLayer > layer = new ElevationLayer(*i->_elevationLayerOptions);
layer->setReadOptions(_dbOptions.get());
Status status = layer->open();
if (status.isOK())
{
i->_layer = layer;
_elevationLayers.push_back( layer.get() );
}
else
{
OE_WARN << LC << "Could not open elevation layer (" << layer->getName() << ") ... " << status.message() << std::endl;
}
}
if ( !i->_layer.valid() )
{
OE_WARN << LC << "A component has no valid TerrainLayer ... removing." << std::endl;
i = _options._components.erase( i );
}
else
{
TileSource* source = i->_layer->getTileSource();
// If no profile is specified assume they want to use the profile of the first layer in the list.
if (!profile.valid())
{
profile = source->getProfile();
}
_dynamic = _dynamic || source->isDynamic();
// gather extents
const DataExtentList& extents = source->getDataExtents();
for( DataExtentList::const_iterator j = extents.begin(); j != extents.end(); ++j )
{
// Convert the data extent to the profile that is actually used by this TileSource
DataExtent dataExtent = *j;
GeoExtent ext = dataExtent.transform(profile->getSRS());
unsigned int minLevel = 0;
unsigned int maxLevel = profile->getEquivalentLOD( source->getProfile(), *dataExtent.maxLevel() );
dataExtent = DataExtent(ext, minLevel, maxLevel);
getDataExtents().push_back( dataExtent );
}
}
++i;
}
// set the new profile that was derived from the components
setProfile( profile.get() );
_initialized = true;
return STATUS_OK;
}
示例5: if
void
CompositeTileSource::initialize(const osgDB::Options* dbOptions,
const Profile* overrideProfile )
{
_dbOptions = dbOptions;
osg::ref_ptr<const Profile> profile = overrideProfile;
for(CompositeTileSourceOptions::ComponentVector::iterator i = _options._components.begin();
i != _options._components.end(); )
{
if ( i->_imageLayerOptions.isSet() )
{
if ( !i->_tileSourceInstance.valid() )
{
i->_tileSourceInstance = TileSourceFactory::create( i->_imageLayerOptions->driver().value() );
if ( !i->_tileSourceInstance.valid() )
{
OE_WARN << LC << "Could not find a TileSource for driver [" << i->_imageLayerOptions->driver()->getDriver() << "]" << std::endl;
}
}
}
if ( !i->_tileSourceInstance.valid() )
{
OE_WARN << LC << "A component has no valid TileSource ... removing." << std::endl;
i = _options._components.erase( i );
}
else
{
TileSource* source = i->_tileSourceInstance.get();
if ( source )
{
osg::ref_ptr<const Profile> localOverrideProfile = overrideProfile;
const TileSourceOptions& opt = source->getOptions();
if ( opt.profile().isSet() )
localOverrideProfile = Profile::create( opt.profile().value() );
source->initialize( dbOptions, localOverrideProfile.get() );
if ( !profile.valid() )
{
// assume the profile of the first source to be the overall profile.
profile = source->getProfile();
}
else if ( !profile->isEquivalentTo( source->getProfile() ) )
{
// if sub-sources have different profiles, print a warning because this is
// not supported!
OE_WARN << LC << "Components with differing profiles are not supported. "
<< "Visual anomalies may result." << std::endl;
}
_dynamic = _dynamic || source->isDynamic();
// gather extents
const DataExtentList& extents = source->getDataExtents();
for( DataExtentList::const_iterator j = extents.begin(); j != extents.end(); ++j )
{
getDataExtents().push_back( *j );
}
}
}
++i;
}
setProfile( profile.get() );
_initialized = true;
}