QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Signals | Public Member Functions | List of all members
QgsLayoutItemMapItemClipPathSettings Class Reference

Contains settings relating to clipping a layout map by another layout item. More...

#include <qgslayoutitemmap.h>

Inheritance diagram for QgsLayoutItemMapItemClipPathSettings:
Inheritance graph
[legend]

Signals

void changed ()
 Emitted when the item clipping settings are changed. More...
 

Public Member Functions

 QgsLayoutItemMapItemClipPathSettings (QgsLayoutItemMap *map=nullptr)
 Constructor for QgsLayoutItemMapItemClipPathSettings, with the specified map parent. More...
 
QgsGeometry clipPathInMapItemCoordinates () const
 Returns the clipping path geometry, in the map item's coordinate space. More...
 
QgsGeometry clippedMapExtent () const
 Returns the geometry to use for clipping the parent map, in the map item's CRS. More...
 
bool enabled () const
 Returns true if the map content should be clipped to the associated item. More...
 
QgsMapClippingRegion::FeatureClippingType featureClippingType () const
 Returns the feature clipping type to apply when clipping to the associated item. More...
 
void finalizeRestoreFromXml ()
 To be called after all pending items have been restored from XML. More...
 
bool forceLabelsInsideClipPath () const
 Returns true if labels should only be placed inside the clip path geometry. More...
 
bool isActive () const
 Returns true if the item clipping is enabled and set to a valid source item. More...
 
bool readXml (const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context)
 Sets the setting's state from a DOM document, where element is the DOM node corresponding to a 'LayoutMap' tag. More...
 
void setEnabled (bool enabled)
 Sets whether the map content should be clipped to the associated item. More...
 
void setFeatureClippingType (QgsMapClippingRegion::FeatureClippingType type)
 Sets the feature clipping type to apply when clipping to the associated item. More...
 
void setForceLabelsInsideClipPath (bool forceInside)
 Sets whether labels should only be placed inside the clip path geometry. More...
 
void setSourceItem (QgsLayoutItem *item)
 Sets the source item which will provide the clipping path for the map. More...
 
QgsLayoutItemsourceItem ()
 Returns the source item which will provide the clipping path for the map, or nullptr if no item is set. More...
 
QgsMapClippingRegion toMapClippingRegion () const
 Returns the clip path as a map clipping region. More...
 
bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
 Stores settings in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag. More...
 

Detailed Description

Contains settings relating to clipping a layout map by another layout item.

Since
QGIS 3.16

Definition at line 169 of file qgslayoutitemmap.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemMapItemClipPathSettings()

QgsLayoutItemMapItemClipPathSettings::QgsLayoutItemMapItemClipPathSettings ( QgsLayoutItemMap map = nullptr)

Constructor for QgsLayoutItemMapItemClipPathSettings, with the specified map parent.

Definition at line 2939 of file qgslayoutitemmap.cpp.

Member Function Documentation

◆ changed

void QgsLayoutItemMapItemClipPathSettings::changed ( )
signal

Emitted when the item clipping settings are changed.

◆ clipPathInMapItemCoordinates()

QgsGeometry QgsLayoutItemMapItemClipPathSettings::clipPathInMapItemCoordinates ( ) const

Returns the clipping path geometry, in the map item's coordinate space.

Warning
The return path is not in geographic coordinates, rather the map layout item's QGraphicsItem coordinate space. Use clippedMapExtent() to retrieve the clip path in the map's CRS.
See also
clippedMapExtent()

Definition at line 2981 of file qgslayoutitemmap.cpp.

◆ clippedMapExtent()

QgsGeometry QgsLayoutItemMapItemClipPathSettings::clippedMapExtent ( ) const

Returns the geometry to use for clipping the parent map, in the map item's CRS.

See also
clipPathInMapItemCoordinates()

Definition at line 2970 of file qgslayoutitemmap.cpp.

◆ enabled()

bool QgsLayoutItemMapItemClipPathSettings::enabled ( ) const

Returns true if the map content should be clipped to the associated item.

See also
setEnabled()

Definition at line 2950 of file qgslayoutitemmap.cpp.

◆ featureClippingType()

QgsMapClippingRegion::FeatureClippingType QgsLayoutItemMapItemClipPathSettings::featureClippingType ( ) const

Returns the feature clipping type to apply when clipping to the associated item.

See also
setFeatureClippingType()

Definition at line 3041 of file qgslayoutitemmap.cpp.

◆ finalizeRestoreFromXml()

void QgsLayoutItemMapItemClipPathSettings::finalizeRestoreFromXml ( )

To be called after all pending items have been restored from XML.

See also
readXml()

Definition at line 3096 of file qgslayoutitemmap.cpp.

◆ forceLabelsInsideClipPath()

bool QgsLayoutItemMapItemClipPathSettings::forceLabelsInsideClipPath ( ) const

Returns true if labels should only be placed inside the clip path geometry.

See also
setForceLabelsInsideClipPath()

Definition at line 3055 of file qgslayoutitemmap.cpp.

◆ isActive()

bool QgsLayoutItemMapItemClipPathSettings::isActive ( ) const

Returns true if the item clipping is enabled and set to a valid source item.

See also
enabled()
sourceItem()

Definition at line 2945 of file qgslayoutitemmap.cpp.

◆ readXml()

bool QgsLayoutItemMapItemClipPathSettings::readXml ( const QDomElement &  element,
const QDomDocument &  doc,
const QgsReadWriteContext context 
)

Sets the setting's state from a DOM document, where element is the DOM node corresponding to a 'LayoutMap' tag.

See also
writeXml()
finalizeRestoreFromXml()

Definition at line 3084 of file qgslayoutitemmap.cpp.

◆ setEnabled()

void QgsLayoutItemMapItemClipPathSettings::setEnabled ( bool  enabled)

Sets whether the map content should be clipped to the associated item.

See also
enabled()

Definition at line 2955 of file qgslayoutitemmap.cpp.

◆ setFeatureClippingType()

void QgsLayoutItemMapItemClipPathSettings::setFeatureClippingType ( QgsMapClippingRegion::FeatureClippingType  type)

Sets the feature clipping type to apply when clipping to the associated item.

See also
featureClippingType()

Definition at line 3046 of file qgslayoutitemmap.cpp.

◆ setForceLabelsInsideClipPath()

void QgsLayoutItemMapItemClipPathSettings::setForceLabelsInsideClipPath ( bool  forceInside)

Sets whether labels should only be placed inside the clip path geometry.

See also
forceLabelsInsideClipPath()

Definition at line 3060 of file qgslayoutitemmap.cpp.

◆ setSourceItem()

void QgsLayoutItemMapItemClipPathSettings::setSourceItem ( QgsLayoutItem item)

Sets the source item which will provide the clipping path for the map.

The specified item must return the QgsLayoutItem::FlagProvidesClipPath flag.

See also
sourceItem()

Definition at line 2999 of file qgslayoutitemmap.cpp.

◆ sourceItem()

QgsLayoutItem * QgsLayoutItemMapItemClipPathSettings::sourceItem ( )

Returns the source item which will provide the clipping path for the map, or nullptr if no item is set.

See also
setSourceItem()

Definition at line 3036 of file qgslayoutitemmap.cpp.

◆ toMapClippingRegion()

QgsMapClippingRegion QgsLayoutItemMapItemClipPathSettings::toMapClippingRegion ( ) const

Returns the clip path as a map clipping region.

Definition at line 2992 of file qgslayoutitemmap.cpp.

◆ writeXml()

bool QgsLayoutItemMapItemClipPathSettings::writeXml ( QDomElement &  element,
QDomDocument &  document,
const QgsReadWriteContext context 
) const

Stores settings in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag.

See also
readXml()

Definition at line 3069 of file qgslayoutitemmap.cpp.


The documentation for this class was generated from the following files: