Fix qgis_core python and project loading with point cloud layer

This commit is contained in:
Martin Dobias 2020-10-21 21:01:01 +02:00 committed by Nyall Dawson
parent b796dbb07b
commit a86149b452
3 changed files with 28 additions and 4 deletions

View File

@ -29,7 +29,28 @@ Represents a map layer supporting display of point clouds
%End
public:
explicit QgsPointCloudLayer( const QString &path = QString(), const QString &baseName = QString() );
struct LayerOptions
{
explicit LayerOptions( const QgsCoordinateTransformContext &transformContext = QgsCoordinateTransformContext( ) );
%Docstring
Constructor for LayerOptions with optional ``transformContext``.
.. note::
transformContext argument was added in QGIS 3.8
%End
QgsCoordinateTransformContext transformContext;
bool skipCrsValidation;
};
explicit QgsPointCloudLayer( const QString &path = QString(),
const QString &baseName = QString(),
const QString &providerLib = QStringLiteral( "pointcloud" ),
const QgsPointCloudLayer::LayerOptions &options = QgsPointCloudLayer::LayerOptions());
%Docstring
Constructor - creates a point cloud layer
%End

View File

@ -32,9 +32,8 @@
class QgsRenderContext;
class QgsPointCloudLayer;
#ifndef SIP_RUN
class QgsPointCloudRendererConfig
class CORE_EXPORT QgsPointCloudRendererConfig
{
public:
QgsPointCloudRendererConfig();
@ -60,7 +59,6 @@ class QgsPointCloudRendererConfig
std::unique_ptr<QgsColorRamp> mColorRamp;
};
#endif
/**

View File

@ -63,6 +63,7 @@
#include "qgsvectortilelayer.h"
#include "qgsruntimeprofiler.h"
#include "qgsannotationlayer.h"
#include "qgspointcloudlayer.h"
#include <algorithm>
#include <QApplication>
@ -1151,6 +1152,10 @@ bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &broken
{
mapLayer = qgis::make_unique<QgsVectorTileLayer>();
}
else if ( type == QLatin1String( "point-cloud" ) )
{
mapLayer = qgis::make_unique<QgsPointCloudLayer>();
}
else if ( type == QLatin1String( "plugin" ) )
{
QString typeName = layerElem.attribute( QStringLiteral( "name" ) );