QGIS API Documentation  2.99.0-Master (13a3f2f)
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsCptCityColorRamp Class Reference

#include <qgscolorramp.h>

Inheritance diagram for QgsCptCityColorRamp:
Inheritance graph
[legend]

Public Member Functions

 QgsCptCityColorRamp (const QString &schemeName=DEFAULT_CPTCITY_SCHEMENAME, const QString &variantName=DEFAULT_CPTCITY_VARIANTNAME, bool inverted=false, bool doLoadFile=true)
 Constructor for QgsCptCityColorRamp. More...
 
 QgsCptCityColorRamp (const QString &schemeName, const QStringList &variantList, const QString &variantName=QString(), bool inverted=false, bool doLoadFile=true)
 Constructor for QgsCptCityColorRamp. More...
 
virtual QgsCptCityColorRampclone () const override
 Creates a clone of the color ramp. More...
 
QgsGradientColorRampcloneGradientRamp () const
 
void copy (const QgsCptCityColorRamp *other)
 
QString copyingFileName () const
 
QgsStringMap copyingInfo () const
 
QString descFileName () const
 
bool fileLoaded () const
 
QString fileName () const
 
bool hasMultiStops () const
 
virtual void invert () override
 Inverts the ordering of the color ramp. More...
 
bool loadFile ()
 
void loadPalette ()
 
virtual QgsStringMap properties () const override
 Returns a string map containing all the color ramp's properties. More...
 
QString schemeName () const
 
void setName (const QString &schemeName, const QString &variantName=QString(), const QStringList &variantList=QStringList())
 
void setSchemeName (const QString &schemeName)
 
void setVariantList (const QStringList &variantList)
 
void setVariantName (const QString &variantName)
 
virtual QString type () const override
 Returns a string representing the color ramp type. More...
 
QStringList variantList () const
 
QString variantName () const
 
- Public Member Functions inherited from QgsGradientColorRamp
 QgsGradientColorRamp (const QColor &color1=DEFAULT_GRADIENT_COLOR1, const QColor &color2=DEFAULT_GRADIENT_COLOR2, bool discrete=false, const QgsGradientStopsList &stops=QgsGradientStopsList())
 Constructor for QgsGradientColorRamp. More...
 
void addStopsToGradient (QGradient *gradient, double alpha=1)
 Copy color ramp stops to a QGradient. More...
 
virtual QColor color (double value) const override
 Returns the color corresponding to a specified value. More...
 
QColor color1 () const
 Returns the gradient start color. More...
 
QColor color2 () const
 Returns the gradient end color. More...
 
void convertToDiscrete (bool discrete)
 Converts a gradient with existing color stops to or from discrete interpolation. More...
 
virtual int count () const override
 Returns number of defined colors, or -1 if undefined. More...
 
QgsStringMap info () const
 Returns any additional info attached to the gradient ramp (e.g., authorship notes) More...
 
bool isDiscrete () const
 Returns true if the gradient is using discrete interpolation, rather than smoothly interpolating between colors. More...
 
void setColor1 (const QColor &color)
 Sets the gradient start color. More...
 
void setColor2 (const QColor &color)
 Sets the gradient end color. More...
 
void setDiscrete (bool discrete)
 Sets whether the gradient should use discrete interpolation, rather than smoothly interpolating between colors. More...
 
void setInfo (const QgsStringMap &info)
 Sets additional info to attach to the gradient ramp (e.g., authorship notes) More...
 
void setStops (const QgsGradientStopsList &stops)
 Sets the list of intermediate gradient stops for the ramp. More...
 
QgsGradientStopsList stops () const
 Returns the list of intermediate gradient stops for the ramp. More...
 
virtual double value (int index) const override
 Returns relative value between [0,1] of color at specified index. More...
 
- Public Member Functions inherited from QgsColorRamp
virtual ~QgsColorRamp ()=default
 

Static Public Member Functions

static QgsColorRampcreate (const QgsStringMap &properties=QgsStringMap())
 
- Static Public Member Functions inherited from QgsGradientColorRamp
static QgsColorRampcreate (const QgsStringMap &properties=QgsStringMap())
 Creates a new QgsColorRamp from a map of properties. More...
 

Protected Attributes

bool mFileLoaded
 
bool mInverted
 
bool mMultiStops
 
QString mSchemeName
 
QStringList mVariantList
 
QString mVariantName
 
- Protected Attributes inherited from QgsGradientColorRamp
QColor mColor1
 
QColor mColor2
 
bool mDiscrete
 
QgsStringMap mInfo
 
QgsGradientStopsList mStops
 

Detailed Description

Definition at line 561 of file qgscolorramp.h.

Constructor & Destructor Documentation

◆ QgsCptCityColorRamp() [1/2]

QgsCptCityColorRamp::QgsCptCityColorRamp ( const QString &  schemeName = DEFAULT_CPTCITY_SCHEMENAME,
const QString &  variantName = DEFAULT_CPTCITY_VARIANTNAME,
bool  inverted = false,
bool  doLoadFile = true 
)

Constructor for QgsCptCityColorRamp.

Parameters
schemeNamecpt-city scheme name
variantNamecpt-city variant name
invertedinvert ramp ordering
doLoadFileload cpt-city ramp from file

Definition at line 591 of file qgscolorramp.cpp.

◆ QgsCptCityColorRamp() [2/2]

QgsCptCityColorRamp::QgsCptCityColorRamp ( const QString &  schemeName,
const QStringList &  variantList,
const QString &  variantName = QString(),
bool  inverted = false,
bool  doLoadFile = true 
)

Constructor for QgsCptCityColorRamp.

Parameters
schemeNamecpt-city scheme name
variantListcpt-city variant list
variantNamecpt-city variant name
invertedinvert ramp ordering
doLoadFileload cpt-city ramp from file

Definition at line 607 of file qgscolorramp.cpp.

Member Function Documentation

◆ clone()

QgsCptCityColorRamp * QgsCptCityColorRamp::clone ( ) const
overridevirtual

Creates a clone of the color ramp.

Reimplemented from QgsGradientColorRamp.

Definition at line 647 of file qgscolorramp.cpp.

◆ cloneGradientRamp()

QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp ( ) const

Definition at line 669 of file qgscolorramp.cpp.

◆ copy()

void QgsCptCityColorRamp::copy ( const QgsCptCityColorRamp other)

Definition at line 654 of file qgscolorramp.cpp.

◆ copyingFileName()

QString QgsCptCityColorRamp::copyingFileName ( ) const

Definition at line 706 of file qgscolorramp.cpp.

◆ copyingInfo()

QgsStringMap QgsCptCityColorRamp::copyingInfo ( ) const

Definition at line 718 of file qgscolorramp.cpp.

◆ create()

QgsColorRamp * QgsCptCityColorRamp::create ( const QgsStringMap properties = QgsStringMap())
static

Definition at line 625 of file qgscolorramp.cpp.

◆ descFileName()

QString QgsCptCityColorRamp::descFileName ( ) const

Definition at line 712 of file qgscolorramp.cpp.

◆ fileLoaded()

bool QgsCptCityColorRamp::fileLoaded ( ) const
inline

Definition at line 615 of file qgscolorramp.h.

◆ fileName()

QString QgsCptCityColorRamp::fileName ( ) const

Definition at line 696 of file qgscolorramp.cpp.

◆ hasMultiStops()

bool QgsCptCityColorRamp::hasMultiStops ( ) const
inline

Definition at line 611 of file qgscolorramp.h.

◆ invert()

void QgsCptCityColorRamp::invert ( )
overridevirtual

Inverts the ordering of the color ramp.

Reimplemented from QgsGradientColorRamp.

Definition at line 641 of file qgscolorramp.cpp.

◆ loadFile()

bool QgsCptCityColorRamp::loadFile ( )

Definition at line 723 of file qgscolorramp.cpp.

◆ loadPalette()

void QgsCptCityColorRamp::loadPalette ( )
inline

Definition at line 610 of file qgscolorramp.h.

◆ properties()

QgsStringMap QgsCptCityColorRamp::properties ( ) const
overridevirtual

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

Reimplemented from QgsGradientColorRamp.

Definition at line 685 of file qgscolorramp.cpp.

◆ schemeName()

QString QgsCptCityColorRamp::schemeName ( ) const
inline

Definition at line 599 of file qgscolorramp.h.

◆ setName()

void QgsCptCityColorRamp::setName ( const QString &  schemeName,
const QString &  variantName = QString(),
const QStringList &  variantList = QStringList() 
)
inline

Definition at line 607 of file qgscolorramp.h.

◆ setSchemeName()

void QgsCptCityColorRamp::setSchemeName ( const QString &  schemeName)
inline

Definition at line 604 of file qgscolorramp.h.

◆ setVariantList()

void QgsCptCityColorRamp::setVariantList ( const QStringList &  variantList)
inline

Definition at line 606 of file qgscolorramp.h.

◆ setVariantName()

void QgsCptCityColorRamp::setVariantName ( const QString &  variantName)
inline

Definition at line 605 of file qgscolorramp.h.

◆ type()

virtual QString QgsCptCityColorRamp::type ( ) const
inlineoverridevirtual

Returns a string representing the color ramp type.

Reimplemented from QgsGradientColorRamp.

Definition at line 589 of file qgscolorramp.h.

◆ variantList()

QStringList QgsCptCityColorRamp::variantList ( ) const
inline

Definition at line 601 of file qgscolorramp.h.

◆ variantName()

QString QgsCptCityColorRamp::variantName ( ) const
inline

Definition at line 600 of file qgscolorramp.h.

Member Data Documentation

◆ mFileLoaded

bool QgsCptCityColorRamp::mFileLoaded
protected

Definition at line 625 of file qgscolorramp.h.

◆ mInverted

bool QgsCptCityColorRamp::mInverted
protected

Definition at line 627 of file qgscolorramp.h.

◆ mMultiStops

bool QgsCptCityColorRamp::mMultiStops
protected

Definition at line 626 of file qgscolorramp.h.

◆ mSchemeName

QString QgsCptCityColorRamp::mSchemeName
protected

Definition at line 622 of file qgscolorramp.h.

◆ mVariantList

QStringList QgsCptCityColorRamp::mVariantList
protected

Definition at line 624 of file qgscolorramp.h.

◆ mVariantName

QString QgsCptCityColorRamp::mVariantName
protected

Definition at line 623 of file qgscolorramp.h.


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