Skip to content
Permalink
Browse files

add simple browser integration

  • Loading branch information
PeterPetrik authored and nyalldawson committed Oct 26, 2020
1 parent 9c27d4a commit 13ecb8c45265c86776b4014ad46e5ce7d35dfc80
@@ -490,7 +490,8 @@ Item that represents a layer that can be opened with one of the providers
Table,
Plugin,
Mesh,
VectorTile
VectorTile,
PointCloud
};


@@ -2094,6 +2094,10 @@ void QgisApp::handleDropUriList( const QgsMimeDataUtils::UriList &lst )
{
addMeshLayer( uri, u.name, u.providerKey );
}
else if ( u.layerType == QLatin1String( "pointcloud" ) )
{
addPointCloudLayer( uri, u.name );
}
else if ( u.layerType == QLatin1String( "vector-tile" ) )
{
QgsTemporaryCursorOverride busyCursor( Qt::WaitCursor );
@@ -25,8 +25,8 @@
///@cond PRIVATE

QgsPointCloudLayerItem::QgsPointCloudLayerItem( QgsDataItem *parent,
const QString &name, const QString &path, const QString &uri )
: QgsLayerItem( parent, name, path, uri, QgsLayerItem::Mesh, QStringLiteral( "pointcloud" ) )
const QString &name, const QString &path, const QString &uri )
: QgsLayerItem( parent, name, path, uri, QgsLayerItem::PointCloud, QStringLiteral( "pointcloud" ) )
{
mToolTip = uri;
setState( Populated );
@@ -66,7 +66,7 @@ QgsDataItem *QgsPointCloudDataItemProvider::createDataItem( const QString &path,
return nullptr;

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

return new QgsPointCloudLayerItem( parentItem, name, path, path );
@@ -828,6 +828,9 @@ QgsMapLayerType QgsLayerItem::mapLayerType() const
case QgsLayerItem::Plugin:
return QgsMapLayerType::PluginLayer;

case QgsLayerItem::PointCloud:
return QgsMapLayerType::PointCloudLayer;

case QgsLayerItem::NoType:
case QgsLayerItem::Vector:
case QgsLayerItem::Point:
@@ -875,6 +878,8 @@ QgsLayerItem::LayerType QgsLayerItem::typeFromMapLayer( QgsMapLayer *layer )
return Plugin;
case QgsMapLayerType::MeshLayer:
return Mesh;
case QgsMapLayerType::PointCloudLayer:
return PointCloud;
case QgsMapLayerType::VectorTileLayer:
return VectorTile;
case QgsMapLayerType::AnnotationLayer:
@@ -909,6 +914,8 @@ QString QgsLayerItem::iconName( QgsLayerItem::LayerType layerType )
return QStringLiteral( "/mIconRaster.svg" );
case Mesh:
return QStringLiteral( "/mIconMeshLayer.svg" );
case PointCloud:
return QStringLiteral( "/mIconPointCloudLayer.svg" );
default:
return QStringLiteral( "/mIconLayer.png" );
}
@@ -964,6 +971,7 @@ QgsMimeDataUtils::Uri QgsLayerItem::mimeUri() const
case Raster:
case Plugin:
case Mesh:
case PointCloud:
case VectorTile:
break;
}
@@ -977,6 +985,9 @@ QgsMimeDataUtils::Uri QgsLayerItem::mimeUri() const
case QgsMapLayerType::VectorTileLayer:
u.layerType = QStringLiteral( "vector-tile" );
break;
case QgsMapLayerType::PointCloudLayer:
u.layerType = QStringLiteral( "pointcloud" );
break;
case QgsMapLayerType::PluginLayer:
u.layerType = QStringLiteral( "plugin" );
break;
@@ -521,7 +521,8 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
Table,
Plugin, //!< Added in 2.10
Mesh, //!< Added in 3.2
VectorTile //!< Added in 3.14
VectorTile, //!< Added in 3.14
PointCloud //!< Added in 3.18
};

Q_ENUM( LayerType )
@@ -140,8 +140,8 @@ void QgsProviderRegistry::init()
}
{
QgsScopedRuntimeProfile profile( QObject::tr( "Create point cloud provider" ) );
QgsProviderMetadata *vt = new QgsPointCloudProviderMetadata();
mProviders[ vt->key() ] = vt;
QgsProviderMetadata *pc = new QgsPointCloudProviderMetadata();
mProviders[ pc->key() ] = pc;
}
#ifdef HAVE_STATIC_PROVIDERS
mProviders[ QgsWmsProvider::providerKey() ] = new QgsWmsProviderMetadata();
@@ -189,7 +189,7 @@ void QgsDataSourceManagerDialog::makeConnections( QgsAbstractDataSourceWidget *d
connect( dlg, &QgsAbstractDataSourceWidget::addMeshLayer, this, &QgsDataSourceManagerDialog::addMeshLayer );
// Vector tile
connect( dlg, &QgsAbstractDataSourceWidget::addVectorTileLayer, this, &QgsDataSourceManagerDialog::addVectorTileLayer );
// Vector tile
// Point Cloud
connect( dlg, &QgsAbstractDataSourceWidget::addPointCloudLayer, this, &QgsDataSourceManagerDialog::addPointCloudLayer );
// Virtual
connect( dlg, &QgsAbstractDataSourceWidget::replaceVectorLayer,

0 comments on commit 13ecb8c

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