QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
30 #include <QDomDocument>
31 #include <QDomElement>
47 return QStringLiteral(
"INVERTED: NULL" );
72 QDomElement embeddedRendererElem = element.firstChildElement( QStringLiteral(
"renderer-v2" ) );
73 if ( !embeddedRendererElem.isNull() )
78 r->
setPreprocessingEnabled( element.attribute( QStringLiteral(
"preprocessing" ), QStringLiteral(
"0" ) ).toInt() == 1 );
87 rendererElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"invertedPolygonRenderer" ) );
88 rendererElem.setAttribute( QStringLiteral(
"preprocessing" ),
preprocessingEnabled() ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
92 const QDomElement embeddedRendererElem =
mSubRenderer->save( doc, context );
93 rendererElem.appendChild( embeddedRendererElem );
103 if ( renderer->
type() == QLatin1String(
"invertedPolygonRenderer" ) )
107 else if ( renderer->
type() == QLatin1String(
"singleSymbol" ) ||
108 renderer->
type() == QLatin1String(
"categorizedSymbol" ) ||
109 renderer->
type() == QLatin1String(
"graduatedSymbol" ) ||
110 renderer->
type() == QLatin1String(
"RuleRenderer" ) )
112 std::unique_ptr< QgsInvertedPolygonRenderer > res = std::make_unique< QgsInvertedPolygonRenderer >( renderer->
clone() );
114 return res.release();
116 else if ( renderer->
type() == QLatin1String(
"mergedFeatureRenderer" ) )
118 std::unique_ptr< QgsInvertedPolygonRenderer > res = std::make_unique< QgsInvertedPolygonRenderer >( renderer->
embeddedRenderer() ? renderer->
embeddedRenderer()->
clone() :
nullptr );
120 return res.release();
void copyRendererData(QgsFeatureRenderer *destRenderer) const
Clones generic renderer data to another renderer.
static QgsFeatureRenderer * defaultRenderer(QgsWkbTypes::GeometryType geomType)
Returns a new renderer - used by default in vector layers.
bool preprocessingEnabled() const
The class is used as a container of context for various read/write operations on other objects.
GeometryOperation mOperation
Operation to apply to collected geometries.
static QgsInvertedPolygonRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
Creates a QgsInvertedPolygonRenderer by a conversion from an existing renderer.
QgsInvertedPolygonRenderer(QgsFeatureRenderer *embeddedRenderer=nullptr)
Constructor.
static QgsFeatureRenderer * load(QDomElement &symbologyElem, const QgsReadWriteContext &context)
create a renderer from XML element
QString dump() const override
Returns debug information about this renderer.
void saveRendererData(QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context)
Saves generic renderer data into the specified element.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
#define RENDERER_TAG_NAME
void setEmbeddedRenderer(QgsFeatureRenderer *subRenderer) override
Sets an embedded renderer (subrenderer) for this feature renderer.
QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) override
Stores renderer properties to an XML element.
static QgsFeatureRenderer * create(QDomElement &element, const QgsReadWriteContext &context)
Creates a renderer out of an XML, for loading.
QgsInvertedPolygonRenderer * clone() const override
Create a deep copy of this renderer.
@ InvertOnly
Invert features only (polygons only)
QgsMergedFeatureRenderer is a polygon or line-only feature renderer used to renderer a set of feature...
void setPreprocessingEnabled(bool enabled)
std::unique_ptr< QgsFeatureRenderer > mSubRenderer
Embedded renderer.
virtual const QgsFeatureRenderer * embeddedRenderer() const
Returns the current embedded renderer (subrenderer) for this feature renderer.
QgsInvertedPolygonRenderer is a polygon-only feature renderer used to display features inverted,...