Wt  3.3.9
Public Member Functions | List of all members
Wt::Chart::WAbstractColorMap Class Referenceabstract

Maps numerical values to colors. More...

Inheritance diagram for Wt::Chart::WAbstractColorMap:
Inheritance graph
[legend]

Public Member Functions

 WAbstractColorMap (double min, double max, WObject *parent=0)
 Constructor. More...
 
virtual WColor toColor (double value) const =0
 Converts a numerical value to a WColor.
 
virtual void createStrip (WPainter *painter, const WRectF &area=WRectF()) const =0
 Paints the colormap as a colored strip. More...
 
virtual void paintLegend (WPainter *painter, const WRectF &area=WRectF()) const =0
 Paints the colormap as a legend. More...
 
double minimum () const
 Returns the minimum of the colormap range.
 
double maximum () const
 Returns the maximum of the colormap range.
 
void setTickSpacing (int spacing)
 Sets the tickspacing for the legend as a number of line-heights. More...
 
int tickSpacing () const
 Returns the tickspacing for the legend. More...
 
void setFormatString (const WString &format)
 Sets the format for the labels on the colormap-legend. More...
 
const WStringformatString () const
 Returns the format string. More...
 
void setLabelFont (const WFont &font)
 Sets the font to be used when drawing the labels in the legend. More...
 
const WFontlabelFont ()
 Returns the font to be used when drawing the labels in the legend. More...
 
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 Create a WObject with a given parent object. More...
 
virtual ~WObject ()
 Destructor. More...
 
virtual const std::string id () const
 Returns the (unique) identifier for this object. More...
 
virtual void setObjectName (const std::string &name)
 Sets an object name. More...
 
virtual std::string objectName () const
 Returns the object name. More...
 
void resetLearnedSlots ()
 Resets learned stateless slot implementations. More...
 
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance. More...
 
void isNotStateless ()
 Marks the current function as not stateless. More...
 
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method. More...
 
void addChild (WObject *child)
 Adds a child object. More...
 
virtual void removeChild (WObject *child)
 Removes a child object. More...
 
const std::vector< WObject * > & children () const
 Returns the children.
 
WObjectparent () const
 Returns the parent object.
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation. More...
 
- Static Protected Member Functions inherited from Wt::WObject
static WObjectsender ()
 Returns the sender of the current slot call. More...
 

Detailed Description

Maps numerical values to colors.

The colormap has functionality to convert a numerical value to a WColor. For details on how, see the documentation of the implementations.

A colormap has a certain numerical range. When a colormap is painted as a colored strip or as a legend, this range is what will be presented, even if the colormap has the ability to convert values outside this range.

Constructor & Destructor Documentation

Wt::Chart::WAbstractColorMap::WAbstractColorMap ( double  min,
double  max,
WObject parent = 0 
)

Constructor.

Constructor taking a minimum and maximum value, determining the active range of the colormap. The default value for tickSpacing is 2 and the default label format is 2 decimal points.

Member Function Documentation

virtual void Wt::Chart::WAbstractColorMap::createStrip ( WPainter painter,
const WRectF area = WRectF() 
) const
pure virtual

Paints the colormap as a colored strip.

This paints the colormap from the minimum to the maximum value in the provided area (default = fill the entire paintdevice). This is no legend with ticks and labels, only the colors are painted.

See also
paintLegend()

Implemented in Wt::Chart::WStandardColorMap.

const WString& Wt::Chart::WAbstractColorMap::formatString ( ) const

Returns the format string.

See also
setFormatString()
const WFont& Wt::Chart::WAbstractColorMap::labelFont ( )

Returns the font to be used when drawing the labels in the legend.

See also
setLabelFont
virtual void Wt::Chart::WAbstractColorMap::paintLegend ( WPainter painter,
const WRectF area = WRectF() 
) const
pure virtual

Paints the colormap as a legend.

The colormap is painted as a legend with ticks and value-labels. The parameter area can be used to specify a part of the paintdevice where the legend should be drawn. When drawing the legend, the tickspacing, labelformat and labelfont are taken into account.

See also
setTickSpacing(), setFormatString(), setLabelFont()

Implemented in Wt::Chart::WStandardColorMap.

void Wt::Chart::WAbstractColorMap::setFormatString ( const WString format)

Sets the format for the labels on the colormap-legend.

The format string is interpreted by snprintf(). The default is a float with two decimal places.

See also
paintLegend()
void Wt::Chart::WAbstractColorMap::setLabelFont ( const WFont font)

Sets the font to be used when drawing the labels in the legend.

The default is a default constructed WFont.

See also
paintLegend()
void Wt::Chart::WAbstractColorMap::setTickSpacing ( int  spacing)

Sets the tickspacing for the legend as a number of line-heights.

The tickspacing must be specified as an integer number of line-heigths. For example, the default value of 2 will leave two line-heights between the labels of the ticks.

See also
paintLegend()
int Wt::Chart::WAbstractColorMap::tickSpacing ( ) const

Returns the tickspacing for the legend.

See also
setTickSpacing()

Generated on Tue Nov 21 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11