QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsalgorithmdrape.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsalgorithmdrape.h
3 ---------------------
4 begin : November 2017
5 copyright : (C) 2017 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
18#ifndef QGSALGORITHMDRAPE_H
19#define QGSALGORITHMDRAPE_H
20
21#define SIP_NO_FILE
22
23#include "qgis_sip.h"
25
27
31class QgsDrapeAlgorithmBase : public QgsProcessingFeatureBasedAlgorithm
32{
33 public:
34 QString group() const override;
35 QString groupId() const override;
36 void initParameters( const QVariantMap &configuration = QVariantMap() ) override;
37
38 protected:
39 QString outputName() const override;
40 bool prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
41 QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
42
43 private:
44 virtual void prepareGeometry( QgsGeometry &geometry, double defaultVal ) const = 0;
45 virtual QgsPoint drapeVertex( const QgsPoint &vertex, double rasterVal ) const = 0;
46
47 double mNoData = 0.0;
48 bool mDynamicNoData = false;
49 QgsProperty mNoDataProperty;
50
51 double mScale = 1.0;
52 bool mDynamicScale = false;
53 QgsProperty mScaleProperty;
54
55 double mOffset = 0.0;
56 bool mDynamicOffset = false;
57 QgsProperty mOffsetProperty;
58
59 std::unique_ptr<QgsRasterDataProvider> mRasterProvider;
60 int mBand = 1;
61 QgsRectangle mRasterExtent;
62 bool mCreatedTransform = false;
63 QgsCoordinateTransform mTransform;
64};
65
66class QgsDrapeToZAlgorithm : public QgsDrapeAlgorithmBase
67{
68 public:
69 QString name() const override;
70 QString displayName() const override;
71 QStringList tags() const override;
72 QString shortHelpString() const override;
73 QString shortDescription() const override;
74 QgsDrapeToZAlgorithm *createInstance() const override SIP_FACTORY;
75 bool supportInPlaceEdit( const QgsMapLayer *layer ) const override;
76
77 protected:
78 Qgis::WkbType outputWkbType( Qgis::WkbType inputWkbType ) const override;
79
80 private:
81 void prepareGeometry( QgsGeometry &geometry, double defaultVal ) const override;
82 QgsPoint drapeVertex( const QgsPoint &vertex, double rasterVal ) const override;
83};
84
85
86class QgsDrapeToMAlgorithm : public QgsDrapeAlgorithmBase
87{
88 public:
89 QString name() const override;
90 QString displayName() const override;
91 QStringList tags() const override;
92 QString shortHelpString() const override;
93 QString shortDescription() const override;
94 QgsDrapeToMAlgorithm *createInstance() const override SIP_FACTORY;
95 bool supportInPlaceEdit( const QgsMapLayer *layer ) const override;
96
97 protected:
98 Qgis::WkbType outputWkbType( Qgis::WkbType inputWkbType ) const override;
99
100 private:
101 void prepareGeometry( QgsGeometry &geometry, double defaultVal ) const override;
102 QgsPoint drapeVertex( const QgsPoint &vertex, double rasterVal ) const override;
103};
104
106
107#endif // QGSALGORITHMDRAPE_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
Class for doing transforms between two map coordinate systems.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
A geometry is the spatial representation of a feature.
Base class for all map layer types.
Definition qgsmaplayer.h:76
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
virtual QString group() const
Returns the name of the group this algorithm belongs to.
virtual bool prepareAlgorithm(const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback)
Prepares the algorithm to run using the specified parameters.
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
Contains information about the context in which a processing algorithm is executed.
An abstract QgsProcessingAlgorithm base class for processing algorithms which operate "feature-by-fea...
virtual QgsFeatureList processFeature(const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback)=0
Processes an individual input feature from the source.
virtual void initParameters(const QVariantMap &configuration=QVariantMap())
Initializes any extra parameters added by the algorithm subclass.
virtual QString outputName() const =0
Returns the translated, user visible name for any layers created by this algorithm.
Base class for providing feedback from a processing algorithm.
A store for object properties.
A rectangle specified with double values.
#define SIP_FACTORY
Definition qgis_sip.h:76
QList< QgsFeature > QgsFeatureList