17#ifndef QGSVECTORLAYERPROFILEGENERATOR_H
18#define QGSVECTORLAYERPROFILEGENERATOR_H
67 QHash< QgsFeatureId, QVector< Feature > >
features;
75 QString
type()
const override;
90 void visitFeaturesAtPoint(
const QgsProfilePoint &point,
double maximumPointDistanceDelta,
double maximumPointElevationDelta,
double maximumSurfaceElevationDelta,
91 const std::function<
void(
QgsFeatureId,
double delta,
double distance,
double elevation ) > &visitor,
bool visitWithin )
const;
93 const std::function<
void (
QgsFeatureId )> &visitor )
const;
127 bool generateProfileForPoints();
128 bool generateProfileForLines();
129 bool generateProfileForPolygons();
131 void processIntersectionPoint(
const QgsPoint *intersectionPoint,
const QgsFeature &feature );
134 QgsPoint interpolatePointOnTriangle(
const QgsPolygon *triangle,
double x,
double y )
const;
135 void processTriangleIntersectForPoint(
const QgsPolygon *triangle,
const QgsPoint *intersect, QVector< QgsGeometry > &transformedParts, QVector< QgsGeometry > &crossSectionParts );
136 void processTriangleIntersectForLine(
const QgsPolygon *triangle,
const QgsLineString *intersect, QVector< QgsGeometry > &transformedParts, QVector< QgsGeometry > &crossSectionParts );
137 void processTriangleIntersectForPolygon(
const QgsPolygon *triangle,
const QgsPolygon *intersectionPolygon, QVector< QgsGeometry > &transformedParts, QVector< QgsGeometry > &crossSectionParts );
139 double tolerance()
const;
141 double terrainHeight(
double x,
double y )
const;
142 double featureZToHeight(
double x,
double y,
double z,
double offset )
const;
145 bool clampAltitudes(
QgsPolygon *polygon,
double offset )
const;
148 std::unique_ptr<QgsFeedback> mFeedback =
nullptr;
150 std::unique_ptr< QgsCurve > mProfileCurve;
151 std::unique_ptr< QgsGeos > mProfileCurveEngine;
153 std::unique_ptr<QgsAbstractGeometry> mProfileBufferedCurve;
154 std::unique_ptr< QgsGeos > mProfileBufferedCurveEngine;
156 std::unique_ptr< QgsAbstractTerrainProvider > mTerrainProvider;
158 std::unique_ptr< QgsCurve > mTransformedCurve;
159 double mTolerance = 0;
167 std::unique_ptr< QgsVectorLayerFeatureSource > mSource;
174 bool mExtrusionEnabled =
false;
175 double mExtrusionHeight = 0;
176 bool mCustomToleranceEnabled =
false;
177 double mCustomTolerance = 0;
187 std::unique_ptr< QgsVectorLayerProfileResults > mResults;
189 bool mRespectLayerSymbology =
true;
190 std::unique_ptr< QgsMarkerSymbol > mProfileMarkerSymbol;
191 bool mShowMarkerSymbolInSurfacePlots =
false;
194 QPointer< QgsVectorLayer > mLayer;
AltitudeClamping
Altitude clamping.
@ Terrain
Elevation is clamped to terrain (final elevation = terrain elevation).
AltitudeBinding
Altitude binding.
@ Centroid
Clamp just centroid of feature.
VectorProfileType
Types of elevation profiles to generate for vector sources.
@ IndividualFeatures
Treat each feature as an individual object (eg buildings).
ProfileExportType
Types of export for elevation profiles.
WkbType
The WKB type describes the number of dimensions a geometry has.
Abstract base class for objects which generate elevation profiles.
Abstract base class for storage of elevation profiles.
virtual QString type() const =0
Returns the unique string identifier for the results type.
QgsAbstractProfileSurfaceGenerator(const QgsProfileRequest &request)
Constructor for QgsAbstractProfileSurfaceGenerator.
Abstract base class for storage of elevation profiles which represent a continuous surface (e....
void renderResults(QgsProfileRenderContext &context) override
Renders the results to the specified context.
void copyPropertiesFromGenerator(const QgsAbstractProfileGenerator *generator) override
Copies properties from specified generator to the results object.
QVector< QgsAbstractProfileResults::Feature > asFeatures(Qgis::ProfileExportType type, QgsFeedback *feedback=nullptr) const override
Returns a list of features representing the calculated elevation results.
QVector< QgsGeometry > asGeometries() const override
Returns a list of geometries representing the calculated elevation results.
QVector< QgsProfileIdentifyResults > identify(const QgsProfilePoint &point, const QgsProfileIdentifyContext &context) override
Identify results visible at the specified profile point.
QgsProfileSnapResult snapPoint(const QgsProfilePoint &point, const QgsProfileSnapContext &context) override
Snaps a point to the generated elevation profile.
Abstract base class for terrain providers.
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.
QgsRange which stores a range of double values.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
Does vector analysis using the GEOS library and handles import, export, and exception handling.
Line string geometry type, with support for z-dimension and m-values.
Point geometry type, with support for z-dimension and m-values.
Encapsulates the context in which an elevation profile is to be generated.
Encapsulates the context of identifying profile results.
Encapsulates a point on a distance-elevation profile.
Abstract base class for storage of elevation profiles.
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
Encapsulates the context of snapping a profile point.
Encapsulates results of snapping a profile point.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A rectangle specified with double values.
Partial snapshot of vector layer's state (only the members necessary for access to features).
QgsAbstractProfileResults * takeResults() override
Takes results from the generator.
bool generateProfile(const QgsProfileGenerationContext &context=QgsProfileGenerationContext()) override
Generate the profile (based on data stored in the class).
friend class QgsVectorLayerProfileResults
QString sourceId() const override
Returns a unique identifier representing the source of the profile.
~QgsVectorLayerProfileGenerator() override
QgsFeedback * feedback() const override
Access to feedback object of the generator (may be nullptr).
QgsVectorLayerProfileGenerator(QgsVectorLayer *layer, const QgsProfileRequest &request)
Constructor for QgsVectorLayerProfileGenerator.
Implementation of QgsAbstractProfileResults for vector layers.
Qgis::VectorProfileType profileType
std::unique_ptr< QgsMarkerSymbol > mMarkerSymbol
bool respectLayerSymbology
bool mShowMarkerSymbolInSurfacePlots
QPointer< QgsVectorLayer > mLayer
QString type() const override
Returns the unique string identifier for the results type.
QHash< QgsFeatureId, QVector< Feature > > features
Represents a vector layer which manages a vector based dataset.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
QgsGeometry crossSectionGeometry
Cross section distance vs height geometry for feature.
QgsFeatureId featureId
Original feature ID.
QgsGeometry geometry
Feature's geometry with any terrain height adjustment and extrusion applied.