Skip to content

Commit

Permalink
Code shuffle to move all material classes to separate subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 3, 2020
1 parent 798ed57 commit c87a8f6
Show file tree
Hide file tree
Showing 20 changed files with 187 additions and 23 deletions.
1 change: 1 addition & 0 deletions doc/CMakeLists.txt
Expand Up @@ -110,6 +110,7 @@ IF(WITH_APIDOC)
${CMAKE_SOURCE_DIR}/src/analysis/vector/geometry_checker
${CMAKE_SOURCE_DIR}/src/3d
${CMAKE_SOURCE_DIR}/src/3d/chunks
${CMAKE_SOURCE_DIR}/src/3d/materials
${CMAKE_SOURCE_DIR}/src/3d/symbols
${CMAKE_SOURCE_DIR}/src/3d/terrain
${CMAKE_SOURCE_DIR}/src/plugins
Expand Down
8 changes: 5 additions & 3 deletions python/3d/3d_auto.sip
Expand Up @@ -3,16 +3,18 @@
%Include auto_generated/qgs3d.sip
%Include auto_generated/qgs3dmapsettings.sip
%Include auto_generated/qgs3dtypes.sip
%Include auto_generated/qgsabstractmaterialsettings.sip
%Include auto_generated/qgsabstractvectorlayer3drenderer.sip
%Include auto_generated/qgscamerapose.sip
%Include auto_generated/qgslayoutitem3dmap.sip
%Include auto_generated/qgsmaterialregistry.sip
%Include auto_generated/qgsphongmaterialsettings.sip
%Include auto_generated/qgspointlightsettings.sip
%Include auto_generated/qgsdirectionallightsettings.sip
%Include auto_generated/qgsrulebased3drenderer.sip
%Include auto_generated/qgsvectorlayer3drenderer.sip
%Include auto_generated/materials/qgsabstractmaterialsettings.sip
%Include auto_generated/materials/qgsgoochmaterialsettings.sip
%Include auto_generated/materials/qgsmaterialregistry.sip
%Include auto_generated/materials/qgsphongmaterialsettings.sip
%Include auto_generated/symbols/qgsline3dsymbol.sip
%Include auto_generated/symbols/qgspoint3dsymbol.sip
%Include auto_generated/symbols/qgspolygon3dsymbol.sip
%Include auto_generated/qgs3dmapexportsettings.sip
2 changes: 1 addition & 1 deletion python/3d/auto_additions/qgsabstractmaterialsettings.py
@@ -1,4 +1,4 @@
# The following has been generated automatically from src/3d/qgsabstractmaterialsettings.h
# The following has been generated automatically from src/3d/materials/qgsabstractmaterialsettings.h
QgsAbstractMaterialSettings.RenderingTechnique = QgsMaterialSettingsRenderingTechnique
# monkey patching scoped based enum
QgsAbstractMaterialSettings.Triangles = QgsMaterialSettingsRenderingTechnique.Triangles
Expand Down
@@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsabstractmaterialsettings.h *
* src/3d/materials/qgsabstractmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
Expand Down Expand Up @@ -131,7 +131,7 @@ during triangulation.
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsabstractmaterialsettings.h *
* src/3d/materials/qgsabstractmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
138 changes: 138 additions & 0 deletions python/3d/auto_generated/materials/qgsgoochmaterialsettings.sip.in
@@ -0,0 +1,138 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/materials/qgsgoochmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsGoochMaterialSettings : QgsAbstractMaterialSettings
{
%Docstring
Basic shading material used for rendering based on the Phong shading model
with three color components: ambient, diffuse and specular.

.. 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.

.. versionadded:: 3.16
%End

%TypeHeaderCode
#include "qgsgoochmaterialsettings.h"
%End
public:

QgsGoochMaterialSettings();
%Docstring
Constructor for QgsGoochMaterialSettings.
%End

virtual QString type() const;


static QgsAbstractMaterialSettings *create() /Factory/;
%Docstring
Returns a new instance of QgsGoochMaterialSettings.
%End

static bool supportsTechnique( QgsMaterialSettingsRenderingTechnique technique );
%Docstring
Returns ``True`` if the specified ``technique`` is suppored by the Gooch material.
%End

virtual QgsGoochMaterialSettings *clone() const /Factory/;


QColor warm() const;
%Docstring
Returns warm color component
%End

QColor cool() const;
%Docstring
Returns cool 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

float alpha() const;
%Docstring
Returns the alpha value
%End

float beta() const;
%Docstring
Returns the beta value
%End

void setWarm( const QColor &warm );
%Docstring
Sets warm color component
%End

void setCool( const QColor &cool );
%Docstring
Sets cool 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 setAlpha( float alpha );
%Docstring
Sets alpha value
%End

void setBeta( float beta );
%Docstring
Sets beta value
%End

virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );

virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;

virtual QMap<QString, QString> toExportParameters() const;



bool operator==( const QgsGoochMaterialSettings &other ) const;

};


/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/materials/qgsgoochmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsmaterialregistry.h *
* src/3d/materials/qgsmaterialregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
Expand Down Expand Up @@ -125,7 +125,7 @@ Returns ``None`` if the specified type is not found in the registry.
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsmaterialregistry.h *
* src/3d/materials/qgsmaterialregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsphongmaterialsettings.h *
* src/3d/materials/qgsphongmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
Expand Down Expand Up @@ -180,7 +180,7 @@ Sets the texture rotation in degrees
/************************************************************************
* This file has been generated automatically from *
* *
* src/3d/qgsphongmaterialsettings.h *
* src/3d/materials/qgsphongmaterialsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/CMakeLists.txt
Expand Up @@ -258,6 +258,7 @@ IF (WITH_3D)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/3d
${CMAKE_SOURCE_DIR}/src/3d/chunks
${CMAKE_SOURCE_DIR}/src/3d/materials
${CMAKE_SOURCE_DIR}/src/3d/processing
${CMAKE_SOURCE_DIR}/src/3d/symbols
${CMAKE_SOURCE_DIR}/src/3d/terrain
Expand Down
31 changes: 19 additions & 12 deletions src/3d/CMakeLists.txt
Expand Up @@ -7,17 +7,18 @@ SET(QGIS_3D_SRCS
qgsabstract3dengine.cpp
qgsabstractvectorlayer3drenderer.cpp
qgs3danimationsettings.cpp
qgs3dexportobject.cpp
qgs3dmapexportsettings.cpp
qgs3dmapscene.cpp
qgs3dmapsettings.cpp
qgs3dsceneexporter.cpp
qgs3dutils.cpp
qgscameracontroller.cpp
qgscamerapose.cpp
qgsfeature3dhandler_p.cpp
qgsgoochmaterialsettings.cpp
qgsimagetexture.cpp
qgslayoutitem3dmap.cpp
qgsmaterialregistry.cpp
qgsoffscreen3dengine.cpp
qgsphongmaterialsettings.cpp
qgspointlightsettings.cpp
qgsdirectionallightsettings.cpp
qgsraycastingutils_p.cpp
Expand All @@ -36,6 +37,10 @@ SET(QGIS_3D_SRCS
chunks/qgschunknode_p.cpp
chunks/qgschunkqueuejob_p.cpp

materials/qgsgoochmaterialsettings.cpp
materials/qgsmaterialregistry.cpp
materials/qgsphongmaterialsettings.cpp

processing/qgs3dalgorithms.cpp
processing/qgsalgorithmtessellate.cpp

Expand Down Expand Up @@ -70,10 +75,6 @@ SET(QGIS_3D_SRCS
mesh/qgsmesh3dentity_p.cpp
mesh/qgsmesh3dmaterial_p.cpp
mesh/qgsmeshterraingenerator.cpp
qgs3dsceneexporter.cpp
qgs3dexportobject.cpp
qgs3dmapexportsettings.cpp
qgsimagetexture.cpp
)

SET(QGIS_3D_HDRS
Expand All @@ -82,43 +83,48 @@ SET(QGIS_3D_HDRS
qgs3danimationsettings.h
qgs3dmapscene.h
qgs3dmapsettings.h
qgs3dsceneexporter.h
qgs3dtypes.h
qgs3dutils.h
qgsaabb.h
qgsabstract3dengine.h
qgsabstractmaterialsettings.h
qgsabstractvectorlayer3drenderer.h
qgscameracontroller.h
qgscamerapose.h
qgsgoochmaterialsettings.h
qgslayoutitem3dmap.h
qgsmaterialregistry.h
qgsmeshlayer3drenderer.h
qgsoffscreen3dengine.h
qgsphongmaterialsettings.h
qgspointlightsettings.h
qgsdirectionallightsettings.h
qgsrulebased3drenderer.h
qgstessellatedpolygongeometry.h
qgstilingscheme.h
qgsvectorlayer3drenderer.h
qgswindow3dengine.h

materials/qgsabstractmaterialsettings.h
materials/qgsgoochmaterialsettings.h
materials/qgsmaterialregistry.h
materials/qgsphongmaterialsettings.h

symbols/qgsbillboardgeometry.h
symbols/qgsline3dsymbol.h
symbols/qgsmesh3dsymbol.h
symbols/qgspoint3dbillboardmaterial.h
symbols/qgspoint3dsymbol.h
symbols/qgspolygon3dsymbol.h

terrain/qgsdemterraingenerator.h
terrain/qgsflatterraingenerator.h
terrain/qgsonlineterraingenerator.h
terrain/qgsterraindownloader.h
terrain/qgsterraingenerator.h
terrain/qgsterraintileloader_p.h

chunks/qgschunkloader_p.h
chunks/qgschunkqueuejob_p.h

mesh/qgsmeshterraingenerator.h
qgs3dsceneexporter.h
)

SET(QGIS_3D_PRIVATE_HDRS
Expand Down Expand Up @@ -152,6 +158,7 @@ SET (QGIS_3D_RCCS shaders.qrc ../../resources/3d/textures/textures.qrc)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/chunks
${CMAKE_CURRENT_SOURCE_DIR}/materials
${CMAKE_CURRENT_SOURCE_DIR}/mesh
${CMAKE_CURRENT_SOURCE_DIR}/symbols
${CMAKE_CURRENT_SOURCE_DIR}/terrain
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions src/3d/qgs3dexportobject.h
Expand Up @@ -24,11 +24,16 @@

#include <Qt3DRender/QAttribute>

#define SIP_NO_FILE

class QgsAbstractMaterialSettings;

/**
* \brief The Qgs3DExportObject class
* Manages the data of each object of the scene (positions, normals, texture coordinates ...) since each object
*
* \note Not available in Python bindings
*
* \ingroup 3d
* \since QGIS 3.16
*/
Expand Down
5 changes: 5 additions & 0 deletions src/3d/qgs3dsceneexporter.h
Expand Up @@ -42,9 +42,14 @@ class QgsLine3DSymbol;
class QgsPoint3DSymbol;
class QgsMeshEntity;

#define SIP_NO_FILE

/**
* \brief The Qgs3DSceneExporter class
* Entity that handles the exporting of 3D scene
*
* \note Not available in Python bindings
*
* \ingroup 3d
* \since QGIS 3.16
*/
Expand Down
4 changes: 4 additions & 0 deletions src/3d/qgsimagetexture.h
Expand Up @@ -21,10 +21,14 @@
#include <Qt3DCore/QNode>
#include <Qt3DRender/QPaintedTextureImage>

#define SIP_NO_FILE

/**
* \brief The QgsImageTexture class
* Holds an image that can be used as a texture in the 3D view
*
* \note Not available in Python bindings
*
* \ingroup 3d
* \since QGIS 3.16
*/
Expand Down

0 comments on commit c87a8f6

Please sign in to comment.