本文整理汇总了C++中QgsSymbolV2::color方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsSymbolV2::color方法的具体用法?C++ QgsSymbolV2::color怎么用?C++ QgsSymbolV2::color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsSymbolV2
的用法示例。
在下文中一共展示了QgsSymbolV2::color方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: symbolForFeature
QgsSymbolV2* QgsGrassEditRenderer::symbolForFeature( QgsFeature& feature, QgsRenderContext& context )
{
int symbolCode = feature.attribute( "topo_symbol" ).toInt();
QgsDebugMsgLevel( QString( "fid = %1 symbolCode = %2" ).arg( feature.id() ).arg( symbolCode ), 3 );
QgsSymbolV2* symbol = 0;
if ( symbolCode == QgsGrassVectorMap::TopoPoint || symbolCode == QgsGrassVectorMap::TopoCentroidIn ||
symbolCode == QgsGrassVectorMap::TopoCentroidOut || symbolCode == QgsGrassVectorMap::TopoCentroidDupl ||
symbolCode == QgsGrassVectorMap::TopoNode0 || symbolCode == QgsGrassVectorMap::TopoNode1 ||
symbolCode == QgsGrassVectorMap::TopoNode2 )
{
symbol = mMarkerRenderer->symbolForFeature( feature, context );
}
else if ( symbolCode == QgsGrassVectorMap::TopoLine || symbolCode == QgsGrassVectorMap::TopoBoundaryError ||
symbolCode == QgsGrassVectorMap::TopoBoundaryErrorLeft || symbolCode == QgsGrassVectorMap::TopoBoundaryErrorRight ||
symbolCode == QgsGrassVectorMap::TopoBoundaryOk )
{
symbol = mLineRenderer->symbolForFeature( feature, context );
}
else
{
// should not happen
QgsDebugMsg( "unknown symbol code" );
}
if ( symbol )
{
QgsDebugMsgLevel( "color = " + symbol->color().name(), 3 );
}
else
{
QgsDebugMsgLevel( "no symbol", 3 );
}
return symbol;
}