本文整理汇总了C++中LayerVector::size方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerVector::size方法的具体用法?C++ LayerVector::size怎么用?C++ LayerVector::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerVector
的用法示例。
在下文中一共展示了LayerVector::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LabelControl
void
updateControlPanel()
{
// erase all child controls and just rebuild them b/c we're lazy.
//Rebuild all the image layers
s_activeBox->clearControls();
int row = 0;
LabelControl* activeLabel = new LabelControl( "Map Layers", 20, osg::Vec4f(1,1,0,1) );
s_activeBox->setControl( 1, row++, activeLabel );
// the active map layers:
LayerVector layers;
s_activeMap->getLayers(layers);
for (int i = layers.size()-1; i >= 0; --i)
{
Layer* layer = layers[i].get();
addLayerItem(s_activeBox, i, layers.size(), layer, true);
if (layer->getStatus().isError())
{
OE_WARN << layer->getName() << " : " << layer->getStatus().toString() << "\n";
}
}
// inactive layers:
s_inactiveBox->clearControls();
if (!_inactive.empty())
{
s_inactiveBox->setControl(0, row++, new LabelControl("Removed:", 18, osg::Vec4f(1,1,0,1)));
for (InactiveLayers::const_iterator i = _inactive.begin(); i != _inactive.end(); ++i)
{
createInactiveLayerItem(s_inactiveBox, row++, i->first, i->second);
}
}
s_inactiveBox->setVisible(!_inactive.empty());
}
示例2: onBeginUpdate
void
MapCallback::invokeOnLayerRemoved(const Map* map)
{
LayerVector layers;
map->getLayers(layers);
unsigned index = 0;
if (layers.size() > 0)
{
onBeginUpdate();
for (LayerVector::iterator i = layers.begin(); i != layers.end(); ++i)
onLayerRemoved(i->get(), index++);
onEndUpdate();
}
}