ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
cMixin

Base class for Mixin Filters. More...

Inheritance diagram for cMixin:
[legend]

Public Member Functions

 cMixin ()
 Constructor.
 
 ~cMixin () override
 Destructor.
 
IChildCoordinateSystemCreateCoordinateSystem (const tChar *strName)
 Creates a new coordinate system. More...
 
osg::Group * GetRoot ()
 Add your nodes to this group. More...
 
ISceneGraphGetSceneGraph ()
 Access the ISceneGraph interface. More...
 
osgText::Font * GetFont ()
 Returns a pointer to a valid Font, use this for your osgText nodes. More...
 
virtual tResult OnPick (tInt32 nPosX, tInt32 nPosY, tUInt32 nFlags, const tNodePath &sNodePath)
 Handle a left click on one of your nodes. More...
 
virtual tResult AddMenuItemForPick (IMenu &oMenu, const tNodePath &sNodePath)
 Return context menu entries for one of your nodes. More...
 
virtual tResult AddGlobalMenuItem (IMenu &oMenu)
 Add global menu entries not related to a specific one of your nodes. More...
 
std::vector< const osg::Node * > GetLastMenuPath ()
 

Protected Member Functions

virtual tResult InitScene ()
 Impelement this to add your graph elements. More...
 
virtual tVoid ClearScene ()
 Use this to clean up your graph elements.
 

Protected Attributes

std::unique_ptr< cImplementation > m_pImplementation
 D-Pointer implementation.
 

Detailed Description

Base class for Mixin Filters.

Use all the basic functionality available from adtf::filter::flash::cFilter.

Create your part of the scene graph by overriding InitScene() and adding nodes to GetRoot().

The overridden Process() and ProcessInput() methods will lock the viewer for you, so you can manipulate your graph elements without any special care in the ProcessInput(streaming::flash::ISampleReader*, const ucom::ant::iobject_ptr<const streaming::ant::ISample>&) method.

If you need to manipulate the tree in other locations, please use IViewer::Lock() / IViewer::Unlock().

Definition at line 91 of file mixin.h.

Member Function Documentation

◆ AddGlobalMenuItem()

virtual tResult AddGlobalMenuItem ( IMenu oMenu)
virtual

Add global menu entries not related to a specific one of your nodes.

Parameters
oMenu[in] The menu you should add your entries to.
Returns
Standard result.

◆ AddMenuItemForPick()

virtual tResult AddMenuItemForPick ( IMenu oMenu,
const tNodePath sNodePath 
)
virtual

Return context menu entries for one of your nodes.

Parameters
oMenu[in] The menu you should add your entries to.
sNodePath[in] The path in the tree from the root node to the clicked node.
Returns
Standard result.

◆ CreateCoordinateSystem()

IChildCoordinateSystem* CreateCoordinateSystem ( const tChar *  strName)

Creates a new coordinate system.

This will create an Interface Server where other Mixins can be connected to. All their nodes will reside within the new coordinate system.

Parameters
[in]strNameThe name of the coordinate system and the Interface Server Pin.
Returns
A pointer to the child coordinate system.

◆ GetFont()

osgText::Font* GetFont ( )

Returns a pointer to a valid Font, use this for your osgText nodes.

Only avaliable after cMixin::InitScene has been called.

Returns
A pointer to a valid Font.

◆ GetLastMenuPath()

std::vector<const osg::Node*> GetLastMenuPath ( )
Returns
The last node path when a context menu was created.

◆ GetRoot()

osg::Group* GetRoot ( )

Add your nodes to this group.

This node is placed within the parent coordinate system of the Mixin.

Returns
The root group.

◆ GetSceneGraph()

ISceneGraph& GetSceneGraph ( )

Access the ISceneGraph interface.

Returns
The connected ISceneGraph interface.

◆ InitScene()

virtual tResult InitScene ( )
protectedvirtual

Impelement this to add your graph elements.

Returns
Standard result.

◆ OnPick()

virtual tResult OnPick ( tInt32  nPosX,
tInt32  nPosY,
tUInt32  nFlags,
const tNodePath sNodePath 
)
virtual

Handle a left click on one of your nodes.

This is called whenever the user left clicks on one of your nodes of the scene graph.

Parameters
nPosX[in] The horizontal position of the click in the view window.
nPosY[in] The vertical position of the click in the view window.
nFlags[in] Modifier keys, mouse buttons etc. (The current osg based implementation uses enums from tModifiers )
sNodePath[in] The path in the tree from the root node to the clicked node.
Returns
Standard result.