本文整理汇总了C++中QgsSymbolV2::setAlpha方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsSymbolV2::setAlpha方法的具体用法?C++ QgsSymbolV2::setAlpha怎么用?C++ QgsSymbolV2::setAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsSymbolV2
的用法示例。
在下文中一共展示了QgsSymbolV2::setAlpha方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cloneLayers
QgsSymbolV2* QgsFillSymbolV2::clone() const
{
QgsSymbolV2* cloneSymbol = new QgsFillSymbolV2( cloneLayers() );
cloneSymbol->setOutputUnit( mOutputUnit );
cloneSymbol->setAlpha( mAlpha );
return cloneSymbol;
}
示例2: cloneLayers
QgsSymbolV2* QgsMarkerSymbolV2::clone() const
{
QgsSymbolV2* cloneSymbol = new QgsMarkerSymbolV2( cloneLayers() );
cloneSymbol->setAlpha( mAlpha );
cloneSymbol->setLayer( mLayer );
cloneSymbol->setClipFeaturesToExtent( mClipFeaturesToExtent );
return cloneSymbol;
}
示例3: switch
QgsSymbolV2* QgsSymbolV2::defaultSymbol( QGis::GeometryType geomType )
{
QgsSymbolV2* s = 0;
// override global default if project has a default for this type
QString defaultSymbol;
switch ( geomType )
{
case QGis::Point :
defaultSymbol = QgsProject::instance()->readEntry( "DefaultStyles", "/Marker", "" );
break;
case QGis::Line :
defaultSymbol = QgsProject::instance()->readEntry( "DefaultStyles", "/Line", "" );
break;
case QGis::Polygon :
defaultSymbol = QgsProject::instance()->readEntry( "DefaultStyles", "/Fill", "" );
break;
default: defaultSymbol = ""; break;
}
if ( defaultSymbol != "" )
s = QgsStyleV2::defaultStyle()->symbol( defaultSymbol );
// if no default found for this type, get global default (as previously)
if ( ! s )
{
switch ( geomType )
{
case QGis::Point: s = new QgsMarkerSymbolV2(); break;
case QGis::Line: s = new QgsLineSymbolV2(); break;
case QGis::Polygon: s = new QgsFillSymbolV2(); break;
default: QgsDebugMsg( "unknown layer's geometry type" ); return NULL;
}
}
// set alpha transparency
s->setAlpha( QgsProject::instance()->readDoubleEntry( "DefaultStyles", "/AlphaInt", 255 ) / 255.0 );
// set random color, it project prefs allow
if ( defaultSymbol == "" ||
QgsProject::instance()->readBoolEntry( "DefaultStyles", "/RandomColors", true ) )
{
s->setColor( QColor::fromHsv( qrand() % 360, 64 + qrand() % 192, 128 + qrand() % 128 ) );
}
return s;
}
示例4: cloneLayers
QgsSymbolV2* QgsLineSymbolV2::clone() const
{
QgsSymbolV2* cloneSymbol = new QgsLineSymbolV2( cloneLayers() );
cloneSymbol->setAlpha( mAlpha );
return cloneSymbol;
}