Python bindings for QGIS 3D library

This commit is contained in:
Martin Dobias 2018-10-13 21:07:11 +02:00
parent 94a7d9db66
commit 88cb8313c8
19 changed files with 760 additions and 6 deletions

12
python/3d/3d.sip.in Normal file
View File

@ -0,0 +1,12 @@
%Module(name=qgis._3d,
keyword_arguments="All")
${DEFAULTDOCSTRINGSIGNATURE}
%Import core/core.sip
%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
%Import QtXml/QtXmlmod.sip
%Include ./3d_auto.sip

8
python/3d/3d_auto.sip Normal file
View File

@ -0,0 +1,8 @@
// Include auto-generated SIP files
%Include auto_generated/qgs3dutils.sip
%Include auto_generated/qgsphongmaterialsettings.sip
%Include auto_generated/qgsvectorlayer3drenderer.sip
%Include auto_generated/symbols/qgsabstract3dsymbol.sip
%Include auto_generated/symbols/qgsline3dsymbol.sip
%Include auto_generated/symbols/qgspoint3dsymbol.sip
%Include auto_generated/symbols/qgspolygon3dsymbol.sip

27
python/3d/__init__.py.in Normal file
View File

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Nathan Woodrow
Email : woodrow dot nathan 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. *
* *
***************************************************************************
"""
__author__ = 'Nathan Woodrow'
__date__ = 'May 2014'
__copyright__ = '(C) 2014, Nathan Woodrow'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
from qgis.PyQt import QtCore
from qgis._3d import *

View File

@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""

View File

@ -0,0 +1,37 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgs3dutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
enum AltitudeClamping
{
AltClampAbsolute,
AltClampRelative,
AltClampTerrain,
};
enum AltitudeBinding
{
AltBindVertex,
AltBindCentroid,
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgs3dutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -0,0 +1,80 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsphongmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsPhongMaterialSettings
{
%Docstring
Basic shading material used for rendering based on the Phong shading model
with three color components: ambient, diffuse and specular.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsphongmaterialsettings.h"
%End
public:
QgsPhongMaterialSettings();
QColor ambient() const;
%Docstring
Returns ambient color component
%End
QColor diffuse() const;
%Docstring
Returns diffuse color component
%End
QColor specular() const;
%Docstring
Returns specular color component
%End
float shininess() const;
%Docstring
Returns shininess of the surface
%End
void setAmbient( const QColor &ambient );
%Docstring
Sets ambient color component
%End
void setDiffuse( const QColor &diffuse );
%Docstring
Sets diffuse color component
%End
void setSpecular( const QColor &specular );
%Docstring
Sets specular color component
%End
void setShininess( float shininess );
%Docstring
Sets shininess of the surface
%End
void readXml( const QDomElement &elem );
%Docstring
Reads settings from a DOM element
%End
void writeXml( QDomElement &elem ) const;
%Docstring
Writes settings to a DOM element
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsphongmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -0,0 +1,98 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsvectorlayer3drenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsVectorLayer3DRendererMetadata : Qgs3DRendererAbstractMetadata
{
%Docstring
Metadata for vector layer 3D renderer to allow creation of its instances from XML
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsvectorlayer3drenderer.h"
%End
public:
QgsVectorLayer3DRendererMetadata();
virtual QgsAbstract3DRenderer *createRenderer( QDomElement &elem, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Creates an instance of a 3D renderer based on a DOM element with renderer configuration
%End
};
class QgsVectorLayer3DRenderer : QgsAbstract3DRenderer
{
%Docstring
3D renderer that renders all features of a vector layer with the same 3D symbol.
The appearance is completely defined by the symbol.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsvectorlayer3drenderer.h"
%End
public:
explicit QgsVectorLayer3DRenderer( QgsAbstract3DSymbol *s /Transfer/ = 0 );
%Docstring
Takes ownership of the symbol object
%End
void setLayer( QgsVectorLayer *layer );
%Docstring
Sets vector layer associated with the renderer
%End
QgsVectorLayer *layer() const;
%Docstring
Returns vector layer associated with the renderer
%End
void setSymbol( QgsAbstract3DSymbol *symbol /Transfer/ );
%Docstring
Sets 3D symbol associated with the renderer. Takes ownership of the symbol
%End
const QgsAbstract3DSymbol *symbol() const;
%Docstring
Returns 3D symbol associated with the renderer
%End
virtual QString type() const;
virtual QgsVectorLayer3DRenderer *clone() const /Factory/;
virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
virtual void resolveReferences( const QgsProject &project );
private:
QgsVectorLayer3DRenderer( const QgsVectorLayer3DRenderer & );
QgsVectorLayer3DRenderer &operator=( const QgsVectorLayer3DRenderer & );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsvectorlayer3drenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -0,0 +1,82 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgsabstract3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAbstract3DSymbol
{
%Docstring
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
3D symbol objects define appearance of GIS data.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsabstract3dsymbol.h"
%End
public:
virtual ~QgsAbstract3DSymbol();
virtual QString type() const = 0;
%Docstring
Returns identifier of symbol type. Each 3D symbol implementation should return a different type.
%End
virtual QgsAbstract3DSymbol *clone() const = 0 /Factory/;
%Docstring
Returns a new instance of the symbol with the same settings
%End
virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const = 0;
%Docstring
Writes symbol configuration to the given DOM element
%End
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
%Docstring
Reads symbol configuration from the given DOM element
%End
enum Property
{
PropertyHeight,
PropertyExtrusionHeight,
};
static const QgsPropertiesDefinition &propertyDefinitions();
%Docstring
Returns the symbol layer property definitions.
%End
QgsPropertyCollection &dataDefinedProperties();
%Docstring
Returns a reference to the symbol layer's property collection, used for data defined overrides.
%End
void setDataDefinedProperties( const QgsPropertyCollection &collection );
%Docstring
Sets the symbol layer's property collection, used for data defined overrides.
%End
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgsabstract3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -0,0 +1,111 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgsline3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLine3DSymbol : QgsAbstract3DSymbol
{
%Docstring
3D symbol that draws linestring geometries as planar polygons (created from lines using a buffer with given thickness).
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsline3dsymbol.h"
%End
public:
QgsLine3DSymbol();
%Docstring
Constructor for QgsLine3DSymbol
%End
virtual QString type() const;
virtual QgsAbstract3DSymbol *clone() const /Factory/;
virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
AltitudeClamping altitudeClamping() const;
%Docstring
Returns method that determines altitude (whether to clamp to feature to terrain)
%End
void setAltitudeClamping( AltitudeClamping altClamping );
%Docstring
Sets method that determines altitude (whether to clamp to feature to terrain)
%End
AltitudeBinding altitudeBinding() const;
%Docstring
Returns method that determines how altitude is bound to individual vertices
%End
void setAltitudeBinding( AltitudeBinding altBinding );
%Docstring
Sets method that determines how altitude is bound to individual vertices
%End
float width() const;
%Docstring
Returns width of the line symbol (in map units)
%End
void setWidth( float width );
%Docstring
Sets width of the line symbol (in map units)
%End
float height() const;
%Docstring
Returns height (altitude) of the symbol (in map units)
%End
void setHeight( float height );
%Docstring
Sets height (altitude) of the symbol (in map units)
%End
float extrusionHeight() const;
%Docstring
Returns extrusion height (in map units)
%End
void setExtrusionHeight( float extrusionHeight );
%Docstring
Sets extrusion height (in map units)
%End
bool renderAsSimpleLines() const;
%Docstring
Returns whether the renderer will render data with simple lines (otherwise it uses buffer)
%End
void setRenderAsSimpleLines( bool enabled );
%Docstring
Sets whether the renderer will render data with simple lines (otherwise it uses buffer)
%End
QgsPhongMaterialSettings material() const;
%Docstring
Returns material used for shading of the symbol
%End
void setMaterial( const QgsPhongMaterialSettings &material );
%Docstring
Sets material used for shading of the symbol
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgsline3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -0,0 +1,114 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgspoint3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsPoint3DSymbol : QgsAbstract3DSymbol
{
%Docstring
3D symbol that draws point geometries as 3D objects using one of the predefined shapes.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgspoint3dsymbol.h"
%End
public:
QgsPoint3DSymbol();
%Docstring
Constructor for QgsPoint3DSymbol.
%End
virtual QString type() const;
virtual QgsAbstract3DSymbol *clone() const /Factory/;
virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
AltitudeClamping altitudeClamping() const;
%Docstring
Returns method that determines altitude (whether to clamp to feature to terrain)
%End
void setAltitudeClamping( AltitudeClamping altClamping );
%Docstring
Sets method that determines altitude (whether to clamp to feature to terrain)
%End
QgsPhongMaterialSettings material() const;
%Docstring
Returns material used for shading of the symbol
%End
void setMaterial( const QgsPhongMaterialSettings &material );
%Docstring
Sets material used for shading of the symbol
%End
enum Shape
{
Cylinder,
Sphere,
Cone,
Cube,
Torus,
Plane,
ExtrudedText,
Model,
};
static Shape shapeFromString( const QString &shape );
%Docstring
Returns shape enum value from a string
%End
static QString shapeToString( Shape shape );
%Docstring
Returns string from a shape enum value
%End
Shape shape() const;
%Docstring
Returns 3D shape for points
%End
void setShape( Shape shape );
%Docstring
Sets 3D shape for points
%End
QVariantMap shapeProperties() const;
%Docstring
Returns a key-value dictionary of point shape properties
%End
void setShapeProperties( const QVariantMap &properties );
%Docstring
Sets a key-value dictionary of point shape properties
%End
QMatrix4x4 transform() const;
%Docstring
Returns transform for individual objects represented by the symbol
%End
void setTransform( const QMatrix4x4 &transform );
%Docstring
Sets transform for individual objects represented by the symbol
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgspoint3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -0,0 +1,117 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgspolygon3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsPolygon3DSymbol : QgsAbstract3DSymbol
{
%Docstring
3D symbol that draws polygon geometries as planar polygons, optionally extruded (with added walls).
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgspolygon3dsymbol.h"
%End
public:
QgsPolygon3DSymbol();
%Docstring
Constructor for QgsPolygon3DSymbol
%End
virtual QString type() const;
virtual QgsAbstract3DSymbol *clone() const /Factory/;
virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
AltitudeClamping altitudeClamping() const;
%Docstring
Returns method that determines altitude (whether to clamp to feature to terrain)
%End
void setAltitudeClamping( AltitudeClamping altClamping );
%Docstring
Sets method that determines altitude (whether to clamp to feature to terrain)
%End
AltitudeBinding altitudeBinding() const;
%Docstring
Returns method that determines how altitude is bound to individual vertices
%End
void setAltitudeBinding( AltitudeBinding altBinding );
%Docstring
Sets method that determines how altitude is bound to individual vertices
%End
float height() const;
%Docstring
Returns height (altitude) of the symbol (in map units)
%End
void setHeight( float height );
%Docstring
Sets height (altitude) of the symbol (in map units)
%End
float extrusionHeight() const;
%Docstring
Returns extrusion height (in map units)
%End
void setExtrusionHeight( float extrusionHeight );
%Docstring
Sets extrusion height (in map units)
%End
QgsPhongMaterialSettings material() const;
%Docstring
Returns material used for shading of the symbol
%End
void setMaterial( const QgsPhongMaterialSettings &material );
%Docstring
Sets material used for shading of the symbol
%End
bool invertNormals() const;
%Docstring
Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
%End
void setInvertNormals( bool invert );
%Docstring
Sets whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
%End
bool addBackFaces() const;
%Docstring
Returns whether also triangles facing the other side will be created. Useful if input data have inconsistent order of vertices
.. versionadded:: 3.2
%End
void setAddBackFaces( bool add );
%Docstring
Sets whether also triangles facing the other side will be created. Useful if input data have inconsistent order of vertices
.. versionadded:: 3.2
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/symbols/qgspolygon3dsymbol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -142,6 +142,17 @@ IF (WITH_GUI)
)
ENDIF ()
IF (WITH_3D)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/3d
${CMAKE_SOURCE_DIR}/src/3d/chunks
${CMAKE_SOURCE_DIR}/src/3d/symbols
${CMAKE_SOURCE_DIR}/src/3d/terrain
${CMAKE_BINARY_DIR}/src/3d
)
ENDIF ()
IF(NOT ENABLE_TESTS)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} TESTS)
ENDIF(NOT ENABLE_TESTS)
@ -219,6 +230,24 @@ IF (WITH_GUI)
BUILD_SIP_PYTHON_MODULE(qgis._gui gui/gui.sip ${cpp_files} "" qgis_core qgis_gui)
ENDIF (WITH_GUI)
# 3D module
IF (WITH_3D)
SET(PY_MODULES ${PY_MODULES} 3d)
FILE(GLOB_RECURSE sip_files_3d 3d/*.sip 3d/*.sip.in)
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_3d})
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.qgis3d.api)
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n sip)
ENDIF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.18) OR (${SIP_VERSION_STR} VERSION_GREATER 4.18))
SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -y ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_qgis3d.pyi)
ENDIF((${SIP_VERSION_STR} VERSION_EQUAL 4.18) OR (${SIP_VERSION_STR} VERSION_GREATER 4.18))
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._3d 3d/3d.sip "${sip_files_3d}" cpp_files)
BUILD_SIP_PYTHON_MODULE(qgis._3d 3d/3d.sip ${cpp_files} "" qgis_core qgis_3d)
ENDIF (WITH_3D)
# server module
IF (WITH_SERVER AND WITH_SERVER_PLUGINS)
INCLUDE_DIRECTORIES(

View File

@ -52,6 +52,16 @@ Reads renderer's properties from given XML element
%Docstring
Resolves references to other objects - second phase of loading - after readXml()
%End
protected:
QgsAbstract3DRenderer();
%Docstring
Default constructor
%End
private:
QgsAbstract3DRenderer( const QgsAbstract3DRenderer & );
QgsAbstract3DRenderer &operator=( const QgsAbstract3DRenderer & );
};

View File

@ -754,7 +754,7 @@ while ($LINE_IDX < $LINE_COUNT){
# class declaration started
# https://regex101.com/r/6FWntP/10
if ( $LINE =~ m/^(\s*class)\s+([A-Z]+_EXPORT\s+)?(\w+)(\s*\:\s*(public|protected|private)\s+\w+(< *(\w|::)+ *>)?(::\w+(<\w+>)?)*(,\s*(public|protected|private)\s+\w+(< *(\w|::)+ *>)?(::\w+(<\w+>)?)*)*)?(?<annot>\s*\/?\/?\s*SIP_\w+)?\s*?(\/\/.*|(?!;))$/ ){
if ( $LINE =~ m/^(\s*class)\s+([A-Z0-9_]+_EXPORT\s+)?(\w+)(\s*\:\s*(public|protected|private)\s+\w+(< *(\w|::)+ *>)?(::\w+(<\w+>)?)*(,\s*(public|protected|private)\s+\w+(< *(\w|::)+ *>)?(::\w+(<\w+>)?)*)*)?(?<annot>\s*\/?\/?\s*SIP_\w+)?\s*?(\/\/.*|(?!;))$/ ){
dbg_info("class definition started");
push @ACCESS, PUBLIC;
push @EXPORTED, 0;
@ -770,7 +770,7 @@ while ($LINE_IDX < $LINE_COUNT){
push @DECLARED_CLASSES, $CLASSNAME[$#CLASSNAME];
}
dbg_info("class: ".$CLASSNAME[$#CLASSNAME]);
if ($LINE =~ m/\b[A-Z]+_EXPORT\b/ || $#CLASSNAME != 0 || $INPUT_LINES[$LINE_IDX-2] =~ m/^\s*template</){
if ($LINE =~ m/\b[A-Z0-9_]+_EXPORT\b/ || $#CLASSNAME != 0 || $INPUT_LINES[$LINE_IDX-2] =~ m/^\s*template</){
# class should be exported except those not at top level or template classes
# if class is not exported, then its methods should be (checked whenever leaving out the class)
$EXPORTED[-1]++;

View File

@ -37,7 +37,7 @@ pushd ${DIR} > /dev/null
count=0
modules=(core gui analysis server)
modules=(3d core gui analysis server)
for module in "${modules[@]}"; do
# clean auto_additions and auto_generated folders

View File

@ -16,6 +16,8 @@
#ifndef QGS3DUTILS_H
#define QGS3DUTILS_H
#include "qgis_sip.h"
class QgsLineString;
class QgsPolygon;
@ -44,6 +46,8 @@ enum AltitudeBinding
};
#ifndef SIP_RUN
/**
* \ingroup 3d
* Miscellaneous utility functions used from 3D code.
@ -114,4 +118,6 @@ class _3D_EXPORT Qgs3DUtils
const QgsCoordinateTransformContext &context );
};
#endif
#endif // QGS3DUTILS_H

View File

@ -17,6 +17,7 @@
#define QGSVECTORLAYER3DRENDERER_H
#include "qgis_3d.h"
#include "qgis_sip.h"
#include "qgs3drendererregistry.h"
#include "qgsabstract3drenderer.h"
@ -71,7 +72,7 @@ class _3D_EXPORT QgsVectorLayer3DRenderer : public QgsAbstract3DRenderer
QString type() const override { return "vector"; }
QgsVectorLayer3DRenderer *clone() const override SIP_FACTORY;
Qt3DCore::QEntity *createEntity( const Qgs3DMapSettings &map ) const override SIP_FACTORY;
Qt3DCore::QEntity *createEntity( const Qgs3DMapSettings &map ) const override SIP_SKIP;
void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
@ -80,6 +81,12 @@ class _3D_EXPORT QgsVectorLayer3DRenderer : public QgsAbstract3DRenderer
private:
QgsMapLayerRef mLayerRef; //!< Layer used to extract polygons from
std::unique_ptr<QgsAbstract3DSymbol> mSymbol; //!< 3D symbol that defines appearance
private:
#ifdef SIP_RUN
QgsVectorLayer3DRenderer( const QgsVectorLayer3DRenderer & );
QgsVectorLayer3DRenderer &operator=( const QgsVectorLayer3DRenderer & );
#endif
};

View File

@ -67,9 +67,9 @@ class _3D_EXPORT QgsPolygon3DSymbol : public QgsAbstract3DSymbol
void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; }
//! Returns front/back culling mode
Qt3DRender::QCullFace::CullingMode cullingMode() const { return mCullingMode; }
Qt3DRender::QCullFace::CullingMode cullingMode() const { return mCullingMode; } SIP_SKIP
//! Sets front/back culling mode
void setCullingMode( Qt3DRender::QCullFace::CullingMode mode ) { mCullingMode = mode; }
void setCullingMode( Qt3DRender::QCullFace::CullingMode mode ) { mCullingMode = mode; } SIP_SKIP
//! Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
bool invertNormals() const { return mInvertNormals; }

View File

@ -63,6 +63,18 @@ class CORE_EXPORT QgsAbstract3DRenderer SIP_ABSTRACT
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
//! Resolves references to other objects - second phase of loading - after readXml()
virtual void resolveReferences( const QgsProject &project );
protected:
//! Default constructor
QgsAbstract3DRenderer() = default;
private:
#ifdef SIP_RUN
QgsAbstract3DRenderer( const QgsAbstract3DRenderer & );
QgsAbstract3DRenderer &operator=( const QgsAbstract3DRenderer & );
#endif
Q_DISABLE_COPY( QgsAbstract3DRenderer )
};