QGIS API Documentation  3.6.0-Noosa (5873452)
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...
 
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
 
void invert () override
 Inverts the ordering of the color ramp. More...
 
bool loadFile ()
 
void loadPalette ()
 
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)
 
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 opacity=1)
 Copy color ramp stops to a QGradient. More...
 
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...
 
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...
 
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 = false
 
bool mInverted
 
bool mMultiStops = false
 
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 626 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 588 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 601 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 639 of file qgscolorramp.cpp.

◆ cloneGradientRamp()

QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp ( ) const

Definition at line 661 of file qgscolorramp.cpp.

◆ copy()

void QgsCptCityColorRamp::copy ( const QgsCptCityColorRamp other)

Definition at line 646 of file qgscolorramp.cpp.

◆ copyingFileName()

QString QgsCptCityColorRamp::copyingFileName ( ) const

Definition at line 698 of file qgscolorramp.cpp.

◆ copyingInfo()

QgsStringMap QgsCptCityColorRamp::copyingInfo ( ) const

Definition at line 710 of file qgscolorramp.cpp.

◆ create()

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

Definition at line 617 of file qgscolorramp.cpp.

◆ descFileName()

QString QgsCptCityColorRamp::descFileName ( ) const

Definition at line 704 of file qgscolorramp.cpp.

◆ fileLoaded()

bool QgsCptCityColorRamp::fileLoaded ( ) const
inline

Definition at line 682 of file qgscolorramp.h.

◆ fileName()

QString QgsCptCityColorRamp::fileName ( ) const

Definition at line 688 of file qgscolorramp.cpp.

◆ hasMultiStops()

bool QgsCptCityColorRamp::hasMultiStops ( ) const
inline

Definition at line 678 of file qgscolorramp.h.

◆ invert()

void QgsCptCityColorRamp::invert ( )
overridevirtual

Inverts the ordering of the color ramp.

Reimplemented from QgsGradientColorRamp.

Definition at line 633 of file qgscolorramp.cpp.

◆ loadFile()

bool QgsCptCityColorRamp::loadFile ( )

Definition at line 715 of file qgscolorramp.cpp.

◆ loadPalette()

void QgsCptCityColorRamp::loadPalette ( )
inline

Definition at line 677 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 677 of file qgscolorramp.cpp.

◆ schemeName()

QString QgsCptCityColorRamp::schemeName ( ) const
inline

Definition at line 666 of file qgscolorramp.h.

◆ setName()

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

Definition at line 674 of file qgscolorramp.h.

◆ setSchemeName()

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

Definition at line 671 of file qgscolorramp.h.

◆ setVariantList()

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

Definition at line 673 of file qgscolorramp.h.

◆ setVariantName()

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

Definition at line 672 of file qgscolorramp.h.

◆ type()

QString QgsCptCityColorRamp::type ( ) const
inlineoverridevirtual

Returns a string representing the color ramp type.

Reimplemented from QgsGradientColorRamp.

Definition at line 656 of file qgscolorramp.h.

◆ variantList()

QStringList QgsCptCityColorRamp::variantList ( ) const
inline

Definition at line 668 of file qgscolorramp.h.

◆ variantName()

QString QgsCptCityColorRamp::variantName ( ) const
inline

Definition at line 667 of file qgscolorramp.h.

Member Data Documentation

◆ mFileLoaded

bool QgsCptCityColorRamp::mFileLoaded = false
protected

Definition at line 692 of file qgscolorramp.h.

◆ mInverted

bool QgsCptCityColorRamp::mInverted
protected

Definition at line 694 of file qgscolorramp.h.

◆ mMultiStops

bool QgsCptCityColorRamp::mMultiStops = false
protected

Definition at line 693 of file qgscolorramp.h.

◆ mSchemeName

QString QgsCptCityColorRamp::mSchemeName
protected

Definition at line 689 of file qgscolorramp.h.

◆ mVariantList

QStringList QgsCptCityColorRamp::mVariantList
protected

Definition at line 691 of file qgscolorramp.h.

◆ mVariantName

QString QgsCptCityColorRamp::mVariantName
protected

Definition at line 690 of file qgscolorramp.h.


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