[3d] Expose 3d algorithms provider to Python

Otherwise this provider cannot be initialized from standalone Python
scripts

Fixes #36661

Also cleanup 3d sip generation by correctly defining SIP_NO_FILE
in headers we don't want to expose, so that the sip_include script
can do its magic
This commit is contained in:
Nyall Dawson 2020-05-28 09:15:39 +10:00
parent 0496ce52fc
commit 1f835dfa9a
48 changed files with 184 additions and 4 deletions

View File

@ -1,4 +1,5 @@
// Include auto-generated SIP files
%Include auto_generated/processing/qgs3dalgorithms.sip
%Include auto_generated/qgs3dmapsettings.sip
%Include auto_generated/qgs3dtypes.sip
%Include auto_generated/qgsabstractvectorlayer3drenderer.sip

View File

@ -0,0 +1,58 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/processing/qgs3dalgorithms.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class Qgs3DAlgorithms: QgsProcessingProvider
{
%Docstring
QGIS 3D processing algorithm provider.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgs3dalgorithms.h"
%End
public:
Qgs3DAlgorithms( QObject *parent = 0 );
%Docstring
Constructor for Qgs3DAlgorithms.
%End
virtual QIcon icon() const;
virtual QString svgIconPath() const;
virtual QString id() const;
virtual QString helpId() const;
virtual QString name() const;
virtual bool supportsNonFileBasedOutput() const;
protected:
virtual void loadAlgorithms();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/processing/qgs3dalgorithms.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -247,6 +247,7 @@ IF (WITH_3D)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/3d
${CMAKE_SOURCE_DIR}/src/3d/chunks
${CMAKE_SOURCE_DIR}/src/3d/processing
${CMAKE_SOURCE_DIR}/src/3d/symbols
${CMAKE_SOURCE_DIR}/src/3d/terrain
${CMAKE_BINARY_DIR}/src/3d

View File

@ -34,7 +34,7 @@ fi
if [[ -n $1 ]]; then
modules=("$1")
else
modules=(core gui analysis server)
modules=(core gui analysis server 3d)
fi
sources=(HDRS MOC_HDRS SRCS)

View File

@ -36,10 +36,13 @@
class QgsAABB;
class AABBMesh;
#define SIP_NO_FILE
/**
* \ingroup 3d
* Draws bounds of axis aligned bounding boxes
* \note Not available in Python bindings
* \since QGIS 3.0
*/
class QgsChunkBoundsEntity : public Qt3DCore::QEntity

View File

@ -29,6 +29,8 @@
#include <Qt3DCore/QEntity>
#define SIP_NO_FILE
class QgsAABB;
class QgsChunkNode;
class QgsChunkList;

View File

@ -27,11 +27,16 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
class QgsChunkNode;
/**
* \ingroup 3d
* Element of a double-linked list
*
* \note Not available in Python bindings
*
* \since QGIS 3.0
*/
struct QgsChunkListEntry

View File

@ -29,9 +29,14 @@
#include "qgschunkqueuejob_p.h"
#define SIP_NO_FILE
/**
* \ingroup 3d
* Base class for jobs that load chunks
*
* \note Not available in Python bindings
*
* \since QGIS 3.0
*/
class QgsChunkLoader : public QgsChunkQueueJob

View File

@ -31,6 +31,8 @@
#include <QTime>
#define SIP_NO_FILE
namespace Qt3DCore
{
class QEntity;

View File

@ -34,6 +34,8 @@ namespace Qt3DCore
class QEntity;
}
#define SIP_NO_FILE
#include <QObject>
/**

View File

@ -36,6 +36,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
class Qgs3DMapSettings;
class QgsTessellatedPolygonGeometry;
class QgsMesh3DSymbol;

View File

@ -40,6 +40,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
namespace Qt3DRender
{
class QAttribute;

View File

@ -38,6 +38,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
class QgsMeshLayer;
/**

View File

@ -26,10 +26,13 @@ class QDomDocument;
class QDomElement;
class QgsReadWriteContext;
#define SIP_NO_FILE
/**
* \ingroup 3d
* Class that holds information about animation in 3D view. The animation is defined
* as a series of keyframes
* \note Not available in Python bindings
* \since QGIS 3.8
*/
class _3D_EXPORT Qgs3DAnimationSettings

View File

@ -49,10 +49,12 @@ class Qgs3DMapSettings;
class QgsTerrainEntity;
class QgsChunkedEntity;
#define SIP_NO_FILE
/**
* \ingroup 3d
* Entity that encapsulates our 3D scene - contains all other entities (such as terrain) as children.
* \note Not available in Python bindings
* \since QGIS 3.0
*/
class _3D_EXPORT Qgs3DMapScene : public Qt3DCore::QEntity

View File

@ -38,11 +38,12 @@ namespace Qt3DExtras
#include <memory>
#ifndef SIP_RUN
#define SIP_NO_FILE
/**
* \ingroup 3d
* Miscellaneous utility functions used from 3D code.
* \note Not available in Python bindings
* \since QGIS 3.0
*/
class _3D_EXPORT Qgs3DUtils
@ -178,6 +179,4 @@ class _3D_EXPORT Qgs3DUtils
static Qt3DExtras::QPhongMaterial *phongMaterial( const QgsPhongMaterialSettings &settings );
};
#endif
#endif // QGS3DUTILS_H

View File

@ -22,9 +22,12 @@
#include <QList>
#include <QVector3D>
#define SIP_NO_FILE
/**
* \ingroup 3d
* Axis-aligned bounding box - in world coords.
* \note Not available in Python bindings
* \since QGIS 3.0
*/
class _3D_EXPORT QgsAABB

View File

@ -20,6 +20,8 @@
#include <QObject>
#define SIP_NO_FILE
class QColor;
class QRect;
class QSurface;
@ -46,6 +48,7 @@ namespace Qt3DRender
* - QgsWindow3DEngine - used for rendering on display (has a QWindow that can be embedded into QWidget)
* - QgsOffscreen3DEngine - renders scene to images
*
* \note Not available in Python bindings
* \since QGIS 3.4
*/
class _3D_EXPORT QgsAbstract3DEngine : public QObject

View File

@ -48,9 +48,12 @@ class QgsCameraPose;
class QgsTerrainEntity;
class QgsVector3D;
#define SIP_NO_FILE
/**
* \ingroup 3d
* Object that controls camera movement based on user input
* \note Not available in Python bindings
* \since QGIS 3.0
*/
class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity

View File

@ -36,10 +36,14 @@ class QgsFeature;
class Qgs3DMapSettings;
#define SIP_NO_FILE
/**
* \ingroup 3d
* Rendering context for preparation of 3D entities.
*
* \note Not available in Python bindings
*/
class Qgs3DRenderContext
{

View File

@ -27,6 +27,8 @@
#include <QObject>
#define SIP_NO_FILE
class QgsMeshLayer;
@ -36,6 +38,7 @@ class QgsMeshLayer;
*
* \warning This is not considered stable API, and may change in future QGIS releases
*
* \note Not available in Python bindings
* \since QGIS 3.6
*/
class _3D_EXPORT QgsMeshLayer3DRendererMetadata : public Qgs3DRendererAbstractMetadata

View File

@ -48,6 +48,7 @@ namespace Qt3DLogic
class QLogicAspect;
}
#define SIP_NO_FILE
/**
* \ingroup 3d
@ -56,6 +57,8 @@ namespace Qt3DLogic
* \note While the on-screen 3D engine also allows capturing of images, its limitation is that
* the captured images are of the size of the on-screen window.
*
* \note Not available in Python bindings
*
* \since QGIS 3.4
*/
class _3D_EXPORT QgsOffscreen3DEngine : public QgsAbstract3DEngine

View File

@ -29,6 +29,8 @@
#include <QVector3D>
#define SIP_NO_FILE
class QgsAABB;
namespace Qt3DRender

View File

@ -32,6 +32,8 @@
#include "qgschunkedentity_p.h"
#include "qgsrulebased3drenderer.h"
#define SIP_NO_FILE
class Qgs3DMapSettings;
class QgsVectorLayer;
class QgsVectorLayerFeatureSource;

View File

@ -26,6 +26,8 @@ namespace Qt3DRender
class QBuffer;
}
#define SIP_NO_FILE
/**
* \ingroup 3d
* Class derived from Qt3DRender::QGeometry that represents polygons tessellated into 3D geometry.
@ -33,6 +35,8 @@ namespace Qt3DRender
* Takes a list of polygons as input, internally it does tessellation and writes output to the internal
* vertex buffer. Optionally it can add "walls" if the extrusion height is non-zero.
*
* \note Not available in Python bindings
*
* \since QGIS 3.0
*/
class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry

View File

@ -23,10 +23,13 @@
class QgsRectangle;
#define SIP_NO_FILE
/**
* \ingroup 3d
* The class encapsulates tiling scheme (just like with WMTS / TMS / XYZ layers).
* The origin (tile [0,0]) is in bottom-left corner.
* \note Not available in Python bindings
* \since QGIS 3.0
*/
class _3D_EXPORT QgsTilingScheme

View File

@ -31,6 +31,8 @@
#include "qgsfeature3dhandler_p.h"
#include "qgschunkedentity_p.h"
#define SIP_NO_FILE
class Qgs3DMapSettings;
class QgsVectorLayer;
class QgsVectorLayer3DTilingSettings;

View File

@ -32,11 +32,15 @@ namespace Qt3DExtras
class QWindow;
#define SIP_NO_FILE
/**
* \ingroup 3d
* On-screen 3D engine: it creates OpenGL window (QWindow) and displays rendered 3D scene there.
* The window can be embedded into a QWidget-based application with QWidget::createWindowContainer().
*
* \note Not available in Python bindings
*
* \since QGIS 3.4
*/
class _3D_EXPORT QgsWindow3DEngine : public QgsAbstract3DEngine

View File

@ -21,11 +21,14 @@
#include <Qt3DRender/QBuffer>
#include <Qt3DRender/QAttribute>
#define SIP_NO_FILE
/**
* \ingroup 3d
* Geometry of the billboard rendering for points in 3D map view.
*
* \note Not available in Python bindings
*
* \since QGIS 3.10
*/
class QgsBillboardGeometry : public Qt3DRender::QGeometry

View File

@ -27,6 +27,7 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include "qgsfeature3dhandler_p.h"

View File

@ -29,6 +29,8 @@
#include <Qt3DRender/QMaterial>
#define SIP_NO_FILE
namespace Qt3DRender
{
class QCamera;

View File

@ -30,6 +30,8 @@
#include <QVector>
#include <QVector3D>
#define SIP_NO_FILE
#include "qgs3dtypes.h"
namespace Qt3DCore

View File

@ -26,6 +26,8 @@
#include <Qt3DRender/QCullFace>
#define SIP_NO_FILE
/**
* \ingroup 3d
* 3D symbol that draws mesh geometry as planar triangles.
@ -33,6 +35,8 @@
* \warning This is not considered stable API, and may change in future QGIS releases. It is
* exposed to the Python bindings as a tech preview only.
*
* \note Not available in Python bindings
*
* \since QGIS 3.6
*/
class _3D_EXPORT QgsMesh3DSymbol : public QgsAbstract3DSymbol

View File

@ -31,6 +31,8 @@
#include <Qt3DExtras/QPhongMaterial>
#include <Qt3DRender/QGeometryRenderer>
#define SIP_NO_FILE
class Qgs3DMapSettings;
class QgsTessellatedPolygonGeometry;
class QgsMesh3DSymbol;

View File

@ -23,10 +23,14 @@
#include "qgsmarkersymbollayer.h"
#include "qgs3dmapsettings.h"
#define SIP_NO_FILE
/**
* \ingroup 3d
* Material of the billboard rendering for points in 3D map view.
*
* \note Not available in Python bindings
*
* \since QGIS 3.10
*/
class QgsPoint3DBillboardMaterial : public Qt3DRender::QMaterial

View File

@ -27,6 +27,7 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include "qgsfeature3dhandler_p.h"

View File

@ -27,6 +27,7 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include "qgsfeature3dhandler_p.h"

View File

@ -28,9 +28,14 @@ class QgsDemHeightMapGenerator;
#include "qgsmaplayerref.h"
#define SIP_NO_FILE
/**
* \ingroup 3d
* Implementation of terrain generator that uses a raster layer with DEM to build terrain.
*
* \note Not available in Python bindings
*
* \since QGIS 3.0
*/
class _3D_EXPORT QgsDemTerrainGenerator : public QgsTerrainGenerator

View File

@ -27,6 +27,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include <Qt3DExtras/qt3dextras_global.h>
#include <Qt3DRender/qgeometry.h>
#include <QSize>

View File

@ -27,6 +27,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include <QtConcurrent/QtConcurrentRun>
#include <QFutureWatcher>
#include <QElapsedTimer>

View File

@ -23,6 +23,8 @@
#include "qgsrectangle.h"
#include <Qt3DExtras/QPlaneGeometry>
#define SIP_NO_FILE
///@cond PRIVATE
//! Chunk loader for flat terrain implementation

View File

@ -24,9 +24,14 @@
class QgsDemHeightMapGenerator;
#define SIP_NO_FILE
/**
* \ingroup 3d
* Implementation of terrain generator that uses online resources to download heightmaps.
*
* \note Not available in Python bindings
*
* \since QGIS 3.8
*/
class _3D_EXPORT QgsOnlineTerrainGenerator : public QgsTerrainGenerator

View File

@ -29,6 +29,8 @@ class QgsCoordinateReferenceSystem;
class QgsRasterLayer;
class QgsCoordinateTransformContext;
#define SIP_NO_FILE
/**
* \ingroup 3d
* Takes care of downloading terrain data from a publicly available data source.
@ -38,6 +40,8 @@ class QgsCoordinateTransformContext;
* - data sources: https://github.com/tilezen/joerd/blob/master/docs/data-sources.md
* - hosting: https://registry.opendata.aws/terrain-tiles/
*
* \note Not available in Python bindings
*
* \since QGIS 3.8
*/
class _3D_EXPORT QgsTerrainDownloader

View File

@ -27,6 +27,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include "qgschunkedentity_p.h"
#include "qgschunkqueuejob_p.h"

View File

@ -30,6 +30,8 @@ class QDomElement;
class QDomDocument;
class QgsProject;
#define SIP_NO_FILE
/**
* \ingroup 3d
@ -37,6 +39,9 @@ class QgsProject;
* to support hierarchical level of detail. Tiling scheme of a generator is defined
* by the generator itself. Terrain generators are asked to produce new terrain tiles
* whenever that is deemed necessary by the terrain controller (that caches generated tiles).
*
* \note Not available in Python bindings
*
* \since QGIS 3.0
*/
class _3D_EXPORT QgsTerrainGenerator : public QgsChunkLoaderFactory

View File

@ -27,6 +27,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
class QgsMapRendererSequentialJob;
class QgsMapSettings;
class QgsProject;

View File

@ -27,6 +27,8 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include <Qt3DRender/QAbstractTextureImage>
#include "qgsrectangle.h"

View File

@ -27,11 +27,15 @@
// version without notice, or even be removed.
//
#define SIP_NO_FILE
#include "qgschunkloader_p.h"
#include <QImage>
#include "qgsrectangle.h"
#define SIP_NO_FILE
class QgsPhongMaterialSettings;
class QgsTerrainEntity;
class QgsTerrainTileEntity;