FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
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 <fhsim/simobject/SimObject.h>
84
85class FhCamera;
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 override;
96
98 void AcceptedStep(const double dT, const double* const adX) override;
99
100#ifdef FH_VISUALIZATION
102 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
103
105 void RenderUpdate(const double T, const double* const X);
106#endif
107
108 protected:
109 std::string GetTimestring();
110
111#ifdef FH_VISUALIZATION
112 std::string m_sFilename;
113 std::string m_sPath;
114 double m_dFrameRate;
115 int m_StepsPerFrame;
116 int m_stepCounter;
117 bool m_bVideo;
118 double m_dVideoStopTime;
119 double m_dVideoStartTime;
120 unsigned int m_iCounter;
121 bool m_bHasTakenShot;
122 int m_iRefinement;
123
124 enum FRAMERATE_CONTROL
125 {
126 FRAMES_PER_SECOND,
127 MAJOR_TIMESTEP_PER_FRAME
128 };
129 FRAMERATE_CONTROL m_framerateControl;
130
131
132 sfh::timers::StopWatch StopWatch;
133 double m_dPeriod;
134
135 FhCamera* m_pFhCamera;
136 Ogre::Camera* m_pCamera;
137 CScreenshotManager* m_pScreenshotManager;
138#endif
139};
140
141#endif
Definition CCameraShot.h:88
virtual void OdeFcn(const double dT, const double *const adX, double *const adXDot) const override
Calculates the state derivatives.
void AcceptedStep(const double dT, const double *const adX) override
Called once after each accepted integration step.
CCameraShot(std::string sSimObjectName, ISimObjectCreator *pCreator)
The constructor sets the pointer to the output object and the parser object.