1
+
1
2
/** \ingroup core
2
- * \class QgsVectorColorRamp
3
+ * \class QgsColorRamp
3
4
* \brief Abstract base class for color ramps
4
5
*/
5
- //TODO QGIS 3.0 - rename to QgsColorRamp, since this is used by much more than just vectors
6
- class QgsVectorColorRamp
6
+ class QgsColorRamp
7
7
{
8
8
%TypeHeaderCode
9
- #include <qgsvectorcolorramp .h>
9
+ #include <qgscolorramp .h>
10
10
%End
11
11
12
12
%ConvertToSubClassCode
13
13
if (sipCpp->type() == "gradient")
14
- sipType = sipType_QgsVectorGradientColorRamp ;
14
+ sipType = sipType_QgsGradientColorRamp ;
15
15
else if (sipCpp->type() == "random")
16
- sipType = sipType_QgsVectorRandomColorRamp ;
16
+ sipType = sipType_QgsLimitedRandomColorRamp ;
17
17
else if (sipCpp->type() == "randomcolors")
18
- sipType = sipType_QgsRandomColors ;
18
+ sipType = sipType_QgsRandomColorRamp ;
19
19
else if (sipCpp->type() == "colorbrewer")
20
- sipType = sipType_QgsVectorColorBrewerColorRamp ;
20
+ sipType = sipType_QgsColorBrewerColorRamp ;
21
21
else if (sipCpp->type() == "cpt-city")
22
22
sipType = sipType_QgsCptCityColorRamp;
23
23
else
@@ -26,7 +26,7 @@ class QgsVectorColorRamp
26
26
27
27
public:
28
28
29
- virtual ~QgsVectorColorRamp ();
29
+ virtual ~QgsColorRamp ();
30
30
31
31
/** Returns number of defined colors, or -1 if undefined
32
32
*/
@@ -48,7 +48,7 @@ class QgsVectorColorRamp
48
48
49
49
/** Creates a clone of the color ramp.
50
50
*/
51
- virtual QgsVectorColorRamp * clone() const = 0 /Factory/;
51
+ virtual QgsColorRamp * clone() const = 0 /Factory/;
52
52
53
53
/** Returns a string map containing all the color ramp's properties.
54
54
*/
@@ -58,20 +58,20 @@ class QgsVectorColorRamp
58
58
59
59
/** \ingroup core
60
60
* \class QgsGradientStop
61
- * \brief Represents a color stop within a gradient color ramp.
61
+ * \brief Represents a color stop within a QgsGradientColorRamp color ramp.
62
62
*/
63
63
class QgsGradientStop
64
64
{
65
65
%TypeHeaderCode
66
- #include <qgsvectorcolorramp .h>
66
+ #include <qgscolorramp .h>
67
67
%End
68
68
public:
69
69
70
70
/** Constructor for QgsGradientStop
71
- * @param o positional offset for stop, between 0 and 1.0
72
- * @param c color for stop
71
+ * @param offset positional offset for stop, between 0 and 1.0
72
+ * @param color color for stop
73
73
*/
74
- QgsGradientStop( double o , const QColor& c );
74
+ QgsGradientStop( double offset , const QColor& color );
75
75
76
76
//! Relative positional offset, between 0 and 1
77
77
double offset;
@@ -86,38 +86,37 @@ class QgsGradientStop
86
86
typedef QList<QgsGradientStop> QgsGradientStopsList;
87
87
88
88
/** \ingroup core
89
- * \class QgsVectorGradientColorRamp
89
+ * \class QgsGradientColorRamp
90
90
* \brief Gradient color ramp, which smoothly interpolates between two colors and also
91
91
* supports optional extra color stops.
92
92
*/
93
- //TODO QGIS 3.0 - rename to QgsGradientColorRamp, since this is used by much more than just vectors
94
- class QgsVectorGradientColorRamp : QgsVectorColorRamp
93
+ class QgsGradientColorRamp : QgsColorRamp
95
94
{
96
95
%TypeHeaderCode
97
- #include <qgsvectorcolorramp .h>
96
+ #include <qgscolorramp .h>
98
97
%End
99
98
public:
100
99
101
- /** Constructor for QgsVectorGradientColorRamp
100
+ /** Constructor for QgsGradientColorRamp
102
101
* @param color1 start color, corresponding to a position of 0.0
103
102
* @param color2 end color, corresponding to a position of 1.0
104
103
* @param discrete set to true for discrete interpolation instead of smoothly
105
104
* interpolating between colors
106
105
* @param stops optional list of additional color stops
107
106
*/
108
- QgsVectorGradientColorRamp ( const QColor& color1 = DEFAULT_GRADIENT_COLOR1,
107
+ QgsGradientColorRamp ( const QColor& color1 = DEFAULT_GRADIENT_COLOR1,
109
108
const QColor& color2 = QColor(0,255,0),
110
109
bool discrete = false,
111
110
const QgsGradientStopsList& stops = QgsGradientStopsList() );
112
111
113
112
//! Creates a new QgsVectorColorRamp from a map of properties
114
- static QgsVectorColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
113
+ static QgsColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
115
114
116
115
virtual int count() const;
117
116
virtual double value( int index ) const;
118
117
virtual QColor color( double value ) const;
119
118
virtual QString type() const;
120
- virtual QgsVectorGradientColorRamp * clone() const /Factory/;
119
+ virtual QgsGradientColorRamp * clone() const /Factory/;
121
120
virtual QgsStringMap properties() const;
122
121
123
122
/** Returns the gradient start color.
@@ -200,30 +199,29 @@ class QgsVectorGradientColorRamp : QgsVectorColorRamp
200
199
};
201
200
202
201
/** \ingroup core
203
- * \class QgsVectorRandomColorRamp
204
- * \brief Random color ramp, which returns random colors based on preset parameters.
202
+ * \class QgsLimitedRandomColorRamp
203
+ * \brief Constrained random color ramp, which returns random colors based on preset parameters.
205
204
*/
206
- //TODO QGIS 3.0 - rename to QgsRandomColorRamp, since this is used by much more than just vectors
207
- class QgsVectorRandomColorRamp : QgsVectorColorRamp
205
+ class QgsLimitedRandomColorRamp : QgsColorRamp
208
206
{
209
207
%TypeHeaderCode
210
- #include <qgsvectorcolorramp .h>
208
+ #include <qgscolorramp .h>
211
209
%End
212
210
public:
213
- QgsVectorRandomColorRamp ( int count = DEFAULT_RANDOM_COUNT,
211
+ QgsLimitedRandomColorRamp ( int count = DEFAULT_RANDOM_COUNT,
214
212
int hueMin = DEFAULT_RANDOM_HUE_MIN, int hueMax = DEFAULT_RANDOM_HUE_MAX,
215
213
int satMin = DEFAULT_RANDOM_SAT_MIN, int satMax = DEFAULT_RANDOM_SAT_MAX,
216
214
int valMin = DEFAULT_RANDOM_VAL_MIN, int valMax = DEFAULT_RANDOM_VAL_MAX );
217
215
218
- static QgsVectorColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
216
+ static QgsColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
219
217
220
218
virtual double value( int index ) const;
221
219
222
220
virtual QColor color( double value ) const;
223
221
224
222
virtual QString type() const;
225
223
226
- virtual QgsVectorRandomColorRamp * clone() const /Factory/;
224
+ virtual QgsLimitedRandomColorRamp * clone() const /Factory/;
227
225
228
226
virtual QgsStringMap properties() const;
229
227
@@ -254,11 +252,17 @@ class QgsVectorRandomColorRamp : QgsVectorColorRamp
254
252
void setValMax( int val );
255
253
};
256
254
257
- class QgsRandomColors : QgsVectorColorRamp
255
+ /** \ingroup core
256
+ * \class QgsRandomColorRamp
257
+ */
258
+ class QgsRandomColorRamp : QgsColorRamp
258
259
{
260
+ %TypeHeaderCode
261
+ #include <qgscolorramp.h>
262
+ %End
259
263
public:
260
- QgsRandomColors ();
261
- ~QgsRandomColors ();
264
+ QgsRandomColorRamp ();
265
+ ~QgsRandomColorRamp ();
262
266
263
267
int count() const;
264
268
@@ -276,29 +280,32 @@ class QgsRandomColors : QgsVectorColorRamp
276
280
277
281
QString type() const;
278
282
279
- virtual QgsRandomColors * clone() const /Factory/;
283
+ virtual QgsRandomColorRamp * clone() const /Factory/;
280
284
281
285
QgsStringMap properties() const;
282
286
};
283
287
284
- class QgsVectorColorBrewerColorRamp : QgsVectorColorRamp
288
+ /** \ingroup core
289
+ * \class QgsColorBrewerColorRamp
290
+ */
291
+ class QgsColorBrewerColorRamp : QgsColorRamp
285
292
{
286
293
%TypeHeaderCode
287
- #include <qgsvectorcolorramp .h>
294
+ #include <qgscolorramp .h>
288
295
%End
289
296
public:
290
- QgsVectorColorBrewerColorRamp ( const QString& schemeName = DEFAULT_COLORBREWER_SCHEMENAME,
297
+ QgsColorBrewerColorRamp ( const QString& schemeName = DEFAULT_COLORBREWER_SCHEMENAME,
291
298
int colors = DEFAULT_COLORBREWER_COLORS );
292
299
293
- static QgsVectorColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
300
+ static QgsColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
294
301
295
302
virtual double value( int index ) const;
296
303
297
304
virtual QColor color( double value ) const;
298
305
299
306
virtual QString type() const;
300
307
301
- virtual QgsVectorColorBrewerColorRamp * clone() const /Factory/;
308
+ virtual QgsColorBrewerColorRamp * clone() const /Factory/;
302
309
303
310
virtual QgsStringMap properties() const;
304
311
@@ -318,10 +325,13 @@ class QgsVectorColorBrewerColorRamp : QgsVectorColorRamp
318
325
};
319
326
320
327
321
- class QgsCptCityColorRamp : QgsVectorGradientColorRamp
328
+ /** \ingroup core
329
+ * \class QgsCptCityColorRamp
330
+ */
331
+ class QgsCptCityColorRamp : QgsGradientColorRamp
322
332
{
323
333
%TypeHeaderCode
324
- #include <qgsvectorcolorramp .h>
334
+ #include <qgscolorramp .h>
325
335
%End
326
336
public:
327
337
QgsCptCityColorRamp( const QString& schemeName = DEFAULT_CPTCITY_SCHEMENAME,
@@ -330,13 +340,13 @@ class QgsCptCityColorRamp : QgsVectorGradientColorRamp
330
340
QgsCptCityColorRamp( const QString& schemeName, const QStringList& variantList,
331
341
const QString& variantName = QString(), bool doLoadFile = true );
332
342
333
- static QgsVectorColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
343
+ static QgsColorRamp * create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
334
344
335
345
virtual QString type() const;
336
346
337
347
virtual QgsCptCityColorRamp* clone() const /Factory/;
338
348
void copy( const QgsCptCityColorRamp* other );
339
- QgsVectorGradientColorRamp * cloneGradientRamp() const /Factory/;
349
+ QgsGradientColorRamp * cloneGradientRamp() const /Factory/;
340
350
341
351
virtual QgsStringMap properties() const;
342
352
0 commit comments