ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
mixin.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "mixin_types.h"
11 #include "scene_graph_intf.h"
12 
13 #include <adtf_filtersdk.h>
14 #include <a_utils.h>
15 #include <adtf_base.h>
16 #include <adtf_ucom3.h>
17 #include <adtf_streaming3.h>
18 
19 #include <vector>
20 
21 namespace osgText { class Font;}
22 namespace osg { class Node; }
23 namespace osg { class Group; }
24 
25 namespace adtf
26 {
27 
28 namespace disptb
29 {
30 
31 namespace mixinlib
32 {
33 
34 namespace endor
35 {
36 
41 {
42  protected:
45 
46  public:
51  virtual osg::Group* GetRoot() = 0;
52 
57  virtual tVoid SetPosition(const osg::Vec3d& oPos) = 0;
58 
63  virtual tVoid SetAttitude(const osg::Quat& oQuat) = 0;
64 
69  virtual tVoid SetScale(const osg::Vec3d& oScale) = 0;
70 
75  virtual tVoid SetPivotPoint(const osg::Vec3d& oPivot) = 0;
76 };
77 
91 class cMixin: public ucom::catwo::object<filter::hollow::cFilter, INodeHandler, IMenuEventSink>,
92  public ucom::ant::enable_object_ptr_from_this<cMixin>
93 {
94  public:
98  cMixin();
99 
103  ~cMixin() override;
104 
115 
120  osg::Group* GetRoot();
121 
127 
133  osgText::Font* GetFont();
134 
136  tResult HandleMenuEvent(const tChar* strMenuText,
137  tVoid* pvEventData) override;
139 
152  virtual tResult OnPick(tInt32 nPosX,
153  tInt32 nPosY,
154  tUInt32 nFlags,
155  const tNodePath& sNodePath);
156 
164  virtual tResult AddMenuItemForPick(IMenu& oMenu, const tNodePath& sNodePath);
165 
171  virtual tResult AddGlobalMenuItem(IMenu& oMenu);
172 
176  std::vector<const osg::Node*> GetLastMenuPath();
177 
179  tResult Init(tInitStage eStage) override;
180  tResult Shutdown(tInitStage eStage) override;
181  tResult GetName(base::ant::IString&& strName) const override;
182  tResult OnPick(tInt32 nPosX,
183  tInt32 nPosY,
184  tUInt32 nFlags,
185  const tNodePath& sNodePath,
186  IMenu& oMenu) override;
187 
188  tResult Process(base::flash::tNanoSeconds tmTrigger,
189  streaming::ant::IRunner* pRunner) override;
190  tResult ProcessInput(base::flash::tNanoSeconds tmTrigger,
191  streaming::flash::ISampleReader* pReader) override;
193 
194  protected:
195 
200  virtual tResult InitScene();
201 
205  virtual tVoid ClearScene();
206 
207  protected:
208  class cImplementation;
209 
211  std::unique_ptr<cImplementation> m_pImplementation;
212 };
213 
214 }
215 
216 using endor::cMixin;
218 
219 
220 } // mixinlib
221 
222 } // disptb
223 
224 } // adtf
Interface for managing a (context) menu.
Definition: menu_intf.h:165
Interface for accessing and manipulating a coordinate system created with cMixin::CreateCoordinateSys...
Definition: mixin.h:41
virtual tVoid SetAttitude(const osg::Quat &oQuat)=0
Set the attitude of the coordinate system.
virtual osg::Group * GetRoot()=0
Use this to add nodes within the coordinate system.
virtual tVoid SetPosition(const osg::Vec3d &oPos)=0
Set the position of the coordinate system.
virtual tVoid SetScale(const osg::Vec3d &oScale)=0
Set the scale of the coordinate system.
virtual tVoid SetPivotPoint(const osg::Vec3d &oPivot)=0
Set the pivot point of the coordinate system.
Interface for the scene graph of a 3D Scene Display.
Base class for Mixin Filters.
Definition: mixin.h:93
osgText::Font * GetFont()
Returns a pointer to a valid Font, use this for your osgText nodes.
virtual tResult AddMenuItemForPick(IMenu &oMenu, const tNodePath &sNodePath)
Return context menu entries for one of your nodes.
IChildCoordinateSystem * CreateCoordinateSystem(const tChar *strName)
Creates a new coordinate system.
virtual tResult InitScene()
Impelement this to add your graph elements.
virtual tResult AddGlobalMenuItem(IMenu &oMenu)
Add global menu entries not related to a specific one of your nodes.
osg::Group * GetRoot()
Add your nodes to this group.
virtual tResult OnPick(tInt32 nPosX, tInt32 nPosY, tUInt32 nFlags, const tNodePath &sNodePath)
Handle a left click on one of your nodes.
std::unique_ptr< cImplementation > m_pImplementation
D-Pointer implementation.
Definition: mixin.h:208
virtual tVoid ClearScene()
Use this to clean up your graph elements.
std::vector< const osg::Node * > GetLastMenuPath()
ISceneGraph & GetSceneGraph()
Access the ISceneGraph interface.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Main namespace.
Copyright © Audi Electronics Venture GmbH.