FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
VisualFlowPlane.h
1#pragma once
2
3#include <fhsim/simobject/SimObject.h>
4#include <memory>
5#include <string>
6
7namespace environment
8{
9class EnvironmentProvider;
10}
11
12#ifdef FH_VISUALIZATION
13# include "visual/FlowPlane.h"
14#endif
15
16namespace environmentmodels
17{
18
47class VisualFlowPlane : public SimObject
48{
49public:
51 enum class ComputeFunction
52 {
53 VelocityMagnitude,
54 CurrentMagnitude,
55 Pressure,
56 TotalPressure,
57 WakeDeficit,
58 SurfaceElevation,
59 ScalarField,
60 };
61
67 VisualFlowPlane(std::string SimObjectName, ISimObjectCreator* Creator);
68
70 void FinalSetup(const double T, const double* const X, ISimObjectCreator* Creator) override;
71
73 void OdeFcn(const double T, const double* const X, double* const XDot) const override;
74
75#ifdef FH_VISUALIZATION
77 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* Creator) override;
78
80 void RenderUpdate(const double T, const double* const X) override;
81#endif
82
83private:
85 environment::EnvironmentProvider* m_pEnvironment;
86
88 ComputeFunction m_computeFunctionType;
89
91 std::string m_fieldName;
92#ifdef FH_VISUALIZATION
94 std::shared_ptr<visual::FlowPlane> m_flowPlane;
96 visual::FlowPlaneSettings m_settings;
98 visual::ComputeFunction m_computeFunction;
99#endif
100
101 // Initial (static) position and orientation
102 double m_position0[3];
103 double m_localX0[3];
104 double m_localY0[3];
105
106 // Optional second position for linear back-and-forth motion
107 double m_position1[3];
108 bool m_hasPosition2;
109 double m_positionPeriod;
110
111 // Optional continuous rotation around the plane’s own axes
112 double m_rotationPeriodX;
113 double m_rotationPeriodY;
114};
115
116} // namespace environmentmodels
Definition VisualFlowPlane.h:48
VisualFlowPlane(std::string SimObjectName, ISimObjectCreator *Creator)
ComputeFunction
Quantity shown on the flow plane, set from the XML ComputeFunction parameter.
Definition VisualFlowPlane.h:52
void OdeFcn(const double T, const double *const X, double *const XDot) const override
ODE function for state updates.
void FinalSetup(const double T, const double *const X, ISimObjectCreator *Creator) override
Final setup phase - retrieves Environment provider.
Environment SimObjects.
Definition Environment.h:25