QGIS API Documentation  2.17.0-Master (872e6d2)
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsVectorRandomColorRampV2 Class Reference

Random color ramp, which returns random colors based on preset parameters. More...

#include <qgsvectorcolorrampv2.h>

Inheritance diagram for QgsVectorRandomColorRampV2:
Inheritance graph
[legend]

Public Member Functions

 QgsVectorRandomColorRampV2 (int count=DEFAULT_RANDOM_COUNT, int hueMin=DEFAULT_RANDOM_HUE_MIN, int hueMax=DEFAULT_RANDOM_HUE_MAX, int satMin=DEFAULT_RANDOM_SAT_MIN, int satMax=DEFAULT_RANDOM_SAT_MAX, int valMin=DEFAULT_RANDOM_VAL_MIN, int valMax=DEFAULT_RANDOM_VAL_MAX)
 
virtual QgsVectorRandomColorRampV2clone () const override
 Creates a clone of the color ramp. More...
 
virtual QColor color (double value) const override
 Returns the color corresponding to a specified value. More...
 
int count () const override
 Returns number of defined colors, or -1 if undefined. More...
 
int hueMax () const
 
int hueMin () const
 
virtual QgsStringMap properties () const override
 Returns a string map containing all the color ramp's properties. More...
 
int satMax () const
 
int satMin () const
 
void setCount (int val)
 
void setHueMax (int val)
 
void setHueMin (int val)
 
void setSatMax (int val)
 
void setSatMin (int val)
 
void setValMax (int val)
 
void setValMin (int val)
 
virtual QString type () const override
 Returns a string representing the color ramp type. More...
 
void updateColors ()
 
int valMax () const
 
int valMin () const
 
virtual double value (int index) const override
 Returns relative value between [0,1] of color at specified index. More...
 
- Public Member Functions inherited from QgsVectorColorRampV2
virtual ~QgsVectorColorRampV2 ()
 

Static Public Member Functions

static QgsVectorColorRampV2create (const QgsStringMap &properties=QgsStringMap())
 
static QList< QColorrandomColors (int count, int hueMax=DEFAULT_RANDOM_HUE_MAX, int hueMin=DEFAULT_RANDOM_HUE_MIN, int satMax=DEFAULT_RANDOM_SAT_MAX, int satMin=DEFAULT_RANDOM_SAT_MIN, int valMax=DEFAULT_RANDOM_VAL_MAX, int valMin=DEFAULT_RANDOM_VAL_MIN)
 Get a list of random colors. More...
 

Protected Attributes

QList< QColormColors
 
int mCount
 
int mHueMax
 
int mHueMin
 
int mSatMax
 
int mSatMin
 
int mValMax
 
int mValMin
 

Detailed Description

Random color ramp, which returns random colors based on preset parameters.

Definition at line 230 of file qgsvectorcolorrampv2.h.

Constructor & Destructor Documentation

QgsVectorRandomColorRampV2::QgsVectorRandomColorRampV2 ( int  count = DEFAULT_RANDOM_COUNT,
int  hueMin = DEFAULT_RANDOM_HUE_MIN,
int  hueMax = DEFAULT_RANDOM_HUE_MAX,
int  satMin = DEFAULT_RANDOM_SAT_MIN,
int  satMax = DEFAULT_RANDOM_SAT_MAX,
int  valMin = DEFAULT_RANDOM_VAL_MIN,
int  valMax = DEFAULT_RANDOM_VAL_MAX 
)

Definition at line 280 of file qgsvectorcolorrampv2.cpp.

Member Function Documentation

QgsVectorRandomColorRampV2 * QgsVectorRandomColorRampV2::clone ( ) const
overridevirtual

Creates a clone of the color ramp.

Implements QgsVectorColorRampV2.

Definition at line 325 of file qgsvectorcolorrampv2.cpp.

QColor QgsVectorRandomColorRampV2::color ( double  value) const
overridevirtual

Returns the color corresponding to a specified value.

Parameters
valuevalue between [0, 1] inclusive
Returns
color for value

Implements QgsVectorColorRampV2.

Definition at line 314 of file qgsvectorcolorrampv2.cpp.

int QgsVectorRandomColorRampV2::count ( ) const
inlineoverridevirtual

Returns number of defined colors, or -1 if undefined.

Implements QgsVectorColorRampV2.

Definition at line 260 of file qgsvectorcolorrampv2.h.

QgsVectorColorRampV2 * QgsVectorRandomColorRampV2::create ( const QgsStringMap properties = QgsStringMap())
static

Definition at line 290 of file qgsvectorcolorrampv2.cpp.

int QgsVectorRandomColorRampV2::hueMax ( ) const
inline

Definition at line 262 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::hueMin ( ) const
inline

Definition at line 261 of file qgsvectorcolorrampv2.h.

QgsStringMap QgsVectorRandomColorRampV2::properties ( ) const
overridevirtual

Returns a string map containing all the color ramp's properties.

Implements QgsVectorColorRampV2.

Definition at line 330 of file qgsvectorcolorrampv2.cpp.

QList< QColor > QgsVectorRandomColorRampV2::randomColors ( int  count,
int  hueMax = DEFAULT_RANDOM_HUE_MAX,
int  hueMin = DEFAULT_RANDOM_HUE_MIN,
int  satMax = DEFAULT_RANDOM_SAT_MAX,
int  satMin = DEFAULT_RANDOM_SAT_MIN,
int  valMax = DEFAULT_RANDOM_VAL_MAX,
int  valMin = DEFAULT_RANDOM_VAL_MIN 
)
static

Get a list of random colors.

Note
added in 2.4

Definition at line 343 of file qgsvectorcolorrampv2.cpp.

int QgsVectorRandomColorRampV2::satMax ( ) const
inline

Definition at line 264 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::satMin ( ) const
inline

Definition at line 263 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::setCount ( int  val)
inline

Definition at line 268 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::setHueMax ( int  val)
inline

Definition at line 270 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::setHueMin ( int  val)
inline

Definition at line 269 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::setSatMax ( int  val)
inline

Definition at line 272 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::setSatMin ( int  val)
inline

Definition at line 271 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::setValMax ( int  val)
inline

Definition at line 274 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::setValMin ( int  val)
inline

Definition at line 273 of file qgsvectorcolorrampv2.h.

virtual QString QgsVectorRandomColorRampV2::type ( ) const
inlineoverridevirtual

Returns a string representing the color ramp type.

Implements QgsVectorColorRampV2.

Definition at line 244 of file qgsvectorcolorrampv2.h.

void QgsVectorRandomColorRampV2::updateColors ( )

Definition at line 376 of file qgsvectorcolorrampv2.cpp.

int QgsVectorRandomColorRampV2::valMax ( ) const
inline

Definition at line 266 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::valMin ( ) const
inline

Definition at line 265 of file qgsvectorcolorrampv2.h.

double QgsVectorRandomColorRampV2::value ( int  index) const
overridevirtual

Returns relative value between [0,1] of color at specified index.

Implements QgsVectorColorRampV2.

Definition at line 308 of file qgsvectorcolorrampv2.cpp.

Member Data Documentation

QList<QColor> QgsVectorRandomColorRampV2::mColors
protected

Definition at line 279 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::mCount
protected

Definition at line 277 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::mHueMax
protected

Definition at line 278 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::mHueMin
protected

Definition at line 278 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::mSatMax
protected

Definition at line 278 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::mSatMin
protected

Definition at line 278 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::mValMax
protected

Definition at line 278 of file qgsvectorcolorrampv2.h.

int QgsVectorRandomColorRampV2::mValMin
protected

Definition at line 278 of file qgsvectorcolorrampv2.h.


The documentation for this class was generated from the following files: