Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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().
 

Public Member Functions

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

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.
 
static void RemoveCallbackBeforeTerminate (FCallbackBeforeTerminate theCB)
 Just in case method for un-registering a callback previously registered by AddCallbackBeforeTerminate().
 
static bool DefineColor (const int theIndex, const char *theColorName)
 
static void Flush ()
 XFlush() wrapper (X11), has no effect on other platforms.
 

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.
 
void init (const NCollection_Vec2< int > &theXY, const NCollection_Vec2< int > &theSize)
 Initialize the window.
 

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
[in]theTitlewindow title
[in]theXYtop-left position
[in]theSizewindow dimensions
[in]theParentoptional native parent window
[in]theWinoptional 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 bool Draw_Window::DefineColor ( const int 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,
int theNumberOfElements )

Draw array of segments.

◆ DrawString()

void Draw_Window::DrawString ( int theX,
int 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 ( int & thePosX,
int & thePosY )

Get window position.

◆ GetTitle()

TCollection_AsciiString Draw_Window::GetTitle ( ) const

Return window title.

◆ GetUseBuffer()

bool Draw_Window::GetUseBuffer ( ) const
inline

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

◆ HeightWin()

int 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()

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

Save snapshot.

◆ SetColor()

void Draw_Window::SetColor ( int theColor)

Set active color index for further paintings.

See also
DefineColor()

◆ SetDimension()

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

Set window dimensions.

◆ SetMode()

void Draw_Window::SetMode ( int theMode)

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

◆ SetPosition()

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

Set window position.

◆ SetTitle()

void Draw_Window::SetTitle ( const TCollection_AsciiString & theTitle)

Set window title.

◆ SetUseBuffer()

void Draw_Window::SetUseBuffer ( bool theToUse)

◆ WExpose()

virtual void Draw_Window::WExpose ( )
pure virtual

Perform window exposing.

Implemented in Draw_View.

◆ WidthWin()

int Draw_Window::WidthWin ( ) const

Return window width.


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