本文整理汇总了C++中Layers::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Layers::begin方法的具体用法?C++ Layers::begin怎么用?C++ Layers::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layers
的用法示例。
在下文中一共展示了Layers::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDateOfLastModification
bool System::getDateOfLastModification(osgTerrain::TerrainTile *source, Date &date)
{
typedef std::list<osgTerrain::Layer *> Layers;
Layers layers;
if (source->getElevationLayer())
{
layers.push_back(source->getElevationLayer());
}
for (unsigned int i = 0; i < source->getNumColorLayers(); ++i)
{
osgTerrain::Layer *layer = source->getColorLayer(i);
if (layer)
{
layers.push_back(layer);
}
}
typedef std::list<std::string> Filenames;
Filenames filenames;
for (Layers::iterator itr = layers.begin();
itr != layers.end();
++itr)
{
osgTerrain::CompositeLayer *compositeLayer = dynamic_cast<osgTerrain::CompositeLayer *>(*itr);
if (compositeLayer)
{
for (unsigned int i = 0; i < compositeLayer->getNumLayers(); ++i)
{
filenames.push_back(compositeLayer->getFileName(i));
}
}
else
{
filenames.push_back((*itr)->getFileName());
}
}
bool modified = false;
for (Filenames::iterator itr = filenames.begin();
itr != filenames.end();
++itr)
{
Date lastModification;
if (lastModification.setWithDateOfLastModification(*itr))
{
if (lastModification > date)
{
date = lastModification;
modified = true;
}
}
}
return modified;
}
示例2: begin
const_iterator begin() const { return m_layers.begin(); }
示例3: createImages
QStringList SmilExportPlugin::createImages(const QList<KTScene *> &scenes, const QDir &dir, float sx, float sy, const char *format)
{
QStringList paths;
int nPhotogramsRenderized = 0;
foreach(KTScene *scene, scenes )
{
Layers layers = scene->layers();
bool m_isRendered = false;
while ( ! m_isRendered )
{
Layers::iterator layerIterator = layers.begin();
bool ok = true;
QImage renderized = QImage(m_size.width(), m_size.height(), QImage::Format_RGB32);
renderized.fill(qRgb(255, 255, 255));
QPainter painter(&renderized);
painter.setRenderHint(QPainter::Antialiasing);
while ( layerIterator != layers.end() )
{
ok = ok && (nPhotogramsRenderized > (*layerIterator)->frames().count());
if ( *layerIterator && nPhotogramsRenderized < (*layerIterator)->frames().count() && (*layerIterator)->isVisible() )
{
KTKeyFrame *frame = (*layerIterator)->frames()[nPhotogramsRenderized];
if ( frame )
{
QList<AGraphicComponent *> componentList = frame->components();
if ( componentList.count() > 0 )
{
QList<AGraphicComponent *>::iterator it = componentList.begin();
while ( it != componentList.end() )
{
(*it)->draw( &painter);
++it;
}
}
}
}
++layerIterator;
}
QString file = "";
QString extension = QString::fromLocal8Bit(format).toLower();
if ( nPhotogramsRenderized < 10 )
{
file = QString("000%1").arg(nPhotogramsRenderized);
}
else if ( nPhotogramsRenderized < 100 )
{
file = QString("00%1").arg(nPhotogramsRenderized);
}
else if( nPhotogramsRenderized < 1000 )
{
file = QString("0%1").arg(nPhotogramsRenderized);
}
else if( nPhotogramsRenderized < 10000 )
{
file = QString("%1").arg(nPhotogramsRenderized);
}
if ( !renderized.isNull() )
{
QString dest = dir.path()+"/data/"+m_baseName+file+"."+extension;
renderized.save(dest, format);
paths << dest;
createPar( dest, 1.0f/(float)scene->fps() );
}
if (ok )
{
m_isRendered = true;
}
nPhotogramsRenderized++;
}
}