QGIS API Documentation 3.99.0-Master (26c88405ac0)
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).

Signals

void nameChanged (const QString &newName)
 Emitted when the profile is renamed.

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).
QDomElement writeXml (QDomDocument &document, const QgsReadWriteContext &context) const
 Returns the profiles's state encapsulated in a DOM element.

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 156 of file qgselevationprofile.cpp.

◆ distanceUnit()

Qgis::DistanceUnit QgsElevationProfile::distanceUnit ( ) const

Returns the distance unit used by the profile.

See also
setDistanceUnit()

Definition at line 193 of file qgselevationprofile.cpp.

◆ icon()

QIcon QgsElevationProfile::icon ( ) const

Returns the icon to use for the elevation profile.

Definition at line 137 of file qgselevationprofile.cpp.

◆ layerTree()

QgsLayerTree * QgsElevationProfile::layerTree ( )

Returns the layer tree used by the profile.

Definition at line 142 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 188 of file qgselevationprofile.cpp.

◆ name()

QString QgsElevationProfile::name ( ) const
inline

Returns the profile's unique name.

See also
setName()
nameChanged()

Definition at line 62 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 169 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 71 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 132 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 147 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 207 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 198 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 243 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 161 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 234 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 174 of file qgselevationprofile.cpp.

◆ subsectionsSymbol()

QgsLineSymbol * QgsElevationProfile::subsectionsSymbol ( )

Returns the symbol used to draw the subsections.

See also
setSubsectionsSymbol()

Definition at line 229 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 183 of file qgselevationprofile.cpp.

◆ 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.


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