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" ) );
89 rendererElem.setAttribute( QStringLiteral(
"forceraster" ), (
mForceRaster ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) ) );
93 QDomElement embeddedRendererElem =
mSubRenderer->save( doc, context );
94 rendererElem.appendChild( embeddedRendererElem );
102 QDomElement
orderBy = doc.createElement( QStringLiteral(
"orderby" ) );
104 rendererElem.appendChild(
orderBy );
106 rendererElem.setAttribute( QStringLiteral(
"enableorderby" ), (
mOrderByEnabled ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) ) );
113 if ( renderer->
type() == QLatin1String(
"invertedPolygonRenderer" ) )
117 else if ( renderer->
type() == QLatin1String(
"singleSymbol" ) ||
118 renderer->
type() == QLatin1String(
"categorizedSymbol" ) ||
119 renderer->
type() == QLatin1String(
"graduatedSymbol" ) ||
120 renderer->
type() == QLatin1String(
"RuleRenderer" ) )
124 else if ( renderer->
type() == QLatin1String(
"mergedFeatureRenderer" ) )
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
static QgsFeatureRenderer * defaultRenderer(QgsWkbTypes::GeometryType geomType)
Returns a new renderer - used by default in vector layers.
QgsPaintEffect * mPaintEffect
void copyRendererData(QgsFeatureRenderer *destRenderer) const
Clones generic renderer data to another renderer.
static QgsFeatureRenderer * load(QDomElement &symbologyElem, const QgsReadWriteContext &context)
create a renderer from XML element
QgsFeatureRequest::OrderBy mOrderBy
virtual const QgsFeatureRenderer * embeddedRenderer() const
Returns the current embedded renderer (subrenderer) for this feature renderer.
QgsFeatureRequest::OrderBy orderBy() const
Gets the order in which features shall be processed by this renderer.
void CORE_EXPORT save(QDomElement &elem) const
Serialize to XML.
QgsInvertedPolygonRenderer is a polygon-only feature renderer used to display features inverted,...
bool preprocessingEnabled() const
static QgsInvertedPolygonRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
Creates a QgsInvertedPolygonRenderer by a conversion from an existing renderer.
static QgsFeatureRenderer * create(QDomElement &element, const QgsReadWriteContext &context)
Creates a renderer out of an XML, for loading.
void setPreprocessingEnabled(bool enabled)
QString dump() const override
Returns debug information about this renderer.
QgsInvertedPolygonRenderer * clone() const override
Create a deep copy of this renderer.
QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) override
store renderer info to XML element
QgsInvertedPolygonRenderer(QgsFeatureRenderer *embeddedRenderer=nullptr)
Constructor.
QgsMergedFeatureRenderer is a polygon or line-only feature renderer used to renderer a set of feature...
@ InvertOnly
Invert features only (polygons only)
GeometryOperation mOperation
Operation to apply to collected geometries.
void setEmbeddedRenderer(QgsFeatureRenderer *subRenderer) override
Sets an embedded renderer (subrenderer) for this feature renderer.
std::unique_ptr< QgsFeatureRenderer > mSubRenderer
Embedded renderer.
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
virtual bool saveProperties(QDomDocument &doc, QDomElement &element) const
Saves the current state of the effect to a DOM element.
The class is used as a container of context for various read/write operations on other objects.
#define RENDERER_TAG_NAME