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
104#endif
105
106 protected:
107 std::string GetTimestring();
108
109#ifdef FH_VISUALIZATION
110 std::string m_sFilename;
111 std::string m_sPath;
112 double m_dFrameRate;
113 int m_StepsPerFrame;
114 int m_stepCounter;
115 bool m_bVideo;
116 double m_dVideoStopTime;
117 double m_dVideoStartTime;
118 unsigned int m_iCounter;
119 bool m_bHasTakenShot;
120 int m_iRefinement;
121
122 enum FRAMERATE_CONTROL
123 {
124 FRAMES_PER_SECOND,
125 MAJOR_TIMESTEP_PER_FRAME
126 };
127 FRAMERATE_CONTROL m_framerateControl;
128
129
130 sfh::timers::StopWatch StopWatch;
131 double m_dPeriod;
132
133 FhCamera* m_pFhCamera = nullptr;
134 Ogre::Camera* m_pCamera = nullptr;
135 CScreenshotManager* m_pScreenshotManager = nullptr;
136#endif
137};
138
139#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.