cee::vis::OverlayColorLegendContinuousDomain Class Reference

The OverlayColorLegendContinuousDomain is capable of visualizing all scalar mappers that derives from the ScalarMapperContinuousDomain. More...

Public Member Functions

 OverlayColorLegendContinuousDomain (Font *font)
 Creates an overlay legend object. More...
 
void setupFromScalarMapper (const ScalarMapperContinuousDomain *scalarMapper)
 Sets up the color legend from the scalar mapper. More...
 
void setupNiceNumbersTickMarks (unsigned int maxNumTickMarks, const ScalarMapperContinuousDomain *scalarMapper)
 Setup tickmarks on the color legend using round and human readable values. More...
 
void setupNiceNumbersTickMarksLogarithmic (unsigned int maxNumTickMarks, const ScalarMapperContinuousDomain *scalarMapper)
 Setup tickmarks on the color legend using round and human readable values. More...
 
void setTickValues (const std::vector< double > &tickValues, const ScalarMapperContinuousDomain *scalarMapper)
 Sets the tick values to show on the color legend. More...
 
virtual unsigned int width () const
 Returns the total width of the overlay item. More...
 
virtual unsigned int height () const
 Returns the total height of the overlay item. More...
 
void setSize (unsigned int width, unsigned int height)
 Sets the size of the legend, in pixels. More...
 
void setWidthToFitText ()
 Sets the width of the legend to fit the current text. More...
 
virtual int priority () const
 Returns the render priority of the item. More...
 
virtual void setPriority (int priority)
 Sets render priority of the item. More...
 
FonttitleFont ()
 Returns the font used for showing the title of the legend. More...
 
void setTitleFont (Font *font)
 Sets the font to use for the title of the legend. More...
 
FonttickMarkFont ()
 Returns the font used to show the tick marks of the legend. More...
 
void setTickMarkFont (Font *font)
 Sets the font to use for the tickmark labels. More...
 
unsigned int legendBarWidth () const
 Returns the width of the legend bar in pixels. More...
 
void setLegendBarWidth (unsigned int widthInPixels)
 Sets the width of the legend bar in pixels. More...
 
Str title () const
 Returns the title of the legend. More...
 
void setTitle (const Str &title)
 Sets the title of the legend. More...
 
Color3f textColor () const
 Returns the text color. More...
 
void setTextColor (const Color3f &color)
 Sets the text color for the category labels. Also sets the border color for the category bar. More...
 
char numericFormat () const
 Returns the numeric format used for this legend. More...
 
void setNumericFormat (char format)
 Sets the numeric format used for this legend. More...
 
int numericPrecision () const
 Returns the numeric precision used for this legend. More...
 
void setNumericPrecision (int precision)
 Sets the numeric precision used for this legend. More...
 
void setShowTickMarkLabels (bool show)
 Specifies if the tick mark labels (usually the number values) should be shown together with the tick mark lines. More...
 
bool showTickMarkLabels () const
 Returns true if the tick mark labels will be shown. More...
 
void setForceUniformTickMarkSpacing (bool forceUniformSpacing)
 Returns true if the legend should be drawn with a uniform spacing between the tick values (not taking the actual value into account). More...
 
bool forceUniformTickMarkSpacing () const
 Returns true if the legend is drawn with a uniform spacing between tick values. More...
 
void setTickMarksThroughLegendBar (bool drawOverLegendBar)
 Sets tick marks to be shown through the legend bar. More...
 
bool tickMarksThroughLegendBar () const
 Returns true if tick marks are shown through the legend bar. More...
 
void setCustomLabels (const std::vector< Str > &labels, const std::vector< double > &relativePositions)
 Sets custom labels that will be drawn at the given relative position on the color legend. More...
 
void clearCustomLabels ()
 Clears the custom labels. More...
 
- Public Member Functions inherited from cee::vis::OverlayItem
bool visible () const
 Returns true if the overlay item is set to be visible. More...
 
void setVisible (bool visible)
 Sets if the overlay item should be visible or not. More...
 
int absolutePositionX () const
 Returns the x coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION. More...
 
int absolutePositionY () const
 Returns the y coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION. More...
 
void setAbsolutePosition (int x, int y)
 Sets the absolute position of the bottom left corner of the OverlayItem as an offset from the LayoutCorner of the item. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 

Additional Inherited Members

- Public Types inherited from cee::vis::OverlayItem
enum  LayoutCorner {
  TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT,
  CENTER, TOP_CENTER, BOTTOM_CENTER
}
 Enumerator for the different locations/"corners" of the view. More...
 
enum  LayoutDirection { HORIZONTAL, VERTICAL, ABSOLUTE_POSITION }
 Enumerator for horizontal or vertical orientation of layout items. Describes which direction additional items should be positioned if more than one exists in the same corner. More...
 
Inheritance diagram for cee::vis::OverlayColorLegendContinuousDomain:
cee::vis::OverlayItem cee::RefCountedObject

Detailed Description

The OverlayColorLegendContinuousDomain is capable of visualizing all scalar mappers that derives from the ScalarMapperContinuousDomain.

The following scalar mappers can be used:

The color legend is configured from the scalar mapper with the setupFromScalarMapper() method. After doing that the apperance of the color legend can be configured with the settings in the class, e.g. set a title, custom tick marks, number formatting and custom labels.

See tutorial Geometry: Create a geometry model with texture for an example of the use of OverlayColorLegendContinuousDomain.

Below is an example of each of the scalar mappers:

See also
OverlayItem
ScalarMapperFilledContoursUniform
ScalarMapperFilledContours
ScalarMapperContinuous
ScalarMapperContinuousPiecewise
View

Constructor & Destructor Documentation

cee::vis::OverlayColorLegendContinuousDomain::OverlayColorLegendContinuousDomain ( Font font)

Creates an overlay legend object.

Member Function Documentation

void cee::vis::OverlayColorLegendContinuousDomain::clearCustomLabels ( )

Clears the custom labels.

See also
setCustomLabels
bool cee::vis::OverlayColorLegendContinuousDomain::forceUniformTickMarkSpacing ( ) const

Returns true if the legend is drawn with a uniform spacing between tick values.

unsigned int cee::vis::OverlayColorLegendContinuousDomain::height ( ) const
virtual

Returns the total height of the overlay item.

Implements cee::vis::OverlayItem.

unsigned int cee::vis::OverlayColorLegendContinuousDomain::legendBarWidth ( ) const

Returns the width of the legend bar in pixels.

char cee::vis::OverlayColorLegendContinuousDomain::numericFormat ( ) const

Returns the numeric format used for this legend.

int cee::vis::OverlayColorLegendContinuousDomain::numericPrecision ( ) const

Returns the numeric precision used for this legend.

int cee::vis::OverlayColorLegendContinuousDomain::priority ( ) const
virtual

Returns the render priority of the item.

Implements cee::vis::OverlayItem.

void cee::vis::OverlayColorLegendContinuousDomain::setCustomLabels ( const std::vector< Str > &  labels,
const std::vector< double > &  relativePositions 
)

Sets custom labels that will be drawn at the given relative position on the color legend.

This could be used to render a description for the given color (for filled contour type legends) and may be used in combination with setShowTickmarkLabels(false) to create a more category type legend.

void cee::vis::OverlayColorLegendContinuousDomain::setForceUniformTickMarkSpacing ( bool  forceUniformSpacing)

Returns true if the legend should be drawn with a uniform spacing between the tick values (not taking the actual value into account).

The color legend bar will be modified accordingly so the tick values indicate the right color.

void cee::vis::OverlayColorLegendContinuousDomain::setLegendBarWidth ( unsigned int  widthInPixels)

Sets the width of the legend bar in pixels.

void cee::vis::OverlayColorLegendContinuousDomain::setNumericFormat ( char  format)

Sets the numeric format used for this legend.

void cee::vis::OverlayColorLegendContinuousDomain::setNumericPrecision ( int  precision)

Sets the numeric precision used for this legend.

void cee::vis::OverlayColorLegendContinuousDomain::setPriority ( int  priority)
virtual

Sets render priority of the item.

The render priority determines the order in which item get rendered. Items with lower priorities get rendered first. The default priority is 10.

Implements cee::vis::OverlayItem.

void cee::vis::OverlayColorLegendContinuousDomain::setShowTickMarkLabels ( bool  show)

Specifies if the tick mark labels (usually the number values) should be shown together with the tick mark lines.

void cee::vis::OverlayColorLegendContinuousDomain::setSize ( unsigned int  width,
unsigned int  height 
)
virtual

Sets the size of the legend, in pixels.

Implements cee::vis::OverlayItem.

void cee::vis::OverlayColorLegendContinuousDomain::setTextColor ( const Color3f color)

Sets the text color for the category labels. Also sets the border color for the category bar.

void cee::vis::OverlayColorLegendContinuousDomain::setTickMarkFont ( Font font)

Sets the font to use for the tickmark labels.

void cee::vis::OverlayColorLegendContinuousDomain::setTickMarksThroughLegendBar ( bool  drawOverLegendBar)

Sets tick marks to be shown through the legend bar.

void cee::vis::OverlayColorLegendContinuousDomain::setTickValues ( const std::vector< double > &  tickValues,
const ScalarMapperContinuousDomain scalarMapper 
)

Sets the tick values to show on the color legend.

void cee::vis::OverlayColorLegendContinuousDomain::setTitle ( const Str title)

Sets the title of the legend.

Multiple lines can be specified by using the '
' separator

void cee::vis::OverlayColorLegendContinuousDomain::setTitleFont ( Font font)

Sets the font to use for the title of the legend.

void cee::vis::OverlayColorLegendContinuousDomain::setupFromScalarMapper ( const ScalarMapperContinuousDomain scalarMapper)

Sets up the color legend from the scalar mapper.

This will configure the color legend so that the legend will reflect the given scalar mapper If the mapper returns tick values (with the tickValuesHint() method) the tick values will also be configured (as is the case for Filled Contours style mappers). If not, only the min and max value will be added as tick marks. In this case, use the setupNiceNumbersTickmarks() or setupNiceNumbersTickmarksLogarithmic() methods to create appropriate tickmarks.

void cee::vis::OverlayColorLegendContinuousDomain::setupNiceNumbersTickMarks ( unsigned int  maxNumTickmarks,
const ScalarMapperContinuousDomain scalarMapper 
)

Setup tickmarks on the color legend using round and human readable values.

This method assumes a linear scalar mapper.

void cee::vis::OverlayColorLegendContinuousDomain::setupNiceNumbersTickMarksLogarithmic ( unsigned int  maxNumTickmarks,
const ScalarMapperContinuousDomain scalarMapper 
)

Setup tickmarks on the color legend using round and human readable values.

This method assumes a logarithmic scalar mapper.

void cee::vis::OverlayColorLegendContinuousDomain::setWidthToFitText ( )

Sets the width of the legend to fit the current text.

bool cee::vis::OverlayColorLegendContinuousDomain::showTickMarkLabels ( ) const

Returns true if the tick mark labels will be shown.

cee::Color3f cee::vis::OverlayColorLegendContinuousDomain::textColor ( ) const

Returns the text color.

Font * cee::vis::OverlayColorLegendContinuousDomain::tickMarkFont ( )

Returns the font used to show the tick marks of the legend.

bool cee::vis::OverlayColorLegendContinuousDomain::tickMarksThroughLegendBar ( ) const

Returns true if tick marks are shown through the legend bar.

cee::Str cee::vis::OverlayColorLegendContinuousDomain::title ( ) const

Returns the title of the legend.

Font * cee::vis::OverlayColorLegendContinuousDomain::titleFont ( )

Returns the font used for showing the title of the legend.

unsigned int cee::vis::OverlayColorLegendContinuousDomain::width ( ) const
virtual

Returns the total width of the overlay item.

Implements cee::vis::OverlayItem.