vtkQtChartColors Class Reference

#include <vtkQtChartColors.h>

List of all members.


Detailed Description

The vtkQtChartColors class stores a list of colors.

Definition at line 36 of file vtkQtChartColors.h.


Public Types

enum  ColorScheme {
  Spectrum = 0, Warm, Cool, Blues,
  WildFlower, Citrus, Custom
}

Public Member Functions

 vtkQtChartColors (ColorScheme scheme=Spectrum)
 Creates a chart colors instance.
 vtkQtChartColors (const vtkQtChartColors &other)
 Makes a copy of another chart colors instance.
 ~vtkQtChartColors ()
vtkQtChartColorsoperator= (const vtkQtChartColors &other)
 Makes a copy of another chart colors instance.
ColorScheme getColorScheme () const
 Gets the current color scheme.
void setColorScheme (ColorScheme scheme)
 Sets the color scheme.
int getNumberOfColors () const
 Gets the number of colors in the color list.
QColor getColor (int index) const
 Gets the color for the given index.
void setColor (int index, const QColor &color)
 Sets the color for the given index.
void clearColors ()
 Clears the list of colors.
void addColor (const QColor &color)
 Adds a color to the list of colors.
void insertColor (int index, const QColor &color)
 Inserts a new color into the list of colors.
void removeColor (int index)
 Removes the color for the given index.

Static Public Member Functions

static QColor lighter (const QColor &color, float factor=0.7)
 Creates a lighter color from the given color.
static QColor interpolateHsv (const QColor &color1, const QColor &color2, float fraction)
 Gets a new color between the given colors in hsv space.
static QColor interpolateRgb (const QColor &color1, const QColor &color2, float fraction)
 Gets a new color between the given colors in rgb space.

Member Enumeration Documentation

Enumerator:
Spectrum  7 different hues.
Warm  6 warm colors (red to yellow).
Cool  7 cool colors (green to purple).
Blues  7 different blues.
WildFlower  7 colors from blue to magenta.
Citrus  6 colors from green to orange.
Custom  User specified color scheme.

Definition at line 39 of file vtkQtChartColors.h.


Constructor & Destructor Documentation

vtkQtChartColors::vtkQtChartColors ( ColorScheme  scheme = Spectrum  ) 

Creates a chart colors instance.

Parameters:
scheme The initial color scheme.

vtkQtChartColors::vtkQtChartColors ( const vtkQtChartColors other  ) 

Makes a copy of another chart colors instance.

Parameters:
other The chart colors to copy.

vtkQtChartColors::~vtkQtChartColors (  ) 


Member Function Documentation

vtkQtChartColors& vtkQtChartColors::operator= ( const vtkQtChartColors other  ) 

Makes a copy of another chart colors instance.

Parameters:
other The chart colors to copy.
Returns:
A reference to the object being assigned.

ColorScheme vtkQtChartColors::getColorScheme (  )  const [inline]

Gets the current color scheme.

Returns:
The current color scheme.

Definition at line 73 of file vtkQtChartColors.h.

void vtkQtChartColors::setColorScheme ( ColorScheme  scheme  ) 

Sets the color scheme.

The color scheme will automatically be changed to Custom if the color list is modified.

Parameters:
scheme The new color scheme.

int vtkQtChartColors::getNumberOfColors (  )  const

Gets the number of colors in the color list.

Returns:
The number of colors in the color list.

QColor vtkQtChartColors::getColor ( int  index  )  const

Gets the color for the given index.

Returns:
The color for the given index.

void vtkQtChartColors::setColor ( int  index,
const QColor &  color 
)

Sets the color for the given index.

This method does nothing if the index is out of range.

Parameters:
index Which color to modify.
color The new color.

void vtkQtChartColors::clearColors (  ) 

Clears the list of colors.

void vtkQtChartColors::addColor ( const QColor &  color  ) 

Adds a color to the list of colors.

Parameters:
color The new color to add.

void vtkQtChartColors::insertColor ( int  index,
const QColor &  color 
)

Inserts a new color into the list of colors.

Parameters:
index Where to insert the new color.
color The new color to insert.

void vtkQtChartColors::removeColor ( int  index  ) 

Removes the color for the given index.

Parameters:
index Which color to remove from the list.

static QColor vtkQtChartColors::lighter ( const QColor &  color,
float  factor = 0.7 
) [static]

Creates a lighter color from the given color.

The QColor::light method does not work for black. This function uses a 3D equation in rgb space to compute the lighter color, which works for all colors including black. the factor determines how light the new color will be. The factor is used to find the point between the current color and white.

Parameters:
color The starting color.
factor A percentage (0.0 to 1.0) of the distance from the given color to white.
Returns:
The new lighter color.

static QColor vtkQtChartColors::interpolateHsv ( const QColor &  color1,
const QColor &  color2,
float  fraction 
) [static]

Gets a new color between the given colors in hsv space.

The interpolation does not wrap around in the hue component.

Parameters:
color1 The first color.
color2 The last color.
fraction The fraction (0.0 to 1.0) of the distance from color1 to color2.
Returns:
The interpolated color.

static QColor vtkQtChartColors::interpolateRgb ( const QColor &  color1,
const QColor &  color2,
float  fraction 
) [static]

Gets a new color between the given colors in rgb space.

Parameters:
color1 The first color.
color2 The last color.
fraction The fraction (0.0 to 1.0) of the distance from color1 to color2.
Returns:
The interpolated color.


The documentation for this class was generated from the following file:

Generated on Mon Sep 27 18:44:08 2010 for VTK by  doxygen 1.5.6