QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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  // TODO c++20 - replace with = default
59  bool operator==( const QgsDirectionalLightSettings &other );
60 
61  private:
62  QgsVector3D mDirection { -0.32, -0.91, -0.27 };
63  QColor mColor = Qt::white;
64  float mIntensity = 1.0;
65 };
66 
67 #endif // QGSDIRECTIONALLIGHTSETTINGS_H
void setColor(const QColor &color)
Sets color of the light.
float intensity() const
Returns intensity of the light.
QColor color() const
Returns color of the light.
void setDirection(const QgsVector3D &direction)
Sets the direction of the light in degrees.
QgsDirectionalLightSettings()=default
Construct a directional light with default values.
void setIntensity(float intensity)
Sets intensity of the light.
QgsVector3D direction() const
Returns the direction of the light in degrees.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)