QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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, const QStringList &variantList, const QString &variantName=QString(), bool inverted=false, bool doLoadFile=true)
 Constructor for QgsCptCityColorRamp. More...
 
 QgsCptCityColorRamp (const QString &schemeName=DEFAULT_CPTCITY_SCHEMENAME, const QString &variantName=DEFAULT_CPTCITY_VARIANTNAME, 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 QString typeString ()
 Returns the string identifier for QgsCptCityColorRamp. More...
 
- Static Public Member Functions inherited from QgsGradientColorRamp
static QgsColorRampcreate (const QgsStringMap &properties=QgsStringMap())
 Creates a new QgsColorRamp from a map of properties. More...
 
static QString typeString ()
 Returns the string identifier for QgsGradientColorRamp. More...
 
- Static Public Member Functions inherited from QgsColorRamp
static QList< QPair< QString, QString > > rampTypes ()
 Returns a list of available ramp types, where the first value in each item is the QgsColorRamp::type() string and the second is a user friendly, translated name for the color ramp type. 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 676 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 599 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 612 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 655 of file qgscolorramp.cpp.

◆ cloneGradientRamp()

QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp ( ) const

Definition at line 677 of file qgscolorramp.cpp.

◆ copy()

void QgsCptCityColorRamp::copy ( const QgsCptCityColorRamp other)

Definition at line 662 of file qgscolorramp.cpp.

◆ copyingFileName()

QString QgsCptCityColorRamp::copyingFileName ( ) const

Definition at line 714 of file qgscolorramp.cpp.

◆ copyingInfo()

QgsStringMap QgsCptCityColorRamp::copyingInfo ( ) const

Definition at line 726 of file qgscolorramp.cpp.

◆ create()

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

Definition at line 628 of file qgscolorramp.cpp.

◆ descFileName()

QString QgsCptCityColorRamp::descFileName ( ) const

Definition at line 720 of file qgscolorramp.cpp.

◆ fileLoaded()

bool QgsCptCityColorRamp::fileLoaded ( ) const
inline

Definition at line 739 of file qgscolorramp.h.

◆ fileName()

QString QgsCptCityColorRamp::fileName ( ) const

Definition at line 704 of file qgscolorramp.cpp.

◆ hasMultiStops()

bool QgsCptCityColorRamp::hasMultiStops ( ) const
inline

Definition at line 735 of file qgscolorramp.h.

◆ invert()

void QgsCptCityColorRamp::invert ( )
overridevirtual

Inverts the ordering of the color ramp.

Reimplemented from QgsGradientColorRamp.

Definition at line 649 of file qgscolorramp.cpp.

◆ loadFile()

bool QgsCptCityColorRamp::loadFile ( )

Definition at line 731 of file qgscolorramp.cpp.

◆ loadPalette()

void QgsCptCityColorRamp::loadPalette ( )
inline

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

◆ schemeName()

QString QgsCptCityColorRamp::schemeName ( ) const
inline

Definition at line 723 of file qgscolorramp.h.

◆ setName()

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

Definition at line 731 of file qgscolorramp.h.

◆ setSchemeName()

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

Definition at line 728 of file qgscolorramp.h.

◆ setVariantList()

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

Definition at line 730 of file qgscolorramp.h.

◆ setVariantName()

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

Definition at line 729 of file qgscolorramp.h.

◆ type()

QString QgsCptCityColorRamp::type ( ) const
overridevirtual

Returns a string representing the color ramp type.

Reimplemented from QgsGradientColorRamp.

Definition at line 644 of file qgscolorramp.cpp.

◆ typeString()

static QString QgsCptCityColorRamp::typeString ( )
inlinestatic

Returns the string identifier for QgsCptCityColorRamp.

Since
QGIS 3.16

Definition at line 711 of file qgscolorramp.h.

◆ variantList()

QStringList QgsCptCityColorRamp::variantList ( ) const
inline

Definition at line 725 of file qgscolorramp.h.

◆ variantName()

QString QgsCptCityColorRamp::variantName ( ) const
inline

Definition at line 724 of file qgscolorramp.h.

Member Data Documentation

◆ mFileLoaded

bool QgsCptCityColorRamp::mFileLoaded = false
protected

Definition at line 749 of file qgscolorramp.h.

◆ mInverted

bool QgsCptCityColorRamp::mInverted
protected

Definition at line 751 of file qgscolorramp.h.

◆ mMultiStops

bool QgsCptCityColorRamp::mMultiStops = false
protected

Definition at line 750 of file qgscolorramp.h.

◆ mSchemeName

QString QgsCptCityColorRamp::mSchemeName
protected

Definition at line 746 of file qgscolorramp.h.

◆ mVariantList

QStringList QgsCptCityColorRamp::mVariantList
protected

Definition at line 748 of file qgscolorramp.h.

◆ mVariantName

QString QgsCptCityColorRamp::mVariantName
protected

Definition at line 747 of file qgscolorramp.h.


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