HyperspaceExplorer 0.7.1
Public Member Functions | Protected Types | Protected Member Functions | Private Attributes
ColorManager Class Reference

Abstract interface for all color managers. More...

#include <ColorManager.h>

Inheritance diagram for ColorManager:
Inheritance graph
[legend]
Collaboration diagram for ColorManager:
Collaboration graph
[legend]

List of all members.

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.
DisplayablegetFunction () 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< Colorcolorvec1D
 one-dimensional Color array, implemented as a std::vector
typedef std::vector< colorvec1Dcolorvec2D
 two-dimensional Color array, implemented as a nested std::vector
typedef std::vector< colorvec2Dcolorvec3D
 three-dimensional Color array, implemented as a nested std::vector
typedef std::vector< colorvec3Dcolorvec4D
 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

Displayablef
 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

Detailed Description

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.


Constructor & Destructor Documentation

ColorManager::ColorManager ( Displayable _f)

Create a ColorManager for a given Function.

Parameters:
_fThe Function for which to manage colors

Member Function Documentation

double ColorManager::getAlpha ( ) [inline, protected]
Returns:
alpha value for transparent display

References ALPHA.

Referenced by depth2RGBColorManager::computeColorFromW().

Here is the caller graph for this function:

virtual Color ColorManager::getColor ( const VecMath::Vector< 4 > &  x) [pure virtual]

Find the color of a given point.

Parameters:
xfour-dimensional coordinate for which the color is sought

Implemented in xyz2RGBColorManager, Fastxyz2RGBColorManager, depth2RGBColorManager, and monochromeColorManager.

Referenced by setColor().

Here is the caller graph for this function:

double ColorManager::getoffset4Ddepthcue ( ) [inline, protected]
Returns:
Offset (minimum color) value for 4D depth cue

References offset4Ddepthcue.

void ColorManager::setColor ( const VecMath::Vector< 4 > &  x) [virtual]

Set current OpenGL color at given point.

Parameters:
xfour-dimensional coordinate for which the color is sought

References getColor(), and setRGB().

Here is the call graph for this function:

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

Todo:
make the agorithm which computes the ambient and specular values variable
Parameters:
rgbcolor value to be set

References ambientColorModifier, Color::setComponentLowerLimit(), SHININESS, specularColorMinimum, and specularColorModifier.

Referenced by setColor().

Here is the call graph for this function:

Here is the caller graph for this function:


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

Generated on Mon Apr 9 2012 20:25:17 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo