Skip to content
Permalink
Browse files

hook point cloud layer type to the rest of the code

  • Loading branch information
PeterPetrik authored and nyalldawson committed Oct 26, 2020
1 parent abd102c commit de6f4d6ad841fef27e508c37271c5dfaebd8a1ba
Showing with 739 additions and 17 deletions.
  1. +1 −0 images/images.qrc
  2. +151 −0 images/themes/default/mActionAddPointCloudLayer.svg
  3. +2 −0 python/CMakeLists.txt
  4. +3 −1 python/core/auto_additions/qgsmaplayer.py
  5. +44 −0 python/core/auto_generated/pointcloud/qgspointcloudindex.sip.in
  6. +93 −0 python/core/auto_generated/pointcloud/qgspointcloudlayer.sip.in
  7. +51 −0 python/core/auto_generated/pointcloud/qgspointcloudrenderer.sip.in
  8. +4 −0 python/core/auto_generated/qgsmaplayer.sip.in
  9. +1 −0 python/core/auto_generated/qgsmaplayerproxymodel.sip.in
  10. +3 −0 python/core/core_auto.sip
  11. +15 −1 python/gui/auto_generated/qgisinterface.sip.in
  12. +2 −0 src/app/CMakeLists.txt
  13. +1 −0 src/app/browser/qgsinbuiltdataitemproviders.cpp
  14. +119 −0 src/app/qgisapp.cpp
  15. +14 −0 src/app/qgisapp.h
  16. +6 −0 src/app/qgisappinterface.cpp
  17. +2 −0 src/app/qgisappinterface.h
  18. +1 −0 src/app/qgsidentifyresultsdialog.cpp
  19. +7 −1 src/app/qgslayerstylingwidget.cpp
  20. +1 −0 src/app/qgslayertreeviewtemporalindicator.cpp
  21. +4 −0 src/core/pointcloud/qgspointcloudindex.cpp
  22. +6 −3 src/core/pointcloud/qgspointcloudindex.h
  23. +84 −0 src/core/pointcloud/qgspointcloudlayer.cpp
  24. +32 −5 src/core/pointcloud/qgspointcloudlayer.h
  25. +27 −0 src/core/pointcloud/qgspointcloudrenderer.cpp
  26. +19 −4 src/core/pointcloud/qgspointcloudrenderer.h
  27. +4 −0 src/core/qgsmaplayer.h
  28. +2 −1 src/core/qgsmaplayerproxymodel.h
  29. +2 −0 src/gui/CMakeLists.txt
  30. +3 −0 src/gui/layertree/qgslayertreeembeddedwidgetsimpl.cpp
  31. +14 −1 src/gui/qgisinterface.h
  32. +8 −0 src/gui/qgsbrowserdockwidget_p.cpp
  33. +1 −0 src/gui/qgsidentifymenu.cpp
  34. +1 −0 src/gui/qgsmaplayerloadstyledialog.cpp
  35. +1 −0 src/gui/qgsmaplayerstylecategoriesmodel.cpp
  36. +10 −0 src/ui/qgisapp.ui
@@ -239,6 +239,7 @@
<file>themes/default/mActionAddWmsLayer.svg</file>
<file>themes/default/mActionAddXyzLayer.svg</file>
<file>themes/default/mActionAddVectorTileLayer.svg</file>
<file>themes/default/mActionAddPointCloudLayer.svg</file>
<file>themes/default/mActionAddGeonodeLayer.svg</file>
<file>themes/default/mActionAddDelimitedTextLayer.svg</file>
<file>themes/default/mActionAddVirtualLayer.svg</file>
@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0beta2 (2b71d25, 2019-12-03)"
sodipodi:docname="mActionAddPointCloudLayer.svg"
id="svg64"
version="1.1"
width="24"
height="24">
<metadata
id="metadata70">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs68" />
<sodipodi:namedview
inkscape:current-layer="svg64"
inkscape:window-maximized="0"
inkscape:window-y="23"
inkscape:window-x="5"
inkscape:cy="4.4065197"
inkscape:cx="11.58581"
inkscape:zoom="43.458333"
showgrid="false"
id="namedview66"
inkscape:window-height="1319"
inkscape:window-width="2560"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
inkscape:document-rotation="0"
bordercolor="#666666"
pagecolor="#ffffff" />
<linearGradient
y2="15.458"
y1="15.458"
xlink:href="#b"
x2="7"
x1="1.729"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.65196,0,0,0.6516,1.174,-6.025)"
id="a" />
<linearGradient
id="b">
<stop
id="stop11"
stop-color="#6e97c4"
offset="0" />
<stop
id="stop13"
stop-color="#aec7e2"
offset="1" />
</linearGradient>
<linearGradient
y2="15"
y1="10"
xlink:href="#b"
x2="7.449"
x1="7.373"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(.65196 0 0 .6516 1.174 1.975)"
id="c" />
<linearGradient
y2="25.132999"
y1="22.364"
x2="4.458"
x1="4.53"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(3.8476185,0,0,3.28136,-4.436498,-70.386576)"
id="d">
<stop
id="stop17"
stop-color="#eee"
offset="0" />
<stop
id="stop19"
stop-color="#aec7e2"
offset="1" />
</linearGradient>
<path
id="path22"
fill="url(#c)"
d="m2.478 8.49c-.87 9.558-.435 4.779 0 0z" />
<g
id="g62"
transform="matrix(.69230769 0 0 .69230769 1.846154 1.846154)">
<rect
id="rect52"
y="19"
x="19"
width="13"
rx="2.614937"
height="13"
fill="#5a8c5a" />
<g
id="g60"
fill-rule="evenodd">
<path
id="path54"
stroke-width="2.6"
stroke-linejoin="round"
stroke-linecap="round"
stroke="#fff"
fill="#fff"
d="m21.6 25.499999h7.8" />
<path
id="path56"
stroke-width="2.6"
stroke-linejoin="round"
stroke-linecap="round"
stroke="#fff"
fill="#fff"
d="m25.5 29.399999v-7.799999" />
<path
id="path58"
opacity=".3"
fill="#fcffff"
d="m20.3 25.499999h10.4s0 0 0-2.6c0-2.599999-.65-2.599999-5.2-2.599999s-5.2 0-5.2 2.599999z" />
</g>
</g>
<path
d="m 11.29625,10.264633 a 1.3486331,3.868824 0 0 1 -0.01109,0.495099"
sodipodi:arc-type="arc"
sodipodi:open="true"
sodipodi:end="0.12832324"
sodipodi:start="0"
sodipodi:ry="3.868824"
sodipodi:rx="1.3486331"
sodipodi:cy="10.264633"
sodipodi:cx="9.9476166"
sodipodi:type="arc"
id="path74"
style="opacity:1;fill:#e16c2e;fill-opacity:1;fill-rule:nonzero;stroke:#00c5e2;stroke-width:11.7555;stroke-linecap:round;stroke-linejoin:bevel" />
</svg>
@@ -124,6 +124,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/processing
${CMAKE_SOURCE_DIR}/src/core/processing/models
${CMAKE_SOURCE_DIR}/src/core/providers
${CMAKE_SOURCE_DIR}/src/core/pointcloud
${CMAKE_SOURCE_DIR}/src/core/providers/memory
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
@@ -161,6 +162,7 @@ IF (WITH_GUI)
${CMAKE_SOURCE_DIR}/src/gui/locator
${CMAKE_SOURCE_DIR}/src/gui/numericformats
${CMAKE_SOURCE_DIR}/src/gui/processing
${CMAKE_SOURCE_DIR}/src/gui/pointcloud
${CMAKE_SOURCE_DIR}/src/gui/processing/models
${CMAKE_SOURCE_DIR}/src/gui/tableeditor
${CMAKE_SOURCE_DIR}/src/gui/vector
@@ -13,7 +13,9 @@
QgsMapLayer.VectorTileLayer.__doc__ = "Added in 3.14"
QgsMapLayer.AnnotationLayer = QgsMapLayerType.AnnotationLayer
QgsMapLayer.AnnotationLayer.__doc__ = "Contains freeform, georeferenced annotations. Added in QGIS 3.16"
QgsMapLayerType.__doc__ = 'Types of layers that can be added to a map\n\n.. versionadded:: 3.8\n\n' + '* ``VectorLayer``: ' + QgsMapLayerType.VectorLayer.__doc__ + '\n' + '* ``RasterLayer``: ' + QgsMapLayerType.RasterLayer.__doc__ + '\n' + '* ``PluginLayer``: ' + QgsMapLayerType.PluginLayer.__doc__ + '\n' + '* ``MeshLayer``: ' + QgsMapLayerType.MeshLayer.__doc__ + '\n' + '* ``VectorTileLayer``: ' + QgsMapLayerType.VectorTileLayer.__doc__ + '\n' + '* ``AnnotationLayer``: ' + QgsMapLayerType.AnnotationLayer.__doc__
QgsMapLayer.PointCloudLayer = QgsMapLayerType.PointCloudLayer
QgsMapLayer.PointCloudLayer.__doc__ = "Added in 3.18"
QgsMapLayerType.__doc__ = 'Types of layers that can be added to a map\n\n.. versionadded:: 3.8\n\n' + '* ``VectorLayer``: ' + QgsMapLayerType.VectorLayer.__doc__ + '\n' + '* ``RasterLayer``: ' + QgsMapLayerType.RasterLayer.__doc__ + '\n' + '* ``PluginLayer``: ' + QgsMapLayerType.PluginLayer.__doc__ + '\n' + '* ``MeshLayer``: ' + QgsMapLayerType.MeshLayer.__doc__ + '\n' + '* ``VectorTileLayer``: ' + QgsMapLayerType.VectorTileLayer.__doc__ + '\n' + '* ``AnnotationLayer``: ' + QgsMapLayerType.AnnotationLayer.__doc__ + '\n' + '* ``PointCloudLayer``: ' + QgsMapLayerType.PointCloudLayer.__doc__
# --
QgsMapLayer.LayerFlag.baseClass = QgsMapLayer
QgsMapLayer.LayerFlags.baseClass = QgsMapLayer
@@ -0,0 +1,44 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudindex.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsPointCloudIndex: QObject
{
%Docstring

Represents a indexed point clouds data in octree

.. note::

The API is considered EXPERIMENTAL and can be changed without a notice

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgspointcloudindex.h"
%End
public:

explicit QgsPointCloudIndex();
~QgsPointCloudIndex();

void load( const QString &fileName );
};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudindex.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -0,0 +1,93 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudlayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/






class QgsPointCloudLayer : QgsMapLayer
{
%Docstring

Represents a map layer supporting display of point clouds

.. note::

The API is considered EXPERIMENTAL and can be changed without a notice

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgspointcloudlayer.h"
%End
public:

explicit QgsPointCloudLayer( const QString &path = QString(), const QString &baseName = QString() );
%Docstring
Constructor - creates a point cloud layer
%End

~QgsPointCloudLayer();


virtual QgsPointCloudLayer *clone() const /Factory/;

%Docstring
QgsPointCloudLayer cannot be copied.
%End
virtual QgsRectangle extent() const;

virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) /Factory/;


virtual bool readXml( const QDomNode &layerNode, QgsReadWriteContext &context );


virtual bool writeXml( QDomNode &layerNode, QDomDocument &doc, const QgsReadWriteContext &context ) const;


virtual bool readSymbology( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories );

virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
StyleCategories categories = AllStyleCategories ) const;

virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext );

virtual QString loadDefaultStyle( bool &resultFlag /Out/ );



void setRenderer( QgsPointCloudRenderer *r /Transfer/ );
%Docstring
Sets renderer for the map layer.

.. note::

Takes ownership of the passed renderer
%End
QgsPointCloudRenderer *renderer() const;
%Docstring
Returns currently assigned renderer
%End


private: // Private methods
QgsPointCloudLayer( const QgsPointCloudLayer &rhs );
};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudlayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -0,0 +1,51 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/






class QgsPointCloudRenderer: QgsMapLayerRenderer
{
%Docstring

Represents a 2D renderer of point cloud data

.. note::

The API is considered EXPERIMENTAL and can be changed without a notice

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgspointcloudrenderer.h"
%End
public:

explicit QgsPointCloudRenderer( QgsPointCloudLayer *layer, QgsRenderContext &context );
~QgsPointCloudRenderer();

virtual bool render();


void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
void readXml( const QDomElement &elem, const QgsReadWriteContext &context );

protected:
};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -22,6 +22,7 @@ enum class QgsMapLayerType
MeshLayer,
VectorTileLayer,
AnnotationLayer,
PointCloudLayer,
};

class QgsMapLayer : QObject
@@ -61,6 +62,9 @@ This is the base class for all map layer types (vector, raster).
case QgsMapLayerType::AnnotationLayer:
sipType = sipType_QgsAnnotationLayer;
break;
case QgsMapLayerType::PointCloudLayer:
sipType = sipType_QgsPointCloudLayer;
break;
default:
sipType = nullptr;
break;

0 comments on commit de6f4d6

Please sign in to comment.
You can’t perform that action at this time.