本文整理汇总了C++中QgsSymbolLayerV2List::append方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsSymbolLayerV2List::append方法的具体用法?C++ QgsSymbolLayerV2List::append怎么用?C++ QgsSymbolLayerV2List::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsSymbolLayerV2List
的用法示例。
在下文中一共展示了QgsSymbolLayerV2List::append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFromSld
QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::createFromSld( QDomElement &element )
{
QgsDebugMsg( "Entered." );
QString name;
QColor fillColor, lineColor;
double size, lineWidth;
QDomElement fillElem = element.firstChildElement( "Fill" );
if ( fillElem.isNull() )
return NULL;
QDomElement graphicFillElem = fillElem.firstChildElement( "GraphicFill" );
if ( graphicFillElem.isNull() )
return NULL;
QDomElement graphicElem = graphicFillElem.firstChildElement( "Graphic" );
if ( graphicElem.isNull() )
return NULL;
if ( !QgsSymbolLayerV2Utils::wellKnownMarkerFromSld( graphicElem, name, fillColor, lineColor, lineWidth, size ) )
return NULL;
if ( name != "horline" )
return NULL;
double angle = 0.0;
QString angleFunc;
if ( QgsSymbolLayerV2Utils::rotationFromSldElement( graphicElem, angleFunc ) )
{
bool ok;
double d = angleFunc.toDouble( &ok );
if ( ok )
angle = d;
}
double offset = 0.0;
QPointF vectOffset;
if ( QgsSymbolLayerV2Utils::displacementFromSldElement( graphicElem, vectOffset ) )
{
offset = sqrt( pow( vectOffset.x(), 2 ) + pow( vectOffset.y(), 2 ) );
}
QgsLinePatternFillSymbolLayer* sl = new QgsLinePatternFillSymbolLayer();
sl->setColor( lineColor );
sl->setLineWidth( lineWidth );
sl->setLineAngle( angle );
sl->setOffset( offset );
sl->setDistance( size );
// try to get the outline
QDomElement strokeElem = element.firstChildElement( "Stroke" );
if ( !strokeElem.isNull() )
{
QgsSymbolLayerV2 *l = QgsSymbolLayerV2Utils::createLineLayerFromSld( strokeElem );
if ( l )
{
QgsSymbolLayerV2List layers;
layers.append( l );
sl->setSubSymbol( new QgsLineSymbolV2( layers ) );
}
}
return sl;
}
示例2:
QgsSymbolLayerV2List QgsSymbolV2::cloneLayers() const
{
QgsSymbolLayerV2List lst;
for ( QgsSymbolLayerV2List::const_iterator it = mLayers.begin(); it != mLayers.end(); ++it )
{
QgsSymbolLayerV2* layer = ( *it )->clone();
layer->setLocked(( *it )->isLocked() );
layer->setRenderingPass(( *it )->renderingPass() );
lst.append( layer );
}
return lst;
}
示例3: QgsDebugMsg
QgsSymbolLayerV2* QgsCentroidFillSymbolLayerV2::createFromSld( QDomElement &element )
{
QgsDebugMsg( "Entered." );
QgsSymbolLayerV2 *l = QgsSymbolLayerV2Utils::createMarkerLayerFromSld( element );
if ( !l )
return NULL;
QgsSymbolLayerV2List layers;
layers.append( l );
QgsMarkerSymbolV2 *marker = new QgsMarkerSymbolV2( layers );
QgsCentroidFillSymbolLayerV2* x = new QgsCentroidFillSymbolLayerV2();
x->setSubSymbol( marker );
return x;
}
示例4: if
QgsSymbolLayerV2* QgsMarkerLineSymbolLayerV2::createFromSld( QDomElement &element )
{
QgsDebugMsg( "Entered." );
QDomElement strokeElem = element.firstChildElement( "Stroke" );
if ( strokeElem.isNull() )
return NULL;
QDomElement graphicStrokeElem = strokeElem.firstChildElement( "GraphicStroke" );
if ( graphicStrokeElem.isNull() )
return NULL;
// retrieve vendor options
bool rotateMarker = true;
Placement placement = Interval;
QgsStringMap vendorOptions = QgsSymbolLayerV2Utils::getVendorOptionList( element );
for ( QgsStringMap::iterator it = vendorOptions.begin(); it != vendorOptions.end(); ++it )
{
if ( it.key() == "placement" )
{
if ( it.value() == "points" ) placement = Vertex;
else if ( it.value() == "firstPoint" ) placement = FirstVertex;
else if ( it.value() == "lastPoint" ) placement = LastVertex;
else if ( it.value() == "centralPoint" ) placement = CentralPoint;
}
else if ( it.value() == "rotateMarker" )
{
rotateMarker = it.value() == "0";
}
}
QgsMarkerSymbolV2 *marker = 0;
QgsSymbolLayerV2 *l = QgsSymbolLayerV2Utils::createMarkerLayerFromSld( graphicStrokeElem );
if ( l )
{
QgsSymbolLayerV2List layers;
layers.append( l );
marker = new QgsMarkerSymbolV2( layers );
}
if ( !marker )
return NULL;
double interval = 0.0;
QDomElement gapElem = graphicStrokeElem.firstChildElement( "Gap" );
if ( !gapElem.isNull() )
{
bool ok;
double d = gapElem.firstChild().nodeValue().toDouble( &ok );
if ( ok )
interval = d;
}
double offset = 0.0;
QDomElement perpOffsetElem = graphicStrokeElem.firstChildElement( "PerpendicularOffset" );
if ( !perpOffsetElem.isNull() )
{
bool ok;
double d = perpOffsetElem.firstChild().nodeValue().toDouble( &ok );
if ( ok )
offset = d;
}
QgsMarkerLineSymbolLayerV2* x = new QgsMarkerLineSymbolLayerV2( rotateMarker );
x->setPlacement( placement );
x->setInterval( interval );
x->setSubSymbol( marker );
x->setOffset( offset );
return x;
}