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

cQtWindow Base class for object mixins. More...

#include <baseobjectselectionmixin.h>

Inheritance diagram for cBaseObjectSelectionMixin:
[legend]

Public Member Functions

 cBaseObjectSelectionMixin ()
 Constructor.
 
QWidget * CreateView () override
 Creates the view with the XService.
 
tVoid ReleaseView () override
 Releases the view with the XService.
 
tResult InitScene () override
 Init the scene of this mixin.
 
tResult ProcessInput (adtf::streaming::flash::ISampleReader *pReader, const adtf::ucom::ant::iobject_ptr< const adtf::streaming::ant::ISample > &pSample) override
 Process input override.
 
tResult OnIdle () override
 Handle a an idle event.
 

Protected Member Functions

virtual void AttachItemsToWidget (QWidget *pWidget)
 Creates Qt widgets for displaying data.
 
virtual tResult UpdateWidgets (cBaseObjectScene *pScene, cBaseObject *pObj)
 Updates the Qt widgets based on the currently selected object.
 

Protected Attributes

adtf::ucom::ant::object_ptr< IViewer > m_pViewer
 pointer to the viewer (used for locking)
 
QLabel * m_pSceneLabel
 Pointer to the pin label.
 
QLabel * m_pIdLabel
 Pointer to the id label.
 
QLabel * m_pPositionLabel
 Pointer to the position label.
 
QLabel * m_pRotationLabel
 Pointer to the rotation label.
 
QLabel * m_pDimLabel
 Pointer to the dimension label.
 
QLabel * m_pMotionLabel
 Pointer to the motion vector label.
 
tBool m_bHadSelection = false
 Used to remember whether we had a selection during the last idle call.
 
osg::ref_ptr< cBaseObject > m_pSelectedObject
 Remembers the selected object.
 
osg::ref_ptr< cBaseObjectScene > m_pSelectedScene
 remembers the scene that the selected object belongs to.
 

Detailed Description

cQtWindow Base class for object mixins.

These support selection (pick functionality).

Implement the UpdateScene method to add data to your scene. To add additional widgets to display custom information overwrite the AttachItemsToWidget method. Call the base implementation at the beginning of your method and use pWidget->layout() to add your own widgets (optional). In your UpdateWidgets method call the base method and update your own widgets (Mind that the parameters can equal NULL, which means that no object is currently selected).

Definition at line 47 of file baseobjectselectionmixin.h.

Constructor & Destructor Documentation

◆ cBaseObjectSelectionMixin()

Constructor.

Definition at line 52 of file baseobjectselectionmixin.h.

◆ ~cBaseObjectSelectionMixin()

~cBaseObjectSelectionMixin ( )
inlineoverride

Definition at line 56 of file baseobjectselectionmixin.h.

Member Function Documentation

◆ AttachItemsToWidget()

virtual void AttachItemsToWidget ( QWidget * pWidget)
inlineprotectedvirtual

Creates Qt widgets for displaying data.

Overwrite this and call the base to add your own widgets.

Parameters
pWidget[in] The base widget of this mixin.

Definition at line 192 of file baseobjectselectionmixin.h.

References m_pDimLabel, m_pIdLabel, m_pMotionLabel, m_pPositionLabel, m_pRotationLabel, and m_pSceneLabel.

Referenced by CreateView().

◆ CreateView()

QWidget * CreateView ( )
inlineoverride

Creates the view with the XService.

Returns
pointer to a qwidget

Definition at line 66 of file baseobjectselectionmixin.h.

References AttachItemsToWidget().

◆ InitScene()

tResult InitScene ( )
inlineoverride

Init the scene of this mixin.

See adtf::disptb::mixinlib::IMixin for further reference.

Returns
standard result

Definition at line 87 of file baseobjectselectionmixin.h.

References cMixin::InitScene(), and m_pViewer.

◆ OnIdle()

tResult OnIdle ( )
inlineoverride

Handle a an idle event.

See adtf::disptb::mixinlib::IMixin for further reference.

Returns
standard result

Definition at line 130 of file baseobjectselectionmixin.h.

References m_pSelectedObject, m_pSelectedScene, m_pViewer, and UpdateWidgets().

◆ ProcessInput()

tResult ProcessInput ( adtf::streaming::flash::ISampleReader * pReader,
const adtf::ucom::ant::iobject_ptr< const adtf::streaming::ant::ISample > & pSample )
inlineoverride

Process input override.

Parameters
pReader[in] pointer to the sample reader
pSample[in] pointer to current sample
Returns
standard result

Definition at line 102 of file baseobjectselectionmixin.h.

References m_pSelectedObject, and m_pSelectedScene.

◆ ReleaseView()

tVoid ReleaseView ( )
inlineoverride

Releases the view with the XService.

Definition at line 78 of file baseobjectselectionmixin.h.

◆ UpdateWidgets()

virtual tResult UpdateWidgets ( cBaseObjectScene * pScene,
cBaseObject * pObj )
inlineprotectedvirtual

Updates the Qt widgets based on the currently selected object.

Overwrite this and call the base to update your own widgets.

Parameters
pScene[in] The scene that the selected object belongs to, can be NULL.
pObj[in] The selected object, can be NULL.
Returns
Standard result.

Definition at line 239 of file baseobjectselectionmixin.h.

References cBaseObject::GetId(), cBaseObject::GetMotion(), cBaseObjectScene::GetName(), cBaseObject::GetPosition(), cBaseObject::GetRotation(), cBaseObject::GetSize(), m_bHadSelection, m_pDimLabel, m_pIdLabel, m_pMotionLabel, m_pPositionLabel, m_pRotationLabel, and m_pSceneLabel.

Referenced by OnIdle().

Member Data Documentation

◆ m_bHadSelection

tBool m_bHadSelection = false
protected

Used to remember whether we had a selection during the last idle call.

Definition at line 294 of file baseobjectselectionmixin.h.

Referenced by UpdateWidgets().

◆ m_pDimLabel

QLabel* m_pDimLabel
protected

Pointer to the dimension label.

Definition at line 289 of file baseobjectselectionmixin.h.

Referenced by AttachItemsToWidget(), and UpdateWidgets().

◆ m_pIdLabel

QLabel* m_pIdLabel
protected

Pointer to the id label.

Definition at line 283 of file baseobjectselectionmixin.h.

Referenced by AttachItemsToWidget(), and UpdateWidgets().

◆ m_pMotionLabel

QLabel* m_pMotionLabel
protected

Pointer to the motion vector label.

Definition at line 291 of file baseobjectselectionmixin.h.

Referenced by AttachItemsToWidget(), and UpdateWidgets().

◆ m_pPositionLabel

QLabel* m_pPositionLabel
protected

Pointer to the position label.

Definition at line 285 of file baseobjectselectionmixin.h.

Referenced by AttachItemsToWidget(), and UpdateWidgets().

◆ m_pRotationLabel

QLabel* m_pRotationLabel
protected

Pointer to the rotation label.

Definition at line 287 of file baseobjectselectionmixin.h.

Referenced by AttachItemsToWidget(), and UpdateWidgets().

◆ m_pSceneLabel

QLabel* m_pSceneLabel
protected

Pointer to the pin label.

Definition at line 281 of file baseobjectselectionmixin.h.

Referenced by AttachItemsToWidget(), and UpdateWidgets().

◆ m_pSelectedObject

osg::ref_ptr<cBaseObject> m_pSelectedObject
protected

Remembers the selected object.

Definition at line 297 of file baseobjectselectionmixin.h.

Referenced by OnIdle(), and ProcessInput().

◆ m_pSelectedScene

osg::ref_ptr<cBaseObjectScene> m_pSelectedScene
protected

remembers the scene that the selected object belongs to.

Definition at line 299 of file baseobjectselectionmixin.h.

Referenced by OnIdle(), and ProcessInput().

◆ m_pViewer

adtf::ucom::ant::object_ptr<IViewer> m_pViewer
protected

pointer to the viewer (used for locking)

Definition at line 278 of file baseobjectselectionmixin.h.

Referenced by InitScene(), and OnIdle().