gfx::ColorCycle Class Reference

#include <graphics.hpp>

Inheritance diagram for gfx::ColorCycle:

Inheritance graph
[legend]
List of all members.

Detailed Description

Maps a value from the navigation function into the range [0.

.1] and forwards the choosing of the color to its registered ColorScheme. The mapping is a 'flat-headed' saw-tooth function, where users control the period of the saw-tooth and the width of the flat sections.


Public Member Functions

 ColorCycle (const ColorScheme *scheme, double period, double width)
virtual void Set (double value) const
 Periodically map 'value' to [0.
double ComputeMapping (double value) const

Protected Attributes

const ColorSchemem_scheme
double m_period
double m_width
double m_half_period
double m_scaled_width
double m_scale


Constructor & Destructor Documentation

gfx::ColorCycle::ColorCycle ( const ColorScheme scheme,
double  period,
double  width 
)

Parameters:
period  the cycle repeats with this period (ensured to be >= epsilon)
width  the mapped value stays 0 or 1 within 'width' of N*period ('width' is trunkated to period/3)


Member Function Documentation

void gfx::ColorCycle::Set ( double  value  )  const [virtual]

Periodically map 'value' to [0.

.1] using ComputeMapping() and forward to the registered scheme.

Implements gfx::ColorScheme.

double gfx::ColorCycle::ComputeMapping ( double  value  )  const


Member Data Documentation

const ColorScheme* gfx::ColorCycle::m_scheme [protected]

double gfx::ColorCycle::m_period [protected]

double gfx::ColorCycle::m_width [protected]

double gfx::ColorCycle::m_half_period [protected]

double gfx::ColorCycle::m_scaled_width [protected]

double gfx::ColorCycle::m_scale [protected]


The documentation for this class was generated from the following files:
doxygen SourceForge.net Logo
E* Interpolated Graph Replanner Wed Dec 12 18:55:51 2007