Skip to content
Permalink
Browse files

Move altitude binding/clamping enums to Qgs3DTypes + add culling mode…

… in Python
  • Loading branch information
wonder-sk committed Oct 14, 2018
1 parent 88cb831 commit 8814e4063579d2055e9d8024491f4e6974113f0d
@@ -1,5 +1,5 @@
// Include auto-generated SIP files
%Include auto_generated/qgs3dutils.sip
%Include auto_generated/qgs3dtypes.sip
%Include auto_generated/qgsphongmaterialsettings.sip
%Include auto_generated/qgsvectorlayer3drenderer.sip
%Include auto_generated/symbols/qgsabstract3dsymbol.sip
@@ -1,37 +1,51 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgs3dutils.h *
* src/3d/qgs3dtypes.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/







enum AltitudeClamping
{
AltClampAbsolute,
AltClampRelative,
AltClampTerrain,
};


enum AltitudeBinding
class Qgs3DTypes
{
AltBindVertex,
AltBindCentroid,
%Docstring
Defines enumerations and other auxilliary types for QGIS 3D

.. versionadded:: 3.4
%End

%TypeHeaderCode
#include "qgs3dtypes.h"
%End
public:
enum AltitudeClamping
{
AltClampAbsolute,
AltClampRelative,
AltClampTerrain,
};

enum AltitudeBinding
{
AltBindVertex,
AltBindCentroid,
};

enum CullingMode
{
NoCulling,
Front,
Back,
FrontAndBack
};
};



/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgs3dutils.h *
* src/3d/qgs3dtypes.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -36,20 +36,20 @@ Constructor for QgsLine3DSymbol
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );


AltitudeClamping altitudeClamping() const;
Qgs3DTypes::AltitudeClamping altitudeClamping() const;
%Docstring
Returns method that determines altitude (whether to clamp to feature to terrain)
%End
void setAltitudeClamping( AltitudeClamping altClamping );
void setAltitudeClamping( Qgs3DTypes::AltitudeClamping altClamping );
%Docstring
Sets method that determines altitude (whether to clamp to feature to terrain)
%End

AltitudeBinding altitudeBinding() const;
Qgs3DTypes::AltitudeBinding altitudeBinding() const;
%Docstring
Returns method that determines how altitude is bound to individual vertices
%End
void setAltitudeBinding( AltitudeBinding altBinding );
void setAltitudeBinding( Qgs3DTypes::AltitudeBinding altBinding );
%Docstring
Sets method that determines how altitude is bound to individual vertices
%End
@@ -36,11 +36,11 @@ Constructor for QgsPoint3DSymbol.
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );


AltitudeClamping altitudeClamping() const;
Qgs3DTypes::AltitudeClamping altitudeClamping() const;
%Docstring
Returns method that determines altitude (whether to clamp to feature to terrain)
%End
void setAltitudeClamping( AltitudeClamping altClamping );
void setAltitudeClamping( Qgs3DTypes::AltitudeClamping altClamping );
%Docstring
Sets method that determines altitude (whether to clamp to feature to terrain)
%End
@@ -36,20 +36,20 @@ Constructor for QgsPolygon3DSymbol
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );


AltitudeClamping altitudeClamping() const;
Qgs3DTypes::AltitudeClamping altitudeClamping() const;
%Docstring
Returns method that determines altitude (whether to clamp to feature to terrain)
%End
void setAltitudeClamping( AltitudeClamping altClamping );
void setAltitudeClamping( Qgs3DTypes::AltitudeClamping altClamping );
%Docstring
Sets method that determines altitude (whether to clamp to feature to terrain)
%End

AltitudeBinding altitudeBinding() const;
Qgs3DTypes::AltitudeBinding altitudeBinding() const;
%Docstring
Returns method that determines how altitude is bound to individual vertices
%End
void setAltitudeBinding( AltitudeBinding altBinding );
void setAltitudeBinding( Qgs3DTypes::AltitudeBinding altBinding );
%Docstring
Sets method that determines how altitude is bound to individual vertices
%End
@@ -81,6 +81,14 @@ Returns material used for shading of the symbol
Sets material used for shading of the symbol
%End

Qgs3DTypes::CullingMode cullingMode() const;
%Docstring
Returns front/back culling mode
%End
void setCullingMode( Qgs3DTypes::CullingMode mode );
%Docstring
Sets front/back culling mode
%End

bool invertNormals() const;
%Docstring
@@ -112,13 +112,13 @@ SIPIFYDIFF=sipify.$REV.diff
true > "$SIPIFYDIFF"
for f in $MODIFIED; do
# if cpp header
if [[ $f =~ ^src\/(core|gui|analysis|server)\/.*\.h$ ]]; then
if [[ $f =~ ^src\/(core|gui|analysis|server|3d)\/.*\.h$ ]]; then
# look if corresponding SIP file
sip_file=$(${GP}sed -r 's@^src/(core|gui|analysis|server)/@@; s@\.h$@.sip@' <<<"$f" )
sip_file=$(${GP}sed -r 's@^src/(core|gui|analysis|server|3d)/@@; s@\.h$@.sip@' <<<"$f" )
pyfile=$(${GP}sed -E 's@([^\/]+\/)*([^\/]+)\.sip@\2.py@;' <<< "$sip_file")
module=$(${GP}sed -r 's@src/(core|gui|analysis|server)/.*$@\1@' <<<"$f" )
module=$(${GP}sed -r 's@src/(core|gui|analysis|server|3d)/.*$@\1@' <<<"$f" )
if grep -Fq "$sip_file" "${TOPLEVEL}"/python/"${module}"/"${module}"_auto.sip; then
sip_file=$(${GP}sed -r 's@^src/(core|gui|analysis|server)@\1/auto_generated@; s@\.h$@.sip.in@' <<<"$f" )
sip_file=$(${GP}sed -r 's@^src/(core|gui|analysis|server|3d)@\1/auto_generated@; s@\.h$@.sip.in@' <<<"$f" )
m=python/$sip_file.$REV.prepare
touch python/"$sip_file"
cp python/"$sip_file" "$m"
@@ -83,6 +83,7 @@ SET(QGIS_3D_HDRS
qgsabstract3dengine.h
qgs3dmapscene.h
qgs3dmapsettings.h
qgs3dtypes.h
qgs3dutils.h
qgscameracontroller.h
qgscamerapose.h
@@ -15,6 +15,7 @@

#include "qgs3dmapsettings.h"

#include "qgs3dutils.h"
#include "qgsflatterraingenerator.h"
#include "qgsdemterraingenerator.h"
//#include "quantizedmeshterraingenerator.h"
@@ -0,0 +1,54 @@
/***************************************************************************
qgs3dtypes.h
--------------------------------------
Date : October 2018
Copyright : (C) 2018 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGS3DTYPES_H
#define QGS3DTYPES_H

#include "qgis_3d.h"

/**
* \ingroup 3d
* Defines enumerations and other auxilliary types for QGIS 3D
* \since QGIS 3.4
*/
class _3D_EXPORT Qgs3DTypes
{
public:
//! how to handle altitude of vector features
enum AltitudeClamping
{
AltClampAbsolute, //!< Z_final = z_geometry
AltClampRelative, //!< Z_final = z_terrain + z_geometry
AltClampTerrain, //!< Z_final = z_terrain
};

//! how to handle clamping of vertices of individual features
enum AltitudeBinding
{
AltBindVertex, //!< Clamp every vertex of feature
AltBindCentroid, //!< Clamp just centroid of feature
};

//! Triangle culling mode
enum CullingMode
{
NoCulling, //!< Will render both front and back faces of triangles
Front, //!< Will render only back faces of triangles
Back, //!< Will render only front faces of triangles (recommended when input data are consistent)
FrontAndBack //!< Will not render anything
};
};

#endif // QGS3DTYPES_H

0 comments on commit 8814e40

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