Skip to content

Commit

Permalink
Fixes to SIP finally working
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk authored and nyalldawson committed Apr 18, 2020
1 parent cad7cf4 commit 5202461
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/3d/3d_auto.sip
Expand Up @@ -5,6 +5,7 @@
%Include auto_generated/qgscamerapose.sip
%Include auto_generated/qgslayoutitem3dmap.sip
%Include auto_generated/qgsphongmaterialsettings.sip
%Include auto_generated/qgspointlightsettings.sip
%Include auto_generated/qgsrulebased3drenderer.sip
%Include auto_generated/qgsvectorlayer3drenderer.sip
%Include auto_generated/symbols/qgsabstract3dsymbol.sip
Expand Down
3 changes: 3 additions & 0 deletions python/3d/auto_generated/qgs3dmapsettings.sip.in
Expand Up @@ -39,6 +39,7 @@ Copy constructor
%End
~Qgs3DMapSettings();


void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
%Docstring
Reads configuration from a DOM element previously written by writeXml()
Expand Down Expand Up @@ -495,6 +496,8 @@ Emitted when the camera lens field of view changes
.. versionadded:: 3.8
%End

private:
Qgs3DMapSettings &operator=( const Qgs3DMapSettings & );
};


Expand Down
5 changes: 5 additions & 0 deletions python/3d/auto_generated/qgslayoutitem3dmap.sip.in
Expand Up @@ -10,6 +10,11 @@



// this is needed for the "convert to subclass" code below to compile
%ModuleHeaderCode
#include "qgslayoutitem3dmap.h"
%End



class QgsLayoutItem3DMap : QgsLayoutItem
Expand Down
108 changes: 108 additions & 0 deletions python/3d/auto_generated/qgspointlightsettings.sip.in
@@ -0,0 +1,108 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgspointlightsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsPointLightSettings
{
%Docstring
Definition of a point light in a 3D map scene

Total light at the distance D from a point light with intensity I
is (I / TA) where TA is total attenuation which is calculated as
(A_0 + A_1 * D + A_2 * D^2). The terms A_0, A_1 and A_2 stand for
constant, linear and quadratic attenuation.

.. versionadded:: 3.6
%End

%TypeHeaderCode
#include "qgspointlightsettings.h"
%End
public:
QgsPointLightSettings();
%Docstring
Construct a point light with default values
%End

QgsVector3D position() const;
%Docstring
Returns position of the light (in 3D world coordinates)
%End
void setPosition( const QgsVector3D &pos );
%Docstring
Sets position of the light (in 3D world coordinates)
%End

QColor color() const;
%Docstring
Returns color of the light
%End
void setColor( const QColor &color );
%Docstring
Sets color of the light
%End

float intensity() const;
%Docstring
Returns intensity of the light
%End
void setIntensity( float intensity );
%Docstring
Sets intensity of the light
%End

float constantAttenuation() const;
%Docstring
Returns constant attenuation (A_0)
%End
void setConstantAttenuation( float value );
%Docstring
Sets constant attenuation (A_0)
%End

float linearAttenuation() const;
%Docstring
Returns linear attenuation (A_1)
%End
void setLinearAttenuation( float value );
%Docstring
Sets linear attenuation (A_1)
%End

float quadraticAttenuation() const;
%Docstring
Returns quadratic attenuation (A_2)
%End
void setQuadraticAttenuation( float value );
%Docstring
Sets quadratic attenuation (A_2)
%End

QDomElement writeXml( QDomDocument &doc ) const;
%Docstring
Writes configuration to a new DOM element and returns it
%End
void readXml( const QDomElement &elem );
%Docstring
Reads configuration from a DOM element previously written using writeXml()
%End

bool operator==( const QgsPointLightSettings &other );

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgspointlightsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
6 changes: 6 additions & 0 deletions src/3d/qgs3dmapsettings.cpp
Expand Up @@ -542,3 +542,9 @@ void Qgs3DMapSettings::setFieldOfView( const float fieldOfView )
emit fieldOfViewChanged();
}

void Qgs3DMapSettings::setSkybox( bool enabled, const QString &fileBase, const QString &fileExtension )
{
mSkyboxEnabled = enabled;
mSkyboxFileBase = fileBase;
mSkyboxFileExtension = fileExtension;
}
7 changes: 7 additions & 0 deletions src/3d/qgs3dmapsettings.h
Expand Up @@ -59,6 +59,8 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
Qgs3DMapSettings( const Qgs3DMapSettings &other );
~Qgs3DMapSettings() override;

Qgs3DMapSettings &operator=( Qgs3DMapSettings const & ) = delete;

//! Reads configuration from a DOM element previously written by writeXml()
void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
//! Writes configuration to a DOM element, to be used later with readXml()
Expand Down Expand Up @@ -417,6 +419,11 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
*/
void fieldOfViewChanged();

private:
#ifdef SIP_RUN
Qgs3DMapSettings &operator=( const Qgs3DMapSettings & );
#endif

private:
//! Offset in map CRS coordinates at which our 3D world has origin (0,0,0)
QgsVector3D mOrigin;
Expand Down
7 changes: 7 additions & 0 deletions src/3d/qgslayoutitem3dmap.h
Expand Up @@ -22,6 +22,13 @@
#include "qgstemporalrangeobject.h"
#include "qgscamerapose.h"

#ifdef SIP_RUN
// this is needed for the "convert to subclass" code below to compile
% ModuleHeaderCode
#include "qgslayoutitem3dmap.h"
% End
#endif


class Qgs3DMapScene;
class Qgs3DMapSettings;
Expand Down
4 changes: 3 additions & 1 deletion src/3d/qgspointlightsettings.h
Expand Up @@ -16,6 +16,8 @@
#ifndef QGSPOINTLIGHTSETTINGS_H
#define QGSPOINTLIGHTSETTINGS_H

#include "qgis_3d.h"

#include "qgsvector3d.h"
#include <QColor>

Expand All @@ -33,7 +35,7 @@ class QDomElement;
*
* \since QGIS 3.6
*/
class QgsPointLightSettings
class _3D_EXPORT QgsPointLightSettings
{
public:
//! Construct a point light with default values
Expand Down

0 comments on commit 5202461

Please sign in to comment.