22 : mRenderContext( context )
29 return mWorldTransform;
34 mWorldTransform = transform;
39 return mDistanceRange;
44 mDistanceRange = range;
49 return mElevationRange;
54 mElevationRange = range;
86#define POINTS_TO_MM 2.83464567
87#define INCH_TO_MM 25.4
91 double conversionFactor = 1.0;
92 const double pixelsPerMillimeter = mDpi / 25.4;
96 conversionFactor = pixelsPerMillimeter;
104 conversionFactor = pixelsPerMillimeter *
INCH_TO_MM;
109 conversionFactor = 1.0 / mMapUnitsPerDistancePixel;
113 conversionFactor = 1.0;
120 conversionFactor = 1.0;
124 return size * conversionFactor;
129 return qgsDoubleNear( mMaxErrorMapUnits, other.mMaxErrorMapUnits )
130 &&
qgsDoubleNear( mMapUnitsPerDistancePixel, other.mMapUnitsPerDistancePixel )
132 && mDistanceRange == other.mDistanceRange
133 && mElevationRange == other.mElevationRange;
138 return !( *
this == other );
143 return Qgis::ProfileGeneratorFlags();
148 , mResults( results )
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 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 all map layer types.
Encapsulates the context in which an elevation profile is to be generated.
bool operator!=(const QgsProfileGenerationContext &other) const
bool operator==(const QgsProfileGenerationContext &other) const
double convertDistanceToPixels(double size, QgsUnitTypes::RenderUnit unit) const
Converts a distance size from the specified units to pixels.
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.
RenderUnit
Rendering size units.
@ RenderUnknownUnit
Mixed or unknown units.
@ RenderMetersInMapUnits
Meters value as Map units.
@ RenderPercentage
Percentage of another measurement (e.g., canvas size, feature size)
@ RenderPoints
Points (e.g., for font sizes)
@ RenderMillimeters
Millimeters.
@ RenderMapUnits
Map units.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)