marble
#include <GeoDataColorStyle.h>
Public Types | |
enum | ColorMode { Normal, Random } |
Public Member Functions | |
GeoDataColorStyle () | |
GeoDataColorStyle (const GeoDataColorStyle &other) | |
virtual | ~GeoDataColorStyle () |
QColor | color () const |
ColorMode | colorMode () const |
virtual const char * | nodeType () const |
bool | operator!= (const GeoDataColorStyle &other) const |
GeoDataColorStyle & | operator= (const GeoDataColorStyle &other) |
bool | operator== (const GeoDataColorStyle &other) const |
virtual void | pack (QDataStream &stream) const |
QColor | paintedColor () const |
void | setColor (const QColor &value) |
void | setColorMode (const ColorMode &colorMode) |
virtual void | unpack (QDataStream &stream) |
Public Member Functions inherited from Marble::GeoDataObject | |
GeoDataObject () | |
GeoDataObject (const GeoDataObject &) | |
virtual | ~GeoDataObject () |
QString | id () const |
GeoDataObject & | operator= (const GeoDataObject &) |
virtual GeoDataObject * | parent () const |
QString | resolvePath (const QString &relativePath) const |
void | setId (const QString &value) |
virtual void | setParent (GeoDataObject *parent) |
void | setTargetId (const QString &value) |
QString | targetId () const |
Public Member Functions inherited from Marble::GeoNode | |
GeoNode () | |
virtual | ~GeoNode () |
Public Member Functions inherited from Marble::Serializable | |
virtual | ~Serializable () |
Additional Inherited Members | |
Protected Member Functions inherited from Marble::GeoDataObject | |
virtual bool | equals (const GeoDataObject &other) const |
Detailed Description
an abstract base class for various style classes
A GeoDataColorStyle is an abstract class that is the base class for a number of different style classes. It provides settings for specifying the color and color mode of the extended style classes. A GeoDataColorStyle should never be instantiated directly.
The color contains RGBA, (Red, Green, Blue, Alpha). Color and opacity (alpha) values have a range of 0 to 255 (00 to ff). For alpha, 00 is fully transparent and ff is fully opaque. For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: 7fff0000, where alpha=0x7f, blue=0xff, green=0x00, and red=0x00.
The color mode can either be normal (no effect) or random. A value of random applies a random linear scale to the base color as follows.
To achieve a truly random selection of colors, specify a base color of white (ffffffff). If you specify a single color component (for example, a value of ff0000ff for red), random color values for that one component (red) will be selected. In this case, the values would range from 00 (black) to ff (full red). If you specify values for two or for all three color components, a random linear scale is applied to each color component, with results ranging from black to the maximum values specified for each component. The opacity of a color comes from the alpha component of color and is never randomized.
Definition at line 64 of file GeoDataColorStyle.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
Marble::GeoDataColorStyle::GeoDataColorStyle | ( | ) |
Definition at line 45 of file GeoDataColorStyle.cpp.
Marble::GeoDataColorStyle::GeoDataColorStyle | ( | const GeoDataColorStyle & | other | ) |
Definition at line 50 of file GeoDataColorStyle.cpp.
|
virtual |
Definition at line 56 of file GeoDataColorStyle.cpp.
Member Function Documentation
QColor Marble::GeoDataColorStyle::color | ( | ) | const |
Return the color component.
Definition at line 98 of file GeoDataColorStyle.cpp.
GeoDataColorStyle::ColorMode Marble::GeoDataColorStyle::colorMode | ( | ) | const |
Return the color mode.
Definition at line 113 of file GeoDataColorStyle.cpp.
|
virtual |
Provides type information for downcasting a GeoData.
Implements Marble::GeoDataObject.
Reimplemented in Marble::GeoDataLabelStyle, Marble::GeoDataLineStyle, Marble::GeoDataPolyStyle, Marble::GeoDataIconStyle, and Marble::GeoDataBalloonStyle.
Definition at line 79 of file GeoDataColorStyle.cpp.
bool Marble::GeoDataColorStyle::operator!= | ( | const GeoDataColorStyle & | other | ) | const |
Definition at line 74 of file GeoDataColorStyle.cpp.
GeoDataColorStyle & Marble::GeoDataColorStyle::operator= | ( | const GeoDataColorStyle & | other | ) |
assignment operator
- Parameters
-
other the other colorstyle
Definition at line 61 of file GeoDataColorStyle.cpp.
bool Marble::GeoDataColorStyle::operator== | ( | const GeoDataColorStyle & | other | ) | const |
Definition at line 68 of file GeoDataColorStyle.cpp.
|
virtual |
Serialize the style to a stream.
- Parameters
-
stream the stream
Reimplemented from Marble::GeoDataObject.
Reimplemented in Marble::GeoDataLineStyle, Marble::GeoDataLabelStyle, Marble::GeoDataPolyStyle, Marble::GeoDataIconStyle, and Marble::GeoDataBalloonStyle.
Definition at line 118 of file GeoDataColorStyle.cpp.
QColor Marble::GeoDataColorStyle::paintedColor | ( | ) | const |
Returns the color that should be painted: Either color() or a randomized version of it, depending on the colorMode() setting.
Randomization happens once per setColor() call, i.e. repeated calls to paintedColor always return the same color unless setColor is called in between.
Definition at line 103 of file GeoDataColorStyle.cpp.
void Marble::GeoDataColorStyle::setColor | ( | const QColor & | value | ) |
Set a new color.
- Parameters
-
value the new color value
Definition at line 84 of file GeoDataColorStyle.cpp.
void Marble::GeoDataColorStyle::setColorMode | ( | const ColorMode & | colorMode | ) |
Set a new color mode.
- Parameters
-
colorMode the new color mode value
Definition at line 108 of file GeoDataColorStyle.cpp.
|
virtual |
Unserialize the style from a stream.
- Parameters
-
stream the stream
Reimplemented from Marble::GeoDataObject.
Reimplemented in Marble::GeoDataLineStyle, Marble::GeoDataLabelStyle, Marble::GeoDataPolyStyle, Marble::GeoDataIconStyle, and Marble::GeoDataBalloonStyle.
Definition at line 127 of file GeoDataColorStyle.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.