Marine systems simulation
FloeDetectRegion.h
1#pragma once
2
8#include <Eigen/Eigen>
9#include <SimObject.h>
10
11#ifdef FH_VISUALIZATION
12 #include <sfh/ogre/C3DLine.h>
13#endif
14namespace ice {
15 class FloeDetectRegion : public SimObject {
16
17 public:
18 EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
19 FloeDetectRegion(std::string simObjectName, ISimObjectCreator* creator);
20 const double * regionVerticesNED(const double T, const double * const X);
21
22 void OdeFcn(const double T, const double* const X, double* const XDot, const bool isMajorTimeStep) {}
23
24#ifdef FH_VISUALIZATION
25 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator) {
26 Ogre::SceneManager* sceneMgr = ogreRoot->getSceneManager("main");
27
28 double trackColor[3] = { 1,0,0 };
29
30 line = new C3DLine(sceneMgr, Ogre::RenderOperation::OT_LINE_STRIP, 5, Ogre::ColourValue::Red);
31
32 }
33 virtual void RenderUpdate(const double T, const double* const X) {
34 const double * vert = regionVerticesNED(T, X);
35
36 for (int i = 0; i < 4; i++)
37 line->SetPoint(i, vert[i * 3 + 0], vert[i * 3 + 1], 0, Ogre::ColourValue::Red);
38 line->SetPoint(4, vert[0], vert[1], 0, Ogre::ColourValue::Red);
39 line->Update();
40 }
41#endif
42 private:
43 ISignalPort * m_inRegionParentPoint;
44 ISignalPort * m_inRegionParentRotation;
45
46 //Eigen::Vector3d m_offset;
47 Eigen::Vector3d m_p0, m_p1, m_p2, m_p3;
48
49 double m_output[12];
50#ifdef FH_VISUALIZATION
51 C3DLine *line;
52#endif
53
54 };
55}
Definition: FloeDetectRegion.h:15