Open CASCADE Technology  6.9.0
Public Member Functions | Static Public Member Functions | Protected Member Functions

Aspect_ColorScale Class Referenceabstract

Defines a color scale for viewer. More...

#include <Aspect_ColorScale.hxx>

Inheritance diagram for Aspect_ColorScale:
Inheritance graph
[legend]

Public Member Functions

Standard_Boolean FindColor (const Standard_Real theValue, Quantity_Color &theColor) const
 Calculate color according passed value; returns true if value is in range or false, if isn't. More...
 
Standard_Real GetMin () const
 Returns minimal value of color scale;. More...
 
Standard_Real GetMax () const
 Returns maximal value of color scale;. More...
 
void GetRange (Standard_Real &theMin, Standard_Real &theMax) const
 Returns minimal and maximal values of color scale;. More...
 
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. More...
 
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. More...
 
Standard_Integer GetNumberOfIntervals () const
 Returns the number of color scale intervals;. More...
 
TCollection_ExtendedString GetTitle () const
 Returns the color scale title string;. More...
 
TCollection_AsciiString GetFormat () const
 Returns the format for numbers. The same like format for function printf(). Used if GetLabelType() is TOCSD_AUTO;. More...
 
TCollection_ExtendedString GetLabel (const Standard_Integer theIndex) const
 Returns the user specified label with index <anIndex>. Returns empty string if label not defined. More...
 
Quantity_Color GetColor (const Standard_Integer theIndex) const
 Returns the user specified color from color map with index <anIndex>. Returns default color if index out of range in color map. More...
 
void GetLabels (TColStd_SequenceOfExtendedString &theLabels) const
 Returns the user specified labels. More...
 
void GetColors (Aspect_SequenceOfColor &theColors) const
 Returns the user specified colors. More...
 
Aspect_TypeOfColorScalePosition GetLabelPosition () const
 Returns the position of labels concerning color filled rectangles. More...
 
Aspect_TypeOfColorScalePosition GetTitlePosition () const
 Returns the position of color scale title. More...
 
Standard_Boolean IsReversed () const
 Returns true if the labels and colors used in reversed order. More...
 
Standard_Boolean IsLabelAtBorder () const
 Returns true if the labels placed at border of color filled rectangles. More...
 
void SetMin (const Standard_Real theMin)
 Sets the minimal value of color scale. More...
 
void SetMax (const Standard_Real theMax)
 Sets the maximal value of color scale. More...
 
void SetRange (const Standard_Real theMin, const Standard_Real theMax)
 Sets the minimal and maximal value of color scale. More...
 
void SetLabelType (const Aspect_TypeOfColorScaleData theType)
 Sets the type of labels. Aspect_TOCSD_AUTO - labels as boundary values for intervals Aspect_TOCSD_USER - user specified label is used. More...
 
void SetColorType (const Aspect_TypeOfColorScaleData theType)
 Sets the type of colors. Aspect_TOCSD_AUTO - value between Red and Blue Aspect_TOCSD_USER - user specified color from color map. More...
 
void SetNumberOfIntervals (const Standard_Integer theNum)
 Sets the number of color scale intervals. More...
 
void SetTitle (const TCollection_ExtendedString &theTitle)
 Sets the color scale title string. More...
 
void SetFormat (const TCollection_AsciiString &theFormat)
 Sets the color scale auto label format specification. More...
 
void SetLabel (const TCollection_ExtendedString &theLabel, const Standard_Integer anIndex=-1)
 Sets the color scale label at index. Index started from 1. More...
 
void SetColor (const Quantity_Color &theColor, const Standard_Integer theIndex=-1)
 Sets the color scale color at index. Index started from 1. More...
 
void SetLabels (const TColStd_SequenceOfExtendedString &theSeq)
 Sets the color scale labels. More...
 
void SetColors (const Aspect_SequenceOfColor &theSeq)
 Sets the color scale colors. More...
 
void SetLabelPosition (const Aspect_TypeOfColorScalePosition thePos)
 Sets the color scale labels position concerning color filled rectangles. More...
 
void SetTitlePosition (const Aspect_TypeOfColorScalePosition thePos)
 Sets the color scale title position. More...
 
void SetReversed (const Standard_Boolean theReverse)
 Sets true if the labels and colors used in reversed order. More...
 
void SetLabelAtBorder (const Standard_Boolean theOn)
 Sets true if the labels placed at border of color filled rectangles. More...
 
void GetSize (Standard_Real &theWidth, Standard_Real &theHeight) const
 Returns the size of color scale. More...
 
Standard_Real GetWidth () const
 Returns the width of color scale. More...
 
Standard_Real GetHeight () const
 Returns the height of color scale. More...
 
void SetSize (const Standard_Real theWidth, const Standard_Real theHeight)
 Sets the size of color scale. More...
 
void SetWidth (const Standard_Real theWidth)
 Sets the width of color scale. More...
 
void SetHeight (const Standard_Real theHeight)
 Sets the height of color scale. More...
 
void GetPosition (Standard_Real &theX, Standard_Real &theY) const
 Returns the position of color scale. More...
 
Standard_Real GetXPosition () const
 Returns the X position of color scale. More...
 
Standard_Real GetYPosition () const
 Returns the height of color scale. More...
 
void SetPosition (const Standard_Real theX, const Standard_Real theY)
 Sets the position of color scale. More...
 
void SetXPosition (const Standard_Real theX)
 Sets the X position of color scale. More...
 
void SetYPosition (const Standard_Real theY)
 Sets the Y position of color scale. More...
 
Standard_Integer GetTextHeight () const
 Returns the height of text of color scale. More...
 
void SetTextHeight (const Standard_Integer theHeight)
 Sets the height of text of color scale. More...
 
virtual void PaintRect (const Standard_Integer theX, const Standard_Integer theY, const Standard_Integer theWidth, const Standard_Integer theHeight, const Quantity_Color &theColor, const Standard_Boolean theFilled=Standard_False)=0
 Draws a rectangle. More...
 
virtual void PaintText (const TCollection_ExtendedString &theText, const Standard_Integer theX, const Standard_Integer theY, const Quantity_Color &theColor)=0
 Draws a text. More...
 
virtual Standard_Integer TextWidth (const TCollection_ExtendedString &theText) const =0
 Returns the width of text. More...
 
virtual Standard_Integer TextHeight (const TCollection_ExtendedString &theText) const =0
 Returns the height of text. More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Member Functions

static Standard_Boolean FindColor (const Standard_Real theValue, const Standard_Real theMin, const Standard_Real theMax, const Standard_Integer theColorsCount, Quantity_Color &theColor)
 

Protected Member Functions

 Aspect_ColorScale ()
 Default constructor. More...
 
void SizeHint (Standard_Integer &theWidth, Standard_Integer &theHeight) const
 Returns the size of color scale. More...
 
virtual void UpdateColorScale ()
 updates color scale parameters. More...
 
void DrawScale (const Quantity_Color &theBgColor, const Standard_Integer theX, const Standard_Integer theY, const Standard_Integer theWidth, const Standard_Integer theHeight)
 Draws color scale. More...
 
virtual Standard_Boolean BeginPaint ()
 
virtual Standard_Boolean EndPaint ()
 

Detailed Description

Defines a color scale for viewer.

Constructor & Destructor Documentation

Aspect_ColorScale::Aspect_ColorScale ( )
protected

Default constructor.

Member Function Documentation

virtual Standard_Boolean Aspect_ColorScale::BeginPaint ( )
protectedvirtual
void Aspect_ColorScale::DrawScale ( const Quantity_Color theBgColor,
const Standard_Integer  theX,
const Standard_Integer  theY,
const Standard_Integer  theWidth,
const Standard_Integer  theHeight 
)
protected

Draws color scale.

Parameters
theBgColor[in] background color
theX[in] the X coordinate of color scale position.
theY[in] the Y coordinate of color scale position.
theWidth[in] the width of color scale.
theHeight[in] the height of color scale.
virtual Standard_Boolean Aspect_ColorScale::EndPaint ( )
protectedvirtual
Standard_Boolean Aspect_ColorScale::FindColor ( const Standard_Real  theValue,
Quantity_Color theColor 
) const

Calculate color according passed value; returns true if value is in range or false, if isn't.

static Standard_Boolean Aspect_ColorScale::FindColor ( const Standard_Real  theValue,
const Standard_Real  theMin,
const Standard_Real  theMax,
const Standard_Integer  theColorsCount,
Quantity_Color theColor 
)
static
Quantity_Color Aspect_ColorScale::GetColor ( const Standard_Integer  theIndex) const

Returns the user specified color from color map with index <anIndex>. Returns default color if index out of range in color map.

void Aspect_ColorScale::GetColors ( Aspect_SequenceOfColor theColors) const

Returns the user specified colors.

Aspect_TypeOfColorScaleData Aspect_ColorScale::GetColorType ( ) const

Returns the type of colors; Aspect_TOCSD_AUTO - value between Red and Blue Aspect_TOCSD_USER - user specified color from color map.

TCollection_AsciiString Aspect_ColorScale::GetFormat ( ) const

Returns the format for numbers. The same like format for function printf(). Used if GetLabelType() is TOCSD_AUTO;.

Standard_Real Aspect_ColorScale::GetHeight ( ) const

Returns the height of color scale.

TCollection_ExtendedString Aspect_ColorScale::GetLabel ( const Standard_Integer  theIndex) const

Returns the user specified label with index <anIndex>. Returns empty string if label not defined.

Aspect_TypeOfColorScalePosition Aspect_ColorScale::GetLabelPosition ( ) const

Returns the position of labels concerning color filled rectangles.

void Aspect_ColorScale::GetLabels ( TColStd_SequenceOfExtendedString theLabels) const

Returns the user specified labels.

Aspect_TypeOfColorScaleData Aspect_ColorScale::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_Real Aspect_ColorScale::GetMax ( ) const

Returns maximal value of color scale;.

Standard_Real Aspect_ColorScale::GetMin ( ) const

Returns minimal value of color scale;.

Standard_Integer Aspect_ColorScale::GetNumberOfIntervals ( ) const

Returns the number of color scale intervals;.

void Aspect_ColorScale::GetPosition ( Standard_Real theX,
Standard_Real theY 
) const

Returns the position of color scale.

void Aspect_ColorScale::GetRange ( Standard_Real theMin,
Standard_Real theMax 
) const

Returns minimal and maximal values of color scale;.

void Aspect_ColorScale::GetSize ( Standard_Real theWidth,
Standard_Real theHeight 
) const

Returns the size of color scale.

Standard_Integer Aspect_ColorScale::GetTextHeight ( ) const

Returns the height of text of color scale.

TCollection_ExtendedString Aspect_ColorScale::GetTitle ( ) const

Returns the color scale title string;.

Aspect_TypeOfColorScalePosition Aspect_ColorScale::GetTitlePosition ( ) const

Returns the position of color scale title.

Standard_Real Aspect_ColorScale::GetWidth ( ) const

Returns the width of color scale.

Standard_Real Aspect_ColorScale::GetXPosition ( ) const

Returns the X position of color scale.

Standard_Real Aspect_ColorScale::GetYPosition ( ) const

Returns the height of color scale.

Standard_Boolean Aspect_ColorScale::IsLabelAtBorder ( ) const

Returns true if the labels placed at border of color filled rectangles.

Standard_Boolean Aspect_ColorScale::IsReversed ( ) const

Returns true if the labels and colors used in reversed order.

virtual void Aspect_ColorScale::PaintRect ( const Standard_Integer  theX,
const Standard_Integer  theY,
const Standard_Integer  theWidth,
const Standard_Integer  theHeight,
const Quantity_Color theColor,
const Standard_Boolean  theFilled = Standard_False 
)
pure virtual

Draws a rectangle.

Parameters
theX[in] the X coordinate of rectangle position.
theY[in] the Y coordinate of rectangle position.
theWidth[in] the width of rectangle.
theHeight[in] the height of rectangle.
theColor[in] the color of rectangle.
theFilled[in] defines if rectangle must be filled.

Implemented in V3d_ColorScale.

virtual void Aspect_ColorScale::PaintText ( const TCollection_ExtendedString theText,
const Standard_Integer  theX,
const Standard_Integer  theY,
const Quantity_Color theColor 
)
pure virtual

Draws a text.

Parameters
theText[in] the text to draw.
theX[in] the X coordinate of text position.
theY[in] the Y coordinate of text position.
theColor[in] the color of text.

Implemented in V3d_ColorScale.

void Aspect_ColorScale::SetColor ( const Quantity_Color theColor,
const Standard_Integer  theIndex = -1 
)

Sets the color scale color at index. Index started from 1.

void Aspect_ColorScale::SetColors ( const Aspect_SequenceOfColor theSeq)

Sets the color scale colors.

void Aspect_ColorScale::SetColorType ( const Aspect_TypeOfColorScaleData  theType)

Sets the type of colors. Aspect_TOCSD_AUTO - value between Red and Blue Aspect_TOCSD_USER - user specified color from color map.

void Aspect_ColorScale::SetFormat ( const TCollection_AsciiString theFormat)

Sets the color scale auto label format specification.

void Aspect_ColorScale::SetHeight ( const Standard_Real  theHeight)

Sets the height of color scale.

void Aspect_ColorScale::SetLabel ( const TCollection_ExtendedString theLabel,
const Standard_Integer  anIndex = -1 
)

Sets the color scale label at index. Index started from 1.

void Aspect_ColorScale::SetLabelAtBorder ( const Standard_Boolean  theOn)

Sets true if the labels placed at border of color filled rectangles.

void Aspect_ColorScale::SetLabelPosition ( const Aspect_TypeOfColorScalePosition  thePos)

Sets the color scale labels position concerning color filled rectangles.

void Aspect_ColorScale::SetLabels ( const TColStd_SequenceOfExtendedString theSeq)

Sets the color scale labels.

void Aspect_ColorScale::SetLabelType ( const Aspect_TypeOfColorScaleData  theType)

Sets the type of labels. Aspect_TOCSD_AUTO - labels as boundary values for intervals Aspect_TOCSD_USER - user specified label is used.

void Aspect_ColorScale::SetMax ( const Standard_Real  theMax)

Sets the maximal value of color scale.

void Aspect_ColorScale::SetMin ( const Standard_Real  theMin)

Sets the minimal value of color scale.

void Aspect_ColorScale::SetNumberOfIntervals ( const Standard_Integer  theNum)

Sets the number of color scale intervals.

void Aspect_ColorScale::SetPosition ( const Standard_Real  theX,
const Standard_Real  theY 
)

Sets the position of color scale.

void Aspect_ColorScale::SetRange ( const Standard_Real  theMin,
const Standard_Real  theMax 
)

Sets the minimal and maximal value of color scale.

void Aspect_ColorScale::SetReversed ( const Standard_Boolean  theReverse)

Sets true if the labels and colors used in reversed order.

void Aspect_ColorScale::SetSize ( const Standard_Real  theWidth,
const Standard_Real  theHeight 
)

Sets the size of color scale.

void Aspect_ColorScale::SetTextHeight ( const Standard_Integer  theHeight)

Sets the height of text of color scale.

void Aspect_ColorScale::SetTitle ( const TCollection_ExtendedString theTitle)

Sets the color scale title string.

void Aspect_ColorScale::SetTitlePosition ( const Aspect_TypeOfColorScalePosition  thePos)

Sets the color scale title position.

void Aspect_ColorScale::SetWidth ( const Standard_Real  theWidth)

Sets the width of color scale.

void Aspect_ColorScale::SetXPosition ( const Standard_Real  theX)

Sets the X position of color scale.

void Aspect_ColorScale::SetYPosition ( const Standard_Real  theY)

Sets the Y position of color scale.

void Aspect_ColorScale::SizeHint ( Standard_Integer theWidth,
Standard_Integer theHeight 
) const
protected

Returns the size of color scale.

Parameters
theWidth[out] the width of color scale.
theHeight[out] the height of color scale.
virtual Standard_Integer Aspect_ColorScale::TextHeight ( const TCollection_ExtendedString theText) const
pure virtual

Returns the height of text.

Parameters
theText[in] the text of which to calculate height.

Implemented in V3d_ColorScale.

virtual Standard_Integer Aspect_ColorScale::TextWidth ( const TCollection_ExtendedString theText) const
pure virtual

Returns the width of text.

Parameters
theText[in] the text of which to calculate width.

Implemented in V3d_ColorScale.

virtual void Aspect_ColorScale::UpdateColorScale ( )
protectedvirtual

updates color scale parameters.

Reimplemented in V3d_ColorScale.


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