Skip to content
Permalink
Browse files

Add Point Clouds to QgsProviderMetadata::FilterType

  • Loading branch information
nyalldawson committed Nov 4, 2020
1 parent 31bc1e8 commit f7b0a2d090d098026591d662449eb004055bd98c
@@ -3,9 +3,10 @@
QgsMeshDriverMetadata.MeshDriverCapabilities.baseClass = QgsMeshDriverMetadata
MeshDriverCapabilities = QgsMeshDriverMetadata # dirty hack since SIP seems to introduce the flags in module
# monkey patching scoped based enum
QgsProviderMetadata.FilterType.FilterVector.__doc__ = ""
QgsProviderMetadata.FilterType.FilterRaster.__doc__ = ""
QgsProviderMetadata.FilterType.FilterMesh.__doc__ = ""
QgsProviderMetadata.FilterType.FilterMeshDataset.__doc__ = ""
QgsProviderMetadata.FilterType.__doc__ = 'Type of file filters\n\n.. versionadded:: 3.10\n\n' + '* ``FilterVector``: ' + QgsProviderMetadata.FilterType.FilterVector.__doc__ + '\n' + '* ``FilterRaster``: ' + QgsProviderMetadata.FilterType.FilterRaster.__doc__ + '\n' + '* ``FilterMesh``: ' + QgsProviderMetadata.FilterType.FilterMesh.__doc__ + '\n' + '* ``FilterMeshDataset``: ' + QgsProviderMetadata.FilterType.FilterMeshDataset.__doc__
QgsProviderMetadata.FilterType.FilterVector.__doc__ = "Vector layers"
QgsProviderMetadata.FilterType.FilterRaster.__doc__ = "Raster layers"
QgsProviderMetadata.FilterType.FilterMesh.__doc__ = "Mesh layers"
QgsProviderMetadata.FilterType.FilterMeshDataset.__doc__ = "Mesh datasets"
QgsProviderMetadata.FilterType.FilterPointCloud.__doc__ = "Point clouds"
QgsProviderMetadata.FilterType.__doc__ = 'Type of file filters\n\n.. versionadded:: 3.10\n\n' + '* ``FilterVector``: ' + QgsProviderMetadata.FilterType.FilterVector.__doc__ + '\n' + '* ``FilterRaster``: ' + QgsProviderMetadata.FilterType.FilterRaster.__doc__ + '\n' + '* ``FilterMesh``: ' + QgsProviderMetadata.FilterType.FilterMesh.__doc__ + '\n' + '* ``FilterMeshDataset``: ' + QgsProviderMetadata.FilterType.FilterMeshDataset.__doc__ + '\n' + '* ``FilterPointCloud``: ' + QgsProviderMetadata.FilterType.FilterPointCloud.__doc__
# --
@@ -163,7 +163,8 @@ Cleanup the provider
FilterVector,
FilterRaster,
FilterMesh,
FilterMeshDataset
FilterMeshDataset,
FilterPointCloud,
};

virtual QString filters( FilterType type );
@@ -3341,9 +3341,14 @@ QString QgsGdalProviderMetadata::filters( FilterType type )
buildSupportedRasterFileFilterAndExtensions( fileFiltersString, exts, wildcards );
return fileFiltersString;
}
default:

case QgsProviderMetadata::FilterType::FilterVector:
case QgsProviderMetadata::FilterType::FilterMesh:
case QgsProviderMetadata::FilterType::FilterMeshDataset:
case QgsProviderMetadata::FilterType::FilterPointCloud:
return QString();
}
return QString();
}

QString QgsGdalProvider::validateCreationOptions( const QStringList &createOptions, const QString &format )
@@ -7157,9 +7157,14 @@ QString QgsOgrProviderMetadata::filters( FilterType type )
{
case QgsProviderMetadata::FilterType::FilterVector:
return QgsOgrProviderUtils::fileVectorFilters();
default:

case QgsProviderMetadata::FilterType::FilterRaster:
case QgsProviderMetadata::FilterType::FilterMesh:
case QgsProviderMetadata::FilterType::FilterMeshDataset:
case QgsProviderMetadata::FilterType::FilterPointCloud:
return QString();
}
return QString();
}


@@ -215,10 +215,11 @@ class CORE_EXPORT QgsProviderMetadata : public QObject
*/
enum class FilterType
{
FilterVector = 1,
FilterRaster,
FilterMesh,
FilterMeshDataset
FilterVector = 1, //!< Vector layers
FilterRaster, //!< Raster layers
FilterMesh, //!< Mesh layers
FilterMeshDataset, //!< Mesh datasets
FilterPointCloud, //!< Point clouds
};

/**
@@ -999,9 +999,13 @@ QString QgsMdalProviderMetadata::filters( FilterType type )
QgsMdalProvider::fileMeshFilters( fileMeshFiltersString, fileMeshDatasetFiltersString );
return fileMeshDatasetFiltersString;
}
default:

case QgsProviderMetadata::FilterType::FilterRaster:
case QgsProviderMetadata::FilterType::FilterVector:
case QgsProviderMetadata::FilterType::FilterPointCloud:
return QString();
}
return QString();
}

QList<QgsMeshDriverMetadata> QgsMdalProviderMetadata::meshDriversMetadata()

0 comments on commit f7b0a2d

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