Open CASCADE Technology 7.8.0
|
#include <Draw_Window.hxx>
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 (Standard_Integer &thePosX, Standard_Integer &thePosY) |
Get window position. | |
void | SetPosition (Standard_Integer theNewXpos, Standard_Integer theNewYpos) |
Set window position. | |
Standard_Integer | HeightWin () const |
Return window height. | |
Standard_Integer | WidthWin () const |
Return window width. | |
void | SetDimension (Standard_Integer theNewDx, Standard_Integer 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. | |
Standard_Boolean | GetUseBuffer () const |
Returns Standard_True if off-screen image buffer is being used. | |
void | SetUseBuffer (Standard_Boolean theToUse) |
void | SetColor (Standard_Integer theColor) |
Set active color index for further paintings. | |
void | SetMode (Standard_Integer theMode) |
Set active paint mode (3 for COPY; 6 for XOR). | |
void | DrawString (Standard_Integer theX, Standard_Integer theY, const char *theText) |
Draw the string. | |
void | DrawSegments (const Draw_XSegment *theSegments, Standard_Integer theNumberOfElements) |
Draw array of segments. | |
void | Redraw () |
Redraw window content. | |
Standard_Boolean | 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 Standard_Boolean | DefineColor (const Standard_Integer 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. | |
Draw window.
typedef void(* Draw_Window::FCallbackBeforeTerminate) () |
Type of the callback function that is to be passed to the method AddCallbackBeforeTerminate().
|
virtual |
Destructor.
|
protected |
Main constructor.
theTitle | [in] window title |
theXY | [in] top-left position |
theSize | [in] window dimensions |
theParent | [in] optional native parent window |
theWin | [in] optional native window |
|
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.
void Draw_Window::Clear | ( | ) |
Clear window content.
|
static |
void Draw_Window::Destroy | ( | ) |
Destroy window.
void Draw_Window::DisplayWindow | ( | ) |
Display window on the screen.
void Draw_Window::DrawSegments | ( | const Draw_XSegment * | theSegments, |
Standard_Integer | theNumberOfElements | ||
) |
Draw array of segments.
void Draw_Window::DrawString | ( | Standard_Integer | theX, |
Standard_Integer | theY, | ||
const char * | theText | ||
) |
Draw the string.
|
static |
XFlush() wrapper (X11), has no effect on other platforms.
void Draw_Window::GetPosition | ( | Standard_Integer & | thePosX, |
Standard_Integer & | thePosY | ||
) |
Get window position.
TCollection_AsciiString Draw_Window::GetTitle | ( | ) | const |
Return window title.
|
inline |
Returns Standard_True if off-screen image buffer is being used.
Standard_Integer Draw_Window::HeightWin | ( | ) | const |
Return window height.
void Draw_Window::Hide | ( | ) |
Hide window.
|
protected |
Initialize the window.
void Draw_Window::InitBuffer | ( | ) |
(Re)initializes off-screen image buffer according to current window size.
bool Draw_Window::IsMapped | ( | ) | const |
Return true if window is displayed on the screen.
void Draw_Window::Redraw | ( | ) |
Redraw window content.
|
static |
Just in case method for un-registering a callback previously registered by AddCallbackBeforeTerminate().
Standard_Boolean Draw_Window::Save | ( | const char * | theFileName | ) | const |
Save snapshot.
void Draw_Window::SetColor | ( | Standard_Integer | theColor | ) |
Set active color index for further paintings.
void Draw_Window::SetDimension | ( | Standard_Integer | theNewDx, |
Standard_Integer | theNewDy | ||
) |
Set window dimensions.
void Draw_Window::SetMode | ( | Standard_Integer | theMode | ) |
Set active paint mode (3 for COPY; 6 for XOR).
void Draw_Window::SetPosition | ( | Standard_Integer | theNewXpos, |
Standard_Integer | theNewYpos | ||
) |
Set window position.
void Draw_Window::SetTitle | ( | const TCollection_AsciiString & | theTitle | ) |
Set window title.
void Draw_Window::SetUseBuffer | ( | Standard_Boolean | theToUse | ) |
|
pure virtual |
Perform window exposing.
Implemented in Draw_View.
Standard_Integer Draw_Window::WidthWin | ( | ) | const |
Return window width.