QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
qgselevationprofilelayertreeview.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgselevationprofilelayertreeview.cpp
3 -----------------
4 begin : April 2022
5 copyright : (C) 2022 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7***************************************************************************/
8
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
20
21#include "qgsapplication.h"
22#include "qgsfillsymbol.h"
23#include "qgslayertree.h"
24#include "qgslayertreenode.h"
25#include "qgsmaplayerutils.h"
26#include "qgsmarkersymbol.h"
31#include "qgssymbollayerutils.h"
32#include "qgsvectorlayer.h"
34
35#include <QContextMenuEvent>
36#include <QHeaderView>
37#include <QMenu>
38#include <QMimeData>
39
40#include "moc_qgselevationprofilelayertreeview.cpp"
41
42const QString QgsElevationProfileLayerTreeView::CUSTOM_NODE_ELEVATION_PROFILE_SOURCE = QStringLiteral( "elevationProfileRegistry" );
43
52
53QVariant QgsElevationProfileLayerTreeModel::data( const QModelIndex &index, int role ) const
54{
55 switch ( role )
56 {
57 case Qt::DecorationRole:
58 {
60
61 if ( node && node->nodeType() == QgsLayerTreeNode::NodeLayer )
62 {
63 if ( QgsMapLayer *layer = QgsLayerTree::toLayer( node )->layer() )
64 {
65 std::unique_ptr<QgsRenderContext> context( createTemporaryRenderContext() );
66
67 const int iconSize = scaleIconSize( 16 );
68 std::unique_ptr<QgsSymbol> symbol;
69 switch ( layer->type() )
70 {
72 {
73 QgsVectorLayerElevationProperties *elevationProperties = qgis::down_cast<QgsVectorLayerElevationProperties *>( layer->elevationProperties() );
74 QgsVectorLayer *vLayer = qobject_cast<QgsVectorLayer *>( layer );
75
76 switch ( elevationProperties->type() )
77 {
79 if ( ( vLayer->geometryType() == Qgis::GeometryType::Point && !elevationProperties->extrusionEnabled() )
80 || ( vLayer->geometryType() == Qgis::GeometryType::Line && !elevationProperties->extrusionEnabled() ) )
81 {
82 if ( QgsMarkerSymbol *markerSymbol = elevationProperties->profileMarkerSymbol() )
83 {
84 symbol.reset( markerSymbol->clone() );
85 }
86 }
87
88 if ( !symbol && vLayer->geometryType() == Qgis::GeometryType::Polygon && elevationProperties->extrusionEnabled() )
89 {
90 if ( QgsFillSymbol *fillSymbol = elevationProperties->profileFillSymbol() )
91 {
92 symbol.reset( fillSymbol->clone() );
93 }
94 }
95
96 if ( !symbol )
97 {
98 if ( QgsLineSymbol *lineSymbol = elevationProperties->profileLineSymbol() )
99 {
100 symbol.reset( lineSymbol->clone() );
101 }
102 }
103
104 if ( elevationProperties->respectLayerSymbology() )
105 {
106 if ( !symbol )
107 {
108 // just use default layer icon
109 return QgsLayerTreeModel::data( index, role );
110 }
111
112 if ( QgsSingleSymbolRenderer *renderer = dynamic_cast<QgsSingleSymbolRenderer *>( qobject_cast<QgsVectorLayer *>( layer )->renderer() ) )
113 {
114 if ( renderer->symbol()->type() == symbol->type() )
115 {
116 // take the whole renderer symbol if we can
117 symbol.reset( renderer->symbol()->clone() );
118 }
119 else
120 {
121 // otherwise emulate what happens when rendering the actual chart and just copy the color and opacity
122 symbol->setColor( renderer->symbol()->color() );
123 symbol->setOpacity( renderer->symbol()->opacity() );
124 }
125 }
126 else
127 {
128 // just use default layer icon
129 return QgsLayerTreeModel::data( index, role );
130 }
131 }
132 break;
133
135 switch ( elevationProperties->profileSymbology() )
136 {
138 if ( QgsLineSymbol *lineSymbol = elevationProperties->profileLineSymbol() )
139 {
140 symbol.reset( lineSymbol->clone() );
141 }
142 break;
145 if ( QgsFillSymbol *fillSymbol = elevationProperties->profileFillSymbol() )
146 {
147 symbol.reset( fillSymbol->clone() );
148 }
149 break;
150 }
151 break;
152 }
153 break;
154 }
155
157 {
158 QgsRasterLayerElevationProperties *rlProps = qgis::down_cast<QgsRasterLayerElevationProperties *>( layer->elevationProperties() );
159 switch ( rlProps->profileSymbology() )
160 {
162 if ( QgsLineSymbol *lineSymbol = rlProps->profileLineSymbol() )
163 {
164 symbol.reset( lineSymbol->clone() );
165 }
166 break;
169 if ( QgsFillSymbol *fillSymbol = rlProps->profileFillSymbol() )
170 {
171 symbol.reset( fillSymbol->clone() );
172 }
173 break;
174 }
175 break;
176 }
177
179 {
180 QgsMeshLayerElevationProperties *mlProps = qgis::down_cast<QgsMeshLayerElevationProperties *>( layer->elevationProperties() );
181 switch ( mlProps->profileSymbology() )
182 {
184 if ( QgsLineSymbol *lineSymbol = mlProps->profileLineSymbol() )
185 {
186 symbol.reset( lineSymbol->clone() );
187 }
188 break;
191 if ( QgsFillSymbol *fillSymbol = mlProps->profileFillSymbol() )
192 {
193 symbol.reset( fillSymbol->clone() );
194 }
195 break;
196 }
197 break;
198 }
199
206 break;
207 }
208 if ( !symbol )
209 break;
210
211 const QPixmap pix = QgsSymbolLayerUtils::symbolPreviewPixmap( symbol.get(), QSize( iconSize, iconSize ), 0, context.get() );
212 return QIcon( pix );
213 }
214 }
215 break;
216 }
217
218 case Qt::ToolTipRole:
219 {
220 // override default tooltip with elevation specific one
222 if ( node && node->nodeType() == QgsLayerTreeNode::NodeLayer )
223 {
224 if ( QgsMapLayer *layer = QgsLayerTree::toLayer( node )->layer() )
225 {
226 QString title = !layer->metadata().title().isEmpty() ? layer->metadata().title() : !layer->serverProperties()->title().isEmpty() ? layer->serverProperties()->title()
227 : !layer->serverProperties()->shortName().isEmpty() ? layer->serverProperties()->shortName()
228 : layer->name();
229
230 title = "<b>" + title.toHtmlEscaped() + "</b>";
231
232 QStringList parts;
233 parts << title;
234
235 const QString elevationPropertiesSummary = layer->elevationProperties() ? layer->elevationProperties()->htmlSummary() : QString();
236 if ( !elevationPropertiesSummary.isEmpty() )
237 parts << elevationPropertiesSummary;
238
239 return parts.join( QLatin1String( "<br/>" ) );
240 }
241 }
242 break;
243 }
244
245 default:
246 break;
247 }
248 return QgsLayerTreeModel::data( index, role );
249}
250
251bool QgsElevationProfileLayerTreeModel::setData( const QModelIndex &index, const QVariant &value, int role )
252{
253 if ( !mAllowModifications )
254 return false;
255
256 if ( QgsLayerTreeLayer *layerNode = qobject_cast<QgsLayerTreeLayer *>( index2node( index ) ) )
257 {
258 if ( role == Qt::CheckStateRole )
259 {
260 const bool checked = static_cast<Qt::CheckState>( value.toInt() ) == Qt::Checked;
261 if ( QgsMapLayer *layer = layerNode->layer() )
262 {
263 layer->setCustomProperty( QStringLiteral( "_include_in_elevation_profiles" ), checked );
264 }
265 }
266 }
267
268 return QgsLayerTreeModel::setData( index, value, role );
269}
270
271Qt::ItemFlags QgsElevationProfileLayerTreeModel::flags( const QModelIndex &index ) const
272{
273 Qt::ItemFlags f = QgsLayerTreeModel::flags( index );
274
275 // the elevation tree model only supports group renames, not layer renames (otherwise
276 // we'd be renaming the actual layer, which is likely NOT what users expect)
278 if ( !mAllowModifications || !QgsLayerTree::isGroup( node ) )
279 {
280 f.setFlag( Qt::ItemFlag::ItemIsEditable, false );
281 }
282 return f;
283}
284
285bool QgsElevationProfileLayerTreeModel::canDropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) const
286{
287 if ( !mAllowModifications )
288 return false;
289
290 if ( action == Qt::IgnoreAction )
291 return true;
292
293 if ( !data->hasFormat( QStringLiteral( "application/qgis.layertreemodeldata" ) ) )
294 return false;
295
296 // don't accept moves from other layer trees -- only allow internal drag
297 if ( action == Qt::MoveAction )
298 {
299 const QString source = data->data( QStringLiteral( "application/qgis.layertree.source" ) );
300 if ( source.isEmpty() || source != QStringLiteral( ":0x%1" ).arg( reinterpret_cast<quintptr>( this ), 2 * QT_POINTER_SIZE, 16, QLatin1Char( '0' ) ) )
301 {
302 return false;
303 }
304 }
305
306 return QgsLayerTreeModel::canDropMimeData( data, action, row, column, parent );
307}
308
309bool QgsElevationProfileLayerTreeModel::dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent )
310{
311 if ( !mAllowModifications )
312 return false;
313
314 if ( action == Qt::IgnoreAction )
315 return true;
316
317 if ( !data->hasFormat( QStringLiteral( "application/qgis.layertreemodeldata" ) ) )
318 return false;
319
320 // don't accept moves from other layer trees -- only allow internal drag
321 const QString source = data->data( QStringLiteral( "application/qgis.layertree.source" ) );
322 if ( source.isEmpty() || source != QStringLiteral( ":0x%1" ).arg( reinterpret_cast<quintptr>( this ), 2 * QT_POINTER_SIZE, 16, QLatin1Char( '0' ) ) )
323 {
324 if ( action == Qt::CopyAction )
325 {
326 QByteArray encodedLayerTreeData = data->data( QStringLiteral( "application/qgis.layertreemodeldata" ) );
327
328 QDomDocument layerTreeDoc;
329 if ( !layerTreeDoc.setContent( QString::fromUtf8( encodedLayerTreeData ) ) )
330 return false;
331
332 QDomElement rootLayerTreeElem = layerTreeDoc.documentElement();
333 if ( rootLayerTreeElem.tagName() != QLatin1String( "layer_tree_model_data" ) )
334 return false;
335
336 QList<QgsMapLayer *> layersToAdd;
337
338 QDomElement elem = rootLayerTreeElem.firstChildElement();
339 while ( !elem.isNull() )
340 {
341 std::unique_ptr<QgsLayerTreeNode> node( QgsLayerTreeNode::readXml( elem, QgsProject::instance() ) );
342 if ( node && QgsLayerTree::isLayer( node.get() ) )
343 {
344 if ( QgsMapLayer *layer = qobject_cast<QgsLayerTreeLayer *>( node.get() )->layer() )
345 {
346 layersToAdd << layer;
347 }
348 }
349 elem = elem.nextSiblingElement();
350 }
351
352 if ( !layersToAdd.empty() )
353 emit addLayers( layersToAdd );
354
355 return true;
356 }
357 else
358 {
359 return false;
360 }
361 }
362
363 return QgsLayerTreeModel::dropMimeData( data, action, row, column, parent );
364}
365
366QMimeData *QgsElevationProfileLayerTreeModel::mimeData( const QModelIndexList &indexes ) const
367{
368 if ( !mAllowModifications )
369 return nullptr;
370
371 QMimeData *mimeData = QgsLayerTreeModel::mimeData( indexes );
372 if ( mimeData )
373 {
374 mimeData->setData( QStringLiteral( "application/qgis.restrictlayertreemodelsubclass" ), "QgsElevationProfileLayerTreeModel" );
375 }
376 return mimeData;
377}
378
386
387
388//
389// QgsElevationProfileLayerTreeProxyModel
390//
391
393 : QSortFilterProxyModel( parent )
394 , mModel( model )
395{
396 setSourceModel( mModel );
397 setDynamicSortFilter( true );
398}
399
400bool QgsElevationProfileLayerTreeProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const
401{
402 const QModelIndex sourceIndex = mModel->index( sourceRow, 0, sourceParent );
403 if ( QgsLayerTreeNode *node = mModel->index2node( sourceIndex ) )
404 {
405 switch ( node->nodeType() )
406 {
408 {
409 if ( QgsLayerTreeLayer *layerTreeLayer = QgsLayerTree::toLayer( node ) )
410 {
411 if ( QgsMapLayer *layer = layerTreeLayer->layer() )
412 {
413 // hide layers which don't have elevation
414 if ( !layer->elevationProperties() || !layer->elevationProperties()->hasElevation() )
415 return false;
416 }
417 }
418 break;
419 }
420
423 break;
424 }
425 return true;
426 }
427 else if ( QgsLayerTreeModelLegendNode *legendNode = mModel->index2legendNode( sourceIndex ) )
428 {
429 // we only show legend nodes for vector layers where the profile symbol is set to follow the layer's symbology
430 // (and the layer's renderer isn't a single symbol renderer)
431 if ( QgsLayerTreeLayer *layerTreeLayer = QgsLayerTree::toLayer( legendNode->layerNode() ) )
432 {
433 if ( QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( layerTreeLayer->layer() ) )
434 {
435 if ( !qgis::down_cast<QgsVectorLayerElevationProperties *>( layer->elevationProperties() )->respectLayerSymbology() )
436 {
437 return false;
438 }
439 else if ( dynamic_cast<QgsSingleSymbolRenderer *>( qobject_cast<QgsVectorLayer *>( layer )->renderer() ) )
440 {
441 return false;
442 }
443 else
444 {
445 return true;
446 }
447 }
448 }
449 return false;
450 }
451 else
452 {
453 return false;
454 }
455}
456
457
459 : QgsLayerTreeViewBase( parent )
460{
461 setLayerTree( rootNode );
462}
463
465{
466 QgsElevationProfileLayerTreeModel *oldModel = mModel;
467
468 mLayerTree = rootNode;
469
470 mModel = new QgsElevationProfileLayerTreeModel( mLayerTree, this );
471
473 mProxyModel = new QgsElevationProfileLayerTreeProxyModel( mModel, this );
474
475 setModel( mProxyModel );
476 setLayerTreeModel( mModel );
477
478 delete oldModel;
479}
480
482{
483 const QList<QgsMapLayer *> layers = project->layers<QgsMapLayer *>().toList();
484
485 // sort layers so that types which are more likely to obscure others are rendered below
486 // e.g. vector features should be drawn above raster DEMS, or the DEM line may completely obscure
487 // the vector feature
489
490 std::reverse( sortedLayers.begin(), sortedLayers.end() );
491 for ( QgsMapLayer *layer : std::as_const( sortedLayers ) )
492 {
493 // don't re-add existing layers
494 if ( mLayerTree->findLayer( layer ) )
495 continue;
496
497 QgsLayerTreeLayer *node = mLayerTree->addLayer( layer );
498
499 if ( layer->customProperty( QStringLiteral( "_include_in_elevation_profiles" ) ).isValid() )
500 {
501 node->setItemVisibilityChecked( layer->customProperty( QStringLiteral( "_include_in_elevation_profiles" ) ).toBool() );
502 }
503 else
504 {
505 node->setItemVisibilityChecked( layer->elevationProperties() && layer->elevationProperties()->showByDefaultInElevationProfilePlots() );
506 }
507 }
508}
509
511{
512 const QList< QgsAbstractProfileSource * > sources = QgsApplication::profileSourceRegistry()->profileSources();
513 for ( QgsAbstractProfileSource *source : sources )
514 {
515 addNodeForRegisteredSource( source->profileSourceId(), source->profileSourceName() );
516 }
517
518 populateMissingLayers( project );
519}
520
521void QgsElevationProfileLayerTreeView::addNodeForRegisteredSource( const QString &sourceId, const QString &sourceName )
522{
523 auto customNode = std::make_unique< QgsLayerTreeCustomNode >( sourceId, sourceName.isEmpty() ? sourceId : sourceName );
524 customNode->setItemVisibilityChecked( true );
525 // Mark the node so that we know which custom nodes correspond to elevation profile sources
526 customNode->setCustomProperty( QStringLiteral( "source" ), QgsElevationProfileLayerTreeView::CUSTOM_NODE_ELEVATION_PROFILE_SOURCE );
527
528 QgsLayerTreeCustomNode *node = mLayerTree->insertCustomNode( -1, customNode.release() );
529 if ( !node )
530 QgsDebugError( QString( "The custom node with id '%1' could not be added!" ).arg( sourceId ) );
531}
532
534{
535 mLayerTree->removeCustomNode( sourceId );
536}
537
542
544{
545 header()->setMinimumSectionSize( viewport()->width() );
546 QTreeView::resizeEvent( event );
547}
@ Point
Points.
Definition qgis.h:359
@ Line
Lines.
Definition qgis.h:360
@ Polygon
Polygons.
Definition qgis.h:361
@ Group
Composite group layer. Added in QGIS 3.24.
Definition qgis.h:198
@ Plugin
Plugin based layer.
Definition qgis.h:193
@ TiledScene
Tiled scene layer. Added in QGIS 3.34.
Definition qgis.h:199
@ Annotation
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
Definition qgis.h:196
@ Vector
Vector layer.
Definition qgis.h:191
@ VectorTile
Vector tile layer. Added in QGIS 3.14.
Definition qgis.h:195
@ Mesh
Mesh layer. Added in QGIS 3.2.
Definition qgis.h:194
@ Raster
Raster layer.
Definition qgis.h:192
@ PointCloud
Point cloud layer. Added in QGIS 3.18.
Definition qgis.h:197
@ ContinuousSurface
The features should be treated as representing values on a continuous surface (eg contour lines).
Definition qgis.h:4208
@ IndividualFeatures
Treat each feature as an individual object (eg buildings).
Definition qgis.h:4207
@ Line
The elevation surface will be rendered using a line symbol.
Definition qgis.h:4194
@ FillBelow
The elevation surface will be rendered using a fill symbol below the surface level.
Definition qgis.h:4195
@ FillAbove
The elevation surface will be rendered using a fill symbol above the surface level.
Definition qgis.h:4196
Interface for classes which can generate elevation profiles.
static QgsProfileSourceRegistry * profileSourceRegistry()
Returns registry of available profile source implementations.
A layer tree model subclass for elevation profiles.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
void addLayers(const QList< QgsMapLayer * > &layers)
Emitted when layers should be added to the profile, e.g.
QgsElevationProfileLayerTreeModel(QgsLayerTree *rootNode, QObject *parent=nullptr)
Construct a new tree model with given layer tree (root node must not be nullptr).
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
QMimeData * mimeData(const QModelIndexList &indexes) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void setAllowModifications(bool allow)
Sets whether modifications like renaming, reordering nodes are supported.
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
QgsElevationProfileLayerTreeProxyModel(QgsElevationProfileLayerTreeModel *model, QObject *parent=nullptr)
Constructor for QgsElevationProfileLayerTreeProxyModel.
void populateInitialSources(QgsProject *project)
Initially populates the tree view using layers from a project, as well as sources from the source reg...
QgsElevationProfileLayerTreeProxyModel * proxyModel()
Returns the view's proxy model.
QgsElevationProfileLayerTreeView(QgsLayerTree *rootNode, QWidget *parent=nullptr)
Construct a new tree view with given layer tree (root node must not be nullptr).
void removeNodeForUnregisteredSource(const QString &sourceId)
Removes a custom node from the layer tree corresponding to an unregistered profile source.
void addNodeForRegisteredSource(const QString &sourceId, const QString &sourceName)
Adds a custom node in the layer tree corresponding to a registered profile source.
void populateMissingLayers(QgsProject *project)
Adds any layers from a project which currently aren't within the profile's layer tree.
void resizeEvent(QResizeEvent *event) override
void addLayers(const QList< QgsMapLayer * > &layers)
Emitted when layers should be added to the profile, e.g.
void setLayerTree(QgsLayerTree *rootNode)
Sets a new layer tree root node to use for the view.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Layer tree custom node serves as a node for objects that are not layers nor groups.
Layer tree node points to a map layer.
An abstract interface for legend items returned from QgsMapLayerLegend implementation.
QgsLayerTreeLayer * layerNode() const
Returns pointer to the parent layer node.
Flags flags() const
Returns OR-ed combination of model flags.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QgsLayerTreeModel(QgsLayerTree *rootNode, QObject *parent=nullptr)
Construct a new tree model with given layer tree (root node must not be nullptr).
QModelIndex parent(const QModelIndex &child) const override
void setFlag(Flag f, bool on=true)
Enable or disable a model flag.
QgsRenderContext * createTemporaryRenderContext() const
Returns a temporary render context.
QgsLayerTreeNode * index2node(const QModelIndex &index) const
Returns layer tree node for given index.
QMimeData * mimeData(const QModelIndexList &indexes) const override
static int scaleIconSize(int standardSize)
Scales an layer tree model icon size to compensate for display pixel density, making the icon size hi...
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
@ AllowNodeChangeVisibility
Allow user to set node visibility with a checkbox.
@ ShowLegendAsTree
For legends that support it, will show them in a tree instead of a list (needs also ShowLegend)....
@ AllowNodeReorder
Allow reordering with drag'n'drop.
@ AllowNodeRename
Allow renaming of groups and layers.
@ AllowLegendChangeState
Allow check boxes for legend nodes (if supported by layer's legend).
Base class for nodes in a layer tree.
@ NodeCustom
Leaf node pointing to a custom object.
@ NodeGroup
Container of other groups and layers.
@ NodeLayer
Leaf node pointing to a layer.
static QgsLayerTreeNode * readXml(QDomElement &element, const QgsReadWriteContext &context)
Read layer tree from XML.
NodeType nodeType() const
Find out about type of the node. It is usually shorter to use convenience functions from QgsLayerTree...
void setItemVisibilityChecked(bool checked)
Check or uncheck a node (independently of its ancestors or children).
void setLayerTreeModel(QgsLayerTreeModel *model)
Associates a layer tree model with the view.
QgsLayerTreeViewBase(QWidget *parent=nullptr)
Constructor for QgsLayerTreeViewBase.
Namespace with helper functions for layer tree operations.
static QgsLayerTreeLayer * toLayer(QgsLayerTreeNode *node)
Cast node to a layer.
static bool isLayer(const QgsLayerTreeNode *node)
Check whether the node is a valid layer node.
static bool isGroup(QgsLayerTreeNode *node)
Check whether the node is a valid group node.
A line symbol type, for rendering LineString and MultiLineString geometries.
static QList< QgsMapLayer * > sortLayersByType(const QList< QgsMapLayer * > &layers, const QList< Qgis::LayerType > &order)
Sorts a list of map layers by their layer type, respecting the order of types specified.
Base class for all map layer types.
Definition qgsmaplayer.h:80
A marker symbol type, for rendering Point and MultiPoint geometries.
Mesh layer specific subclass of QgsMapLayerElevationProperties.
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the mesh profile in elevation profile plots.
QgsLineSymbol * profileLineSymbol() const
Returns the line symbol used to render the mesh profile in elevation profile plots.
QgsFillSymbol * profileFillSymbol() const
Returns the fill symbol used to render the mesh profile in elevation profile plots.
QList< QgsAbstractProfileSource * > profileSources() const
Returns a list of registered profile sources.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
static QgsProject * instance()
Returns the QgsProject singleton instance.
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
Raster layer specific subclass of QgsMapLayerElevationProperties.
QgsLineSymbol * profileLineSymbol() const
Returns the line symbol used to render the raster profile in elevation profile plots.
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the raster profile in elevation profile plots.
QgsFillSymbol * profileFillSymbol() const
Returns the fill symbol used to render the raster profile in elevation profile plots.
A feature renderer which renders all features with the same symbol.
static QPixmap symbolPreviewPixmap(const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr, const QgsLegendPatchShape *shape=nullptr, const QgsScreenProperties &screen=QgsScreenProperties())
Returns a pixmap preview for a color ramp.
Vector layer specific subclass of QgsMapLayerElevationProperties.
QgsFillSymbol * profileFillSymbol() const
Returns the symbol used to render polygons for the layer in elevation profile plots.
Qgis::VectorProfileType type() const
Returns the type of profile the layer represents.
QgsLineSymbol * profileLineSymbol() const
Returns the symbol used to render lines for the layer in elevation profile plots.
QgsMarkerSymbol * profileMarkerSymbol() const
Returns the symbol used to render points for the layer in elevation profile plots.
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the vector profile in elevation profile plots.
bool respectLayerSymbology() const
Returns true if layer symbology should be respected when rendering elevation profile plots.
bool extrusionEnabled() const
Returns true if extrusion is enabled.
Represents a vector layer which manages a vector based dataset.
Q_INVOKABLE Qgis::GeometryType geometryType() const
Returns point, line or polygon.
#define QgsDebugError(str)
Definition qgslogger.h:57