QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsdirectionallightsettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdirectionallightsettings.h
3  --------------------------------------
4  Date : June 2020
5  Copyright : (C) 2020 by Belgacem Nedjima
6  Email : gb underscore nedjima at esi dot dz
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 
16 #ifndef QGSDIRECTIONALLIGHTSETTINGS_H
17 #define QGSDIRECTIONALLIGHTSETTINGS_H
18 #include "qgis_3d.h"
19 
20 #include "qgsvector3d.h"
21 #include <QColor>
22 
23 class QDomDocument;
24 class QDomElement;
25 
33 {
34  public:
37 
39  QgsVector3D direction() const { return mDirection; }
41  void setDirection( const QgsVector3D &direction ) { mDirection = direction; }
42 
44  QColor color() const { return mColor; }
46  void setColor( const QColor &color ) { mColor = color; }
47 
49  float intensity() const { return mIntensity; }
51  void setIntensity( float intensity ) { mIntensity = intensity; }
52 
54  QDomElement writeXml( QDomDocument &doc ) const;
56  void readXml( const QDomElement &elem );
57 
58  bool operator==( const QgsDirectionalLightSettings &other );
59 
60  private:
61  QgsVector3D mDirection { -0.32, -0.91, -0.27 };
62  QColor mColor = Qt::white;
63  float mIntensity = 1.0;
64 };
65 
66 #endif // QGSDIRECTIONALLIGHTSETTINGS_H
QgsDirectionalLightSettings::color
QColor color() const
Returns color of the light.
Definition: qgsdirectionallightsettings.h:44
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:400
QgsDirectionalLightSettings::setDirection
void setDirection(const QgsVector3D &direction)
Sets the direction of the light in degrees.
Definition: qgsdirectionallightsettings.h:41
QgsVector3D
3 Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double preci...
Definition: qgsvector3d.h:32
QgsDirectionalLightSettings::setIntensity
void setIntensity(float intensity)
Sets intensity of the light.
Definition: qgsdirectionallightsettings.h:51
QgsDirectionalLightSettings::QgsDirectionalLightSettings
QgsDirectionalLightSettings()=default
Construct a directional light with default values.
qgsvector3d.h
QgsDirectionalLightSettings::intensity
float intensity() const
Returns intensity of the light.
Definition: qgsdirectionallightsettings.h:49
QgsDirectionalLightSettings::direction
QgsVector3D direction() const
Returns the direction of the light in degrees.
Definition: qgsdirectionallightsettings.h:39
QgsDirectionalLightSettings::setColor
void setColor(const QColor &color)
Sets color of the light.
Definition: qgsdirectionallightsettings.h:46
QgsDirectionalLightSettings
3 Definition of a directional light in a 3D map scene
Definition: qgsdirectionallightsettings.h:33