QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsCptCityColorRamp Class Reference

A color ramp from the CPT City collection. More...

#include <qgscolorrampimpl.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.
 
 QgsCptCityColorRamp (const QString &schemeName=DEFAULT_CPTCITY_SCHEMENAME, const QString &variantName=DEFAULT_CPTCITY_VARIANTNAME, bool inverted=false, bool doLoadFile=true)
 Constructor for QgsCptCityColorRamp.
 
QgsCptCityColorRampclone () const override
 Creates a clone of the color ramp.
 
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.
 
bool loadFile ()
 
void loadPalette ()
 
QVariantMap properties () const override
 Returns a string map containing all the color ramp's properties.
 
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.
 
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.
 
void addStopsToGradient (QGradient *gradient, double opacity=1) const
 Copy color ramp stops to a QGradient.
 
QgsGradientColorRampclone () const override
 Creates a clone of the color ramp.
 
QColor color (double value) const override
 Returns the color corresponding to a specified value.
 
QColor color1 () const
 Returns the gradient start color.
 
QColor color2 () const
 Returns the gradient end color.
 
QColor::Spec colorSpec () const
 Returns the color specification in which the color component interpolation will occur.
 
void convertToDiscrete (bool discrete)
 Converts a gradient with existing color stops to or from discrete interpolation.
 
int count () const override
 Returns number of defined colors, or -1 if undefined.
 
Qgis::AngularDirection direction () const
 Returns the direction to traverse the color wheel using when interpolating hue-based color specifications.
 
QgsStringMap info () const
 Returns any additional info attached to the gradient ramp (e.g., authorship notes)
 
void invert () override
 Inverts the ordering of the color ramp.
 
bool isDiscrete () const
 Returns true if the gradient is using discrete interpolation, rather than smoothly interpolating between colors.
 
QVariantMap properties () const override
 Returns a string map containing all the color ramp's properties.
 
void setColor1 (const QColor &color)
 Sets the gradient start color.
 
void setColor2 (const QColor &color)
 Sets the gradient end color.
 
void setColorSpec (QColor::Spec spec)
 Sets the color specification in which the color component interpolation will occur.
 
void setDirection (Qgis::AngularDirection direction)
 Sets the direction to traverse the color wheel using when interpolating hue-based color specifications.
 
void setDiscrete (bool discrete)
 Sets whether the gradient should use discrete interpolation, rather than smoothly interpolating between colors.
 
void setInfo (const QgsStringMap &info)
 Sets additional info to attach to the gradient ramp (e.g., authorship notes)
 
void setStops (const QgsGradientStopsList &stops)
 Sets the list of intermediate gradient stops for the ramp.
 
QgsGradientStopsList stops () const
 Returns the list of intermediate gradient stops for the ramp.
 
QString type () const override
 Returns a string representing the color ramp type.
 
double value (int index) const override
 Returns relative value between [0,1] of color at specified index.
 
- Public Member Functions inherited from QgsColorRamp
virtual ~QgsColorRamp ()
 

Static Public Member Functions

static QgsColorRampcreate (const QVariantMap &properties=QVariantMap())
 Creates the symbol layer.
 
static QString fileNameForVariant (const QString &schema, const QString &variant)
 Returns the source file name for a CPT schema and variant.
 
static QString typeString ()
 Returns the string identifier for QgsCptCityColorRamp.
 
- Static Public Member Functions inherited from QgsGradientColorRamp
static QgsColorRampcreate (const QVariantMap &properties=QVariantMap())
 Creates a new QgsColorRamp from a map of properties.
 
static QString typeString ()
 Returns the string identifier for QgsGradientColorRamp.
 
- 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.
 

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
 
QColor::Spec mColorSpec = QColor::Spec::Rgb
 
Qgis::AngularDirection mDirection = Qgis::AngularDirection::CounterClockwise
 
bool mDiscrete
 
InterpolateColorFunc mFunc = nullptr
 
QgsStringMap mInfo
 
QgsGradientStopsList mStops
 

Detailed Description

A color ramp from the CPT City collection.

Definition at line 704 of file qgscolorrampimpl.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 947 of file qgscolorrampimpl.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 960 of file qgscolorrampimpl.cpp.

Member Function Documentation

◆ clone()

QgsCptCityColorRamp * QgsCptCityColorRamp::clone ( ) const
overridevirtual

Creates a clone of the color ramp.

Implements QgsColorRamp.

Definition at line 1003 of file qgscolorrampimpl.cpp.

◆ cloneGradientRamp()

QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp ( ) const

Definition at line 1025 of file qgscolorrampimpl.cpp.

◆ copy()

void QgsCptCityColorRamp::copy ( const QgsCptCityColorRamp other)

Definition at line 1010 of file qgscolorrampimpl.cpp.

◆ copyingFileName()

QString QgsCptCityColorRamp::copyingFileName ( ) const

Definition at line 1066 of file qgscolorrampimpl.cpp.

◆ copyingInfo()

QgsStringMap QgsCptCityColorRamp::copyingInfo ( ) const

Definition at line 1078 of file qgscolorrampimpl.cpp.

◆ create()

QgsColorRamp * QgsCptCityColorRamp::create ( const QVariantMap &  properties = QVariantMap())
static

Creates the symbol layer.

Definition at line 976 of file qgscolorrampimpl.cpp.

◆ descFileName()

QString QgsCptCityColorRamp::descFileName ( ) const

Definition at line 1072 of file qgscolorrampimpl.cpp.

◆ fileLoaded()

bool QgsCptCityColorRamp::fileLoaded ( ) const
inline

Definition at line 776 of file qgscolorrampimpl.h.

◆ fileName()

QString QgsCptCityColorRamp::fileName ( ) const

Definition at line 1056 of file qgscolorrampimpl.cpp.

◆ fileNameForVariant()

QString QgsCptCityColorRamp::fileNameForVariant ( const QString &  schema,
const QString &  variant 
)
static

Returns the source file name for a CPT schema and variant.

Note
Not available in Python bindings
Since
QGIS 3.28

Definition at line 1051 of file qgscolorrampimpl.cpp.

◆ hasMultiStops()

bool QgsCptCityColorRamp::hasMultiStops ( ) const
inline

Definition at line 764 of file qgscolorrampimpl.h.

◆ invert()

void QgsCptCityColorRamp::invert ( )
overridevirtual

Inverts the ordering of the color ramp.

Reimplemented from QgsColorRamp.

Definition at line 997 of file qgscolorrampimpl.cpp.

◆ loadFile()

bool QgsCptCityColorRamp::loadFile ( )

Definition at line 1083 of file qgscolorrampimpl.cpp.

◆ loadPalette()

void QgsCptCityColorRamp::loadPalette ( )
inline

Definition at line 763 of file qgscolorrampimpl.h.

◆ properties()

QVariantMap QgsCptCityColorRamp::properties ( ) const
overridevirtual

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

Implements QgsColorRamp.

Definition at line 1041 of file qgscolorrampimpl.cpp.

◆ schemeName()

QString QgsCptCityColorRamp::schemeName ( ) const
inline

Definition at line 752 of file qgscolorrampimpl.h.

◆ setName()

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

Definition at line 760 of file qgscolorrampimpl.h.

◆ setSchemeName()

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

Definition at line 757 of file qgscolorrampimpl.h.

◆ setVariantList()

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

Definition at line 759 of file qgscolorrampimpl.h.

◆ setVariantName()

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

Definition at line 758 of file qgscolorrampimpl.h.

◆ type()

QString QgsCptCityColorRamp::type ( ) const
overridevirtual

Returns a string representing the color ramp type.

Implements QgsColorRamp.

Definition at line 992 of file qgscolorrampimpl.cpp.

◆ typeString()

static QString QgsCptCityColorRamp::typeString ( )
inlinestatic

Returns the string identifier for QgsCptCityColorRamp.

Since
QGIS 3.16

Definition at line 740 of file qgscolorrampimpl.h.

◆ variantList()

QStringList QgsCptCityColorRamp::variantList ( ) const
inline

Definition at line 754 of file qgscolorrampimpl.h.

◆ variantName()

QString QgsCptCityColorRamp::variantName ( ) const
inline

Definition at line 753 of file qgscolorrampimpl.h.

Member Data Documentation

◆ mFileLoaded

bool QgsCptCityColorRamp::mFileLoaded = false
protected

Definition at line 786 of file qgscolorrampimpl.h.

◆ mInverted

bool QgsCptCityColorRamp::mInverted
protected

Definition at line 788 of file qgscolorrampimpl.h.

◆ mMultiStops

bool QgsCptCityColorRamp::mMultiStops = false
protected

Definition at line 787 of file qgscolorrampimpl.h.

◆ mSchemeName

QString QgsCptCityColorRamp::mSchemeName
protected

Definition at line 783 of file qgscolorrampimpl.h.

◆ mVariantList

QStringList QgsCptCityColorRamp::mVariantList
protected

Definition at line 785 of file qgscolorrampimpl.h.

◆ mVariantName

QString QgsCptCityColorRamp::mVariantName
protected

Definition at line 784 of file qgscolorrampimpl.h.


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