# Visualization
TKService
WNT

# WNT_GraphicDevice Class Reference

This class defines Windows NT display device.
A Graphic Device defines color management. Windows can run in three
different color modes depending of the installed graphic board:
- Low color resolution which allows us to use 16 predefined pure
colors for drawing lines and unlimited number of dithered colors
for window's background, solid filled areas etc. Here Graphic Device
will approximate requested colors by existing ones for line colors
( really this approximation is doing by Windows ). A dithering
technique will be used for window's backgrounds, solid fills etc.
( this is doing by WIndows also ). A dithering techique will be use
for solid fill.
- Medium color resolution which requires a Windows palette manager.
This mode takes after X window system's PseudoColor Visual. The
application can create a LOGICAL PALETTE to represent 20 reserved
by Windows colors and 236 programmable ones. It's possible to reserve
odd entries in the palette for highlighting purposes ( but real
technique is not the same as in X window system - see Windows manual ).
It's possible to create several logical palettes. To do it create
other GraphicDevice but in this case color "flicking" is possible.
- High color resolution. Here 65 536 or 16 777 216 colors are available.
Any color we like will be exactly displayed on the screen, but
highlighting technique is not available. This mode often called
TrueColor but it's not the same as X window TrueColor.
A Graphic Device also defines physical dimensions of the screen.
.

`#include <WNT_GraphicDevice.hxx>`

Inheritance diagram for WNT_GraphicDevice:

[legend]

## Public Member Functions

Standard_EXPORT | WNT_GraphicDevice (const Standard_Boolean aColorCube=Standard_False, const Aspect_Handle aDevContext=0)
| Creates a GraphicDevice and logical palette. Builds an OpenGL colorcube on that palette depending of the aColorCube flag and hardware. Warning: Raises if createion of the logical palette failed. .
Standard_EXPORT | WNT_GraphicDevice (const Standard_Boolean aColorCube, const Standard_Integer aDevContext)
| same as previous one (to provide access form CCL)
virtual Standard_EXPORT void | Destroy ()
| Destroies all ressources attached to the GraphicDevice. .
| ~WNT_GraphicDevice ()
Standard_EXPORT WNT_ColorRef | SetColor (const Quantity_Color &aColor, const Standard_Boolean aHighlight=Standard_False)
| Returns the color value in form specific to Windows NT. Sets the color values in the logical palette if the hardware supports it. If in this case there are not free cell in the logical palette then this method will search for nearest color in the palette. If <ahighlight> is True then sets a highlight color. .
virtual Standard_EXPORT WNT_ColorRef | SetColor (const Standard_Integer aRed, const Standard_Integer aGreen, const Standard_Integer aBlue, const Standard_Boolean aHighlight=Standard_False)
| See above .
virtual Standard_EXPORT void | SetColor (const WNT_Long &aPixel)
| Color allocation for images. .
Standard_EXPORT void | MapColors (const Handle(Aspect_ColorMap)&aColorMap, Handle(WNT_HColorTable)&aColorTable)
| Returns the color value in form specific to WIndows NT in the <acolortable>. See SetColor method. Warning: The dimensions and index ranges of the <acolormap> and <acolortable> must be the same; .
Aspect_Handle | HPalette () const
| Returns logical palette handle attached to the GraphicDevice. .
void | DisplaySize (Standard_Integer &aWidth, Standard_Integer &aHeight) const
| Returns the Display size in PIXEL .
void | DisplaySize (Quantity_Length &aWidth, Quantity_Length &aHeight) const
| Returns the Display size in working units units .
Standard_Boolean | IsPaletteDevice () const
| Returns True if hardware is palette-compatible. .
Standard_Integer | NumColors () const
| Returns number of available colors. .
WNT_ColorRef | HighlightColor () const
| Returns highlight color. .
virtual Standard_EXPORT Handle_Aspect_GraphicDriver | GraphicDriver () const
| Dummy method .
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Member Functions

Standard_EXPORT void | Init (const Standard_Boolean aColorCube, const Aspect_Handle aDevContext)

## Protected Attributes

Quantity_Length | myMWidth
Quantity_Length | myMHeight
Standard_Integer | myWidth
Standard_Integer | myHeight
Standard_Integer | myNumColors
Standard_Integer | myFreeIndex
Aspect_Handle | myPalette
Standard_Address | myLogPal
WNT_ColorRef | myHighlightColor
Standard_Boolean | myOpenGLPalette

## Constructor & Destructor Documentation

Standard_EXPORT WNT_GraphicDevice::WNT_GraphicDevice | ( | const Standard_Boolean | aColorCube = `Standard_False`,
|  | const Aspect_Handle | aDevContext = `0`
| ) |

Standard_EXPORT WNT_GraphicDevice::WNT_GraphicDevice | ( | const Standard_Boolean | aColorCube,
|  | const Standard_Integer | aDevContext
| ) |

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

## Member Function Documentation

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

| Reimplemented in Graphic3d_WNTGraphicDevice.

void WNT_GraphicDevice::DisplaySize | ( | Quantity_Length & | aWidth,
|  | Quantity_Length & | aHeight
| ) | const`[inline]`

void WNT_GraphicDevice::DisplaySize | ( | Standard_Integer & | aWidth,
|  | Standard_Integer & | aHeight
| ) | const`[inline]`

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

| Implements Aspect_GraphicDevice. Reimplemented in Graphic3d_WNTGraphicDevice.

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

| Reimplemented from Aspect_GraphicDevice. Reimplemented in Graphic3d_WNTGraphicDevice.

WNT_ColorRef WNT_GraphicDevice::HighlightColor | ( |  | ) | const`[inline]`

Aspect_Handle WNT_GraphicDevice::HPalette | ( |  | ) | const`[inline]`

Standard_EXPORT void WNT_GraphicDevice::Init | ( | const Standard_Boolean | aColorCube,
|  | const Aspect_Handle | aDevContext
| ) | `[protected]`

Standard_Boolean WNT_GraphicDevice::IsPaletteDevice | ( |  | ) | const`[inline]`

Standard_EXPORT void WNT_GraphicDevice::MapColors | ( | const Handle(Aspect_ColorMap)& | aColorMap,
|  | Handle(WNT_HColorTable)& | aColorTable
| ) |

Standard_Integer WNT_GraphicDevice::NumColors | ( |  | ) | const`[inline]`

virtual Standard_EXPORT void WNT_GraphicDevice::SetColor | ( | const WNT_Long & | aPixel | ) | `[virtual]`

virtual Standard_EXPORT WNT_ColorRef WNT_GraphicDevice::SetColor | ( | const Standard_Integer | aRed,
|  | const Standard_Integer | aGreen,
|  | const Standard_Integer | aBlue,
|  | const Standard_Boolean | aHighlight = `Standard_False`
| ) | `[virtual]`

Standard_EXPORT WNT_ColorRef WNT_GraphicDevice::SetColor | ( | const Quantity_Color & | aColor,
|  | const Standard_Boolean | aHighlight = `Standard_False`
| ) |

## Field Documentation

Standard_Integer WNT_GraphicDevice::myFreeIndex `[protected]`

Standard_Integer WNT_GraphicDevice::myHeight `[protected]`

WNT_ColorRef WNT_GraphicDevice::myHighlightColor `[protected]`

Standard_Address WNT_GraphicDevice::myLogPal `[protected]`

Quantity_Length WNT_GraphicDevice::myMHeight `[protected]`

Quantity_Length WNT_GraphicDevice::myMWidth `[protected]`

Standard_Integer WNT_GraphicDevice::myNumColors `[protected]`

Standard_Boolean WNT_GraphicDevice::myOpenGLPalette `[protected]`

Aspect_Handle WNT_GraphicDevice::myPalette `[protected]`

Standard_Integer WNT_GraphicDevice::myWidth `[protected]`

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

- WNT_GraphicDevice.hxx
- WNT_GraphicDevice.lxx