bpp-core  2.1.0
bpp::AbstractColorSet Class Reference

Partial implementation of the ColorSet interface. More...

#include <Bpp/Graphics/ColorSet.h>

+ Inheritance diagram for bpp::AbstractColorSet:
+ Collaboration diagram for bpp::AbstractColorSet:

List of all members.

Public Member Functions

 AbstractColorSet ()
virtual ~AbstractColorSet ()
const RGBColorgetColor (const std::string &name) const throw (Exception)
 Get the color object corresponding to a given name.
const RGBColorgetColor (unsigned int index) const throw (IndexOutOfBoundsException)
 Get the ith color object in the set.
std::vector< std::string > getColorNames () const
size_t getNumberOfColors () const

Protected Attributes

std::map< std::string, RGBColorcolors_

Detailed Description

Partial implementation of the ColorSet interface.

Derivative classes just have to fill the colors_ map in the constructor of the class.

Definition at line 98 of file ColorSet.h.


Constructor & Destructor Documentation

Definition at line 105 of file ColorSet.h.

virtual bpp::AbstractColorSet::~AbstractColorSet ( ) [inline, virtual]

Definition at line 106 of file ColorSet.h.


Member Function Documentation

const RGBColor& bpp::AbstractColorSet::getColor ( const std::string &  name) const throw (Exception) [inline, virtual]

Get the color object corresponding to a given name.

Parameters:
nameThe name of the color to look for.
Returns:
The color associated to the given name.
Exceptions:
Exceptionif the name is not assigned to any color.

Implements bpp::ColorSet.

Definition at line 109 of file ColorSet.h.

References colors_.

const RGBColor& bpp::AbstractColorSet::getColor ( unsigned int  index) const throw (IndexOutOfBoundsException) [inline, virtual]

Get the ith color object in the set.

Parameters:
indexThe index of the color to look for.
Returns:
The color associated to the given index.
Exceptions:
IndexOutOfBoundsExceptionif the index is not assigned to any color.

Implements bpp::ColorSet.

Definition at line 116 of file ColorSet.h.

References colors_.

std::vector<std::string> bpp::AbstractColorSet::getColorNames ( ) const [inline, virtual]
Returns:
All valid color names.

Implements bpp::ColorSet.

Definition at line 124 of file ColorSet.h.

References colors_, and bpp::MapTools::getKeys().

size_t bpp::AbstractColorSet::getNumberOfColors ( ) const [inline, virtual]
Returns:
The total number of colors available.

Implements bpp::ColorSet.

Definition at line 126 of file ColorSet.h.

References colors_.


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends