QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
QgsElevationProfile Class Reference

Represents an elevation profile attached to a project. More...

#include <qgselevationprofile.h>

Inheritance diagram for QgsElevationProfile:

Public Slots

void setCrs (const QgsCoordinateReferenceSystem &crs)
 Sets the crs associated with the profile's map coordinates.
void setDistanceUnit (Qgis::DistanceUnit unit)
 Sets the distance unit used by the profile.
void setLockAxisScales (bool lock)
 Sets whether the distance and elevation scales are locked to each other.
void setName (const QString &name)
 Sets the profile's unique name.
void setTolerance (double tolerance)
 Sets the profile tolerance (in crs() units).
void setUseProjectLayerTree (bool useProjectTree)
 Sets whether the profile should always use the project's layer tree.

Signals

void nameChanged (const QString &newName)
 Emitted when the profile is renamed.
void useProjectLayerTreeChanged (bool useProjectTree)
 Emitted when the use project layer tree property is changed.

Public Member Functions

 QgsElevationProfile (QgsProject *project)
 Constructor for QgsElevationProfile.
 ~QgsElevationProfile () override
QgsCoordinateReferenceSystem crs () const
 Returns the crs associated with the profile's map coordinates.
Qgis::DistanceUnit distanceUnit () const
 Returns the distance unit used by the profile.
QIcon icon () const
 Returns the icon to use for the elevation profile.
QgsLayerTreelayerTree ()
 Returns the layer tree used by the profile.
bool lockAxisScales () const
 Returns true if the distance and elevation scales are locked to each other.
QString name () const
 Returns the profile's unique name.
QgsCurveprofileCurve () const
 Returns the profile curve.
bool readXml (const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
 Sets the profiles's state from a DOM element.
void resolveReferences (const QgsProject *project)
 After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs.
void setProfileCurve (QgsCurve *curve)
 Sets the profile curve.
void setSubsectionsSymbol (QgsLineSymbol *symbol)
 Sets the symbol used to draw the subsections.
QgsLineSymbolsubsectionsSymbol ()
 Returns the symbol used to draw the subsections.
double tolerance () const
 Returns the tolerance of the profile (in crs() units).
bool useProjectLayerTree ()
 Returns true if the profile should always use the project's layer tree.
QDomElement writeXml (QDomDocument &document, const QgsReadWriteContext &context) const
 Returns the profiles's state encapsulated in a DOM element.

Properties

bool useProjectLayerTree

Detailed Description

Represents an elevation profile attached to a project.

Since
QGIS 4.0

Definition at line 44 of file qgselevationprofile.h.

Constructor & Destructor Documentation

◆ QgsElevationProfile()

QgsElevationProfile::QgsElevationProfile ( QgsProject * project)
explicit

Constructor for QgsElevationProfile.

Definition at line 25 of file qgselevationprofile.cpp.

◆ ~QgsElevationProfile()

QgsElevationProfile::~QgsElevationProfile ( )
overridedefault

Member Function Documentation

◆ crs()

QgsCoordinateReferenceSystem QgsElevationProfile::crs ( ) const

Returns the crs associated with the profile's map coordinates.

See also
setCrs()

Definition at line 165 of file qgselevationprofile.cpp.

◆ distanceUnit()

Qgis::DistanceUnit QgsElevationProfile::distanceUnit ( ) const

Returns the distance unit used by the profile.

See also
setDistanceUnit()

Definition at line 202 of file qgselevationprofile.cpp.

◆ icon()

QIcon QgsElevationProfile::icon ( ) const

Returns the icon to use for the elevation profile.

Definition at line 146 of file qgselevationprofile.cpp.

◆ layerTree()

QgsLayerTree * QgsElevationProfile::layerTree ( )

Returns the layer tree used by the profile.

Will be nullptr if useProjectLayerTree() is true.

See also
useProjectLayerTree()
setUseProjectLayerTree()

Definition at line 151 of file qgselevationprofile.cpp.

◆ lockAxisScales()

bool QgsElevationProfile::lockAxisScales ( ) const

Returns true if the distance and elevation scales are locked to each other.

See also
setLockAxisScales()

Definition at line 197 of file qgselevationprofile.cpp.

◆ name()

QString QgsElevationProfile::name ( ) const
inline

Returns the profile's unique name.

See also
setName()
nameChanged()

Definition at line 64 of file qgselevationprofile.h.

◆ nameChanged

void QgsElevationProfile::nameChanged ( const QString & newName)
signal

Emitted when the profile is renamed.

See also
name()
setName()

◆ profileCurve()

QgsCurve * QgsElevationProfile::profileCurve ( ) const

Returns the profile curve.

The CRS associated with the curve is retrieved via crs().

See also
setProfileCurve()

Definition at line 178 of file qgselevationprofile.cpp.

◆ readXml()

bool QgsElevationProfile::readXml ( const QDomElement & element,
const QDomDocument & document,
const QgsReadWriteContext & context )

Sets the profiles's state from a DOM element.

element is the DOM node corresponding to the profile.

See also
resolveReferences()
writeXml()

Definition at line 78 of file qgselevationprofile.cpp.

◆ resolveReferences()

void QgsElevationProfile::resolveReferences ( const QgsProject * project)

After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs.

See also
readXml()

Definition at line 141 of file qgselevationprofile.cpp.

◆ setCrs

void QgsElevationProfile::setCrs ( const QgsCoordinateReferenceSystem & crs)
slot

Sets the crs associated with the profile's map coordinates.

See also
crs()

Definition at line 156 of file qgselevationprofile.cpp.

◆ setDistanceUnit

void QgsElevationProfile::setDistanceUnit ( Qgis::DistanceUnit unit)
slot

Sets the distance unit used by the profile.

See also
distanceUnit()

Definition at line 216 of file qgselevationprofile.cpp.

◆ setLockAxisScales

void QgsElevationProfile::setLockAxisScales ( bool lock)
slot

Sets whether the distance and elevation scales are locked to each other.

See also
lockAxisScales()

Definition at line 207 of file qgselevationprofile.cpp.

◆ setName

void QgsElevationProfile::setName ( const QString & name)
slot

Sets the profile's unique name.

See also
name()
nameChanged()

Definition at line 262 of file qgselevationprofile.cpp.

◆ setProfileCurve()

void QgsElevationProfile::setProfileCurve ( QgsCurve * curve)

Sets the profile curve.

The CRS associated with curve is set via setCrs().

Ownership is transferred to the profile.

See also
profileCurve()

Definition at line 170 of file qgselevationprofile.cpp.

◆ setSubsectionsSymbol()

void QgsElevationProfile::setSubsectionsSymbol ( QgsLineSymbol * symbol)

Sets the symbol used to draw the subsections.

If symbol is nullptr, the subsections are not drawn. Ownership of symbol is transferred.

See also
subsectionsSymbol()

Definition at line 253 of file qgselevationprofile.cpp.

◆ setTolerance

void QgsElevationProfile::setTolerance ( double tolerance)
slot

Sets the profile tolerance (in crs() units).

This value determines how far from the profileCurve() is appropriate for inclusion of results. For instance, when a profile is generated for a point vector layer this tolerance distance will dictate how far from the actual profile curve a point can reside within to be included in the results.

See also
tolerance()

Definition at line 183 of file qgselevationprofile.cpp.

◆ setUseProjectLayerTree

void QgsElevationProfile::setUseProjectLayerTree ( bool useProjectTree)
slot

Sets whether the profile should always use the project's layer tree.

i.e. the profiles layer tree will be synchronized to the project and no reordering or re-grouping of layers is supported.

See also
useProjectLayerTree()
layerTree()

Definition at line 225 of file qgselevationprofile.cpp.

◆ subsectionsSymbol()

QgsLineSymbol * QgsElevationProfile::subsectionsSymbol ( )

Returns the symbol used to draw the subsections.

See also
setSubsectionsSymbol()

Definition at line 248 of file qgselevationprofile.cpp.

◆ tolerance()

double QgsElevationProfile::tolerance ( ) const

Returns the tolerance of the profile (in crs() units).

This value determines how far from the profileCurve() is appropriate for inclusion of results. For instance, when a profile is generated for a point vector layer this tolerance distance will dictate how far from the actual profile curve a point can reside within to be included in the results.

See also
setTolerance()

Definition at line 192 of file qgselevationprofile.cpp.

◆ useProjectLayerTree()

bool QgsElevationProfile::useProjectLayerTree ( )
inline

Returns true if the profile should always use the project's layer tree.

i.e. the profiles layer tree will be synchronized to the project and no reordering or re-grouping of layers is supported.

See also
setUseProjectLayerTree()
layerTree()

Definition at line 113 of file qgselevationprofile.h.

◆ useProjectLayerTreeChanged

void QgsElevationProfile::useProjectLayerTreeChanged ( bool useProjectTree)
signal

Emitted when the use project layer tree property is changed.

See also
setUseProjectLayerTree()

◆ writeXml()

QDomElement QgsElevationProfile::writeXml ( QDomDocument & document,
const QgsReadWriteContext & context ) const

Returns the profiles's state encapsulated in a DOM element.

See also
readXml()

Definition at line 34 of file qgselevationprofile.cpp.

Property Documentation

◆ useProjectLayerTree

bool QgsElevationProfile::useProjectLayerTree
readwrite

Definition at line 50 of file qgselevationprofile.h.


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