QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgspoint3dbillboardmaterial.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspoint3dbillboardmaterial.h
3  --------------------------------------
4  Date : Jul 2019
5  Copyright : (C) 2019 by Ismail Sunni
6  Email : imajimatika at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSPOINT3DBILLBOARDMATERIAL_H
16 #define QGSPOINT3DBILLBOARDMATERIAL_H
17 
18 #include <QObject>
19 #include <Qt3DRender/QParameter>
20 #include <Qt3DRender/QTexture>
21 #include <Qt3DRender/QMaterial>
22 
23 #include "qgsmarkersymbollayer.h"
24 #include "qgs3dmapsettings.h"
25 
26 #define SIP_NO_FILE
27 
36 class QgsPoint3DBillboardMaterial : public Qt3DRender::QMaterial
37 {
38  Q_OBJECT
39 
40  public:
42 
44  void setSize( const QSizeF size );
46  QSizeF size() const;
47 
49  void setViewportSize( const QSizeF size );
51  QSizeF windowSize() const;
52 
54  void useDefaultSymbol( const Qgs3DMapSettings &map, bool selected = false );
55 
57  void setTexture2DFromSymbol( QgsMarkerSymbol *markerSymbol, const Qgs3DMapSettings &map, bool selected = false );
58 
59  private:
61  void setTexture2DFromImage( QImage image, double size = 100 );
62 
64  void setTexture2DFromTextureImage( Qt3DRender::QAbstractTextureImage *textureImage );
65 
66  Qt3DRender::QParameter *mSize = nullptr;
67  Qt3DRender::QParameter *mViewportSize = nullptr;
68  Qt3DRender::QParameter *mTexture2D = nullptr;
69 };
70 
71 
72 #endif // QGSPOINT3DBILLBOARDMATERIAL_H
QgsPoint3DBillboardMaterial
3 Material of the billboard rendering for points in 3D map view.
Definition: qgspoint3dbillboardmaterial.h:37
QgsPoint3DBillboardMaterial::setViewportSize
void setViewportSize(const QSizeF size)
Set the size of the view port.
Definition: qgspoint3dbillboardmaterial.cpp:95
QgsPoint3DBillboardMaterial::setTexture2DFromSymbol
void setTexture2DFromSymbol(QgsMarkerSymbol *markerSymbol, const Qgs3DMapSettings &map, bool selected=false)
Set markerSymbol for the texture with map and selected parameter for rendering.
Definition: qgspoint3dbillboardmaterial.cpp:122
qgsmarkersymbollayer.h
QgsPoint3DBillboardMaterial::QgsPoint3DBillboardMaterial
QgsPoint3DBillboardMaterial()
Definition: qgspoint3dbillboardmaterial.cpp:33
QgsMarkerSymbol
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgssymbol.h:931
Qgs3DMapSettings
3 Definition of the world
Definition: qgs3dmapsettings.h:54
qgs3dmapsettings.h
QgsPoint3DBillboardMaterial::setSize
void setSize(const QSizeF size)
Set the billboard size.
Definition: qgspoint3dbillboardmaterial.cpp:85
QgsPoint3DBillboardMaterial::useDefaultSymbol
void useDefaultSymbol(const Qgs3DMapSettings &map, bool selected=false)
Set default symbol for the texture with map and selected parameter for rendering.
Definition: qgspoint3dbillboardmaterial.cpp:115
QgsPoint3DBillboardMaterial::windowSize
QSizeF windowSize() const
Returns the size of the view port.
Definition: qgspoint3dbillboardmaterial.cpp:100
QgsPoint3DBillboardMaterial::size
QSizeF size() const
Returns the billboard size.
Definition: qgspoint3dbillboardmaterial.cpp:90