ADTF Display Toolbox
Loading...
Searching...
No Matches
cMixin

Base class for Mixin Filters. More...

#include <mixin.h>

Inheritance diagram for cMixin:
[legend]

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

osg::ref_ptr< osg::Switch > m_pRootNode
 
filter::interface_client< ISceneGraph > m_pSceneGraph
 
std::vector< ucom::object_ptr< detail::cSceneGraphProxy > > m_oCoordinateSystemSceneGraphProxys
 
osg::ref_ptr< osgText::Font > m_pFont = new cInstanceFont
 
ucom::object_ptr< IViewer > m_pViewer
 
std::vector< const osg::Node * > m_oLastPick
 

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 237 of file mixin.h.

Constructor & Destructor Documentation

◆ cMixin()

cMixin ( )
inline

Constructor.

Definition at line 245 of file mixin.h.

◆ ~cMixin()

~cMixin ( )
inlineoverride

Destructor.

Definition at line 254 of file mixin.h.

Member Function Documentation

◆ AddGlobalMenuItem()

virtual tResult AddGlobalMenuItem ( chewbacca::IMenu & )
inlinevirtual

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.

Definition at line 355 of file mixin.h.

◆ AddMenuItemForPick()

virtual tResult AddMenuItemForPick ( chewbacca::IMenu & ,
const tNodePath &  )
inlinevirtual

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.

Definition at line 345 of file mixin.h.

◆ ClearScene()

virtual tVoid ClearScene ( )
inlineprotectedvirtual

Use this to clean up your graph elements.

Definition at line 451 of file mixin.h.

◆ CreateCoordinateSystem()

IChildCoordinateSystem * CreateCoordinateSystem ( const tChar * strName)
inline

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.

Definition at line 267 of file mixin.h.

◆ CreateCoordinateSystems()

tVoid CreateCoordinateSystems ( )
inlineprotected

Definition at line 456 of file mixin.h.

◆ GetFont()

osgText::Font * GetFont ( )
inline

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.

Definition at line 307 of file mixin.h.

◆ GetLastMenuPath()

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

Definition at line 363 of file mixin.h.

◆ GetRoot()

osg::Group * GetRoot ( )
inline

Add your nodes to this group.

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

Returns
The root group.

Definition at line 279 of file mixin.h.

References GetSceneGraph().

Referenced by cBaseObjectMixin::AddScene().

◆ GetSceneGraph()

ISceneGraph & GetSceneGraph ( )
inline

Access the ISceneGraph interface.

Returns
The connected ISceneGraph interface.

Definition at line 297 of file mixin.h.

Referenced by GetRoot().

◆ InitScene()

virtual tResult InitScene ( )
inlineprotectedvirtual

Impelement this to add your graph elements.

Returns
Standard result.

Definition at line 443 of file mixin.h.

Referenced by cBaseObjectSelectionMixin::InitScene().

◆ OnPick()

virtual tResult OnPick ( tInt32 ,
tInt32 ,
tUInt32 ,
const tNodePath &  )
inlinevirtual

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. For high DPI displays, this is in Qt logical pixels.
nPosY[in] The vertical position of the click in the view window. For high DPI displays, this is in Qt logical pixels.
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.

Definition at line 333 of file mixin.h.

Member Data Documentation

◆ m_oCoordinateSystemSceneGraphProxys

std::vector<ucom::object_ptr<detail::cSceneGraphProxy> > m_oCoordinateSystemSceneGraphProxys
protected

Definition at line 466 of file mixin.h.

◆ m_oLastPick

std::vector<const osg::Node*> m_oLastPick
protected

Definition at line 469 of file mixin.h.

◆ m_pFont

osg::ref_ptr<osgText::Font> m_pFont = new cInstanceFont
protected

Definition at line 467 of file mixin.h.

◆ m_pRootNode

osg::ref_ptr<osg::Switch> m_pRootNode
protected

Definition at line 464 of file mixin.h.

◆ m_pSceneGraph

filter::interface_client<ISceneGraph> m_pSceneGraph
protected

Definition at line 465 of file mixin.h.

◆ m_pViewer

ucom::object_ptr<IViewer> m_pViewer
protected

Definition at line 468 of file mixin.h.