Skip to content
Permalink
Browse files

bunch of other file skeletons

  • Loading branch information
PeterPetrik authored and nyalldawson committed Oct 26, 2020
1 parent de6f4d6 commit 9c27d4ae919f36d13e32317c88295328cc35f402
Showing with 764 additions and 42 deletions.
  1. +1 −0 images/images.qrc
  2. +97 −0 images/themes/default/mIconPointCloudLayer.svg
  3. +0 −14 python/core/auto_generated/pointcloud/qgspointcloudlayer.sip.in
  4. +4 −1 python/core/auto_generated/qgsdataitem.sip.in
  5. +7 −0 python/gui/auto_generated/qgsabstractdatasourcewidget.sip.in
  6. +3 −0 src/app/qgisapp.cpp
  7. +5 −0 src/core/CMakeLists.txt
  8. +3 −0 src/core/layertree/qgslayertreemodel.cpp
  9. +75 −0 src/core/pointcloud/qgspointclouddataitems.cpp
  10. +52 −0 src/core/pointcloud/qgspointclouddataitems.h
  11. +8 −3 src/core/pointcloud/qgspointcloudindex.cpp
  12. +3 −3 src/core/pointcloud/qgspointcloudindex.h
  13. +3 −3 src/core/pointcloud/qgspointcloudlayer.cpp
  14. +2 −11 src/core/pointcloud/qgspointcloudlayer.h
  15. +38 −0 src/core/pointcloud/qgspointcloudprovidermetadata.cpp
  16. +41 −0 src/core/pointcloud/qgspointcloudprovidermetadata.h
  17. +3 −3 src/core/pointcloud/qgspointcloudrenderer.cpp
  18. +3 −3 src/core/pointcloud/qgspointcloudrenderer.h
  19. +5 −0 src/core/qgsdataitem.cpp
  20. +2 −1 src/core/qgsdataitem.h
  21. +6 −0 src/core/qgsproviderregistry.cpp
  22. +8 −0 src/gui/CMakeLists.txt
  23. +30 −0 src/gui/pointcloud/qgspointclouddataitemguiprovider.cpp
  24. +40 −0 src/gui/pointcloud/qgspointclouddataitemguiprovider.h
  25. +58 −0 src/gui/pointcloud/qgspointcloudproviderguimetadata.cpp
  26. +40 −0 src/gui/pointcloud/qgspointcloudproviderguimetadata.h
  27. +53 −0 src/gui/pointcloud/qgspointcloudsourceselect.cpp
  28. +46 −0 src/gui/pointcloud/qgspointcloudsourceselect.h
  29. +6 −0 src/gui/qgsabstractdatasourcewidget.h
  30. +2 −0 src/gui/qgsdatasourcemanagerdialog.cpp
  31. +6 −0 src/gui/qgsdatasourcemanagerdialog.h
  32. +4 −0 src/gui/qgsproviderguiregistry.cpp
  33. +2 −0 src/ui/CMakeLists.txt
  34. +108 −0 src/ui/pointcloud/qgspointcloudsourceselectbase.ui
@@ -537,6 +537,7 @@
<file>themes/default/mIconTreeView.svg</file>
<file>themes/default/mIconVector.svg</file>
<file>themes/default/mIconVectorTileLayer.svg</file>
<file>themes/default/mIconPointCloudLayer.svg</file>
<file>themes/default/mIconVirtualLayer.svg</file>
<file>themes/default/mIconWcs.svg</file>
<file>themes/default/mIconWfs.svg</file>
@@ -0,0 +1,97 @@
<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 16 16"
version="1.1"
id="svg14"
sodipodi:docname="mIconPointCloudLayer.svg"
inkscape:version="1.0beta2 (2b71d25, 2019-12-03)">
<metadata
id="metadata18">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
inkscape:document-rotation="0"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1319"
id="namedview16"
showgrid="false"
inkscape:zoom="13.421875"
inkscape:cx="17.893017"
inkscape:cy="6.8450475"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="1"
inkscape:current-layer="svg14" />
<defs
id="defs10">
<linearGradient
id="linearGradient921">
<stop
id="stop915"
stop-color="#ffebeb"
offset="0" />
<stop
id="stop917"
stop-color="#be0f0f"
offset=".516"
style="stop-color:#be0f0f;stop-opacity:0.36910987" />
<stop
id="stop919"
stop-color="#280000"
offset="1"
style="stop-color:#280000;stop-opacity:0" />
</linearGradient>
<linearGradient
id="a">
<stop
offset="0"
stop-color="#ffebeb"
id="stop3"
style="stop-color:#e00000;stop-opacity:1" />
<stop
offset=".516"
stop-color="#be0f0f"
id="stop5" />
<stop
offset="1"
stop-color="#280000"
id="stop7" />
</linearGradient>
</defs>
<path
d="m 7.8975556,7.5995336 a 0.4097788,0.52153665 0 0 1 -0.00337,0.066742"
sodipodi:arc-type="arc"
sodipodi:open="true"
sodipodi:end="0.12832324"
sodipodi:start="0"
sodipodi:ry="0.52153665"
sodipodi:rx="0.4097788"
sodipodi:cy="7.5995336"
sodipodi:cx="7.4877768"
sodipodi:type="arc"
id="path857"
style="fill:#e16c2e;stroke:#00c5e2;stroke-width:12.7181;stroke-linecap:round;stroke-linejoin:bevel" />
</svg>
@@ -65,20 +65,6 @@ QgsPointCloudLayer cannot be copied.



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 );
};
@@ -589,7 +589,10 @@ Returns icon for mesh layer type
%Docstring
Returns icon for vector tile layer
%End

static QIcon iconPointCloudLayer();
%Docstring
Returns icon for point cloud layer
%End
virtual QString layerName() const;
%Docstring

@@ -99,6 +99,13 @@ Emitted when a mesh layer has been selected for addition.
Emitted when a vector tile layer has been selected for addition.

.. versionadded:: 3.14
%End

void addPointCloudLayer( const QString &url, const QString &baseName );
%Docstring
Emitted when a point cloud layer has been selected for addition.

.. versionadded:: 3.18
%End

void addVectorLayers( const QStringList &layerList, const QString &encoding, const QString &dataSourceType );
@@ -2416,6 +2416,7 @@ void QgisApp::dataSourceManager( const QString &pageName )
this, SLOT( addVectorLayers( QStringList const &, QString const &, QString const & ) ) );
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::addMeshLayer, this, &QgisApp::addMeshLayer );
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::addVectorTileLayer, this, &QgisApp::addVectorTileLayer );
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::addPointCloudLayer, this, &QgisApp::addPointCloudLayer );
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::showStatusMessage, this, &QgisApp::showStatusMessage );
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::addDatabaseLayers, this, &QgisApp::addDatabaseLayers );
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::replaceSelectedVectorLayer, this, &QgisApp::replaceSelectedVectorLayer );
@@ -2757,6 +2758,7 @@ void QgisApp::createActions()
connect( mActionAddWmsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "wms" ) ); } );
connect( mActionAddXyzLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "xyz" ) ); } );
connect( mActionAddVectorTileLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "vectortile" ) ); } );
connect( mActionAddPointCloudLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "pointcloud" ) ); } );
connect( mActionAddWcsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "wcs" ) ); } );
connect( mActionAddWfsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "WFS" ) ); } );
connect( mActionAddAfsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "arcgisfeatureserver" ) ); } );
@@ -9008,6 +9010,7 @@ void QgisApp::saveStyleFile( QgsMapLayer *layer )
case QgsMapLayerType::VectorTileLayer:
case QgsMapLayerType::AnnotationLayer:
case QgsMapLayerType::PluginLayer:
case QgsMapLayerType::PointCloudLayer:
break;

}
@@ -624,6 +624,8 @@ SET(QGIS_CORE_SRCS
pointcloud/qgspointcloudlayer.cpp
pointcloud/qgspointcloudrenderer.cpp
pointcloud/qgspointcloudindex.cpp
pointcloud/qgspointclouddataitems.cpp
pointcloud/qgspointcloudprovidermetadata.cpp

labeling/qgslabelfeature.cpp
labeling/qgslabelingengine.cpp
@@ -1297,6 +1299,8 @@ SET(QGIS_CORE_HDRS
pointcloud/qgspointcloudlayer.h
pointcloud/qgspointcloudrenderer.h
pointcloud/qgspointcloudindex.h
pointcloud/qgspointclouddataitems.h
pointcloud/qgspointcloudprovidermetadata.h

metadata/qgsabstractmetadatabase.h
metadata/qgslayermetadata.h
@@ -1568,6 +1572,7 @@ INCLUDE_DIRECTORIES(
locator
mesh
metadata
pointcloud
numericformats
pal
processing
@@ -207,6 +207,9 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
case QgsMapLayerType::VectorTileLayer:
return QgsLayerItem::iconVectorTile();

case QgsMapLayerType::PointCloudLayer:
return QgsLayerItem::iconPointCloudLayer();

case QgsMapLayerType::VectorLayer:
case QgsMapLayerType::PluginLayer:
case QgsMapLayerType::AnnotationLayer:
@@ -0,0 +1,75 @@
/***************************************************************************
qgspointclouddataitems.cpp
--------------------
begin : October 2020
copyright : (C) 2020 by Peter Petrik
email : zilolv at gmail dot com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgspointclouddataitems.h"
#include "qgslogger.h"
#include "qgssettings.h"

#include <QFileInfo>
#include <mutex>

///@cond PRIVATE

QgsPointCloudLayerItem::QgsPointCloudLayerItem( QgsDataItem *parent,
const QString &name, const QString &path, const QString &uri )
: QgsLayerItem( parent, name, path, uri, QgsLayerItem::Mesh, QStringLiteral( "pointcloud" ) )
{
mToolTip = uri;
setState( Populated );
}

QString QgsPointCloudLayerItem::layerName() const
{
QFileInfo info( name() );
return info.completeBaseName();
}

// ---------------------------------------------------------------------------
QString QgsPointCloudDataItemProvider::name()
{
return QStringLiteral( "pointcloud" );
}

int QgsPointCloudDataItemProvider::capabilities() const
{
return QgsDataProvider::File;
}

QgsDataItem *QgsPointCloudDataItemProvider::createDataItem( const QString &path, QgsDataItem *parentItem )
{
if ( path.isEmpty() )
return nullptr;

QgsDebugMsgLevel( "thePath = " + path, 2 );

// get suffix, removing .gz if present
QFileInfo info( path );
info.setFile( path );
QString name = info.fileName();

// allow only normal files
if ( !info.isFile() )
return nullptr;

// Filter files by extension
if ( name != QStringLiteral("ept.json") )
return nullptr;

return new QgsPointCloudLayerItem( parentItem, name, path, path );
}

///@endcond
@@ -0,0 +1,52 @@
/***************************************************************************
qgspointclouddataitems.h
--------------------
begin : October 2020
copyright : (C) 2020 by Peter Petrik
email : zilolv at gmail dot com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSPOINTCLOUDDATAITEMS_H
#define QGSPOINTCLOUDDATAITEMS_H

#include "qgsdataitem.h"
#include "qgsdataitemprovider.h"

///@cond PRIVATE
#define SIP_NO_FILE

class CORE_EXPORT QgsPointCloudLayerItem : public QgsLayerItem
{
Q_OBJECT
public:
QgsPointCloudLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri );
QString layerName() const override;

};

//! Provider for MDAL data items
class QgsPointCloudDataItemProvider : public QgsDataItemProvider
{
public:
QString name() override;

int capabilities() const override;

QgsDataItem *createDataItem( const QString &pathIn, QgsDataItem *parentItem ) override;
};

///@endcond

#endif // QGSPOINTCLOUDDATAITEMS_H



@@ -1,9 +1,9 @@
/***************************************************************************
qgspointcloudlayer.h
qgspointcloudindex.cpp
--------------------
begin : October 2020
copyright : (C) 2020 by Martin Dobias and Peter Petrik
email : wonder dot sk at gmail dot com, zilolv at gmail dot com
copyright : (C) 2020 by Peter Petrik
email : zilolv at gmail dot com
***************************************************************************/

/***************************************************************************
@@ -21,3 +21,8 @@
QgsPointCloudIndex::QgsPointCloudIndex() = default;

QgsPointCloudIndex::~QgsPointCloudIndex() = default;

void QgsPointCloudIndex::load( const QString &fileName )
{

}
@@ -1,9 +1,9 @@
/***************************************************************************
QgsPointCloudIndex.h
qgspointcloudindex.h
--------------------
begin : October 2020
copyright : (C) 2020 by Martin Dobias and Peter Petrik
email : wonder dot sk at gmail dot com, zilolv at gmail dot com
copyright : (C) 2020 by Peter Petrik
email : zilolv at gmail dot com
***************************************************************************/

/***************************************************************************
@@ -1,9 +1,9 @@
/***************************************************************************
qgspointcloudlayer.h
qgspointcloudlayer.cpp
--------------------
begin : October 2020
copyright : (C) 2020 by Martin Dobias and Peter Petrik
email : wonder dot sk at gmail dot com, zilolv at gmail dot com
copyright : (C) 2020 by Peter Petrik
email : zilolv at gmail dot com
***************************************************************************/

/***************************************************************************

0 comments on commit 9c27d4a

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