ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
cDrawer

cDrawer class. More...

Inheritance diagram for cDrawer:
[legend]

Public Member Functions

 cDrawer ()
 Constructor.
 
virtual ~cDrawer ()=default
 Destructor.
 
tInt GetZOrder () const override
 The ZOrder defines the order of drawing the objects, if there are in the same coordinate space level. More...
 
tBool IsVisible () const override
 IsVisible() is not the same as IsActive()! If a drawer is invisible all Handlers will be called except the Draw method. More...
 
virtual tResult Draw (const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &pCanvas) override
 This method is where the user code defines what is drawn on the canvas. More...
 
tResult OnDraw (const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &pCanvas) override
 This method is called from the drawer manager to draw on the give canvas. More...
 
tVoid SetMatrix (tFloat32 fTransX, tFloat32 fTransY, tFloat32 fScaleX, tFloat32 fScaleY, tFloat32 fRotate)
 SetMatrix sets all parameter for the matrix to use in cDrawer::ApplyMatrix() Draw() don't need them because the matrix is applied before cDrawer::Draw() is called. More...
 
tVoid ApplyMatrix (const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &pCanvas)
 This method is called before Drawing. More...
 
virtual tResult ContextCreated (const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &pCanvas) override
 This method can be overwritten to define the desired behavior during the OnCreateContext event. More...
 
tResult OnCreateContext (const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &pCanvas) final
 This oneshot method is called once when the transition from runlevel 4 to runlevel 5 occurs The use of this function is purely to call the ContextCreated Callbacks within the user implementation. More...
 
virtual tResult ContextDestroyed () override
 This method can be overwritten to define the desired behavior during the OnDestroyContext event. More...
 
tResult OnDestroyContext () final
 This oneshot method is called once when the transition from runlevel 5 to runlevel 4 occurs The use of this function is purely to call the ContextCreated Callbacks within the user implementation. More...
 

Detailed Description

cDrawer class.

A cDrawer derived class behaves like a Filter and extends its functionality by IDrawer methods, a Draw method and the coordinate space handling.

A cDrawer shares the Canvas with the containing Filter (based on cFilter) and handles Mouse and Keyboard events.

If the parent property is set, then the coordinate space is placed inside the referenced coordinate space. The parent property can contain the name of any drawer instantiated in the current filter graph. If no parent is set, the 2DDisplay coordinate space aka world is the parent.

Definition at line 153 of file drawer.h.

Member Function Documentation

◆ ApplyMatrix()

tVoid ApplyMatrix ( const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &  pCanvas)

This method is called before Drawing.

The purpose is to pass the matrix over to OpenGL, so that all further drawings will be scaled, rotated and moved like described.

Parameters
pCanvas[in/out] Pointer to the current Canvas object

◆ ContextCreated()

virtual tResult ContextCreated ( const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &  pCanvas)
overridevirtual

This method can be overwritten to define the desired behavior during the OnCreateContext event.

Parameters
pCanvas[in/out] Pointer to the current Canvas object
Returns
standard result

◆ ContextDestroyed()

virtual tResult ContextDestroyed ( )
overridevirtual

This method can be overwritten to define the desired behavior during the OnDestroyContext event.

Returns
standard result

◆ Draw()

virtual tResult Draw ( const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &  pCanvas)
overridevirtual

This method is where the user code defines what is drawn on the canvas.

Parameters
pCanvas[in/out] Pointer to the current Canvas object
Returns
always NO_ERROR because the base class cDrawer has nothing to draw

◆ GetZOrder()

tInt GetZOrder ( ) const
override

The ZOrder defines the order of drawing the objects, if there are in the same coordinate space level.

Returns
the current ZOrder value

◆ IsVisible()

tBool IsVisible ( ) const
override

IsVisible() is not the same as IsActive()! If a drawer is invisible all Handlers will be called except the Draw method.

Returns
tTrue, if the drawer is visibel otherwise tFalse

◆ OnCreateContext()

tResult OnCreateContext ( const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &  pCanvas)
final

This oneshot method is called once when the transition from runlevel 4 to runlevel 5 occurs The use of this function is purely to call the ContextCreated Callbacks within the user implementation.

It is not intended to be overridden by Drawer implementations.

Parameters
pCanvas[in/out] Pointer to the current Canvas object
Returns
standard result

◆ OnDestroyContext()

tResult OnDestroyContext ( )
final

This oneshot method is called once when the transition from runlevel 5 to runlevel 4 occurs The use of this function is purely to call the ContextCreated Callbacks within the user implementation.

It is not intended to be overridden by Drawer implementations.

Returns
standard result

◆ OnDraw()

tResult OnDraw ( const ucom::ant::iobject_ptr< disptb::graphicslib::dengar::ICanvas > &  pCanvas)
override

This method is called from the drawer manager to draw on the give canvas.

Parameters
pCanvas[in/out] Pointer to the current Canvas object
Returns
always NO_ERROR because the base class cDrawer has nothing to draw

◆ SetMatrix()

tVoid SetMatrix ( tFloat32  fTransX,
tFloat32  fTransY,
tFloat32  fScaleX,
tFloat32  fScaleY,
tFloat32  fRotate 
)

SetMatrix sets all parameter for the matrix to use in cDrawer::ApplyMatrix() Draw() don't need them because the matrix is applied before cDrawer::Draw() is called.

Parameters
fTransX[in] Translation in x direction
fTransY[in] Translation in y direction
fScaleX[in] Scaling in x direction
fScaleY[in] Scaling in y direction
fRotate[in] Rotation angle in degrees (CCW)