# Visualization
TKService
Xw

# Xw_GraphicDevice Class Reference

This class defines an X11 Graphic Device
Warning: An Graphic Device is defined by :
- a connection "host:server.screen"
- a colormap mapping of type Xw_TOM_xxxxx
- a "UseDefault" flag which permits the use of the
DefaultColormap if possible.
The connection can be specified directly
or extracted from an existing Window.
All Xw_Windows may share the same Graphic Device if
you don't want to have any side effects on the stations
which have only one hardware pseudo-colormap .
Four kind of mapping are possible :
1) Xw_TOM_SIMPLERAMP
Allocates the number of required colors in the
colormap.
The number of user colors depends directly on
the hardware colormap size if UseDefault is False,
or on the remainding free colors in the hardware colormap
if UseDefault is True.
2) Xw_TOM_BESTRAMP
Allocates the number of required colors in the
colormap but leaves the Odd color indexes free
if possible for highlight color management.
(plane 0 is reserved for this usage)
The number of user colors depends directly on
the hardware colormap size if UseDefault is False,
or on the remainding free colors in the hardware colormap
if UseDefault is True.
3) Xw_TOM_COLORCUBE (the default)
Allocates the maximum available colors in the colormap
and builds a colorcube at this place.
Any user color will be approximate and will be chosen as
the nearest of the set of available colorcube colors.
In this case the number of user colors can be unlimited.
4) Xw_TOM_HARDWARE
May do serious damage to the color system.
Must be used for maintenance only.
5) Xw_TOM_READONLY
Allocates the number of required read only colors in the
default colormap.
The number of user colors depends directly on
the hardware colormap size.
.

`#include <Xw_GraphicDevice.hxx>`

Inheritance diagram for Xw_GraphicDevice:

[legend]

## Public Member Functions

Standard_EXPORT | Xw_GraphicDevice (const Standard_CString Connection, const Xw_TypeOfMapping Mapping=Xw_TOM_COLORCUBE, const Standard_Integer Ncolors=0, const Standard_Boolean UseDefault=Standard_True)
| Create an Graphic Device on the specified Connection by using ALL screen defaults if possible (i.e:Default Colormap) Warning: Raises if the Device is Badly defined .
virtual Standard_EXPORT void | Destroy ()
| Destroies all ressources attached to the GraphicDevice (Windows, Colormaps, ....) Warning: Raises if the Device is Badly defined .
| ~Xw_GraphicDevice ()
Standard_EXPORT Handle_Xw_ColorMap | ColorMap2D () const
| Returns the 2D oriented Device color map. .
Standard_EXPORT Xw_TypeOfVisual | VisualClass2D () const
| Returns the 2D oriented Visual Class. .
Standard_EXPORT Xw_TypeOfVisual | OverlayVisualClass2D () const
| Returns the 2D oriented overlay Visual Class. .
Standard_EXPORT Handle_Xw_ColorMap | ColorMap3D () const
| Returns the 3D oriented Device color map. .
Standard_EXPORT Xw_TypeOfVisual | VisualClass3D () const
| Returns the 3D oriented Visual Class. .
Standard_EXPORT Xw_TypeOfVisual | OverlayVisualClass3D () const
| Returns the 3D oriented overlay Visual Class. .
Standard_EXPORT Handle_Xw_TypeMap | TypeMap () const
| Returns the Device Type map. .
Standard_EXPORT Handle_Xw_WidthMap | WidthMap () const
| Returns the Device Width map. .
Standard_EXPORT Handle_Xw_FontMap | FontMap () const
| Returns the Device Font map. .
Standard_EXPORT Handle_Xw_MarkMap | MarkMap () const
| Returns the Device Mark map. .
Standard_EXPORT Standard_CString | Display () const
| Returns the Device connection string. .
Standard_EXPORT Standard_Address | XDisplay () const
| Returns the Device Display Address. .
Standard_EXPORT void | DisplaySize (Standard_Integer &Width, Standard_Integer &Height) const
| Returns the Display size in PIXEL Warning: Raises if the connection is not defined properly .
Standard_EXPORT void | DisplaySize (Quantity_Length &Width, Quantity_Length &Height) const
| Returns the Display size in METER Warning: Raises if the connection is not defined properly .
Standard_EXPORT Standard_Integer | PlaneLayer (const Standard_Integer aVisualID) const
| Returns the plane layer ID from a visual ID Warning: Raises if the connection is not defined properly .
virtual Standard_EXPORT Handle_Aspect_GraphicDriver | GraphicDriver () const
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Member Functions

Standard_EXPORT | Xw_GraphicDevice ()
Standard_EXPORT void | InitMaps (const Standard_CString Connection, const Xw_TypeOfMapping Mapping, const Standard_Integer Ncolors, const Standard_Boolean UseDefault)
| Initializes all ressources attached to the GraphicDevice Category: methods to modify the class definition Warning: Raises if the Device is Badly defined .
Standard_EXPORT Standard_Address | ExtendedColorMap2D () const
| Returns extended data colormap 2D structure pointer. .
Standard_EXPORT Standard_Address | ExtendedOverlayColorMap2D () const
| Returns extended data overlay colormap 2D structure pointer. .
Standard_EXPORT Standard_Address | ExtendedColorMap3D () const
| Returns extended data colormap 3D structure pointer. .
Standard_EXPORT Standard_Address | ExtendedOverlayColorMap3D () const
| Returns extended data overlay colormap 3D structure pointer. .
Standard_EXPORT Standard_Address | ExtendedTypeMap () const
| Returns extended data typemap structure pointer. .
Standard_EXPORT Standard_Address | ExtendedWidthMap () const
| Returns extended data widthmap structure pointer. .
Standard_EXPORT Standard_Address | ExtendedFontMap () const
| Returns extended data fontmap structure pointer. .
Standard_EXPORT Standard_Address | ExtendedMarkMap () const
| Returns extended data markmap structure pointer. .
Standard_EXPORT Standard_Address | ExtendedDisplay () const
| Returns extended data display structure pointer. .

## Protected Attributes

Standard_Address | MyExtendedDisplay

## Private Attributes

TCollection_AsciiString | MyDisplay
Handle_Xw_ColorMap | MyColorMap2D
Handle_Xw_ColorMap | MyColorMap3D
Handle_Xw_TypeMap | MyTypeMap
Handle_Xw_WidthMap | MyWidthMap
Handle_Xw_FontMap | MyFontMap
Handle_Xw_MarkMap | MyMarkMap

## Constructor & Destructor Documentation

Standard_EXPORT Xw_GraphicDevice::Xw_GraphicDevice | ( | const Standard_CString | Connection,
|  | const Xw_TypeOfMapping | Mapping = `Xw_TOM_COLORCUBE`,
|  | const Standard_Integer | Ncolors = `0`,
|  | const Standard_Boolean | UseDefault = `Standard_True`
| ) |

Xw_GraphicDevice::~Xw_GraphicDevice | ( |  | ) | `[inline]`

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

## Member Function Documentation

Standard_EXPORT Handle_Xw_ColorMap Xw_GraphicDevice::ColorMap2D | ( |  | ) | const

Standard_EXPORT Handle_Xw_ColorMap Xw_GraphicDevice::ColorMap3D | ( |  | ) | const

virtual Standard_EXPORT void Xw_GraphicDevice::Destroy | ( |  | ) | `[virtual]`

| Reimplemented in Graphic3d_GraphicDevice.

Standard_EXPORT Standard_CString Xw_GraphicDevice::Display | ( |  | ) | const

Standard_EXPORT void Xw_GraphicDevice::DisplaySize | ( | Quantity_Length & | Width,
|  | Quantity_Length & | Height
| ) | const

Standard_EXPORT void Xw_GraphicDevice::DisplaySize | ( | Standard_Integer & | Width,
|  | Standard_Integer & | Height
| ) | const

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedColorMap2D | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedColorMap3D | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedDisplay | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedFontMap | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedMarkMap | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedOverlayColorMap2D | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedOverlayColorMap3D | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedTypeMap | ( |  | ) | const`[protected]`

Standard_EXPORT Standard_Address Xw_GraphicDevice::ExtendedWidthMap | ( |  | ) | const`[protected]`

Standard_EXPORT Handle_Xw_FontMap Xw_GraphicDevice::FontMap | ( |  | ) | const

virtual Standard_EXPORT Handle_Aspect_GraphicDriver Xw_GraphicDevice::GraphicDriver | ( |  | ) | const`[virtual]`

| Implements Aspect_GraphicDevice. Reimplemented in Graphic3d_GraphicDevice.

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

| Reimplemented from Aspect_GraphicDevice. Reimplemented in Graphic3d_GraphicDevice.

Standard_EXPORT void Xw_GraphicDevice::InitMaps | ( | const Standard_CString | Connection,
|  | const Xw_TypeOfMapping | Mapping,
|  | const Standard_Integer | Ncolors,
|  | const Standard_Boolean | UseDefault
| ) | `[protected]`

Standard_EXPORT Handle_Xw_MarkMap Xw_GraphicDevice::MarkMap | ( |  | ) | const

Standard_EXPORT Xw_TypeOfVisual Xw_GraphicDevice::OverlayVisualClass2D | ( |  | ) | const

Standard_EXPORT Xw_TypeOfVisual Xw_GraphicDevice::OverlayVisualClass3D | ( |  | ) | const

Standard_EXPORT Standard_Integer Xw_GraphicDevice::PlaneLayer | ( | const Standard_Integer | aVisualID | ) | const

Standard_EXPORT Handle_Xw_TypeMap Xw_GraphicDevice::TypeMap | ( |  | ) | const

Standard_EXPORT Xw_TypeOfVisual Xw_GraphicDevice::VisualClass2D | ( |  | ) | const

Standard_EXPORT Xw_TypeOfVisual Xw_GraphicDevice::VisualClass3D | ( |  | ) | const

Standard_EXPORT Handle_Xw_WidthMap Xw_GraphicDevice::WidthMap | ( |  | ) | const

Standard_EXPORT Standard_Address Xw_GraphicDevice::XDisplay | ( |  | ) | const

## Field Documentation

Handle_Xw_ColorMap Xw_GraphicDevice::MyColorMap2D `[private]`

Handle_Xw_ColorMap Xw_GraphicDevice::MyColorMap3D `[private]`

TCollection_AsciiString Xw_GraphicDevice::MyDisplay `[private]`

Standard_Address Xw_GraphicDevice::MyExtendedDisplay `[protected]`

Handle_Xw_FontMap Xw_GraphicDevice::MyFontMap `[private]`

Handle_Xw_MarkMap Xw_GraphicDevice::MyMarkMap `[private]`

Handle_Xw_TypeMap Xw_GraphicDevice::MyTypeMap `[private]`

Handle_Xw_WidthMap Xw_GraphicDevice::MyWidthMap `[private]`

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

- Xw_GraphicDevice.hxx