QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsprofilerequest.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprofilerequest.h
3 ---------------
4 begin : February 2022
5 copyright : (C) 2022 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSPROFILEREQUEST_H
18#define QGSPROFILEREQUEST_H
19
20#include "qgis_core.h"
21#include "qgis_sip.h"
25
26#include <memory>
27
28class QgsCurve;
30
37class CORE_EXPORT QgsProfileRequest
38{
39
40 public:
41
49
51
53
54 QgsProfileRequest &operator=( const QgsProfileRequest &other );
55
56 bool operator==( const QgsProfileRequest &other ) const;
57 bool operator!=( const QgsProfileRequest &other ) const;
58
68 QgsProfileRequest &setProfileCurve( QgsCurve *curve SIP_TRANSFER );
69
77 QgsCurve *profileCurve() const;
78
87
96
103 QgsCoordinateTransformContext transformContext() const;
104
111 QgsProfileRequest &setTransformContext( const QgsCoordinateTransformContext &context );
112
123 QgsProfileRequest &setTolerance( double tolerance );
124
135 double tolerance() const { return mTolerance; }
136
144 QgsProfileRequest &setTerrainProvider( QgsAbstractTerrainProvider *provider SIP_TRANSFER );
145
151 QgsAbstractTerrainProvider *terrainProvider() const;
152
166 QgsProfileRequest &setStepDistance( double distance );
167
181 double stepDistance() const { return mStepDistance; }
182
187 QgsExpressionContext &expressionContext() { return mExpressionContext; }
188
193 const QgsExpressionContext &expressionContext() const SIP_SKIP { return mExpressionContext; }
194
199 QgsProfileRequest &setExpressionContext( const QgsExpressionContext &context );
200
201 private:
202
203 std::unique_ptr< QgsCurve> mCurve;
205 QgsCoordinateTransformContext mTransformContext;
206
207 double mTolerance = 0;
208
209 double mStepDistance = std::numeric_limits<float>::quiet_NaN();
210
211 std::unique_ptr< QgsAbstractTerrainProvider > mTerrainProvider;
212 QgsExpressionContext mExpressionContext;
213
214};
215
216#endif // QGSPROFILEREQUEST_H
Abstract base class for terrain providers.
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Abstract base class for curved geometry type.
Definition qgscurve.h:35
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
QgsExpressionContext & expressionContext()
Returns the expression context used to evaluate expressions.
double stepDistance() const
Returns the profile step distance (in crs() units).
double tolerance() const
Returns the tolerance of the request (in crs() units).
const QgsExpressionContext & expressionContext() const
Returns the expression context used to evaluate expressions.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_TRANSFER
Definition qgis_sip.h:36
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
const QgsCoordinateReferenceSystem & crs