AnimatLab  2
Test
OsgSimulationWindow.h
1 #pragma once
2 
3 namespace OsgAnimatSim
4 {
5  namespace Visualization
6  {
7 
8 class ANIMAT_OSG_PORT OsgSimulationWindow : public AnimatSim::SimulationWindow
9 {
10  protected:
11  OsgSimulationWindowMgr *m_lpWinMgr;
12 
13  osg::ref_ptr<osgViewer::Viewer> m_osgViewer;
14 
15  osg::ref_ptr<osgGA::TrackballManipulator> m_osgManip;
16 
17  //osg::ref_ptr<VsStatsHandler> m_osgStatsHandler;
18 
19  BodyPart *m_lpTrackBody;
20 
21  float m_fltCameraPosX, m_fltCameraPosY, m_fltCameraPosZ;
22 
25 
26  virtual void InitEmbedded(Simulator *lpSim, OsgSimulator *lpVsSim);
27  virtual void InitStandalone(Simulator *lpSim, OsgSimulator *lpVsSim);
28  virtual void TrackCamera();
29 
30  virtual ~OsgSimulationWindow(void);
31 
32  public:
33  OsgSimulationWindow(void);
34 
35  virtual CStdFPoint GetCameraPosition();
36 
37  virtual BodyPart *TrackBody() {return m_lpTrackBody;};
38  virtual osg::Matrix GetScreenMatrix();
39  virtual osg::Viewport* GetViewport();
40  virtual osgViewer::Viewer *Viewer() {return m_osgViewer.get();};
41 
42  virtual void SetupTrackCamera(bool bResetEyePos);
43  virtual void SetCameraLookAt(CStdFPoint oTarget, bool bResetEyePos);
44  virtual void SetCameraPositionAndLookAt(CStdFPoint oCameraPos, CStdFPoint oTarget);
45  virtual void SetCameraPositionAndLookAt(osg::Vec3d vCameraPos, osg::Vec3d vTarget);
46  virtual void SetCameraPostion(CStdFPoint vCameraPos);
47 
48  virtual float *GetDataPointer(const std::string &strDataType);
49 
50  virtual void UpdateBackgroundColor();
51 
52  virtual void Initialize();
53  virtual void Update();
54  virtual void Close();
55 
56  virtual void OnGetFocus();
57  virtual void OnLoseFocus();
58 };
59 
60  }// end Visualization
61 }// end OsgAnimatSim
62 
bool m_bEyePosSet
true if we have set the eye position at least once.
Base class for a simulation window.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.