|
bpp-core
2.1.0
|
Partial implementation of the ColorSet interface. More...
#include <Bpp/Graphics/ColorSet.h>
Inheritance diagram for bpp::AbstractColorSet:
Collaboration diagram for bpp::AbstractColorSet:Public Member Functions | |
| AbstractColorSet () | |
| virtual | ~AbstractColorSet () |
| const RGBColor & | getColor (const std::string &name) const throw (Exception) |
| Get the color object corresponding to a given name. | |
| const RGBColor & | getColor (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, RGBColor > | colors_ |
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.
| bpp::AbstractColorSet::AbstractColorSet | ( | ) | [inline] |
Definition at line 105 of file ColorSet.h.
| virtual bpp::AbstractColorSet::~AbstractColorSet | ( | ) | [inline, virtual] |
Definition at line 106 of file ColorSet.h.
| const RGBColor& bpp::AbstractColorSet::getColor | ( | const std::string & | name | ) | const throw (Exception) [inline, virtual] |
Get the color object corresponding to a given name.
| name | The name of the color to look for. |
| Exception | if 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.
| index | The index of the color to look for. |
| IndexOutOfBoundsException | if 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] |
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] |
Implements bpp::ColorSet.
Definition at line 126 of file ColorSet.h.
References colors_.
std::map<std::string, RGBColor> bpp::AbstractColorSet::colors_ [protected] |
Definition at line 102 of file ColorSet.h.
Referenced by bpp::DefaultColorSet::DefaultColorSet(), bpp::DvipsColorSet::DvipsColorSet(), getColor(), getColorNames(), getNumberOfColors(), bpp::MolscriptColorSet::MolscriptColorSet(), and bpp::RColorSet::RColorSet().