mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-10 00:04:23 -04:00
Provider registry tiled mesh file handling support
This commit is contained in:
parent
6e02d953fd
commit
61a3f44e98
@ -1027,7 +1027,10 @@ QgsProviderMetadata.FilterPointCloud.__doc__ = "Point clouds (since QGIS 3.18)"
|
|||||||
QgsProviderMetadata.VectorTile = Qgis.FileFilterType.VectorTile
|
QgsProviderMetadata.VectorTile = Qgis.FileFilterType.VectorTile
|
||||||
QgsProviderMetadata.VectorTile.is_monkey_patched = True
|
QgsProviderMetadata.VectorTile.is_monkey_patched = True
|
||||||
QgsProviderMetadata.VectorTile.__doc__ = "Vector tile layers (since QGIS 3.32)"
|
QgsProviderMetadata.VectorTile.__doc__ = "Vector tile layers (since QGIS 3.32)"
|
||||||
Qgis.FileFilterType.__doc__ = 'Type of file filters\n\nPrior to QGIS 3.32 this was available as :py:class:`QgsProviderMetadata`.FilterType\n\n.. versionadded:: 3.32\n\n' + '* ``FilterVector``: ' + Qgis.FileFilterType.Vector.__doc__ + '\n' + '* ``FilterRaster``: ' + Qgis.FileFilterType.Raster.__doc__ + '\n' + '* ``FilterMesh``: ' + Qgis.FileFilterType.Mesh.__doc__ + '\n' + '* ``FilterMeshDataset``: ' + Qgis.FileFilterType.MeshDataset.__doc__ + '\n' + '* ``FilterPointCloud``: ' + Qgis.FileFilterType.PointCloud.__doc__ + '\n' + '* ``VectorTile``: ' + Qgis.FileFilterType.VectorTile.__doc__
|
QgsProviderMetadata.TiledMesh = Qgis.FileFilterType.TiledMesh
|
||||||
|
QgsProviderMetadata.TiledMesh.is_monkey_patched = True
|
||||||
|
QgsProviderMetadata.TiledMesh.__doc__ = "Tiled mesh layers (since QGIS 3.34)"
|
||||||
|
Qgis.FileFilterType.__doc__ = 'Type of file filters\n\nPrior to QGIS 3.32 this was available as :py:class:`QgsProviderMetadata`.FilterType\n\n.. versionadded:: 3.32\n\n' + '* ``FilterVector``: ' + Qgis.FileFilterType.Vector.__doc__ + '\n' + '* ``FilterRaster``: ' + Qgis.FileFilterType.Raster.__doc__ + '\n' + '* ``FilterMesh``: ' + Qgis.FileFilterType.Mesh.__doc__ + '\n' + '* ``FilterMeshDataset``: ' + Qgis.FileFilterType.MeshDataset.__doc__ + '\n' + '* ``FilterPointCloud``: ' + Qgis.FileFilterType.PointCloud.__doc__ + '\n' + '* ``VectorTile``: ' + Qgis.FileFilterType.VectorTile.__doc__ + '\n' + '* ``TiledMesh``: ' + Qgis.FileFilterType.TiledMesh.__doc__
|
||||||
# --
|
# --
|
||||||
Qgis.FileFilterType.baseClass = Qgis
|
Qgis.FileFilterType.baseClass = Qgis
|
||||||
# monkey patching scoped based enum
|
# monkey patching scoped based enum
|
||||||
|
@ -619,6 +619,8 @@ supported by all data providers.
|
|||||||
.. seealso:: :py:func:`filePointCloudFilters`
|
.. seealso:: :py:func:`filePointCloudFilters`
|
||||||
|
|
||||||
.. seealso:: :py:func:`fileVectorTileFilters`
|
.. seealso:: :py:func:`fileVectorTileFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileTiledMeshFilters`
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QString fileRasterFilters() const;
|
QString fileRasterFilters() const;
|
||||||
@ -639,6 +641,8 @@ supported by all data providers.
|
|||||||
.. seealso:: :py:func:`filePointCloudFilters`
|
.. seealso:: :py:func:`filePointCloudFilters`
|
||||||
|
|
||||||
.. seealso:: :py:func:`fileVectorTileFilters`
|
.. seealso:: :py:func:`fileVectorTileFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileTiledMeshFilters`
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QString fileMeshFilters() const;
|
QString fileMeshFilters() const;
|
||||||
@ -658,6 +662,8 @@ supported by all data providers.
|
|||||||
|
|
||||||
.. seealso:: :py:func:`fileVectorTileFilters`
|
.. seealso:: :py:func:`fileVectorTileFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileTiledMeshFilters`
|
||||||
|
|
||||||
.. versionadded:: 3.6
|
.. versionadded:: 3.6
|
||||||
%End
|
%End
|
||||||
|
|
||||||
@ -688,6 +694,8 @@ supported by all data providers.
|
|||||||
|
|
||||||
.. seealso:: :py:func:`fileVectorTileFilters`
|
.. seealso:: :py:func:`fileVectorTileFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileTiledMeshFilters`
|
||||||
|
|
||||||
.. versionadded:: 3.18
|
.. versionadded:: 3.18
|
||||||
%End
|
%End
|
||||||
|
|
||||||
@ -706,7 +714,29 @@ supported by all data providers.
|
|||||||
|
|
||||||
.. seealso:: :py:func:`filePointCloudFilters`
|
.. seealso:: :py:func:`filePointCloudFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileTiledMeshFilters`
|
||||||
|
|
||||||
.. versionadded:: 3.32
|
.. versionadded:: 3.32
|
||||||
|
%End
|
||||||
|
|
||||||
|
QString fileTiledMeshFilters() const;
|
||||||
|
%Docstring
|
||||||
|
Returns a file filter string for supported tiled mesh files.
|
||||||
|
|
||||||
|
Returns a string suitable for a QFileDialog of tiled mesh file formats
|
||||||
|
supported by all data providers.
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileMeshFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileRasterFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileVectorFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`filePointCloudFilters`
|
||||||
|
|
||||||
|
.. seealso:: :py:func:`fileVectorTileFilters`
|
||||||
|
|
||||||
|
.. versionadded:: 3.34
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QString databaseDrivers() const;
|
QString databaseDrivers() const;
|
||||||
|
@ -576,6 +576,7 @@ The development version
|
|||||||
MeshDataset,
|
MeshDataset,
|
||||||
PointCloud,
|
PointCloud,
|
||||||
VectorTile,
|
VectorTile,
|
||||||
|
TiledMesh,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class SublayerQueryFlag
|
enum class SublayerQueryFlag
|
||||||
|
@ -211,6 +211,7 @@ QString QgsCopcProviderMetadata::filters( Qgis::FileFilterType type )
|
|||||||
case Qgis::FileFilterType::Mesh:
|
case Qgis::FileFilterType::Mesh:
|
||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
|
@ -218,6 +218,7 @@ QString QgsEptProviderMetadata::filters( Qgis::FileFilterType type )
|
|||||||
case Qgis::FileFilterType::Mesh:
|
case Qgis::FileFilterType::Mesh:
|
||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
|
@ -4001,6 +4001,7 @@ QString QgsGdalProviderMetadata::filters( Qgis::FileFilterType type )
|
|||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
|
@ -1152,6 +1152,7 @@ QString QgsOgrProviderMetadata::filters( Qgis::FileFilterType type )
|
|||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
|
@ -360,6 +360,9 @@ void QgsProviderRegistry::init()
|
|||||||
QStringList vectorTileWildcards;
|
QStringList vectorTileWildcards;
|
||||||
QStringList vectorTileFilters;
|
QStringList vectorTileFilters;
|
||||||
|
|
||||||
|
QStringList tiledMeshWildcards;
|
||||||
|
QStringList tiledMeshFilters;
|
||||||
|
|
||||||
// now initialize all providers
|
// now initialize all providers
|
||||||
for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
|
for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
|
||||||
{
|
{
|
||||||
@ -438,6 +441,24 @@ void QgsProviderRegistry::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// now get tiled mesh file filters, if any
|
||||||
|
const QString fileTiledMeshFilters = meta->filters( Qgis::FileFilterType::TiledMesh );
|
||||||
|
if ( !fileTiledMeshFilters.isEmpty() )
|
||||||
|
{
|
||||||
|
QgsDebugMsgLevel( "tiled mesh filters: " + fileTiledMeshFilters, 2 );
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
const QStringList filters = fileTiledMeshFilters.split( QStringLiteral( ";;" ), QString::SkipEmptyParts );
|
||||||
|
#else
|
||||||
|
const QStringList filters = fileTiledMeshFilters.split( QStringLiteral( ";;" ), Qt::SkipEmptyParts );
|
||||||
|
#endif
|
||||||
|
for ( const QString &filter : filters )
|
||||||
|
{
|
||||||
|
tiledMeshFilters.append( filter );
|
||||||
|
tiledMeshWildcards.append( QgsFileUtils::wildcardsFromFilter( filter ).split( ' ' ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// call initProvider() - allows provider to register its services to QGIS
|
// call initProvider() - allows provider to register its services to QGIS
|
||||||
meta->initProvider();
|
meta->initProvider();
|
||||||
}
|
}
|
||||||
@ -456,6 +477,13 @@ void QgsProviderRegistry::init()
|
|||||||
mVectorTileFileFilters = vectorTileFilters.join( QLatin1String( ";;" ) );
|
mVectorTileFileFilters = vectorTileFilters.join( QLatin1String( ";;" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !tiledMeshFilters.empty() )
|
||||||
|
{
|
||||||
|
tiledMeshFilters.insert( 0, QObject::tr( "All Supported Files" ) + QStringLiteral( " (%1)" ).arg( tiledMeshWildcards.join( ' ' ) ) );
|
||||||
|
tiledMeshFilters.insert( 1, QObject::tr( "All Files" ) + QStringLiteral( " (*.*)" ) );
|
||||||
|
mTiledMeshFileFilters = tiledMeshFilters.join( QLatin1String( ";;" ) );
|
||||||
|
}
|
||||||
|
|
||||||
// load database drivers (only OGR)
|
// load database drivers (only OGR)
|
||||||
mDatabaseDrivers = QgsOgrProviderUtils::databaseDrivers();
|
mDatabaseDrivers = QgsOgrProviderUtils::databaseDrivers();
|
||||||
|
|
||||||
@ -927,6 +955,11 @@ QString QgsProviderRegistry::fileVectorTileFilters() const
|
|||||||
return mVectorTileFileFilters;
|
return mVectorTileFileFilters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QgsProviderRegistry::fileTiledMeshFilters() const
|
||||||
|
{
|
||||||
|
return mTiledMeshFileFilters;
|
||||||
|
}
|
||||||
|
|
||||||
QString QgsProviderRegistry::databaseDrivers() const
|
QString QgsProviderRegistry::databaseDrivers() const
|
||||||
{
|
{
|
||||||
return mDatabaseDrivers;
|
return mDatabaseDrivers;
|
||||||
|
@ -630,6 +630,7 @@ class CORE_EXPORT QgsProviderRegistry
|
|||||||
* \see fileMeshFilters()
|
* \see fileMeshFilters()
|
||||||
* \see filePointCloudFilters()
|
* \see filePointCloudFilters()
|
||||||
* \see fileVectorTileFilters()
|
* \see fileVectorTileFilters()
|
||||||
|
* \see fileTiledMeshFilters()
|
||||||
*/
|
*/
|
||||||
QString fileVectorFilters() const;
|
QString fileVectorFilters() const;
|
||||||
|
|
||||||
@ -645,6 +646,7 @@ class CORE_EXPORT QgsProviderRegistry
|
|||||||
* \see fileMeshFilters()
|
* \see fileMeshFilters()
|
||||||
* \see filePointCloudFilters()
|
* \see filePointCloudFilters()
|
||||||
* \see fileVectorTileFilters()
|
* \see fileVectorTileFilters()
|
||||||
|
* \see fileTiledMeshFilters()
|
||||||
*/
|
*/
|
||||||
QString fileRasterFilters() const;
|
QString fileRasterFilters() const;
|
||||||
|
|
||||||
@ -659,6 +661,7 @@ class CORE_EXPORT QgsProviderRegistry
|
|||||||
* \see fileVectorFilters()
|
* \see fileVectorFilters()
|
||||||
* \see filePointCloudFilters()
|
* \see filePointCloudFilters()
|
||||||
* \see fileVectorTileFilters()
|
* \see fileVectorTileFilters()
|
||||||
|
* \see fileTiledMeshFilters()
|
||||||
*
|
*
|
||||||
* \since QGIS 3.6
|
* \since QGIS 3.6
|
||||||
*/
|
*/
|
||||||
@ -686,6 +689,7 @@ class CORE_EXPORT QgsProviderRegistry
|
|||||||
* \see fileRasterFilters()
|
* \see fileRasterFilters()
|
||||||
* \see fileVectorFilters()
|
* \see fileVectorFilters()
|
||||||
* \see fileVectorTileFilters()
|
* \see fileVectorTileFilters()
|
||||||
|
* \see fileTiledMeshFilters()
|
||||||
*
|
*
|
||||||
* \since QGIS 3.18
|
* \since QGIS 3.18
|
||||||
*/
|
*/
|
||||||
@ -701,11 +705,28 @@ class CORE_EXPORT QgsProviderRegistry
|
|||||||
* \see fileRasterFilters()
|
* \see fileRasterFilters()
|
||||||
* \see fileVectorFilters()
|
* \see fileVectorFilters()
|
||||||
* \see filePointCloudFilters()
|
* \see filePointCloudFilters()
|
||||||
|
* \see fileTiledMeshFilters()
|
||||||
*
|
*
|
||||||
* \since QGIS 3.32
|
* \since QGIS 3.32
|
||||||
*/
|
*/
|
||||||
QString fileVectorTileFilters() const;
|
QString fileVectorTileFilters() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a file filter string for supported tiled mesh files.
|
||||||
|
*
|
||||||
|
* Returns a string suitable for a QFileDialog of tiled mesh file formats
|
||||||
|
* supported by all data providers.
|
||||||
|
*
|
||||||
|
* \see fileMeshFilters()
|
||||||
|
* \see fileRasterFilters()
|
||||||
|
* \see fileVectorFilters()
|
||||||
|
* \see filePointCloudFilters()
|
||||||
|
* \see fileVectorTileFilters()
|
||||||
|
*
|
||||||
|
* \since QGIS 3.34
|
||||||
|
*/
|
||||||
|
QString fileTiledMeshFilters() const;
|
||||||
|
|
||||||
//! Returns a string containing the available database drivers
|
//! Returns a string containing the available database drivers
|
||||||
QString databaseDrivers() const;
|
QString databaseDrivers() const;
|
||||||
//! Returns a string containing the available directory drivers
|
//! Returns a string containing the available directory drivers
|
||||||
@ -782,6 +803,11 @@ class CORE_EXPORT QgsProviderRegistry
|
|||||||
*/
|
*/
|
||||||
QString mVectorTileFileFilters;
|
QString mVectorTileFileFilters;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File filter string for tiled mesh files
|
||||||
|
*/
|
||||||
|
QString mTiledMeshFileFilters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Available database drivers string for vector databases
|
* Available database drivers string for vector databases
|
||||||
*
|
*
|
||||||
|
@ -576,6 +576,7 @@ QString QgsVirtualPointCloudProviderMetadata::filters( Qgis::FileFilterType type
|
|||||||
case Qgis::FileFilterType::Mesh:
|
case Qgis::FileFilterType::Mesh:
|
||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
|
@ -945,6 +945,7 @@ class CORE_EXPORT Qgis
|
|||||||
MeshDataset SIP_MONKEYPATCH_COMPAT_NAME( FilterMeshDataset ), //!< Mesh datasets
|
MeshDataset SIP_MONKEYPATCH_COMPAT_NAME( FilterMeshDataset ), //!< Mesh datasets
|
||||||
PointCloud SIP_MONKEYPATCH_COMPAT_NAME( FilterPointCloud ), //!< Point clouds (since QGIS 3.18)
|
PointCloud SIP_MONKEYPATCH_COMPAT_NAME( FilterPointCloud ), //!< Point clouds (since QGIS 3.18)
|
||||||
VectorTile, //!< Vector tile layers (since QGIS 3.32)
|
VectorTile, //!< Vector tile layers (since QGIS 3.32)
|
||||||
|
TiledMesh, //!< Tiled mesh layers (since QGIS 3.34)
|
||||||
};
|
};
|
||||||
Q_ENUM( FileFilterType )
|
Q_ENUM( FileFilterType )
|
||||||
|
|
||||||
|
@ -254,6 +254,7 @@ QString QgsMbTilesVectorTileDataProviderMetadata::filters( Qgis::FileFilterType
|
|||||||
case Qgis::FileFilterType::Mesh:
|
case Qgis::FileFilterType::Mesh:
|
||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
@ -324,6 +324,7 @@ QString QgsVtpkVectorTileDataProviderMetadata::filters( Qgis::FileFilterType typ
|
|||||||
case Qgis::FileFilterType::Mesh:
|
case Qgis::FileFilterType::Mesh:
|
||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
@ -1269,6 +1269,7 @@ QString QgsMdalProviderMetadata::filters( Qgis::FileFilterType type )
|
|||||||
case Qgis::FileFilterType::Vector:
|
case Qgis::FileFilterType::Vector:
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
|
@ -435,6 +435,7 @@ QString QgsPdalProviderMetadata::filters( Qgis::FileFilterType type )
|
|||||||
case Qgis::FileFilterType::Mesh:
|
case Qgis::FileFilterType::Mesh:
|
||||||
case Qgis::FileFilterType::MeshDataset:
|
case Qgis::FileFilterType::MeshDataset:
|
||||||
case Qgis::FileFilterType::VectorTile:
|
case Qgis::FileFilterType::VectorTile:
|
||||||
|
case Qgis::FileFilterType::TiledMesh:
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
case Qgis::FileFilterType::PointCloud:
|
case Qgis::FileFilterType::PointCloud:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user