AnimatLab  2
Test
VsSimulationWindow.h
1 #pragma once
2 
3 namespace VortexAnimatSim
4 {
5  namespace Visualization
6  {
7 
8 class VORTEX_PORT VsSimulationWindow : public AnimatSim::SimulationWindow, osgGA::GUIEventHandler
9 {
10  protected:
11  VsSimulationWindowMgr *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, VsSimulator *lpVsSim);
27  virtual void InitStandalone(Simulator *lpSim, VsSimulator *lpVsSim);
28  virtual void TrackCamera();
29 
30  public:
31  VsSimulationWindow(void);
32  virtual ~VsSimulationWindow(void);
33 
34  virtual CStdFPoint GetCameraPosition();
35 
36  virtual BodyPart *TrackBody() {return m_lpTrackBody;};
37  virtual osg::Matrix GetScreenMatrix();
38  virtual osg::Viewport* GetViewport();
39  virtual osgViewer::Viewer *Viewer() {return m_osgViewer.get();};
40 
41  virtual void SetupTrackCamera(bool bResetEyePos);
42  virtual void SetCameraLookAt(CStdFPoint oTarget, bool bResetEyePos);
43  virtual void SetCameraPositionAndLookAt(CStdFPoint oCameraPos, CStdFPoint oTarget);
44  virtual void SetCameraPositionAndLookAt(osg::Vec3d vCameraPos, osg::Vec3d vTarget);
45  virtual void SetCameraPostion(CStdFPoint vCameraPos);
46 
47  virtual float *GetDataPointer(const std::string &strDataType);
48 
49  virtual void UpdateBackgroundColor();
50 
51  virtual void Initialize();
52  virtual void Update();
53  virtual void Close();
54 
55  virtual void OnGetFocus();
56  virtual void OnLoseFocus();
57 };
58 
59  }// end Visualization
60 }// end VortexAnimatSim
61 
Base class for a simulation window.
bool m_bEyePosSet
true if we have set the eye position at least once.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.