|
ADTF Display Toolbox
|
The Streaming Source 2D OpenGL Display, offers the possibility to display all Drawers which are connected to the 2D OpenGL Display via BindingProxy.
To use the 2D OpenGL Display, simply add it to the Streaming Graph and connect the Drawers to the Streaming Source.
You can use the 2D OpenGL Display multiple times and connect each Drawer to the 2D OpenGL Display where it should be displayed.
Drawers are ADTF Plugins, which are a compound of an ADTF Filter and the IDrawer interface. This means that they offer all functionality which is typically for a filter, and additionally functionality defined by the IDrawer interface. This interface offers possibilities to add and manage 2D data which is added to the canvas object provided by the 2D OpenGL Display through a callback mechanism.
The basic behaviour of a Drawer is defined by the base class cDrawer. When implementing a custom Drawer, cDrawer is subclassed, and methods are overwritten to provide the custom behaviour,
especially the cDrawer::Draw(...) method defines what data is painted on the canvas object and therefore shown on the 2D OpenGL Display.
Just use the pointer to the ICanvas Interface which will be provided through 2D OpenGL Display during the active callback routine and call the painting functions with it you want to use. Each custom Drawer (= plugin) can manage its data independently, without knowing about other Drawers.
The technique to define custom 2D Data is exclusively based on OpenGL wrapped in a conveniance API provided throught the ICanvas Interface.
This section provides information about the 2D OpenGL Display. The 2D OpenGL Display paints all Drawer data and provides some interaction with the 2D canvas.
All Drawers connected to one instance of the 2D OpenGL Display will be called and can paint their information onto the canvas. The order in which the individual Drawer will be called from the callback mechanism of the 2D OpenGL Display is defined by two properties. Each Drawer derived from cDrawer will inherit multiple properties. To specify the hierachy in which of all connected Drawers you can use the ZOrder and Parent property. The Parent property defines which coordinate system is the basis for all drawing operations done by the Drawer. The default value is "world" which is base for all Drawers. With the ZOrder property you can define which Drawer paints over other Drawers with the same parent.
If a Drawer is placed in the Filter Graph, you need to connect them via the BindingProxy Interface called drawer_manager.
The interactions with the canvas are:
The above list of the context menu is automatically provided by the 2D OpenGL Display.
All interfaces and functionalities related to Drawers is provided by packages. These packages are part of the Display Toolbox. In the installation they can be found in the folder 'pkg'.
To address different needs, the functionality is split into 2 packages:
Relevant for developing custom Drawers is the packages 'adtf::disptb::drawerlib'.
Part of the Drawer concept are coordinate systems. Each Drawer holds a own coordinate system in relation to the Drawer parent. You can manipulate the coordinate system of the Drawer with the provided properties of cDrawer.
By default all these values are set to zero.
You only need to create a custum class which derives from the cDrawer base class. Then just overwrite the virtual function Draw implemented in cDrawer with your own implementation.
Just take a look at our provided examples.