本文整理汇总了C++中QgsSymbolV2List::size方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsSymbolV2List::size方法的具体用法?C++ QgsSymbolV2List::size怎么用?C++ QgsSymbolV2List::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsSymbolV2List
的用法示例。
在下文中一共展示了QgsSymbolV2List::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertFromRenderer
QgsSingleSymbolRendererV2* QgsSingleSymbolRendererV2::convertFromRenderer( const QgsFeatureRendererV2 *renderer )
{
if ( renderer->type() == "singleSymbol" )
{
return dynamic_cast<QgsSingleSymbolRendererV2*>( renderer->clone() );
}
if ( renderer->type() == "pointDisplacement" )
{
const QgsPointDisplacementRenderer* pointDisplacementRenderer = dynamic_cast<const QgsPointDisplacementRenderer*>( renderer );
if ( pointDisplacementRenderer )
return convertFromRenderer( pointDisplacementRenderer->embeddedRenderer() );
}
if ( renderer->type() == "invertedPolygonRenderer" )
{
const QgsInvertedPolygonRenderer* invertedPolygonRenderer = dynamic_cast<const QgsInvertedPolygonRenderer*>( renderer );
if ( invertedPolygonRenderer )
return convertFromRenderer( invertedPolygonRenderer->embeddedRenderer() );
}
QgsSymbolV2List symbols = const_cast<QgsFeatureRendererV2 *>( renderer )->symbols();
if ( symbols.size() > 0 )
{
return new QgsSingleSymbolRendererV2( symbols.at( 0 )->clone() );
}
return 0;
}
示例2: firstSymbolForFeature
QgsSymbolV2* QgsPointDisplacementRenderer::firstSymbolForFeature( QgsFeatureRendererV2* r, QgsFeature& f )
{
if ( !r )
{
return 0;
}
QgsSymbolV2List symbolList = r->symbolsForFeature( f );
if ( symbolList.size() < 1 )
{
return 0;
}
return symbolList.at( 0 );
}
示例3: writeEntities
void QgsDxfExport::writeEntities()
{
startSection();
writeGroup( 2, "ENTITIES" );
//label engine
QgsDxfPalLabeling labelEngine( this, mExtent.isEmpty() ? dxfExtent() : mExtent, mSymbologyScaleDenominator, mMapUnits );
QgsRenderContext& ctx = labelEngine.renderContext();
//iterate through the maplayers
QList< QgsMapLayer* >::iterator layerIt = mLayers.begin();
for ( ; layerIt != mLayers.end(); ++layerIt )
{
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer*>( *layerIt );
if ( !vl || !layerIsScaleBasedVisible( vl ) )
{
continue;
}
QgsSymbolV2RenderContext sctx( ctx, QgsSymbolV2::MM , 1.0, false, 0, 0 );
QgsFeatureRendererV2* renderer = vl->rendererV2();
renderer->startRender( ctx, vl->pendingFields() );
QStringList attributes = renderer->usedAttributes();
bool labelLayer = ( labelEngine.prepareLayer( vl, attributes, ctx ) != 0 );
if ( mSymbologyExport == QgsDxfExport::SymbolLayerSymbology && ( renderer->capabilities() & QgsFeatureRendererV2::SymbolLevels ) &&
renderer->usingSymbolLevels() )
{
writeEntitiesSymbolLevels( vl );
renderer->stopRender( ctx );
continue;
}
QgsFeatureRequest freq = QgsFeatureRequest().setSubsetOfAttributes(
attributes, vl->pendingFields() );
if ( !mExtent.isEmpty() )
{
freq.setFilterRect( mExtent );
}
QgsFeatureIterator featureIt = vl->getFeatures( freq );
QgsFeature fet;
while ( featureIt.nextFeature( fet ) )
{
sctx.setFeature( &fet );
if ( mSymbologyExport == NoSymbology )
{
addFeature( sctx, dxfLayerName( vl->name() ), 0, 0 ); //no symbology at all
}
else
{
if ( !renderer )
{
continue;
}
QgsSymbolV2List symbolList = renderer->symbolsForFeature( fet );
if ( symbolList.size() < 1 )
{
continue;
}
if ( mSymbologyExport == QgsDxfExport::SymbolLayerSymbology ) //symbol layer symbology, but layer does not use symbol levels
{
QgsSymbolV2List::iterator symbolIt = symbolList.begin();
for ( ; symbolIt != symbolList.end(); ++symbolIt )
{
int nSymbolLayers = ( *symbolIt )->symbolLayerCount();
for ( int i = 0; i < nSymbolLayers; ++i )
{
addFeature( sctx, dxfLayerName( vl->name() ), ( *symbolIt )->symbolLayer( i ), *symbolIt );
}
}
}
else
{
//take first symbollayer from first symbol
QgsSymbolV2* s = symbolList.first();
if ( !s || s->symbolLayerCount() < 1 )
{
continue;
}
addFeature( sctx, dxfLayerName( vl->name() ), s->symbolLayer( 0 ), s );
}
if ( labelLayer )
{
labelEngine.registerFeature( vl->id(), fet, ctx );
}
}
}
renderer->stopRender( ctx );
}
labelEngine.drawLabeling( ctx );
endSection();
}