本文整理汇总了C++中ImageLayer::createTextureSupported方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageLayer::createTextureSupported方法的具体用法?C++ ImageLayer::createTextureSupported怎么用?C++ ImageLayer::createTextureSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageLayer
的用法示例。
在下文中一共展示了ImageLayer::createTextureSupported方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createCoverageTexture
void
TerrainTileModelFactory::addColorLayers(TerrainTileModel* model,
const Map* map,
const TerrainEngineRequirements* reqs,
const TileKey& key,
const CreateTileModelFilter& filter,
ProgressCallback* progress)
{
OE_START_TIMER(fetch_image_layers);
int order = 0;
LayerVector layers;
map->getLayers(layers);
for (LayerVector::const_iterator i = layers.begin(); i != layers.end(); ++i)
{
Layer* layer = i->get();
if (layer->getRenderType() != layer->RENDERTYPE_TERRAIN_SURFACE)
continue;
if (!layer->getEnabled())
continue;
if (!filter.accept(layer))
continue;
ImageLayer* imageLayer = dynamic_cast<ImageLayer*>(layer);
if (imageLayer)
{
osg::Texture* tex = 0L;
osg::Matrixf textureMatrix;
if (imageLayer->isKeyInLegalRange(key) && imageLayer->mayHaveDataInExtent(key.getExtent()))
{
if (imageLayer->createTextureSupported())
{
tex = imageLayer->createTexture( key, progress, textureMatrix );
}
else
{
GeoImage geoImage = imageLayer->createImage( key, progress );
if ( geoImage.valid() )
{
if ( imageLayer->isCoverage() )
tex = createCoverageTexture(geoImage.getImage(), imageLayer);
else
tex = createImageTexture(geoImage.getImage(), imageLayer);
}
}
}
// if this is the first LOD, and the engine requires that the first LOD
// be populated, make an empty texture if we didn't get one.
if (tex == 0L &&
_options.firstLOD() == key.getLOD() &&
reqs && reqs->fullDataAtFirstLodRequired())
{
tex = _emptyTexture.get();
}
if (tex)
{
tex->setName(model->getKey().str());
TerrainTileImageLayerModel* layerModel = new TerrainTileImageLayerModel();
layerModel->setImageLayer(imageLayer);
layerModel->setTexture(tex);
layerModel->setMatrix(new osg::RefMatrixf(textureMatrix));
model->colorLayers().push_back(layerModel);
if (imageLayer->isShared())
{
model->sharedLayers().push_back(layerModel);
}
if (imageLayer->isDynamic())
{
model->setRequiresUpdateTraverse(true);
}
}
}
else // non-image kind of TILE layer:
{
TerrainTileColorLayerModel* colorModel = new TerrainTileColorLayerModel();
colorModel->setLayer(layer);
model->colorLayers().push_back(colorModel);
}
}
if (progress)
progress->stats()["fetch_imagery_time"] += OE_STOP_TIMER(fetch_image_layers);
}