HyperspaceExplorer 0.7.1
|
Abstract interface for all color managers. More...
#include <ColorManager.h>
Public Member Functions | |
ColorManager () | |
Create a ColorManager without a Function. | |
ColorManager (Displayable *) | |
Create a ColorManager for a given Function. | |
virtual void | setFunction (Displayable *) |
Set the function we are managing. | |
Displayable * | getFunction () const |
Access to the managed Function. | |
virtual void | calibrateColor (const VecMath::Vector< 4 > &x, const Color &col=Color())=0 |
Point (x, y, z) has color col. This may serve for interpolation. | |
void | setRGB (const Color &) |
set the current OpenGL color | |
virtual void | setColor (const VecMath::Vector< 4 > &) |
Set current OpenGL color at given point. | |
virtual Color | getColor (const VecMath::Vector< 4 > &x)=0 |
Find the color of a given point. | |
virtual void | depthCueColor (double wmax, double wmin, double w, const VecMath::Vector< 4 > &x)=0 |
post-process color at given point to have 4D depth cue | |
virtual std::string | getContents () |
debugging output | |
Protected Types | |
typedef std::vector< Color > | colorvec1D |
one-dimensional Color array, implemented as a std::vector | |
typedef std::vector< colorvec1D > | colorvec2D |
two-dimensional Color array, implemented as a nested std::vector | |
typedef std::vector< colorvec2D > | colorvec3D |
three-dimensional Color array, implemented as a nested std::vector | |
typedef std::vector< colorvec3D > | colorvec4D |
four-dimensional Color array, implemented as a nested std::vector | |
typedef std::map < VecMath::Vector< 4 >, Color > | colormap |
map of Colors, indexed by 4D points | |
Protected Member Functions | |
double | getoffset4Ddepthcue () |
double | getAlpha () |
Private Attributes | |
Displayable * | f |
Function for which to manage colors. | |
double | ambientColorModifier |
value to multiply a color with to get its ambient value | |
double | specularColorModifier |
value to multiply a color with to get its specular value | |
double | specularColorMinimum |
minimum value for the specular component of any color | |
double | SHININESS |
shininess value | |
double | ALPHA |
alpha value for transparent display | |
double | offset4Ddepthcue |
offset (minimum color) value for 4D depth cue |
Abstract interface for all color managers.
Sets some values common to all color managers, manages the function belonging to every color manager and has some typedefs for arrays of colors.
But above all, defines the interface every color manager must implement.
Implementing classes must register themselves with the ColorManagerManager after their declaration in the header file:
namespace { ColorManager *createXYZ2RGB() { return new xyz2RGBColorManager(); } const bool registeredC0 = ColMgrMgr::Instance().registerColorManager("XYZ to RGB", createXYZ2RGB); }
Of course, the name of the class and the description passed to ColorManagerManager::registerColorManager() must be changed. The name of the variable registeredC0
must be chosen to be unique in the anonymous namespace.
ColorManager::ColorManager | ( | Displayable * | _f | ) |
Create a ColorManager for a given Function.
_f | The Function for which to manage colors |
double ColorManager::getAlpha | ( | ) | [inline, protected] |
References ALPHA.
Referenced by depth2RGBColorManager::computeColorFromW().
virtual Color ColorManager::getColor | ( | const VecMath::Vector< 4 > & | x | ) | [pure virtual] |
Find the color of a given point.
x | four-dimensional coordinate for which the color is sought |
Implemented in xyz2RGBColorManager, Fastxyz2RGBColorManager, depth2RGBColorManager, and monochromeColorManager.
Referenced by setColor().
double ColorManager::getoffset4Ddepthcue | ( | ) | [inline, protected] |
References offset4Ddepthcue.
void ColorManager::setColor | ( | const VecMath::Vector< 4 > & | x | ) | [virtual] |
Set current OpenGL color at given point.
x | four-dimensional coordinate for which the color is sought |
References getColor(), and setRGB().
void ColorManager::setRGB | ( | const Color & | rgb | ) |
set the current OpenGL color
uses HARDCODED simple algorithm to set ambient and specular values for a specific color: if halves resp. dobles them, clipping at 1.0
rgb | color value to be set |
References ambientColorModifier, Color::setComponentLowerLimit(), SHININESS, specularColorMinimum, and specularColorModifier.
Referenced by setColor().