te::color::ColorScheme Class Reference

It models the concept of color scheme. More...

#include <ColorScheme.h>

Public Member Functions

Initializer Methods

Methods related to instantiation and destruction.

 ColorScheme (const std::string &name)
 It initializes a new ColorScheme and adds it to the parent group of schemes. More...
 
 ~ColorScheme ()
 Destructor. More...
 
Accessor methods

Methods used to get or set properties.

const std::string & getName () const
 It returns the color schema name. More...
 
void setName (const std::string &name)
 It sets the color schema name and adjust its entry in the scheme group if needed. More...
 
void push_back (std::vector< RGBAColor > *colors)
 It adds a new list of colors to the color scheme. More...
 
const std::vector< std::vector< RGBAColor > *> & getColors () const
 It returns all color lists. More...
 
std::vector< RGBAColor > * getColors (size_t size) const
 It returns a color list having the specified number of elements or NULL if none is found. More...
 
ColorSchemeGroupgetParent () const
 It returns the parent scheme group or NULL if it doesn't belong to a group. More...
 

Private Member Functions

Copy Constructor and Assignment Operator

Copy constructor and assignment operator not allowed.

 ColorScheme (const ColorScheme &rhs)
 Copy constructor not allowed. More...
 
ColorSchemeoperator= (const ColorScheme &rhs)
 Assignment operator not allowed. More...
 
Auxiliary Methods

Auxiliary methods.

void setParent (ColorSchemeGroup *parent)
 It sets the parent color scheme group for this scheme. More...
 

Private Attributes

std::vector< std::vector< RGBAColor > *> m_colorSet
 A set of color list. More...
 
std::string m_name
 Color scheme name. More...
 
ColorSchemeGroupm_parent
 A pointer to the parent group. More...
 

Friends

class ColorSchemeGroup
 

Detailed Description

It models the concept of color scheme.

It is used to construct color scheme catalogs, that helps the user to decide the right colors to use in a map. A color scheme has a name and a set of list colors. Each list can have a certain number of colors.

See also
ColorSchemeGroup, ColorSchemeCatalog, ColorSchemeCatalogManager

Definition at line 58 of file ColorScheme.h.

Constructor & Destructor Documentation

◆ ColorScheme() [1/2]

te::color::ColorScheme::ColorScheme ( const std::string &  name)

It initializes a new ColorScheme and adds it to the parent group of schemes.

Parameters
nameColor schema name.

◆ ~ColorScheme()

te::color::ColorScheme::~ColorScheme ( )

Destructor.

◆ ColorScheme() [2/2]

te::color::ColorScheme::ColorScheme ( const ColorScheme rhs)
private

Copy constructor not allowed.

Parameters
rhsThe right-hand-side copy that would be used to copy from.

Member Function Documentation

◆ getColors() [1/2]

const std::vector<std::vector<RGBAColor>* >& te::color::ColorScheme::getColors ( ) const

It returns all color lists.

Returns
All color lists.

◆ getColors() [2/2]

std::vector<RGBAColor>* te::color::ColorScheme::getColors ( size_t  size) const

It returns a color list having the specified number of elements or NULL if none is found.

This method will look up a list of color in the scheme that has the choosen number of colors. If it can not find one, it will return NULL.

Parameters
sizeThe number of elements needed for the color scheme.
Returns
A color list having the specified number of elements or NULL if none is found.
Note
size must be a value greater than 0.

◆ getName()

const std::string& te::color::ColorScheme::getName ( ) const

It returns the color schema name.

Returns
The color schema name.

◆ getParent()

ColorSchemeGroup* te::color::ColorScheme::getParent ( ) const

It returns the parent scheme group or NULL if it doesn't belong to a group.

Returns
The parent scheme group or NULL if it doesn't belong to a group.

◆ operator=()

ColorScheme& te::color::ColorScheme::operator= ( const ColorScheme rhs)
private

Assignment operator not allowed.

Parameters
rhsThe right-hand-side copy that would be used to copy from.
Returns
A reference to this object.

◆ push_back()

void te::color::ColorScheme::push_back ( std::vector< RGBAColor > *  colors)

It adds a new list of colors to the color scheme.

Parameters
colorsThe new list of colors to be added to the scheme.
Note
The color scheme will take the ownership of the color list.
Don't inform a NULL pointer.

◆ setName()

void te::color::ColorScheme::setName ( const std::string &  name)

It sets the color schema name and adjust its entry in the scheme group if needed.

Parameters
nameThe new color schema name.

◆ setParent()

void te::color::ColorScheme::setParent ( ColorSchemeGroup parent)
private

It sets the parent color scheme group for this scheme.

Parameters
parentThe parent color scheme group.
Note
This method is intended to be used by a ColorSchemeGroup object.

Friends And Related Function Documentation

◆ ColorSchemeGroup

friend class ColorSchemeGroup
friend

Definition at line 186 of file ColorScheme.h.

Member Data Documentation

◆ m_colorSet

std::vector<std::vector<RGBAColor>* > te::color::ColorScheme::m_colorSet
private

A set of color list.

Definition at line 184 of file ColorScheme.h.

◆ m_name

std::string te::color::ColorScheme::m_name
private

Color scheme name.

Definition at line 183 of file ColorScheme.h.

◆ m_parent

ColorSchemeGroup* te::color::ColorScheme::m_parent
private

A pointer to the parent group.

Definition at line 182 of file ColorScheme.h.


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