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 | Protected Attributes
Xw_Window Class Reference

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

#include <Xw_Window.hxx>

Inheritance diagram for Xw_Window:
Inheritance graph
[legend]

Public Member Functions

 Xw_Window (const Handle< Xw_GraphicDevice > &Device)
 Xw_Window (const Handle< Xw_GraphicDevice > &Device, const Standard_Integer aPart1, const Standard_Integer aPart2, const Xw_WindowQuality aQuality=Xw_WQ_SAMEQUALITY, const Quantity_NameOfColor BackColor=Quantity_NOC_MATRAGRAY)
 Creates a Window from an X Window defined by his ID
This Xid equals (aPart1 << 16) + aPart2.
A child of this Window is created when the WindowQuality
isn't the same than the parent Window
Trigger: Raises WindowDefinitionError if the connection failed
or if the Position out of the Screen Space

 Xw_Window (const Handle< Xw_GraphicDevice > &Device, const Aspect_Handle aWindow, const Xw_WindowQuality aQuality=Xw_WQ_SAMEQUALITY, const Quantity_NameOfColor BackColor=Quantity_NOC_MATRAGRAY)
 Creates a Window from an X Window defined by his Xid
A child of this Window is created when the WindowQuality
isn't the same than the parent Window
Trigger: Raises WindowDefinitionError if the connection failed
or if the Position out of the Screen Space

 Xw_Window (const Handle< Xw_GraphicDevice > &Device, const Standard_CString Title, const Quantity_Parameter Xc=0.5, const Quantity_Parameter Yc=0.5, const Quantity_Parameter Width=0.5, const Quantity_Parameter Height=0.5, const Xw_WindowQuality Quality=Xw_WQ_DRAWINGQUALITY, const Quantity_NameOfColor BackColor=Quantity_NOC_MATRAGRAY, const Aspect_Handle Parent=0)
 Creates a Window defined by his Center and his Size
in DSU from the Parent Window.
NOTE than if Parent is 0 the window is created from the
ROOT Window.
Connects it to the X server at the first call
depending of the GraphicDevice Visual and
Display parameters.
Quality defined a 2D or 3D Graphics oriented Window and
must be one of :
Xw_WQ_DRAWINGQUALITY for 2D Wireframe.
Xw_WQ_PICTUREQUALITY for Picture.
Xw_WQ_3DQUALITY for 3D Shading, HiddenLines, Wireframe.

Creation of an Xw_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 connection failed
or if the Position out of the Screen Space

 Xw_Window (const Handle< Xw_GraphicDevice > &theDevice, const Standard_CString theTitle, const Standard_Integer thePxLeft, const Standard_Integer thePxTop, const Standard_Integer thePxWidth, const Standard_Integer thePxHeight, const Xw_WindowQuality theQuality=Xw_WQ_DRAWINGQUALITY, const Quantity_NameOfColor theBackColor=Quantity_NOC_MATRAGRAY, const Aspect_Handle theParent=0)
 Creates a Window defined by his position and size
in pixels from the Parent Window.
Trigger: Raises WindowDefinitionError if the connection failed
or if the Position out of the Screen Space

virtual void SetBackground (const Aspect_Background &Background)
 Modifies the window background.
Warning: the background color is ignored when the quality
of this window is TRANSPARENT.

virtual void SetBackground (const Quantity_NameOfColor BackColor)
 Modifies the window background from a Named Color.
Warning: the background color is ignored when the quality
of this window is TRANSPARENT.

virtual void SetBackground (const Quantity_Color &color)
 Modifies the window background from a Named Color.
Warning: the background color is ignored when the quality
of this window is TRANSPARENT.

void SetBackground (const Aspect_Handle aPixmap)
 Defines the window background directly from a bitmap.
Warning: the bitmap and window must have the same depth.

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.

virtual void SetBackground (const Aspect_GradientBackground &Background)
 Modifies the window gradient background.
Warning: the gradient background colours are ignored when the quality
of this window is TRANSPARENT.

void SetBackground (const Quantity_Color &aCol1, const Quantity_Color &aCol2, const Aspect_GradientFillMethod aMethod=Aspect_GFM_HOR)
 Modifies the window gradient background.
Warning: the gradient background colours are ignored when the quality
of this window is TRANSPARENT.

virtual void SetDoubleBuffer (const Standard_Boolean DBmode)
 Activates/Deactivates the Double Buffering capability
for this window.
Warning: Double Buffering is always DISABLE by default
If there is not enought ressources to activate the
double-buffering the DB mode flag can be set to FALSE.

virtual void Flush () const
 Flushs all graphics to the screen and Swap the Double
buffer if Enable
Category: Methods to modify the class definition
Trigger: Raises if Something is WRONG at Drawing Time.

virtual void Map () const
 Opens the window <me>.

virtual void Unmap () const
 Closes the window <me>.

virtual Aspect_TypeOfResize DoResize () const
 Applies the resizing to the window <me>.

virtual Standard_Boolean DoMapping () const
 Apply the mapping change to the window <me>
and returns TRUE if the window is mapped at screen.

virtual void Destroy ()
 Destroies the Window
C++: alias ~
Category: Methods to modify the class definition
Trigger: Raises if Window is not defined properly

virtual void Clear () const
 Clears the Window in the Background color

virtual 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
Category: Methods to modify the class definition
Trigger: Raises if Window is not defined properly

virtual void Restore () const
 Restores The Window from the BackingStored Window
See BackingStore () method.

virtual 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_Boolean Dump (const Standard_CString aFilename, const Standard_Real aGammaValue=1.0) const
 Dumps the Window 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.
Category: Methods to modify the class definition
Trigger: Raises if Window is not defined properly

virtual 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.
Category: Methods to modify the class definition
Trigger: Raises if Window is not defined properly
or the area is out of the Window.

virtual Standard_Boolean ToPixMap (Image_PixMap &theImage) const
 dump the full contents of the window to a pixmap.

virtual 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.
Category: Methods to modify the class definition
Trigger: Raises if Window is not defined properly

virtual 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.
Category: Methods to modify the class definition
Trigger: Raises if Window is not defined properly
or the area is out of the Window.

virtual void SetCursor (const Standard_Integer anId, const Quantity_NameOfColor aColor=Quantity_NOC_YELLOW) const
 Changes the current window cursor by anId cursor
in the specified color.
NOTE than anId must be one of /usr/include/X11/cursorfont.h
or 0 for Deactivate the cursor

virtual 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_Boolean IsMapped () const
 Returns True if the window <me> is opened
and False if the window is closed.

virtual Quantity_Ratio Ratio () const
 Returns The Window RATIO equal to the physical
WIDTH/HEIGHT dimensions

virtual void Position (Quantity_Parameter &X1, Quantity_Parameter &Y1, Quantity_Parameter &X2, Quantity_Parameter &Y2) const
 Returns The Window POSITION in DSU

virtual void Position (Standard_Integer &X1, Standard_Integer &Y1, Standard_Integer &X2, Standard_Integer &Y2) const
 Returns The Window POSITION in PIXEL

virtual void Size (Quantity_Parameter &Width, Quantity_Parameter &Height) const
 Returns The Window SIZE in DSU

virtual void Size (Standard_Integer &Width, Standard_Integer &Height) const
 Returns The Window SIZE in PIXEL

virtual void MMSize (Standard_Real &Width, Standard_Real &Height) const
 Returns The Window SIZE in MM

virtual Quantity_Parameter Convert (const Standard_Integer PV) const
 Returns the DSU value depending of the PIXEL value.

virtual Standard_Integer Convert (const Quantity_Parameter DV) const
 Returns the PIXEL value depending of the DSU value.

virtual 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 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 XWindow () const
 Returns the X window ID of the created window <me>.

void XWindow (Standard_Integer &aPart1, Standard_Integer &aPart2) const
 Returns the X window ID of the created window <me>.
This Xid equals (aPart1 << 16) + aPart2.

Aspect_Handle XParentWindow () const
 Returns the X window ID parent of the created window <me>.

void XParentWindow (Standard_Integer &aPart1, Standard_Integer &aPart2) const
 Returns the X window ID parent of the created window <me>.
This Xid equals (aPart1 << 16) + aPart2.

Aspect_Handle XPixmap () const
 Returns the X pixmap ID of the created window <me>.
If BackingStore () is permitted.

virtual Standard_Boolean PointerPosition (Standard_Integer &X, Standard_Integer &Y) const
 Returns the Pointer position relatively to the Window <me>
and FALSE if the pointer is outside of the window

Handle_Xw_ColorMap ColorMap () const
 Returns the Colormap attached to this Window

Handle_Xw_TypeMap TypeMap () const
 Returns the Typemap attached to this Window

Handle_Xw_WidthMap WidthMap () const
 Returns the Widthmap attached to this Window

Handle_Xw_FontMap FontMap () const
 Returns the Fontmap attached to this Window

Handle_Xw_MarkMap MarkMap () const
 Returns the Markmap attached to this Window

Aspect_Handle XColorMap () const
 Returns the Colormap XId attached to this Window
depending of the HardWare and Visual class
Trigger: Raises if Window is not defined properly

Standard_Address XVisual () const
 Returns the Visual address attached to this Window
depending of the HardWare
Trigger: Raises if Window is not defined properly

Xw_TypeOfVisual VisualClass () const
 Returns the X window Visual class of the created window <me>

Standard_Integer VisualDepth () const
 Returns the X window Visual depth of the created window <me>

Standard_Integer VisualID () const
 Returns the Visual ID of the Window

Xw_WindowQuality Quality () const
 Returns the Quality of this window

Standard_Boolean PixelOfColor (const Quantity_NameOfColor aColor, Standard_Integer &aPixel) const
 Returns FALSE when the returned pixel value <aPixel>
of an RGB color <aColor> is exact or TRUE
when the pixel value is approximated.

Standard_Boolean PixelOfColor (const Quantity_Color &aColor, Standard_Integer &aPixel) const
 Returns FALSE when the returned pixel value <aPixel>
of an RGB color <aColor> is exact or TRUE
when the pixel value is approximated.
Warning:
make becarefull about the number of different pixel
of colors reserved in the colormap in PseudoColor mode !!!

Standard_Boolean BackgroundPixel (Standard_Integer &aPixel) const
 Returns FALSE when the returned background pixel
value <aPixel> is not defined

Protected Member Functions

Standard_Address ExtendedWindow () const
 Returns the ExtendedWindow address of the created window.

Standard_Address ExtendedColorMap () const
 Returns the ExtendedColorMap address of the created window.

Standard_Address ExtendedTypeMap () const
 Returns the ExtendedTypeMap address of the created window.

Standard_Address ExtendedWidthMap () const
 Returns the ExtendedWidthMap address of the created window.

Standard_Address ExtendedFontMap () const
 Returns the ExtendedFontMap address of the created window.

Standard_Address ExtendedMarkMap () const
 Returns the ExtendedMarkMap address of the created window.

Static Protected Member Functions

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

Protected Attributes

Xw_WindowQuality MyQuality
Handle_Xw_ColorMap MyColorMap
Handle_Xw_TypeMap MyTypeMap
Handle_Xw_WidthMap MyWidthMap
Handle_Xw_FontMap MyFontMap
Handle_Xw_MarkMap MyMarkMap
Aspect_Handle MyXWindow
Aspect_Handle MyXParentWindow
Aspect_Handle MyXPixmap
Xw_TypeOfVisual MyVisualClass
Standard_Integer MyDepth
Standard_Integer MyBackgroundIndex
Standard_Address MyExtendedDisplay
Standard_Address MyExtendedWindow
Standard_Address MyExtendedColorMap
Standard_Address MyExtendedTypeMap
Standard_Address MyExtendedWidthMap
Standard_Address MyExtendedFontMap
Standard_Address MyExtendedMarkMap

Constructor & Destructor Documentation


Member Function Documentation

virtual Standard_Boolean Xw_Window::BackingStore ( ) const [virtual]

Implements Aspect_Window.

virtual void Xw_Window::Clear ( ) const [virtual]

Implements Aspect_Window.

Implements Aspect_Window.

Handle_Xw_ColorMap Xw_Window::ColorMap ( ) const

Implements Aspect_Window.

Implements Aspect_Window.

Implements Aspect_Window.

Implements Aspect_Window.

virtual void Xw_Window::Destroy ( ) [virtual]

Implements Aspect_Window.

Reimplemented in Xw_IconBox.

virtual Standard_Boolean Xw_Window::DoMapping ( ) const [virtual]

Implements Aspect_Window.

virtual Aspect_TypeOfResize Xw_Window::DoResize ( ) const [virtual]

Implements Aspect_Window.

virtual Standard_Boolean Xw_Window::DoubleBuffer ( ) const [virtual]

Implements Aspect_Window.

virtual Standard_Boolean Xw_Window::Dump ( const Standard_CString  aFilename,
const Standard_Real  aGammaValue = 1.0 
) const [virtual]

Implements Aspect_Window.

virtual Standard_Boolean Xw_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 void Xw_Window::Flush ( ) const [virtual]

Implements Aspect_Window.

Handle_Xw_FontMap Xw_Window::FontMap ( ) const
virtual Standard_Boolean Xw_Window::IsMapped ( ) const [virtual]

Implements Aspect_Window.

virtual Standard_Boolean Xw_Window::Load ( const Standard_CString  aFilename) const [virtual]

Implements Aspect_Window.

Implements Aspect_Window.

virtual void Xw_Window::Map ( ) const [virtual]

Implements Aspect_Window.

Handle_Xw_MarkMap Xw_Window::MarkMap ( ) const
virtual void Xw_Window::MMSize ( Standard_Real Width,
Standard_Real Height 
) const [virtual]

Implements Aspect_Window.

virtual void Xw_Window::Position ( Quantity_Parameter X1,
Quantity_Parameter Y1,
Quantity_Parameter X2,
Quantity_Parameter Y2 
) const [virtual]

Implements Aspect_Window.

virtual void Xw_Window::Position ( Standard_Integer X1,
Standard_Integer Y1,
Standard_Integer X2,
Standard_Integer Y2 
) const [virtual]

Implements Aspect_Window.

static void Xw_Window::PrintError ( ) [static, protected]
virtual Quantity_Ratio Xw_Window::Ratio ( ) const [virtual]

Implements Aspect_Window.

virtual void Xw_Window::Restore ( ) const [virtual]

Implements Aspect_Window.

Implements Aspect_Window.

virtual void Xw_Window::SetBackground ( const Aspect_Background Background) [virtual]

Implements Aspect_Window.

virtual void Xw_Window::SetBackground ( const Quantity_NameOfColor  BackColor) [virtual]

Implements Aspect_Window.

virtual void Xw_Window::SetBackground ( const Quantity_Color color) [virtual]

Implements Aspect_Window.

Implements Aspect_Window.

Implements Aspect_Window.

virtual void Xw_Window::SetBackground ( const Aspect_GradientBackground Background) [virtual]

Implements Aspect_Window.

virtual void Xw_Window::SetDoubleBuffer ( const Standard_Boolean  DBmode) [virtual]

Implements Aspect_Window.

virtual void Xw_Window::Size ( Quantity_Parameter Width,
Quantity_Parameter Height 
) const [virtual]

Implements Aspect_Window.

virtual void Xw_Window::Size ( Standard_Integer Width,
Standard_Integer Height 
) const [virtual]

Implements Aspect_Window.

virtual Standard_Boolean Xw_Window::ToPixMap ( Image_PixMap theImage) const [virtual]
Handle_Xw_TypeMap Xw_Window::TypeMap ( ) const
virtual void Xw_Window::Unmap ( ) const [virtual]

Implements Aspect_Window.

Handle_Xw_WidthMap Xw_Window::WidthMap ( ) const
void Xw_Window::XParentWindow ( Standard_Integer aPart1,
Standard_Integer aPart2 
) const
void Xw_Window::XWindow ( Standard_Integer aPart1,
Standard_Integer aPart2 
) const

Field Documentation

Handle_Xw_ColorMap Xw_Window::MyColorMap [protected]
Handle_Xw_FontMap Xw_Window::MyFontMap [protected]
Handle_Xw_MarkMap Xw_Window::MyMarkMap [protected]
Handle_Xw_TypeMap Xw_Window::MyTypeMap [protected]
Handle_Xw_WidthMap Xw_Window::MyWidthMap [protected]

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