Skip to content

Commit

Permalink
Merge branch 'master' into 3d-view-dock-undock
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem committed Jan 14, 2022
2 parents f4c8d8a + e39f980 commit becd7ed
Show file tree
Hide file tree
Showing 65 changed files with 1,205 additions and 241 deletions.
1 change: 1 addition & 0 deletions external/mdal/frmts/mdal_cf.cpp
Expand Up @@ -527,6 +527,7 @@ void MDAL::DriverCF::setProjection( MDAL::Mesh *mesh )
}
else
{
wkt = MDAL::replace( wkt, "\n", "" );
mesh->setSourceCrsFromWKT( wkt );
}
}
Expand Down
2 changes: 1 addition & 1 deletion external/mdal/frmts/mdal_flo2d.cpp
Expand Up @@ -996,7 +996,7 @@ MDAL::DriverFlo2D::DriverFlo2D()
: Driver(
"FLO2D",
"Flo2D",
"*.nc;;*.DAT",
"*.nc;;*.DAT;;*.OUT",
Capability::ReadMesh | Capability::ReadDatasets | Capability::WriteDatasetsOnFaces )
{

Expand Down
19 changes: 16 additions & 3 deletions external/mdal/frmts/mdal_netcdf.cpp
Expand Up @@ -180,12 +180,14 @@ std::vector<double> NetCDFFile::readDoubleArr( int arr_id,
std::vector<double> arr_val( count_dim );

nc_type typep;
if ( nc_inq_vartype( mNcid, arr_id, &typep ) != NC_NOERR ) throw MDAL::Error( MDAL_Status::Err_UnknownFormat, "Could not read double array" );
if ( nc_inq_vartype( mNcid, arr_id, &typep ) != NC_NOERR )
throw MDAL::Error( MDAL_Status::Err_UnknownFormat, "Could not read double array" );

if ( typep == NC_FLOAT )
{
std::vector<float> arr_val_f( count_dim );
if ( nc_get_vars_float( mNcid, arr_id, startp.data(), countp.data(), stridep.data(), arr_val_f.data() ) != NC_NOERR ) throw MDAL::Error( MDAL_Status::Err_UnknownFormat, "Could not read double array" );
if ( nc_get_vars_float( mNcid, arr_id, startp.data(), countp.data(), stridep.data(), arr_val_f.data() ) != NC_NOERR )
throw MDAL::Error( MDAL_Status::Err_UnknownFormat, "Could not read double array" );
for ( size_t i = 0; i < count_dim; ++i )
{
const float val = arr_val_f[i];
Expand All @@ -195,9 +197,20 @@ std::vector<double> NetCDFFile::readDoubleArr( int arr_id,
arr_val[i] = static_cast<double>( val );
}
}
else if ( typep == NC_INT )
{
std::vector<int> arr_val_int( count_dim );
if ( nc_get_vars_int( mNcid, arr_id, startp.data(), countp.data(), stridep.data(), arr_val_int.data() ) != NC_NOERR )
throw MDAL::Error( MDAL_Status::Err_UnknownFormat, "Could not read double array" );
for ( size_t i = 0; i < count_dim; ++i )
{
arr_val[i] = static_cast<double>( arr_val_int[i] );
}
}
else if ( typep == NC_DOUBLE )
{
if ( nc_get_vars_double( mNcid, arr_id, startp.data(), countp.data(), stridep.data(), arr_val.data() ) != NC_NOERR ) throw MDAL::Error( MDAL_Status::Err_UnknownFormat, "Could not read double array" );
if ( nc_get_vars_double( mNcid, arr_id, startp.data(), countp.data(), stridep.data(), arr_val.data() ) != NC_NOERR )
throw MDAL::Error( MDAL_Status::Err_UnknownFormat, "Could not read double array" );
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion external/mdal/mdal.cpp
Expand Up @@ -21,7 +21,7 @@ static const char *EMPTY_STR = "";

const char *MDAL_Version()
{
return "0.9.1";
return "0.9.2";
}

MDAL_Status MDAL_LastStatus()
Expand Down
18 changes: 18 additions & 0 deletions python/3d/auto_generated/qgs3dmapsettings.sip.in
Expand Up @@ -601,6 +601,24 @@ Sets whether the 2D terrain surface will be rendered in.
.. seealso:: :py:func:`terrainRenderingEnabled`

.. versionadded:: 3.22
%End

Qgis::RendererUsage rendererUsage() const;
%Docstring
Returns the renderer usage

.. seealso:: :py:func:`rendererUsage`

.. versionadded:: 3.24
%End

void setRendererUsage( Qgis::RendererUsage rendererUsage );
%Docstring
Sets the renderer usage

.. seealso:: :py:func:`rendererUsage`

.. versionadded:: 3.24
%End

signals:
Expand Down
7 changes: 7 additions & 0 deletions python/core/auto_additions/qgis.py
Expand Up @@ -1194,6 +1194,13 @@
# --
Qgis.AngularDirection.baseClass = Qgis
# monkey patching scoped based enum
Qgis.RendererUsage.View.__doc__ = "Renderer used for displaying on screen"
Qgis.RendererUsage.Export.__doc__ = "Renderer used for printing or exporting to a file"
Qgis.RendererUsage.Unknown.__doc__ = "Renderer used for unknown usage"
Qgis.RendererUsage.__doc__ = 'Usage of the renderer.\n\n.. versionadded:: 3.24\n\n' + '* ``View``: ' + Qgis.RendererUsage.View.__doc__ + '\n' + '* ``Export``: ' + Qgis.RendererUsage.Export.__doc__ + '\n' + '* ``Unknown``: ' + Qgis.RendererUsage.Unknown.__doc__
# --
Qgis.RendererUsage.baseClass = Qgis
# monkey patching scoped based enum
Qgis.HistoryProviderBackend.LocalProfile.__doc__ = "Local profile"
Qgis.HistoryProviderBackend.__doc__ = 'History provider backends.\n\n.. versionadded:: 3.24\n\n' + '* ``LocalProfile``: ' + Qgis.HistoryProviderBackend.LocalProfile.__doc__
# --
Expand Down
Expand Up @@ -995,6 +995,34 @@ definition. FormatWkt is recommended as it is a lossless format.
Since QGIS 3.18, internally this calls :py:func:`QgsCoordinateReferenceSystemRegistry.addUserCrs()`.
%End

void setNativeFormat( Qgis::CrsDefinitionFormat format );
%Docstring
Sets the native ``format`` for the CRS definition.

.. note::

This has no effect on the underlying definition of the CRS, rather it controls what format
to use when displaying the CRS's definition to users.

.. seealso:: :py:func:`nativeFormat`

.. versionadded:: 3.24
%End

Qgis::CrsDefinitionFormat nativeFormat() const;
%Docstring
Returns the native format for the CRS definition.

.. note::

This has no effect on the underlying definition of the CRS, rather it controls what format
to use when displaying the CRS's definition to users.

.. seealso:: :py:func:`setNativeFormat`

.. versionadded:: 3.24
%End

QgsCoordinateReferenceSystem toGeographicCrs() const;
%Docstring
Returns the geographic CRS associated with this CRS object.
Expand Down
10 changes: 1 addition & 9 deletions python/core/auto_generated/project/qgsmapviewsmanager.sip.in
Expand Up @@ -27,7 +27,7 @@ accessed through a :py:class:`QgsProject` via :py:func:`QgsProject.get3DViewsMan
%End
public:

explicit QgsMapViewsManager( QgsProject *project );
explicit QgsMapViewsManager( QgsProject *project /TransferThis/ );
%Docstring
Constructor for QgsMapViewsManager. The project will become the parent object for this
manager.
Expand Down Expand Up @@ -67,15 +67,7 @@ Removes the configuration of the 3D view named ``name``
Renames the 3D view named ``oldTitle`` to ``newTitle``
%End

void set3DViewInitiallyVisible( const QString &name, bool visible );
%Docstring
Sets whether the 3D view named ``name`` will be initially visible when the project is opened
%End

bool is3DViewOpen( const QString &name );
%Docstring
Returns whether the 3D view named ``name`` will is opened
%End

signals:
void views3DListChanged();
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/project/qgsproject.sip.in
Expand Up @@ -745,7 +745,7 @@ the project.
%End


QgsMapViewsManager *getViewsManager();
QgsMapViewsManager *viewsManager();
%Docstring
Returns the project's views manager, which manages map views (including 3d maps)
in the project.
Expand Down
7 changes: 7 additions & 0 deletions python/core/auto_generated/qgis.sip.in
Expand Up @@ -765,6 +765,13 @@ The development version
CounterClockwise,
};

enum class RendererUsage
{
View,
Export,
Unknown,
};

enum class HistoryProviderBackend
{
LocalProfile,
Expand Down
24 changes: 24 additions & 0 deletions python/core/auto_generated/qgsmapsettings.sip.in
Expand Up @@ -909,6 +909,29 @@ Sets the ``range`` of z-values which will be visible in the map.
.. seealso:: :py:func:`zRange`

.. versionadded:: 3.18
%End

Qgis::RendererUsage rendererUsage() const;
%Docstring
Returns the rendering usage

.. seealso:: :py:func:`setRendererUsage`

.. versionadded:: 3.24
%End

void setRendererUsage( Qgis::RendererUsage rendererUsage );
%Docstring
Sets the rendering usage

.. note::

This usage not alter how the map gets rendered but the intention is that data provider
knows the context of rendering and may report that to the backend.

.. seealso:: :py:func:`rendererUsage`

.. versionadded:: 3.24
%End

protected:
Expand All @@ -931,6 +954,7 @@ Sets the ``range`` of z-values which will be visible in the map.





void updateDerived();

Expand Down
23 changes: 23 additions & 0 deletions python/core/auto_generated/qgsrendercontext.sip.in
Expand Up @@ -1028,6 +1028,29 @@ during rendering.
.. seealso:: :py:func:`setImageFormat`

.. versionadded:: 3.22
%End

Qgis::RendererUsage rendererUsage() const;
%Docstring
Returns the renderer usage

.. seealso:: :py:func:`setRendererUsage`

.. versionadded:: 3.24
%End

void setRendererUsage( Qgis::RendererUsage usage );
%Docstring
Sets the renderer usage

.. note::

This usage not alter how the map gets rendered but the intention is that data provider
knows the context of rendering and may report that to the backend.

.. seealso:: :py:func:`rendererUsage`

.. versionadded:: 3.24
%End

};
Expand Down
18 changes: 18 additions & 0 deletions python/core/auto_generated/raster/qgsrasterinterface.sip.in
Expand Up @@ -80,6 +80,24 @@ Returns a list of any errors encountered while retrieving the raster block.
.. seealso:: :py:func:`appendError`

.. versionadded:: 3.8.0
%End

QgsRenderContext renderContext() const;
%Docstring
Returns the render context of the associated block reading

.. seealso:: :py:func:`setRenderContext`

.. versionadded:: 3.24.0
%End

void setRenderContext( const QgsRenderContext &renderContext );
%Docstring
Sets the render context of the associated block reading

.. seealso:: :py:func:`renderContext`

.. versionadded:: 3.24.0
%End

};
Expand Down
9 changes: 8 additions & 1 deletion python/gui/auto_generated/qgscrsdefinitionwidget.sip.in
Expand Up @@ -36,7 +36,14 @@ An invalid CRS may be returned if no CRS is defined in the widget.
.. seealso:: :py:func:`setCrs`
%End

void setCrs( const QgsCoordinateReferenceSystem &crs, Qgis::CrsDefinitionFormat nativeFormat = Qgis::CrsDefinitionFormat::Wkt );
void setCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
Sets the current ``crs`` to display in the widget.

.. seealso:: :py:func:`crs`
%End

void setCrs( const QgsCoordinateReferenceSystem &crs, Qgis::CrsDefinitionFormat nativeFormat );
%Docstring
Sets the current ``crs`` to display in the widget.

Expand Down
9 changes: 9 additions & 0 deletions python/gui/auto_generated/qgsoptionswidgetfactory.sip.in
Expand Up @@ -39,7 +39,16 @@ help will be retrieved.
%End


virtual bool isValid();
%Docstring
Validates the current state of the widget.

Subclasses should return ``True`` if the widget state is currently valid and acceptable to :py:func:`~QgsOptionsPageWidget.apply`.

The default implementation returns ``True``.

.. versionadded:: 3.24
%End

public slots:

Expand Down
6 changes: 6 additions & 0 deletions python/server/auto_generated/qgsserverrequest.sip.in
Expand Up @@ -57,6 +57,12 @@ class QgsServerRequest
X_QGIS_WCS_SERVICE_URL,
// The QGIS WMTS service URL
X_QGIS_WMTS_SERVICE_URL,
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
ACCEPT,
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
USER_AGENT,
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization
AUTHORIZATION,
};

QgsServerRequest();
Expand Down
18 changes: 18 additions & 0 deletions resources/function_help/json/overlay_intersects
Expand Up @@ -38,6 +38,16 @@
"arg": "min_inscribed_circle_radius",
"description": "defines an optional exclusion filter (for polygons only): minimum radius in current feature units for the maximum inscribed circle of the intersection (if the intersection results in multiple polygons the intersection will be returned if at least one of the polygons has a radius for the maximum inscribed circle greater or equal to the value).<br>Read more on the underlying GEOS predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_MaximumInscribedCircle.html'>ST_MaximumInscribedCircle</a> function.<br>This argument requires GEOS >= 3.9.",
"optional": true
},
{
"arg": "return_details",
"description": "Set this to true to return a list of maps containing (key names in quotes) the feature 'id', the expression 'result' and the 'overlap' value. The 'radius' of the maximum inscribed circle is also returned when the target layer is a polygon. Only valid when used with the expression parameter",
"optional": true
},
{
"arg": "sort_by_intersection_size",
"description": "only valid when used with an expression, set this to 'des' to return the results ordered by the overlap value in descending order or set this to 'asc' for ascending order.",
"optional": true
}
],
"examples": [
Expand Down Expand Up @@ -72,6 +82,14 @@
{
"expression": "overlay_intersects(layer:='regions', min_inscribed_circle_radius:=0.54)",
"returns": "true if the current feature spatially intersects a region and the intersection area maximum inscribed circle's radius (of at least one of the parts in case of multipart) is greater or equal to the 0.54"
},
{
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt($geometry), return_details:=true)",
"returns": "an array of maps containing 'id', 'result', 'overlap' and 'radius'"
},
{
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt($geometry), sort_by_intersection_size:='des')",
"returns": "an array of geometries (in WKT) ordered by the overlap value in descending order"
}
]
}
12 changes: 11 additions & 1 deletion src/3d/qgs3dmapsettings.cpp
Expand Up @@ -88,6 +88,7 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
, mDebugDepthMapCorner( other.mDebugDepthMapCorner )
, mDebugDepthMapSize( other.mDebugDepthMapSize )
, mTerrainRenderingEnabled( other.mTerrainRenderingEnabled )
, mRendererUsage( other.mRendererUsage )
{
for ( QgsAbstract3DRenderer *renderer : std::as_const( other.mRenderers ) )
{
Expand Down Expand Up @@ -812,6 +813,16 @@ void Qgs3DMapSettings::setTerrainRenderingEnabled( bool terrainRenderingEnabled
emit terrainGeneratorChanged();
}

Qgis::RendererUsage Qgs3DMapSettings::rendererUsage() const
{
return mRendererUsage;
}

void Qgs3DMapSettings::setRendererUsage( Qgis::RendererUsage rendererUsage )
{
mRendererUsage = rendererUsage;
}

void Qgs3DMapSettings::connectChangedSignalsToSettingsChanged()
{
connect( this, &Qgs3DMapSettings::selectionColorChanged, this, &Qgs3DMapSettings::settingsChanged );
Expand Down Expand Up @@ -845,4 +856,3 @@ void Qgs3DMapSettings::connectChangedSignalsToSettingsChanged()
connect( this, &Qgs3DMapSettings::shadowSettingsChanged, this, &Qgs3DMapSettings::settingsChanged );
connect( this, &Qgs3DMapSettings::fpsCounterEnabledChanged, this, &Qgs3DMapSettings::settingsChanged );
}

0 comments on commit becd7ed

Please sign in to comment.