22 : mRenderContext( context )
29 return mWorldTransform;
34 mWorldTransform = transform;
39 return mDistanceRange;
44 mDistanceRange = range;
49 return mElevationRange;
54 mElevationRange = range;
91#define POINTS_TO_MM 2.83464567
92#define INCH_TO_MM 25.4
96 double conversionFactor = 1.0;
97 const double pixelsPerMillimeter = mDpi / 25.4;
101 conversionFactor = pixelsPerMillimeter;
109 conversionFactor = pixelsPerMillimeter *
INCH_TO_MM;
114 conversionFactor = 1.0 / mMapUnitsPerDistancePixel;
118 conversionFactor = 1.0;
125 conversionFactor = 1.0;
129 return size * conversionFactor;
134 return qgsDoubleNear( mMaxErrorMapUnits, other.mMaxErrorMapUnits )
135 &&
qgsDoubleNear( mMapUnitsPerDistancePixel, other.mMapUnitsPerDistancePixel )
137 && mDistanceRange == other.mDistanceRange
138 && mElevationRange == other.mElevationRange;
143 return !( *
this == other );
148 return Qgis::ProfileGeneratorFlags();
153 , mResults( results )
RenderUnit
Rendering size units.
@ Percentage
Percentage of another measurement (e.g., canvas size, feature size)
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ Unknown
Mixed or unknown units.
@ MetersInMapUnits
Meters value as Map units.
ProfileExportType
Types of export for elevation profiles.
Abstract base class for objects which generate elevation profiles.
virtual Qgis::ProfileGeneratorFlags flags() const
Returns flags which reflect how the profile generator operates.
virtual ~QgsAbstractProfileGenerator()
virtual ~QgsAbstractProfileResults()
virtual QVector< QgsAbstractProfileResults::Feature > asFeatures(Qgis::ProfileExportType type, QgsFeedback *feedback=nullptr) const
Returns a list of features representing the calculated elevation results.
virtual QgsProfileSnapResult snapPoint(const QgsProfilePoint &point, const QgsProfileSnapContext &context)
Snaps a point to the generated elevation profile.
virtual QVector< QgsProfileIdentifyResults > identify(const QgsProfilePoint &point, const QgsProfileIdentifyContext &context)
Identify results visible at the specified profile point.
virtual void copyPropertiesFromGenerator(const QgsAbstractProfileGenerator *generator)
Copies properties from specified generator to the results object.
QgsRange which stores a range of double values.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Base class for all map layer types.
Encapsulates the context in which an elevation profile is to be generated.
bool operator!=(const QgsProfileGenerationContext &other) const
double convertDistanceToPixels(double size, Qgis::RenderUnit unit) const
Converts a distance size from the specified units to pixels.
bool operator==(const QgsProfileGenerationContext &other) const
Encapsulates the context of identifying profile results.
QgsProfileIdentifyResults(QgsMapLayer *layer=nullptr, const QVector< QVariantMap > &results=QVector< QVariantMap >())
Constructor for QgsProfileIdentifyResult, with the associated map layer.
Encapsulates a point on a distance-elevation profile.
void setWorldTransform(const QTransform &transform)
Sets the transform from world coordinates to painter coordinates.
void setDistanceRange(const QgsDoubleRange &range)
Sets the range of distances to include in the render.
const QTransform & worldTransform() const
Returns the transform from world coordinates to painter coordinates.
QgsDoubleRange elevationRange() const
Returns the range of elevations to include in the render.
QgsDoubleRange distanceRange() const
Returns the range of distances to include in the render.
void setElevationRange(const QgsDoubleRange &range)
Sets the range of elevations to include in the render.
QgsProfileRenderContext(QgsRenderContext &context)
Constructor for QgsProfileRenderContext, with the specified embedded render context.
Encapsulates the context of snapping a profile point.
Encapsulates results of snapping a profile point.
Contains information about the context of a rendering operation.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)