# Visualization
TKService
WNT

# WNT_Window Class Reference

This class defines Windows NT window
Warning: The position and size for the creation of the window
are defined in Device Screen Unit (DSU)
floating [0,1] space.
.

`#include <WNT_Window.hxx>`

Inheritance diagram for WNT_Window:

[legend]

## Public Member Functions

Standard_EXPORT

WNT_Window (const Handle(WNT_GraphicDevice)&aDevice, const Standard_CString aTitle, const Handle(WNT_WClass)&aClass, const WNT_Dword &aStyle=0, const Quantity_Parameter Xc=0.5, const Quantity_Parameter Yc=0.5, const Quantity_Parameter aWidth=0.5, const Quantity_Parameter aHeight=0.5, const Quantity_NameOfColor aBackColor=Quantity_NOC_MATRAGRAY, const Aspect_Handle aParent=0, const Aspect_Handle aMenu=0, const Standard_Address aClientStruct=0)

Creates a Window defined by his Center and his Size
in DSU from the Parent Window. If <aparent> is 0 then
creates a window without parent.
Creation of an WNT_Window automatically determines the
smaller dimension of the screen (usually the height)
and parametrises it as 1.0.
The smaller dimension of the window is limited to 1.0
We can give a value greater than 1.0 to the larger
dimension.
No matter how large the values passed in argument, the
window is automatically limited to the maximum size of
the screen.
The ratio of width to height of a conventional screen is
of the order of 1.3.
Trigger: Raises WindowDefinitionError if the Position out of the
Screen Space or the window creation failed.
.

Standard_EXPORT | WNT_Window (const Handle(WNT_GraphicDevice)&aDevice, const Aspect_Handle aHandle, const Quantity_NameOfColor aBackColor=Quantity_NOC_MATRAGRAY)
| Creates a Window based on the existing window handle. This handle equals ( aPart1 << 16 ) + aPart2. .
Standard_EXPORT | WNT_Window (const Handle(WNT_GraphicDevice)&aDevice, const Standard_Integer aPart1, const Standard_Integer aPart2, const Quantity_NameOfColor aBackColor=Quantity_NOC_MATRAGRAY)
| Creates a Window based on the existing window <ahandle>. .
virtual Standard_EXPORT void | Destroy ()
| Destroies the Window and all resourses attached to it. .
| ~WNT_Window ()
virtual Standard_EXPORT void | SetBackground (const Aspect_Background &Background)
| Modifies the window background. .
virtual Standard_EXPORT void | SetBackground (const Quantity_NameOfColor BackColor)
| Modifies the window background. .
virtual Standard_EXPORT void | SetBackground (const Quantity_Color &color)
| Modifies the window background. .
Standard_EXPORT void | SetBackground (const Aspect_Handle aBackPixmap)
| Modifies the window background. .
Standard_EXPORT Standard_Boolean | SetBackground (const Standard_CString aName, const Aspect_FillMethod aMethod=Aspect_FM_CENTERED)
| Loads the window background from an image file <aname> defined with a supported format XWD,GIF or BMP and returns TRUE if the operation is successfull. Category: Methods to modify the class definition .
Standard_EXPORT void | SetCursor (const Aspect_Handle aCursor) const
| Sets cursor <acursor> for ENTIRE WINDOW CLASS to which the Window belongs. .
Standard_EXPORT void | SetIcon (const Aspect_Handle anIcon, const Standard_CString aName=0)
| Sets icon <anicon> for window .
Standard_EXPORT void | SetIconName (const Standard_CString aName)
| Sets name for window's icon .
virtual Standard_EXPORT void | SetDoubleBuffer (const Standard_Boolean DBmode)
| Activates/Deactivates the Double Buffering capability for this window. Warning: Double Buffering is always DISABLE by default. Trigger: Raises if BackingStore () isn't allowed for this Window .
virtual Standard_EXPORT void | Flush () const
| Flushes all graphics to the screen and Swap the Double buffer if Enable Trigger: Raises if Something is WRONG at Drawing Time. .
virtual Standard_EXPORT void | Map () const
| Opens the window <me>. .
Standard_EXPORT void | Map (const Standard_Integer aMapMode) const
| Opens a window <me> according to <amapmode>. This method is specific to Windows NT. <amapmode> can be one of SW_xxx constants defined in <windows.h>. See documentation. .
virtual Standard_EXPORT void | Unmap () const
| Closes the window <me>. .
virtual Standard_EXPORT Aspect_TypeOfResize | DoResize () const
| Applies the resizing to the window <me>. .
virtual Standard_EXPORT Standard_Boolean | DoMapping () const
| Apply the mapping change to the window <me> and returns TRUE if the window is mapped at screen. .
virtual Standard_EXPORT void | Clear () const
| Clears the Window in the Background color. .
virtual Standard_EXPORT void | ClearArea (const Standard_Integer Xc, const Standard_Integer Yc, const Standard_Integer Width, const Standard_Integer Height) const
| Clears the Window Area defined by his center and PIXEL size in the Background color Trigger: Raises if Window is not defined properly .
virtual Standard_EXPORT void | Restore () const
| Restores The Window from the BackingStored Window See BackingStore () method. .
virtual Standard_EXPORT void | RestoreArea (const Standard_Integer Xc, const Standard_Integer Yc, const Standard_Integer Width, const Standard_Integer Height) const
| Restores The Window Area defined by his center and PIXEL size from the BackingStored Window See BackingStore () method. .
virtual Standard_EXPORT Standard_Boolean | Dump (const Standard_CString aFilename, const Standard_Real aGammaValue=1.0) const
| Dumps the Window to an XWD,GIF or BMP filei with an optional gamma correction value according to the graphic system. and returns TRUE if the dump occurs normaly. Trigger: Raises if Window is not defined properly .
virtual Standard_EXPORT Standard_Boolean | DumpArea (const Standard_CString aFilename, const Standard_Integer Xc, const Standard_Integer Yc, const Standard_Integer Width, const Standard_Integer Height, const Standard_Real aGammaValue=1.0) const
| Dumps the Window Area defined by his center and PIXEL size to an XWD,GIF or BMP file with an optional gamma correction value according to the graphic system and returns TRUE if the dump occurs normaly. Trigger: Raises if Window is not defined properly or the area is out of the Window. .
virtual Standard_EXPORT Standard_Boolean | Load (const Standard_CString aFilename) const
| Loads the XWD file to this Window. Returns TRUE if the loading occurs normaly. Warning: Note that the Window is enlarged automatically when the image size is too large for this window. Trigger: Raises if Window is not defined properly .
virtual Standard_EXPORT Standard_Boolean | LoadArea (const Standard_CString aFilename, const Standard_Integer Xc, const Standard_Integer Yc, const Standard_Integer Width, const Standard_Integer Height) const
| Loads the XWD file to Window Area defined by his center and PIXEL size. Returns TRUE if the loading occurs normaly. Warning: Note that the Image is zoomed automatically when the image size is too large for this window area. Trigger: Raises if Window is not defined properly or the area is out of the Window. .
Standard_EXPORT void | SetOutputFormat (const WNT_TypeOfImage aFormat)
| Sets format of the image file created by Dump or DumpArea methods. .
Standard_EXPORT void | SetPos (const Standard_Integer X, const Standard_Integer Y, const Standard_Integer X1, const Standard_Integer Y1)
| Changes variables due to window position. .
Standard_EXPORT void | SetFlags (const Standard_Integer aFlags)
| Sets user defined flags in the extra window data area. .
Standard_EXPORT void | ResetFlags (const Standard_Integer aFlags)
| Reset specified flags in the extra window data area. .
virtual Standard_EXPORT Standard_Boolean | BackingStore () const
| Returns the BackingStore capability for this Window. If Answer is True Exposure can be recovered by Restore RestoreArea methods. If Answer is False, Application must Redraw the exposed area. .
virtual Standard_Boolean | DoubleBuffer () const
| Returns the DoubleBuffer state. .
virtual Standard_EXPORT Standard_Boolean | IsMapped () const
| Returns True if the window <me> is opened and False if the window is closed. .
virtual Standard_EXPORT Quantity_Ratio | Ratio () const
| Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions. .
virtual Standard_EXPORT void | Position (Quantity_Parameter &X1, Quantity_Parameter &Y1, Quantity_Parameter &X2, Quantity_Parameter &Y2) const
| Returns The Window POSITION in DSU .
virtual Standard_EXPORT void | Position (Standard_Integer &X1, Standard_Integer &Y1, Standard_Integer &X2, Standard_Integer &Y2) const
| Returns The Window POSITION in PIXEL .
virtual Standard_EXPORT void | Size (Quantity_Parameter &Width, Quantity_Parameter &Height) const
| Returns The Window SIZE in DSU .
virtual Standard_EXPORT void | Size (Standard_Integer &Width, Standard_Integer &Height) const
| Returns The Window SIZE in PIXEL .
virtual Standard_EXPORT void | MMSize (Standard_Real &Width, Standard_Real &Height) const
| Returns The Window SIZE in MM .
virtual Standard_EXPORT Quantity_Parameter | Convert (const Standard_Integer PV) const
| Returns the DSU value depending of the PIXEL value. .
virtual Standard_EXPORT Standard_Integer | Convert (const Quantity_Parameter DV) const
| Returns the PIXEL value depending of the DSU value. .
virtual Standard_EXPORT void | Convert (const Standard_Integer PX, const Standard_Integer PY, Quantity_Parameter &DX, Quantity_Parameter &DY) const
| Returns the DSU position depending of the PIXEL position. .
virtual Standard_EXPORT void | Convert (const Quantity_Parameter DX, const Quantity_Parameter DY, Standard_Integer &PX, Standard_Integer &PY) const
| Returns the PIXEL position depending of the DSU position. .
Aspect_Handle | HWindow () const
| Returns the Windows NT handle of the created window <me>. .
Aspect_Handle | HParentWindow () const
| Returns the Windows NT handle parent of the created window <me>. .
Aspect_Handle | HPixmap () const
| Returns the Windows NT double buffer pixmap handle of the created window <me>. If BackingStore () is permitted. .
Standard_Address | WndProc () const
| Returns address of the window procedure. .
Handle_WNT_ImageManager | ImageManager () const
| Returns ImageManager of the Window. .
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Attributes

Standard_Integer | aXLeft
Standard_Integer | aYTop
Standard_Integer | aXRight
Standard_Integer | aYBottom
Handle_WNT_WClass | myWClass
Aspect_Handle | myHWindow
Aspect_Handle | myHParentWindow
Aspect_Handle | myHPixmap
Standard_Boolean | myDoubleBuffer
WNT_WindowData | myExtraData
WNT_TypeOfImage | myFormat
Handle_WNT_ImageManager | myImages
Handle_WNT_Icon | myIcon
Standard_Address | myWndProc
Standard_Integer | myUsrData

## Private Member Functions

Standard_EXPORT void | doCreate (const Handle(WNT_GraphicDevice)&aDevice, const Aspect_Handle aHandle, const Quantity_NameOfColor aBackColor=Quantity_NOC_MATRAGRAY)
| private method

## Constructor & Destructor Documentation

Standard_EXPORT WNT_Window::WNT_Window | ( | const Handle(WNT_GraphicDevice)& | aDevice,
|  | const Standard_CString | aTitle,
|  | const Handle(WNT_WClass)& | aClass,
|  | const WNT_Dword & | aStyle = `0`,
|  | const Quantity_Parameter | Xc = `0.5`,
|  | const Quantity_Parameter | Yc = `0.5`,
|  | const Quantity_Parameter | aWidth = `0.5`,
|  | const Quantity_Parameter | aHeight = `0.5`,
|  | const Quantity_NameOfColor | aBackColor = `Quantity_NOC_MATRAGRAY`,
|  | const Aspect_Handle | aParent = `0`,
|  | const Aspect_Handle | aMenu = `0`,
|  | const Standard_Address | aClientStruct = `0`
| ) |

Standard_EXPORT WNT_Window::WNT_Window | ( | const Handle(WNT_GraphicDevice)& | aDevice,
|  | const Aspect_Handle | aHandle,
|  | const Quantity_NameOfColor | aBackColor = `Quantity_NOC_MATRAGRAY`
| ) |

Standard_EXPORT WNT_Window::WNT_Window | ( | const Handle(WNT_GraphicDevice)& | aDevice,
|  | const Standard_Integer | aPart1,
|  | const Standard_Integer | aPart2,
|  | const Quantity_NameOfColor | aBackColor = `Quantity_NOC_MATRAGRAY`
| ) |

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

## Member Function Documentation

virtual Standard_EXPORT Standard_Boolean WNT_Window::BackingStore | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Clear | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::ClearArea | ( | const Standard_Integer | Xc,
|  | const Standard_Integer | Yc,
|  | const Standard_Integer | Width,
|  | const Standard_Integer | Height
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Convert | ( | const Quantity_Parameter | DX,
|  | const Quantity_Parameter | DY,
|  | Standard_Integer & | PX,
|  | Standard_Integer & | PY
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Convert | ( | const Standard_Integer | PX,
|  | const Standard_Integer | PY,
|  | Quantity_Parameter & | DX,
|  | Quantity_Parameter & | DY
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Standard_Integer WNT_Window::Convert | ( | const Quantity_Parameter | DV | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Quantity_Parameter WNT_Window::Convert | ( | const Standard_Integer | PV | ) | const`[virtual]`

| Implements Aspect_Window.

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

| Implements Aspect_Window. Reimplemented in WNT_IconBox.

Standard_EXPORT void WNT_Window::doCreate | ( | const Handle(WNT_GraphicDevice)& | aDevice,
|  | const Aspect_Handle | aHandle,
|  | const Quantity_NameOfColor | aBackColor = `Quantity_NOC_MATRAGRAY`
| ) | `[private]`

virtual Standard_EXPORT Standard_Boolean WNT_Window::DoMapping | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Aspect_TypeOfResize WNT_Window::DoResize | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

Standard_Boolean WNT_Window::DoubleBuffer | ( |  | ) | const`[inline, virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Standard_Boolean WNT_Window::Dump | ( | const Standard_CString | aFilename,
|  | const Standard_Real | aGammaValue = `1.0`
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Standard_Boolean WNT_Window::DumpArea | ( | const Standard_CString | aFilename,
|  | const Standard_Integer | Xc,
|  | const Standard_Integer | Yc,
|  | const Standard_Integer | Width,
|  | const Standard_Integer | Height,
|  | const Standard_Real | aGammaValue = `1.0`
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Flush | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

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

| Reimplemented from Aspect_Window. Reimplemented in WNT_IconBox.

Aspect_Handle WNT_Window::HParentWindow | ( |  | ) | const`[inline]`

Aspect_Handle WNT_Window::HPixmap | ( |  | ) | const`[inline]`

Aspect_Handle WNT_Window::HWindow | ( |  | ) | const`[inline]`

Handle_WNT_ImageManager WNT_Window::ImageManager | ( |  | ) | const`[inline]`

virtual Standard_EXPORT Standard_Boolean WNT_Window::IsMapped | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Standard_Boolean WNT_Window::Load | ( | const Standard_CString | aFilename | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Standard_Boolean WNT_Window::LoadArea | ( | const Standard_CString | aFilename,
|  | const Standard_Integer | Xc,
|  | const Standard_Integer | Yc,
|  | const Standard_Integer | Width,
|  | const Standard_Integer | Height
| ) | const`[virtual]`

| Implements Aspect_Window.

Standard_EXPORT void WNT_Window::Map | ( | const Standard_Integer | aMapMode | ) | const

virtual Standard_EXPORT void WNT_Window::Map | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::MMSize | ( | Standard_Real & | Width,
|  | Standard_Real & | Height
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Position | ( | Standard_Integer & | X1,
|  | Standard_Integer & | Y1,
|  | Standard_Integer & | X2,
|  | Standard_Integer & | Y2
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Position | ( | Quantity_Parameter & | X1,
|  | Quantity_Parameter & | Y1,
|  | Quantity_Parameter & | X2,
|  | Quantity_Parameter & | Y2
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT Quantity_Ratio WNT_Window::Ratio | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

Standard_EXPORT void WNT_Window::ResetFlags | ( | const Standard_Integer | aFlags | ) |

virtual Standard_EXPORT void WNT_Window::Restore | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::RestoreArea | ( | const Standard_Integer | Xc,
|  | const Standard_Integer | Yc,
|  | const Standard_Integer | Width,
|  | const Standard_Integer | Height
| ) | const`[virtual]`

| Implements Aspect_Window.

Standard_EXPORT Standard_Boolean WNT_Window::SetBackground | ( | const Standard_CString | aName,
|  | const Aspect_FillMethod | aMethod = `Aspect_FM_CENTERED`
| ) | `[virtual]`

| Implements Aspect_Window.

Standard_EXPORT void WNT_Window::SetBackground | ( | const Aspect_Handle | aBackPixmap | ) | `[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::SetBackground | ( | const Quantity_Color & | color | ) | `[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::SetBackground | ( | const Quantity_NameOfColor | BackColor | ) | `[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::SetBackground | ( | const Aspect_Background & | Background | ) | `[virtual]`

| Implements Aspect_Window.

Standard_EXPORT void WNT_Window::SetCursor | ( | const Aspect_Handle | aCursor | ) | const

virtual Standard_EXPORT void WNT_Window::SetDoubleBuffer | ( | const Standard_Boolean | DBmode | ) | `[virtual]`

| Implements Aspect_Window.

Standard_EXPORT void WNT_Window::SetFlags | ( | const Standard_Integer | aFlags | ) |

Standard_EXPORT void WNT_Window::SetIcon | ( | const Aspect_Handle | anIcon,
|  | const Standard_CString | aName = `0`
| ) |

Standard_EXPORT void WNT_Window::SetIconName | ( | const Standard_CString | aName | ) |

Standard_EXPORT void WNT_Window::SetOutputFormat | ( | const WNT_TypeOfImage | aFormat | ) |

Standard_EXPORT void WNT_Window::SetPos | ( | const Standard_Integer | X,
|  | const Standard_Integer | Y,
|  | const Standard_Integer | X1,
|  | const Standard_Integer | Y1
| ) |

virtual Standard_EXPORT void WNT_Window::Size | ( | Standard_Integer & | Width,
|  | Standard_Integer & | Height
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Size | ( | Quantity_Parameter & | Width,
|  | Quantity_Parameter & | Height
| ) | const`[virtual]`

| Implements Aspect_Window.

virtual Standard_EXPORT void WNT_Window::Unmap | ( |  | ) | const`[virtual]`

| Implements Aspect_Window.

Standard_Address WNT_Window::WndProc | ( |  | ) | const`[inline]`

## Field Documentation

Standard_Integer WNT_Window::aXLeft `[protected]`

Standard_Integer WNT_Window::aXRight `[protected]`

Standard_Integer WNT_Window::aYBottom `[protected]`

Standard_Integer WNT_Window::aYTop `[protected]`

Standard_Boolean WNT_Window::myDoubleBuffer `[protected]`

WNT_WindowData WNT_Window::myExtraData `[protected]`

WNT_TypeOfImage WNT_Window::myFormat `[protected]`

Aspect_Handle WNT_Window::myHParentWindow `[protected]`

Aspect_Handle WNT_Window::myHPixmap `[protected]`

Aspect_Handle WNT_Window::myHWindow `[protected]`

Handle_WNT_Icon WNT_Window::myIcon `[protected]`

Handle_WNT_ImageManager WNT_Window::myImages `[protected]`

Standard_Integer WNT_Window::myUsrData `[protected]`

Handle_WNT_WClass WNT_Window::myWClass `[protected]`

Standard_Address WNT_Window::myWndProc `[protected]`

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

- WNT_Window.hxx
- WNT_Window.lxx