Marine systems simulation
CCameraShot.h
1#ifndef C_CAMERA_SHOT_H
2#define C_CAMERA_SHOT_H
3
66#include <string>
67
68#ifdef FH_VISUALIZATION
69# include <fstream>
70# include <locale>
71# include <sstream>
72# pragma warning(push)
73# pragma warning(disable : 4251)
74# pragma warning(disable : 4267)
75# include "sfh/ogre/CScreenshotManager.h"
76
77# include <Ogre.h>
78# include <OgreResourceGroupManager.h>
79# pragma warning(pop)
80# include "sfh/timers/StopWatch.h"
81#endif
82
83#include "SimObject.h"
84
85class CFhCamera;
86
87class CCameraShot : public SimObject
88{
89 public:
91 CCameraShot(std::string sSimObjectName, ISimObjectCreator* pCreator);
92
94 virtual void OdeFcn(const double dT, const double* const adX,
95 double* const adXDot, const bool bIsMajorTimeStep);
96
97#ifdef FH_VISUALIZATION
99 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
100
102 void RenderUpdate(const double T, const double* const X);
103#endif
104
105 protected:
106 std::string GetTimestring();
107
108#ifdef FH_VISUALIZATION
109 std::string m_sFilename;
110 std::string m_sPath;
111 double m_dFrameRate;
112 int m_StepsPerFrame;
113 int m_stepCounter;
114 bool m_bVideo;
115 double m_dVideoStopTime;
116 double m_dVideoStartTime;
117 unsigned int m_iCounter;
118 bool m_bHasTakenShot;
119 int m_iRefinement;
120
121 enum FRAMERATE_CONTROL
122 {
123 FRAMES_PER_SECOND,
124 MAJOR_TIMESTEP_PER_FRAME
125 };
126 FRAMERATE_CONTROL m_framerateControl;
127
128
129 sfh::timers::StopWatch StopWatch;
130 double m_dPeriod;
131
132 CFhCamera* m_pFhCamera;
133 Ogre::Camera* m_pCamera;
134 CScreenshotManager* m_pScreenshotManager;
135#endif
136};
137
138#endif
Definition: CCameraShot.h:88
virtual void OdeFcn(const double dT, const double *const adX, double *const adXDot, const bool bIsMajorTimeStep)
Calculates the state derivatives.
CCameraShot(std::string sSimObjectName, ISimObjectCreator *pCreator)
The constructor sets the pointer to the output object and the parser object.