QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgscolorramptexture.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscolorramptexture.h
3  -------------------------
4  begin : january 2020
5  copyright : (C) 2020 by Vincent Cloarec
6  email : vcloarec at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSCOLORRAMPTEXTURE_H
19 #define QGSCOLORRAMPTEXTURE_H
20 
22 
23 #include <Qt3DRender/QEffect>
24 #include <Qt3DRender/QGraphicsApiFilter>
25 #include <Qt3DRender/QParameter>
26 #include <Qt3DRender/QTexture>
27 
28 #include <QUrl>
29 #include <QVector2D>
30 #include <QVector3D>
31 #include <QVector4D>
32 #include <Qt3DRender/QBuffer>
33 #include <QByteArray>
34 
35 #include "qgsmeshlayer.h"
36 #include "qgsmeshlayerutils.h"
37 #include "qgstriangularmesh.h"
38 
39 #define SIP_NO_FILE
40 
41 class QgsColorRampTextureGenerator: public Qt3DRender::QTextureImageDataGenerator
42 {
43 
44  public:
45  QgsColorRampTextureGenerator( const QgsColorRampShader &colorRampShader, double verticalScale = 1 );
46 
47  public:
48  Qt3DRender::QTextureImageDataPtr operator()() override;
49 
50  bool operator ==( const Qt3DRender::QTextureImageDataGenerator &other ) const override;
51 
52  // marked as deprecated in 5.15, but undeprecated for Qt 6.0. TODO -- remove when we require 6.0
54  QT3D_FUNCTOR( QgsColorRampTextureGenerator )
56 
57  private:
58  QgsColorRampShader mColorRampShader;
59  double mVerticalScale = 1;
60 };
61 
62 
63 class QgsColorRampTexture: public Qt3DRender::QAbstractTextureImage
64 {
65  Q_OBJECT
66 
67  public:
68  QgsColorRampTexture( const QgsColorRampShader &colorRampShader, double verticalScale = 1, Qt3DCore::QNode *parent = nullptr );
69  // QAbstractTextureImage interface
70  protected:
71  Qt3DRender::QTextureImageDataGeneratorPtr dataGenerator() const override;
72 
73  private:
74  QgsColorRampShader mColorRampShader;
75  double mVerticalScale = 1;
76 };
77 
79 
80 #endif // QGSCOLORRAMPTEXTURE_H
qgsmeshlayerutils.h
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:425
QgsColorRampShader
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Definition: qgscolorrampshader.h:42
qgstriangularmesh.h
Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_POP
Definition: qgis.h:2820
qgsmeshlayer.h
Q_NOWARN_DEPRECATED_PUSH
#define Q_NOWARN_DEPRECATED_PUSH
Definition: qgis.h:2819