本文整理汇总了C++中MapFrame::layers方法的典型用法代码示例。如果您正苦于以下问题:C++ MapFrame::layers方法的具体用法?C++ MapFrame::layers怎么用?C++ MapFrame::layers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapFrame
的用法示例。
在下文中一共展示了MapFrame::layers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
TerrainRenderData::setup(const MapFrame& frame,
const RenderBindings& bindings,
unsigned frameNum,
osgUtil::CullVisitor* cv)
{
_bindings = &bindings;
// Create a new State object to track sampler and uniform settings
_drawState = new DrawState();
_drawState->_frame = frameNum;
_drawState->_bindings = &bindings;
// Make a drawable for each rendering pass (i.e. each render-able map layer).
for(LayerVector::const_iterator i = frame.layers().begin();
i != frame.layers().end();
++i)
{
Layer* layer = i->get();
if (layer->getEnabled())
{
if (layer->getRenderType() == Layer::RENDERTYPE_TILE ||
layer->getRenderType() == Layer::RENDERTYPE_PATCH)
{
bool render = true;
// If this is an image layer, check the enabled/visible states.
VisibleLayer* visLayer = dynamic_cast<VisibleLayer*>(layer);
if (visLayer)
{
render = visLayer->getVisible();
}
if (render)
{
ImageLayer* imgLayer = dynamic_cast<ImageLayer*>(layer);
// Make a list of "global" layers. There are layers whose data is not
// represented in the TerrainTileModel, like a splatting layer or a patch
// layer. The data for these is dynamic and not based on data fetched.
if (imgLayer == 0L && layer->getRenderType() == Layer::RENDERTYPE_TILE)
{
tileLayers().push_back(layer);
addLayerDrawable(layer);
}
else if (layer->getRenderType() == Layer::RENDERTYPE_PATCH)
{
PatchLayer* patchLayer = static_cast<PatchLayer*>(layer); // asumption!
if (patchLayer->getAcceptCallback() != 0L &&
patchLayer->getAcceptCallback()->acceptLayer(*cv, cv->getCurrentCamera()))
{
patchLayers().push_back(dynamic_cast<PatchLayer*>(layer));
addLayerDrawable(layer);
}
}
else
{
addLayerDrawable(layer);
}
}
}
}
}
// Include a "blank" layer for missing data.
LayerDrawable* blank = addLayerDrawable(0L);
blank->getOrCreateStateSet()->setDefine("OE_TERRAIN_RENDER_IMAGERY", osg::StateAttribute::OFF);
}