Skip to content
Permalink
Browse files

[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
  • Loading branch information
nyalldawson committed May 28, 2020
1 parent 0496ce5 commit 1f835dfa9af51204ea1182df7bf722d84b223645
Showing with 184 additions and 4 deletions.
  1. +1 −0 python/3d/3d_auto.sip
  2. +58 −0 python/3d/auto_generated/processing/qgs3dalgorithms.sip.in
  3. +1 −0 python/CMakeLists.txt
  4. +1 −1 scripts/sip_include.sh
  5. +3 −0 src/3d/chunks/qgschunkboundsentity_p.h
  6. +2 −0 src/3d/chunks/qgschunkedentity_p.h
  7. +5 −0 src/3d/chunks/qgschunklist_p.h
  8. +5 −0 src/3d/chunks/qgschunkloader_p.h
  9. +2 −0 src/3d/chunks/qgschunknode_p.h
  10. +2 −0 src/3d/chunks/qgschunkqueuejob_p.h
  11. +2 −0 src/3d/mesh/qgsmesh3dentity_p.h
  12. +2 −0 src/3d/mesh/qgsmesh3dgeometry_p.h
  13. +2 −0 src/3d/mesh/qgsmesh3dmaterial_p.h
  14. +3 −0 src/3d/qgs3danimationsettings.h
  15. +2 −0 src/3d/qgs3dmapscene.h
  16. +2 −3 src/3d/qgs3dutils.h
  17. +3 −0 src/3d/qgsaabb.h
  18. +3 −0 src/3d/qgsabstract3dengine.h
  19. +3 −0 src/3d/qgscameracontroller.h
  20. +4 −0 src/3d/qgsfeature3dhandler_p.h
  21. +3 −0 src/3d/qgsmeshlayer3drenderer.h
  22. +3 −0 src/3d/qgsoffscreen3dengine.h
  23. +2 −0 src/3d/qgsraycastingutils_p.h
  24. +2 −0 src/3d/qgsrulebasedchunkloader_p.h
  25. +4 −0 src/3d/qgstessellatedpolygongeometry.h
  26. +3 −0 src/3d/qgstilingscheme.h
  27. +2 −0 src/3d/qgsvectorlayerchunkloader_p.h
  28. +4 −0 src/3d/qgswindow3dengine.h
  29. +3 −0 src/3d/symbols/qgsbillboardgeometry.h
  30. +1 −0 src/3d/symbols/qgsline3dsymbol_p.h
  31. +2 −0 src/3d/symbols/qgslinematerial_p.h
  32. +2 −0 src/3d/symbols/qgslinevertexdata_p.h
  33. +4 −0 src/3d/symbols/qgsmesh3dsymbol.h
  34. +2 −0 src/3d/symbols/qgsmesh3dsymbol_p.h
  35. +4 −0 src/3d/symbols/qgspoint3dbillboardmaterial.h
  36. +1 −0 src/3d/symbols/qgspoint3dsymbol_p.h
  37. +1 −0 src/3d/symbols/qgspolygon3dsymbol_p.h
  38. +5 −0 src/3d/terrain/qgsdemterraingenerator.h
  39. +2 −0 src/3d/terrain/qgsdemterraintilegeometry_p.h
  40. +2 −0 src/3d/terrain/qgsdemterraintileloader_p.h
  41. +2 −0 src/3d/terrain/qgsflatterraingenerator.h
  42. +5 −0 src/3d/terrain/qgsonlineterraingenerator.h
  43. +4 −0 src/3d/terrain/qgsterraindownloader.h
  44. +2 −0 src/3d/terrain/qgsterrainentity_p.h
  45. +5 −0 src/3d/terrain/qgsterraingenerator.h
  46. +2 −0 src/3d/terrain/qgsterraintexturegenerator_p.h
  47. +2 −0 src/3d/terrain/qgsterraintextureimage_p.h
  48. +4 −0 src/3d/terrain/qgsterraintileloader_p.h
@@ -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
@@ -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 *
************************************************************************/
@@ -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
@@ -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)

@@ -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
@@ -29,6 +29,8 @@

#include <Qt3DCore/QEntity>

#define SIP_NO_FILE

class QgsAABB;
class QgsChunkNode;
class QgsChunkList;
@@ -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
@@ -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
@@ -31,6 +31,8 @@

#include <QTime>

#define SIP_NO_FILE

namespace Qt3DCore
{
class QEntity;
@@ -34,6 +34,8 @@ namespace Qt3DCore
class QEntity;
}

#define SIP_NO_FILE

#include <QObject>

/**
@@ -36,6 +36,8 @@
// version without notice, or even be removed.
//

#define SIP_NO_FILE

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

#define SIP_NO_FILE

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

#define SIP_NO_FILE

class QgsMeshLayer;

/**
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
{
@@ -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
@@ -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
@@ -29,6 +29,8 @@

#include <QVector3D>

#define SIP_NO_FILE

class QgsAABB;

namespace Qt3DRender
@@ -32,6 +32,8 @@
#include "qgschunkedentity_p.h"
#include "qgsrulebased3drenderer.h"

#define SIP_NO_FILE

class Qgs3DMapSettings;
class QgsVectorLayer;
class QgsVectorLayerFeatureSource;
@@ -26,13 +26,17 @@ namespace Qt3DRender
class QBuffer;
}

#define SIP_NO_FILE

/**
* \ingroup 3d
* Class derived from Qt3DRender::QGeometry that represents polygons tessellated into 3D geometry.
*
* 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
@@ -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
@@ -31,6 +31,8 @@
#include "qgsfeature3dhandler_p.h"
#include "qgschunkedentity_p.h"

#define SIP_NO_FILE

class Qgs3DMapSettings;
class QgsVectorLayer;
class QgsVectorLayer3DTilingSettings;
@@ -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

0 comments on commit 1f835df

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