mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
Add QgsProviderRegistry::filePointCloudFilters() for retrieving filter string of all supported point cloud types
This commit is contained in:
parent
6885a1604c
commit
e59bab7f2e
@ -339,6 +339,22 @@ fileMeshFilters to a string, which is then returned.
|
||||
.. seealso:: :py:func:`fileMeshFilters`
|
||||
|
||||
.. versionadded:: 3.6
|
||||
%End
|
||||
|
||||
QString filePointCloudFilters() const;
|
||||
%Docstring
|
||||
Returns a file filter string for supported point clouds.
|
||||
|
||||
Returns a string suitable for a QFileDialog of point cloud file formats
|
||||
supported by all data providers.
|
||||
|
||||
.. seealso:: :py:func:`fileMeshFilters`
|
||||
|
||||
.. seealso:: :py:func:`fileRasterFilters`
|
||||
|
||||
.. seealso:: :py:func:`fileVectorFilters`
|
||||
|
||||
.. versionadded:: 3.18
|
||||
%End
|
||||
|
||||
QString databaseDrivers() const;
|
||||
|
@ -292,6 +292,15 @@ void QgsProviderRegistry::init()
|
||||
QgsDebugMsgLevel( QStringLiteral( "Checking %1: ...loaded OK (%2 file dataset filters)" ).arg( key ).arg( mMeshDatasetFileFilters.split( ";;" ).count() ), 2 );
|
||||
}
|
||||
|
||||
// now get point cloud file filters, if any
|
||||
const QString filePointCloudFilters = meta->filters( QgsProviderMetadata::FilterType::FilterPointCloud );
|
||||
if ( !filePointCloudFilters.isEmpty() )
|
||||
{
|
||||
QgsDebugMsgLevel( "point cloud filters: " + filePointCloudFilters, 2 );
|
||||
mPointCloudFileFilters += filePointCloudFilters;
|
||||
QgsDebugMsgLevel( QStringLiteral( "Checking %1: ...loaded OK (%2 file filters)" ).arg( key ).arg( filePointCloudFilters.split( ";;" ).count() ), 2 );
|
||||
}
|
||||
|
||||
// call initProvider() - allows provider to register its services to QGIS
|
||||
meta->initProvider();
|
||||
}
|
||||
@ -702,6 +711,11 @@ QString QgsProviderRegistry::fileMeshDatasetFilters() const
|
||||
return mMeshDatasetFileFilters;
|
||||
}
|
||||
|
||||
QString QgsProviderRegistry::filePointCloudFilters() const
|
||||
{
|
||||
return mPointCloudFileFilters;
|
||||
}
|
||||
|
||||
QString QgsProviderRegistry::databaseDrivers() const
|
||||
{
|
||||
return mDatabaseDrivers;
|
||||
|
@ -340,6 +340,20 @@ class CORE_EXPORT QgsProviderRegistry
|
||||
*/
|
||||
QString fileMeshDatasetFilters() const;
|
||||
|
||||
/**
|
||||
* Returns a file filter string for supported point clouds.
|
||||
*
|
||||
* Returns a string suitable for a QFileDialog of point cloud file formats
|
||||
* supported by all data providers.
|
||||
*
|
||||
* \see fileMeshFilters()
|
||||
* \see fileRasterFilters()
|
||||
* \see fileVectorFilters()
|
||||
*
|
||||
* \since QGIS 3.18
|
||||
*/
|
||||
QString filePointCloudFilters() const;
|
||||
|
||||
//! Returns a string containing the available database drivers
|
||||
QString databaseDrivers() const;
|
||||
//! Returns a string containing the available directory drivers
|
||||
@ -406,6 +420,11 @@ class CORE_EXPORT QgsProviderRegistry
|
||||
*/
|
||||
QString mMeshDatasetFileFilters;
|
||||
|
||||
/**
|
||||
* File filter string for point cloud files
|
||||
*/
|
||||
QString mPointCloudFileFilters;
|
||||
|
||||
/**
|
||||
* Available database drivers string for vector databases
|
||||
*
|
||||
|
@ -82,6 +82,9 @@ void TestQgsEptProvider::filters()
|
||||
|
||||
QCOMPARE( metadata->filters( QgsProviderMetadata::FilterType::FilterPointCloud ), QStringLiteral( "Entwine Point Clouds (ept.json EPT.JSON)" ) );
|
||||
QCOMPARE( metadata->filters( QgsProviderMetadata::FilterType::FilterVector ), QString() );
|
||||
|
||||
const QString registryPointCloudFilters = QgsProviderRegistry::instance()->filePointCloudFilters();
|
||||
QVERIFY( registryPointCloudFilters.contains( "(ept.json EPT.JSON)" ) );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user