# Visualization
TKService
Aspect

# Aspect_ColorScale Class Reference

`#include <Aspect_ColorScale.hxx>`

Inheritance diagram for Aspect_ColorScale:

[legend]

## Public Member Functions

Standard_EXPORT Standard_Boolean | FindColor (const Standard_Real Value, Quantity_Color &Color) const
| Calculate color according passed value; returns true if value is in range or false, if isn't .
Standard_EXPORT Standard_Real | GetMin () const
| Returns minimal value of color scale; .
Standard_EXPORT Standard_Real | GetMax () const
| Returns maximal value of color scale; .
Standard_EXPORT void | GetRange (Standard_Real &aMin, Standard_Real &aMax) const
| Returns minimal and maximal values of color scale; .
Standard_EXPORT Aspect_TypeOfColorScaleData | GetLabelType () const
| Returns the type of labels; Aspect_TOCSD_AUTO - labels as boundary values for intervals Aspect_TOCSD_USER - user specified label is used .
Standard_EXPORT Aspect_TypeOfColorScaleData | GetColorType () const
| Returns the type of colors; Aspect_TOCSD_AUTO - value between Red and Blue Aspect_TOCSD_USER - user specified color from color map .
Standard_EXPORT Standard_Integer | GetNumberOfIntervals () const
| Returns the number of color scale intervals; .
Standard_EXPORT TCollection_ExtendedString | GetTitle () const
| Returns the color scale title string; .
Standard_EXPORT TCollection_AsciiString | GetFormat () const
| Returns the format for numbers. The same like format for function printf(). Used if GetLabelType() is TOCSD_AUTO; .
Standard_EXPORT TCollection_ExtendedString | GetLabel (const Standard_Integer anIndex) const
| Returns the user specified label with index <anindex>. Returns empty string if label not defined. .
Standard_EXPORT Quantity_Color | GetColor (const Standard_Integer anIndex) const
| Returns the user specified color from color map with index <anindex>. Returns default color if index out of range in color map. .
Standard_EXPORT void | GetLabels (TColStd_SequenceOfExtendedString &aLabels) const
| Returns the user specified labels. .
Standard_EXPORT void | GetColors (Aspect_SequenceOfColor &aColors) const
| Returns the user specified colors. .
Standard_EXPORT Aspect_TypeOfColorScalePosition | GetLabelPosition () const
| Returns the position of labels concerning color filled rectangles. .
Standard_EXPORT Aspect_TypeOfColorScalePosition | GetTitlePosition () const
| Returns the position of color scale title. .
Standard_EXPORT Standard_Boolean | IsReversed () const
| Returns true if the labels and colors used in reversed order. .
Standard_EXPORT Standard_Boolean | IsLabelAtBorder () const
| Returns true if the labels placed at border of color filled rectangles. .
Standard_EXPORT void | SetMin (const Standard_Real aMin)
| Sets the minimal value of color scale. .
Standard_EXPORT void | SetMax (const Standard_Real aMax)
| Sets the maximal value of color scale. .
Standard_EXPORT void | SetRange (const Standard_Real aMin, const Standard_Real aMax)
| Sets the minimal and maximal value of color scale. .
Standard_EXPORT void | SetLabelType (const Aspect_TypeOfColorScaleData aType)
| Sets the type of labels. Aspect_TOCSD_AUTO - labels as boundary values for intervals Aspect_TOCSD_USER - user specified label is used .
Standard_EXPORT void | SetColorType (const Aspect_TypeOfColorScaleData aType)
| Sets the type of colors. Aspect_TOCSD_AUTO - value between Red and Blue Aspect_TOCSD_USER - user specified color from color map .
Standard_EXPORT void | SetNumberOfIntervals (const Standard_Integer aNum)
| Sets the number of color scale intervals. .
Standard_EXPORT void | SetTitle (const TCollection_ExtendedString &aTitle)
| Sets the color scale title string. .
Standard_EXPORT void | SetFormat (const TCollection_AsciiString &aFormat)
| Sets the color scale auto label format specification. .
Standard_EXPORT void | SetLabel (const TCollection_ExtendedString &aLabel, const Standard_Integer anIndex=-1)
| Sets the color scale label at index. Index started from 1. .
Standard_EXPORT void | SetColor (const Quantity_Color &aColor, const Standard_Integer anIndex=-1)
| Sets the color scale color at index. Index started from 1. .
Standard_EXPORT void | SetLabels (const TColStd_SequenceOfExtendedString &aSeq)
| Sets the color scale labels. .
Standard_EXPORT void | SetColors (const Handle(Aspect_ColorMap)&aMap)
| Sets the color scale colors. .
Standard_EXPORT void | SetColors (const Aspect_SequenceOfColor &aSeq)
| Sets the color scale colors. .
Standard_EXPORT void | SetLabelPosition (const Aspect_TypeOfColorScalePosition aPos)
| Sets the color scale labels position concerning color filled rectangles. .
Standard_EXPORT void | SetTitlePosition (const Aspect_TypeOfColorScalePosition aPos)
| Sets the color scale title position. .
Standard_EXPORT void | SetReversed (const Standard_Boolean aReverse)
| Sets true if the labels and colors used in reversed order. .
Standard_EXPORT void | SetLabelAtBorder (const Standard_Boolean anOn)
| Sets true if the labels placed at border of color filled rectangles. .
Standard_EXPORT void | GetSize (Standard_Real &aWidth, Standard_Real &aHeight) const
| Returns the size of color scale. .
Standard_EXPORT Standard_Real | GetWidth () const
| Returns the width of color scale. .
Standard_EXPORT Standard_Real | GetHeight () const
| Returns the height of color scale. .
Standard_EXPORT void | SetSize (const Standard_Real aWidth, const Standard_Real aHeight)
| Sets the size of color scale. .
Standard_EXPORT void | SetWidth (const Standard_Real aWidth)
| Sets the width of color scale. .
Standard_EXPORT void | SetHeight (const Standard_Real aHeight)
| Sets the height of color scale. .
Standard_EXPORT void | GetPosition (Standard_Real &aX, Standard_Real &aY) const
| Returns the position of color scale. .
Standard_EXPORT Standard_Real | GetXPosition () const
| Returns the X position of color scale. .
Standard_EXPORT Standard_Real | GetYPosition () const
| Returns the height of color scale. .
Standard_EXPORT void | SetPosition (const Standard_Real aX, const Standard_Real aY)
| Sets the position of color scale. .
Standard_EXPORT void | SetXPosition (const Standard_Real aX)
| Sets the X position of color scale. .
Standard_EXPORT void | SetYPosition (const Standard_Real aY)
| Sets the Y position of color scale. .
Standard_EXPORT Standard_Integer | GetTextHeight () const
Standard_EXPORT void | SetTextHeight (const Standard_Integer aHeigh)
virtual Standard_EXPORT void | PaintRect (const Standard_Integer X, const Standard_Integer Y, const Standard_Integer W, const Standard_Integer H, const Quantity_Color &aColor, const Standard_Boolean aFilled=Standard_False)=0
virtual Standard_EXPORT void | PaintText (const TCollection_ExtendedString &aText, const Standard_Integer X, const Standard_Integer Y, const Quantity_Color &aColor)=0
virtual Standard_EXPORT Standard_Integer | TextWidth (const TCollection_ExtendedString &aText) const =0
virtual Standard_EXPORT Standard_Integer | TextHeight (const TCollection_ExtendedString &aText) const =0
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Static Public Member Functions

static Standard_EXPORT Standard_Boolean | FindColor (const Standard_Real Value, const Standard_Real Min, const Standard_Real Max, const Standard_Integer ColorsCount, Quantity_Color &Color)

## Protected Member Functions

Standard_EXPORT | Aspect_ColorScale ()
Standard_EXPORT void | SizeHint (Standard_Integer &aWidth, Standard_Integer &aHeight) const
virtual Standard_EXPORT void | UpdateColorScale ()
Standard_EXPORT void | DrawScale (const Quantity_Color &aBgColor, const Standard_Integer X, const Standard_Integer Y, const Standard_Integer W, const Standard_Integer H)
virtual Standard_EXPORT Standard_Boolean | BeginPaint ()
virtual Standard_EXPORT Standard_Boolean | EndPaint ()

## Private Member Functions

Standard_EXPORT TCollection_AsciiString | Format () const
Standard_EXPORT TCollection_ExtendedString | GetCurrentLabel (const Standard_Integer anIndex) const
Standard_EXPORT Quantity_Color | GetCurrentColor (const Standard_Integer anIndex) const
Standard_EXPORT Standard_Real | GetNumber (const Standard_Integer anIndex) const

## Static Private Member Functions

static Standard_EXPORT Standard_Integer | HueFromValue (const Standard_Integer aValue, const Standard_Integer aMin, const Standard_Integer aMax)

## Private Attributes

Standard_Real | myMin
Standard_Real | myMax
TCollection_ExtendedString | myTitle
TCollection_AsciiString | myFormat
Standard_Integer | myInterval
Aspect_TypeOfColorScaleData | myColorType
Aspect_TypeOfColorScaleData | myLabelType
Standard_Boolean | myAtBorder
Standard_Boolean | myReversed
Aspect_SequenceOfColor | myColors
TColStd_SequenceOfExtendedString | myLabels
Aspect_TypeOfColorScalePosition | myLabelPos
Aspect_TypeOfColorScalePosition | myTitlePos
Standard_Real | myXPos
Standard_Real | myYPos
Standard_Real | myWidth
Standard_Real | myHeight
Standard_Integer | myTextHeight

## Constructor & Destructor Documentation

Standard_EXPORT Aspect_ColorScale::Aspect_ColorScale | ( |  | ) | `[protected]`

## Member Function Documentation

virtual Standard_EXPORT Standard_Boolean Aspect_ColorScale::BeginPaint | ( |  | ) | `[protected, virtual]`

Standard_EXPORT void Aspect_ColorScale::DrawScale | ( | const Quantity_Color & | aBgColor,
|  | const Standard_Integer | X,
|  | const Standard_Integer | Y,
|  | const Standard_Integer | W,
|  | const Standard_Integer | H
| ) | `[protected]`

virtual Standard_EXPORT Standard_Boolean Aspect_ColorScale::EndPaint | ( |  | ) | `[protected, virtual]`

static Standard_EXPORT Standard_Boolean Aspect_ColorScale::FindColor | ( | const Standard_Real | Value,
|  | const Standard_Real | Min,
|  | const Standard_Real | Max,
|  | const Standard_Integer | ColorsCount,
|  | Quantity_Color & | Color
| ) | `[static]`

Standard_EXPORT Standard_Boolean Aspect_ColorScale::FindColor | ( | const Standard_Real | Value,
|  | Quantity_Color & | Color
| ) | const

Standard_EXPORT TCollection_AsciiString Aspect_ColorScale::Format | ( |  | ) | const`[private]`

Standard_EXPORT Quantity_Color Aspect_ColorScale::GetColor | ( | const Standard_Integer | anIndex | ) | const

Standard_EXPORT void Aspect_ColorScale::GetColors | ( | Aspect_SequenceOfColor & | aColors | ) | const

Standard_EXPORT Aspect_TypeOfColorScaleData Aspect_ColorScale::GetColorType | ( |  | ) | const

Standard_EXPORT Quantity_Color Aspect_ColorScale::GetCurrentColor | ( | const Standard_Integer | anIndex | ) | const`[private]`

Standard_EXPORT TCollection_ExtendedString Aspect_ColorScale::GetCurrentLabel | ( | const Standard_Integer | anIndex | ) | const`[private]`

Standard_EXPORT TCollection_AsciiString Aspect_ColorScale::GetFormat | ( |  | ) | const

Standard_EXPORT Standard_Real Aspect_ColorScale::GetHeight | ( |  | ) | const

Standard_EXPORT TCollection_ExtendedString Aspect_ColorScale::GetLabel | ( | const Standard_Integer | anIndex | ) | const

Standard_EXPORT Aspect_TypeOfColorScalePosition Aspect_ColorScale::GetLabelPosition | ( |  | ) | const

Standard_EXPORT void Aspect_ColorScale::GetLabels | ( | TColStd_SequenceOfExtendedString & | aLabels | ) | const

Standard_EXPORT Aspect_TypeOfColorScaleData Aspect_ColorScale::GetLabelType | ( |  | ) | const

Standard_EXPORT Standard_Real Aspect_ColorScale::GetMax | ( |  | ) | const

Standard_EXPORT Standard_Real Aspect_ColorScale::GetMin | ( |  | ) | const

Standard_EXPORT Standard_Real Aspect_ColorScale::GetNumber | ( | const Standard_Integer | anIndex | ) | const`[private]`

Standard_EXPORT Standard_Integer Aspect_ColorScale::GetNumberOfIntervals | ( |  | ) | const

Standard_EXPORT void Aspect_ColorScale::GetPosition | ( | Standard_Real & | aX,
|  | Standard_Real & | aY
| ) | const

Standard_EXPORT void Aspect_ColorScale::GetRange | ( | Standard_Real & | aMin,
|  | Standard_Real & | aMax
| ) | const

Standard_EXPORT void Aspect_ColorScale::GetSize | ( | Standard_Real & | aWidth,
|  | Standard_Real & | aHeight
| ) | const

Standard_EXPORT Standard_Integer Aspect_ColorScale::GetTextHeight | ( |  | ) | const

Standard_EXPORT TCollection_ExtendedString Aspect_ColorScale::GetTitle | ( |  | ) | const

Standard_EXPORT Aspect_TypeOfColorScalePosition Aspect_ColorScale::GetTitlePosition | ( |  | ) | const

Standard_EXPORT Standard_Real Aspect_ColorScale::GetWidth | ( |  | ) | const

Standard_EXPORT Standard_Real Aspect_ColorScale::GetXPosition | ( |  | ) | const

Standard_EXPORT Standard_Real Aspect_ColorScale::GetYPosition | ( |  | ) | const

Standard_EXPORT const Aspect_ColorScale::Handle | ( | Standard_Type |  | ) | const

| Reimplemented in V3d_ColorScale.

static Standard_EXPORT Standard_Integer Aspect_ColorScale::HueFromValue | ( | const Standard_Integer | aValue,
|  | const Standard_Integer | aMin,
|  | const Standard_Integer | aMax
| ) | `[static, private]`

Standard_EXPORT Standard_Boolean Aspect_ColorScale::IsLabelAtBorder | ( |  | ) | const

Standard_EXPORT Standard_Boolean Aspect_ColorScale::IsReversed | ( |  | ) | const

virtual Standard_EXPORT void Aspect_ColorScale::PaintRect | ( | const Standard_Integer | X,
|  | const Standard_Integer | Y,
|  | const Standard_Integer | W,
|  | const Standard_Integer | H,
|  | const Quantity_Color & | aColor,
|  | const Standard_Boolean | aFilled = `Standard_False`
| ) | `[pure virtual]`

| Implemented in V3d_ColorScale.

virtual Standard_EXPORT void Aspect_ColorScale::PaintText | ( | const TCollection_ExtendedString & | aText,
|  | const Standard_Integer | X,
|  | const Standard_Integer | Y,
|  | const Quantity_Color & | aColor
| ) | `[pure virtual]`

| Implemented in V3d_ColorScale.

Standard_EXPORT void Aspect_ColorScale::SetColor | ( | const Quantity_Color & | aColor,
|  | const Standard_Integer | anIndex = `-1`
| ) |

Standard_EXPORT void Aspect_ColorScale::SetColors | ( | const Aspect_SequenceOfColor & | aSeq | ) |

Standard_EXPORT void Aspect_ColorScale::SetColors | ( | const Handle(Aspect_ColorMap)& | aMap | ) |

Standard_EXPORT void Aspect_ColorScale::SetColorType | ( | const Aspect_TypeOfColorScaleData | aType | ) |

Standard_EXPORT void Aspect_ColorScale::SetFormat | ( | const TCollection_AsciiString & | aFormat | ) |

Standard_EXPORT void Aspect_ColorScale::SetHeight | ( | const Standard_Real | aHeight | ) |

Standard_EXPORT void Aspect_ColorScale::SetLabel | ( | const TCollection_ExtendedString & | aLabel,
|  | const Standard_Integer | anIndex = `-1`
| ) |

Standard_EXPORT void Aspect_ColorScale::SetLabelAtBorder | ( | const Standard_Boolean | anOn | ) |

Standard_EXPORT void Aspect_ColorScale::SetLabelPosition | ( | const Aspect_TypeOfColorScalePosition | aPos | ) |

Standard_EXPORT void Aspect_ColorScale::SetLabels | ( | const TColStd_SequenceOfExtendedString & | aSeq | ) |

Standard_EXPORT void Aspect_ColorScale::SetLabelType | ( | const Aspect_TypeOfColorScaleData | aType | ) |

Standard_EXPORT void Aspect_ColorScale::SetMax | ( | const Standard_Real | aMax | ) |

Standard_EXPORT void Aspect_ColorScale::SetMin | ( | const Standard_Real | aMin | ) |

Standard_EXPORT void Aspect_ColorScale::SetNumberOfIntervals | ( | const Standard_Integer | aNum | ) |

Standard_EXPORT void Aspect_ColorScale::SetPosition | ( | const Standard_Real | aX,
|  | const Standard_Real | aY
| ) |

Standard_EXPORT void Aspect_ColorScale::SetRange | ( | const Standard_Real | aMin,
|  | const Standard_Real | aMax
| ) |

Standard_EXPORT void Aspect_ColorScale::SetReversed | ( | const Standard_Boolean | aReverse | ) |

Standard_EXPORT void Aspect_ColorScale::SetSize | ( | const Standard_Real | aWidth,
|  | const Standard_Real | aHeight
| ) |

Standard_EXPORT void Aspect_ColorScale::SetTextHeight | ( | const Standard_Integer | aHeigh | ) |

Standard_EXPORT void Aspect_ColorScale::SetTitle | ( | const TCollection_ExtendedString & | aTitle | ) |

Standard_EXPORT void Aspect_ColorScale::SetTitlePosition | ( | const Aspect_TypeOfColorScalePosition | aPos | ) |

Standard_EXPORT void Aspect_ColorScale::SetWidth | ( | const Standard_Real | aWidth | ) |

Standard_EXPORT void Aspect_ColorScale::SetXPosition | ( | const Standard_Real | aX | ) |

Standard_EXPORT void Aspect_ColorScale::SetYPosition | ( | const Standard_Real | aY | ) |

Standard_EXPORT void Aspect_ColorScale::SizeHint | ( | Standard_Integer & | aWidth,
|  | Standard_Integer & | aHeight
| ) | const`[protected]`

virtual Standard_EXPORT Standard_Integer Aspect_ColorScale::TextHeight | ( | const TCollection_ExtendedString & | aText | ) | const`[pure virtual]`

| Implemented in V3d_ColorScale.

virtual Standard_EXPORT Standard_Integer Aspect_ColorScale::TextWidth | ( | const TCollection_ExtendedString & | aText | ) | const`[pure virtual]`

| Implemented in V3d_ColorScale.

virtual Standard_EXPORT void Aspect_ColorScale::UpdateColorScale | ( |  | ) | `[protected, virtual]`

| Reimplemented in V3d_ColorScale.

## Field Documentation

Standard_Boolean Aspect_ColorScale::myAtBorder `[private]`

Aspect_SequenceOfColor Aspect_ColorScale::myColors `[private]`

Aspect_TypeOfColorScaleData Aspect_ColorScale::myColorType `[private]`

TCollection_AsciiString Aspect_ColorScale::myFormat `[private]`

Standard_Real Aspect_ColorScale::myHeight `[private]`

Standard_Integer Aspect_ColorScale::myInterval `[private]`

Aspect_TypeOfColorScalePosition Aspect_ColorScale::myLabelPos `[private]`

TColStd_SequenceOfExtendedString Aspect_ColorScale::myLabels `[private]`

Aspect_TypeOfColorScaleData Aspect_ColorScale::myLabelType `[private]`

Standard_Real Aspect_ColorScale::myMax `[private]`

Standard_Real Aspect_ColorScale::myMin `[private]`

Standard_Boolean Aspect_ColorScale::myReversed `[private]`

Standard_Integer Aspect_ColorScale::myTextHeight `[private]`

TCollection_ExtendedString Aspect_ColorScale::myTitle `[private]`

Aspect_TypeOfColorScalePosition Aspect_ColorScale::myTitlePos `[private]`

Standard_Real Aspect_ColorScale::myWidth `[private]`

Standard_Real Aspect_ColorScale::myXPos `[private]`

Standard_Real Aspect_ColorScale::myYPos `[private]`

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

- Aspect_ColorScale.hxx