Open CASCADE Technology  7.6.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

Draw_Window Class Referenceabstract

Draw window. More...

#include <Draw_Window.hxx>

Inheritance diagram for Draw_Window:
Inheritance graph
[legend]

Public Types

typedef void(* FCallbackBeforeTerminate) ()
 Type of the callback function that is to be passed to the method AddCallbackBeforeTerminate(). More...
 

Public Member Functions

virtual ~Draw_Window ()
 Destructor. More...
 
void GetPosition (Standard_Integer &thePosX, Standard_Integer &thePosY)
 Get window position. More...
 
void SetPosition (Standard_Integer theNewXpos, Standard_Integer theNewYpos)
 Set window position. More...
 
Standard_Integer HeightWin () const
 Return window height. More...
 
Standard_Integer WidthWin () const
 Return window width. More...
 
void SetDimension (Standard_Integer theNewDx, Standard_Integer theNewDy)
 Set window dimensions. More...
 
TCollection_AsciiString GetTitle () const
 Return window title. More...
 
void SetTitle (const TCollection_AsciiString &theTitle)
 Set window title. More...
 
bool IsMapped () const
 Return true if window is displayed on the screen. More...
 
void DisplayWindow ()
 Display window on the screen. More...
 
void Hide ()
 Hide window. More...
 
void Destroy ()
 Destroy window. More...
 
void Clear ()
 Clear window content. More...
 
Standard_Boolean GetUseBuffer () const
 Returns Standard_True if off-screen image buffer is being used. More...
 
void SetUseBuffer (Standard_Boolean theToUse)
 
void SetColor (Standard_Integer theColor)
 Set active color index for further paintings. More...
 
void SetMode (Standard_Integer theMode)
 Set active paint mode (3 for COPY; 6 for XOR). More...
 
void DrawString (Standard_Integer theX, Standard_Integer theY, const char *theText)
 Draw the string. More...
 
void DrawSegments (const Draw_XSegment *theSegments, Standard_Integer theNumberOfElements)
 Draw array of segments. More...
 
void Redraw ()
 Redraw window content. More...
 
Standard_Boolean Save (const char *theFileName) const
 Save snapshot. More...
 
virtual void WExpose ()=0
 Perform window exposing. More...
 
void InitBuffer ()
 (Re)initializes off-screen image buffer according to current window size. More...
 

Static Public Member Functions

static void AddCallbackBeforeTerminate (FCallbackBeforeTerminate theCB)
 This method registers a callback function that will be called just before exit. This is useful especially for Windows platform, on which Draw is normally self-terminated instead of exiting. More...
 
static void RemoveCallbackBeforeTerminate (FCallbackBeforeTerminate theCB)
 Just in case method for un-registering a callback previously registered by AddCallbackBeforeTerminate(). More...
 
static Standard_Boolean DefineColor (const Standard_Integer theIndex, const char *theColorName)
 
static void Flush ()
 XFlush() wrapper (X11), has no effect on other platforms. More...
 

Protected Member Functions

 Draw_Window (const char *theTitle, const NCollection_Vec2< int > &theXY, const NCollection_Vec2< int > &theSize, Aspect_Drawable theParent, Aspect_Drawable theWin)
 Main constructor. More...
 
void init (const NCollection_Vec2< int > &theXY, const NCollection_Vec2< int > &theSize)
 Initialize the window. More...
 

Detailed Description

Draw window.

Member Typedef Documentation

◆ FCallbackBeforeTerminate

typedef void(* Draw_Window::FCallbackBeforeTerminate) ()

Type of the callback function that is to be passed to the method AddCallbackBeforeTerminate().

Constructor & Destructor Documentation

◆ ~Draw_Window()

virtual Draw_Window::~Draw_Window ( )
virtual

Destructor.

◆ Draw_Window()

Draw_Window::Draw_Window ( const char *  theTitle,
const NCollection_Vec2< int > &  theXY,
const NCollection_Vec2< int > &  theSize,
Aspect_Drawable  theParent,
Aspect_Drawable  theWin 
)
protected

Main constructor.

Parameters
theTitle[in] window title
theXY[in] top-left position
theSize[in] window dimensions
theParent[in] optional native parent window
theWin[in] optional native window

Member Function Documentation

◆ AddCallbackBeforeTerminate()

static void Draw_Window::AddCallbackBeforeTerminate ( FCallbackBeforeTerminate  theCB)
static

This method registers a callback function that will be called just before exit. This is useful especially for Windows platform, on which Draw is normally self-terminated instead of exiting.

◆ Clear()

void Draw_Window::Clear ( )

Clear window content.

◆ DefineColor()

static Standard_Boolean Draw_Window::DefineColor ( const Standard_Integer  theIndex,
const char *  theColorName 
)
static
See also
SetColor()

◆ Destroy()

void Draw_Window::Destroy ( )

Destroy window.

◆ DisplayWindow()

void Draw_Window::DisplayWindow ( )

Display window on the screen.

◆ DrawSegments()

void Draw_Window::DrawSegments ( const Draw_XSegment theSegments,
Standard_Integer  theNumberOfElements 
)

Draw array of segments.

◆ DrawString()

void Draw_Window::DrawString ( Standard_Integer  theX,
Standard_Integer  theY,
const char *  theText 
)

Draw the string.

◆ Flush()

static void Draw_Window::Flush ( )
static

XFlush() wrapper (X11), has no effect on other platforms.

◆ GetPosition()

void Draw_Window::GetPosition ( Standard_Integer thePosX,
Standard_Integer thePosY 
)

Get window position.

◆ GetTitle()

TCollection_AsciiString Draw_Window::GetTitle ( ) const

Return window title.

◆ GetUseBuffer()

Standard_Boolean Draw_Window::GetUseBuffer ( ) const
inline

Returns Standard_True if off-screen image buffer is being used.

◆ HeightWin()

Standard_Integer Draw_Window::HeightWin ( ) const

Return window height.

◆ Hide()

void Draw_Window::Hide ( )

Hide window.

◆ init()

void Draw_Window::init ( const NCollection_Vec2< int > &  theXY,
const NCollection_Vec2< int > &  theSize 
)
protected

Initialize the window.

◆ InitBuffer()

void Draw_Window::InitBuffer ( )

(Re)initializes off-screen image buffer according to current window size.

◆ IsMapped()

bool Draw_Window::IsMapped ( ) const

Return true if window is displayed on the screen.

◆ Redraw()

void Draw_Window::Redraw ( )

Redraw window content.

◆ RemoveCallbackBeforeTerminate()

static void Draw_Window::RemoveCallbackBeforeTerminate ( FCallbackBeforeTerminate  theCB)
static

Just in case method for un-registering a callback previously registered by AddCallbackBeforeTerminate().

◆ Save()

Standard_Boolean Draw_Window::Save ( const char *  theFileName) const

Save snapshot.

◆ SetColor()

void Draw_Window::SetColor ( Standard_Integer  theColor)

Set active color index for further paintings.

See also
DefineColor()

◆ SetDimension()

void Draw_Window::SetDimension ( Standard_Integer  theNewDx,
Standard_Integer  theNewDy 
)

Set window dimensions.

◆ SetMode()

void Draw_Window::SetMode ( Standard_Integer  theMode)

Set active paint mode (3 for COPY; 6 for XOR).

◆ SetPosition()

void Draw_Window::SetPosition ( Standard_Integer  theNewXpos,
Standard_Integer  theNewYpos 
)

Set window position.

◆ SetTitle()

void Draw_Window::SetTitle ( const TCollection_AsciiString theTitle)

Set window title.

◆ SetUseBuffer()

void Draw_Window::SetUseBuffer ( Standard_Boolean  theToUse)

◆ WExpose()

virtual void Draw_Window::WExpose ( )
pure virtual

Perform window exposing.

Implemented in Draw_View.

◆ WidthWin()

Standard_Integer Draw_Window::WidthWin ( ) const

Return window width.


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