Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Static Protected Member Functions
Xw_ColorMap Class Reference

This class defines a GenericColorMap object.

#include <Xw_ColorMap.hxx>

Inheritance diagram for Xw_ColorMap:
Inheritance graph
[legend]

Public Member Functions

 Xw_ColorMap (const Standard_CString Connexion, const Xw_TypeOfVisual Visual=Xw_TOV_PREFERRED_PSEUDOCOLOR, const Xw_TypeOfMapping Mapping=Xw_TOM_COLORCUBE, const Standard_Integer Ncolors=0, const Standard_Boolean UseDefault=Standard_True)
 Creates a generic ColorMap with a maximum of
unallocated ColorMapEntry.
Sets this colormap with the best colorcube in
the Default HardWare Colormap.

virtual void SetEntry (const Standard_Integer Index, const Standard_Real Red, const Standard_Real Green, const Standard_Real Blue)
 Modifies an entry in the color map <me>.
//! Warning if Index is < 0 or >= MaxColors()
or ColorMap is not defined properly

virtual void SetEntry (const Aspect_ColorMapEntry &Entry)
 Modifies an entry in the color map <me>.
//! Warning if ColorMap size is exceeded.
or ColorMap is not defined properly
or ColorMapEntry Index is out of range according
to the supported hardware,
or the Mapping type of this colormap is READ_ONLY.

virtual void SetEntries (const Handle< Aspect_ColorMap > &Colormap)
 Modifies all Entries from the new colormap
//! Warning if ColorMap size is exceeded.
or ColorMap is not defined properly
or One of the new ColorMapEntry Index is out of range
according to the supported hardware

virtual void SetHighlightColor (const Quantity_Color &aColor)
 Sets the Highlight Color for all Windows
which use it .
Error if Colormap is not defined properly

virtual void Destroy ()
 Destroies the Colormap

 ~Xw_ColorMap ()
virtual Quantity_Color HighlightColor () const
 Returns the highlight color .

virtual Standard_Integer PixelOfColor (const Quantity_Color &aColor) const
 Returns a pixel value of an RGB color given as
Quantity_Color, depending of the HardWare and
Visual class.

virtual Standard_Integer AllocatesPixelOfColor () const
 Returns an allocated pixel of color
writable by using the method SetColorOfPixel(..)
or -1 if no more pixel must be allocated.
Warning: this call take has an effect in PseudoColor model only.

void FreePixelOfColor (const Standard_Integer aPixel) const
 Free an allocated pixel of color
Warning: this call take has an effect in PseudoColor model only.

virtual Standard_Boolean SetColorOfPixel (const Standard_Integer aPixel, const Quantity_Color &aColor) const
 Returns TRUE if the allocated pixel <aPixel>
has been updated correctly with the color <aColor>

virtual Standard_Integer Entry (const Standard_Integer Index, Standard_Real &Red, Standard_Real &Green, Standard_Real &Blue) const
 Returns a pixel value and the components of the
corresponding color index.

virtual Standard_Integer HighlightPixel () const
 Returns the current HighLight pixel value ,
depending of the HardWare and Visual class

Standard_Integer MaxColors () const
 Returns the number of available colors in the colormap.
or 0 if the colormap is not enabled.

Standard_Integer MaxOverlayColors () const
 Returns the number of available colors in the associated
overlay colormap if any.
or 0 if the overlay colormap is not enabled.

Aspect_Handle XColorMap () const
 Returns the Colormap XId of the Colormap
depending of the HardWare and Visual class

Standard_Boolean XColorCube (Aspect_Handle &ColormapID, Standard_Integer &VisualID, Standard_Integer &BasePixel, Standard_Integer &RedMax, Standard_Integer &RedMult, Standard_Integer &GreenMax, Standard_Integer &GreenMult, Standard_Integer &BlueMax, Standard_Integer &BlueMult) const
 Returns TRUE and the color-cube definition of the colormap
depending of the HardWare and Visual class
or returns FALSE if the colormap dont't have a color-cube defined.
Color computation from the colorcube :
colorindex = BasePixel +
r*RedMax*RedMult + g*GreenMax*GreenMult + b*BlueMax*BlueMult
where r,g,b are the red,green,blue components of the color in the
range [0.,1.]

Standard_Boolean XGrayRamp (Aspect_Handle &ColormapID, Standard_Integer &VisualID, Standard_Integer &BasePixel, Standard_Integer &GrayMax, Standard_Integer &GrayMult) const
 Returns TRUE and the gray-ramp definition of the colormap
depending of the HardWare and Visual class
or returns FALSE if the colormap dont't have a gray-ramp defined.
Color computation from the grayramp :
colorindex = BasePixel + g*GrayMax*GrayMult
where g is the gray intensity of the color in the
range [0.,1.]

Aspect_Handle XOverlayColorMap () const
 Returns the Colormap XId of the associated Overlay Colormap
depending of the HardWare and Visual class

Standard_Address XVisual () const
 Returns the Visual address of the Colormap
depending of the HardWare

Standard_Address XOverlayVisual () const
 Returns the Visual address of the associated Overlay Colormap
depending of the HardWare

Xw_TypeOfVisual VisualClass () const
 Returns the Visual Class of the Colormap
depending of the HardWare

Xw_TypeOfVisual OverlayVisualClass () const
 Returns the Visual Class of the associated Overlay Colormap
depending of the HardWare

Standard_Integer VisualID () const
 Returns the Visual ID of the Colormap
depending of the HardWare

Standard_Integer OverlayVisualID () const
 Returns the Visual ID of the associated Overlay Colormap
depending of the HardWare

Protected Member Functions

 Xw_ColorMap ()
Standard_Address ExtendedColorMap () const
 Returns extended data colormap structure pointer.

Standard_Address ExtendedOverlayColorMap () const
 Returns extended data overlay colormap structure pointer.

Static Protected Member Functions

static void PrintError ()
 Print last error or raise depending of the error gravity.


Constructor & Destructor Documentation

Xw_ColorMap::Xw_ColorMap ( ) [protected]

Member Function Documentation

virtual void Xw_ColorMap::Destroy ( ) [virtual]
virtual Standard_Integer Xw_ColorMap::Entry ( const Standard_Integer  Index,
Standard_Real Red,
Standard_Real Green,
Standard_Real Blue 
) const [virtual]
virtual Quantity_Color Xw_ColorMap::HighlightColor ( ) const [virtual]
virtual Standard_Integer Xw_ColorMap::HighlightPixel ( ) const [virtual]
virtual Standard_Integer Xw_ColorMap::PixelOfColor ( const Quantity_Color aColor) const [virtual]
static void Xw_ColorMap::PrintError ( ) [static, protected]
virtual Standard_Boolean Xw_ColorMap::SetColorOfPixel ( const Standard_Integer  aPixel,
const Quantity_Color aColor 
) const [virtual]
virtual void Xw_ColorMap::SetEntries ( const Handle< Aspect_ColorMap > &  Colormap) [virtual]
virtual void Xw_ColorMap::SetEntry ( const Standard_Integer  Index,
const Standard_Real  Red,
const Standard_Real  Green,
const Standard_Real  Blue 
) [virtual]
virtual void Xw_ColorMap::SetEntry ( const Aspect_ColorMapEntry Entry) [virtual]
virtual void Xw_ColorMap::SetHighlightColor ( const Quantity_Color aColor) [virtual]
Standard_Boolean Xw_ColorMap::XColorCube ( Aspect_Handle ColormapID,
Standard_Integer VisualID,
Standard_Integer BasePixel,
Standard_Integer RedMax,
Standard_Integer RedMult,
Standard_Integer GreenMax,
Standard_Integer GreenMult,
Standard_Integer BlueMax,
Standard_Integer BlueMult 
) const
Standard_Boolean Xw_ColorMap::XGrayRamp ( Aspect_Handle ColormapID,
Standard_Integer VisualID,
Standard_Integer BasePixel,
Standard_Integer GrayMax,
Standard_Integer GrayMult 
) const

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