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
48class VisualFlowPlane : public SimObject
49{
50public:
52 enum class ComputeFunction
53 {
54 VelocityMagnitude,
55 CurrentMagnitude,
56 Pressure,
57 TotalPressure,
58 WakeFactor,
59 SurfaceElevation,
60 ScalarField,
61 };
62
68 VisualFlowPlane(std::string SimObjectName, ISimObjectCreator* Creator);
69
71 void FinalSetup(const double T, const double* const X, ISimObjectCreator* Creator) override;
72
74 void OdeFcn(const double T, const double* const X, double* const XDot) const override;
75
76#ifdef FH_VISUALIZATION
78 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* Creator) override;
79
81 void RenderUpdate(const double T, const double* const X) override;
82#endif
83
84private:
86 environment::EnvironmentProvider* m_pEnvironment;
87
89 ComputeFunction m_computeFunctionType;
90
92 std::string m_fieldName;
93#ifdef FH_VISUALIZATION
95 std::shared_ptr<visual::FlowPlane> m_flowPlane;
97 visual::FlowPlaneSettings m_settings;
99 visual::ComputeFunction m_computeFunction;
100#endif
101
102 // Initial (static) position and orientation
103 double m_position0[3];
104 double m_localX0[3];
105 double m_localY0[3];
106
107 // Optional second position for linear back-and-forth motion
108 double m_position1[3];
109 bool m_hasPosition2;
110 double m_positionPeriod;
111
112 // Optional continuous rotation around the plane’s own axes
113 double m_rotationPeriodX;
114 double m_rotationPeriodY;
115};
116
117} // namespace environmentmodels
Definition VisualFlowPlane.h:49
VisualFlowPlane(std::string SimObjectName, ISimObjectCreator *Creator)
ComputeFunction
Quantity shown on the flow plane, set from the XML ComputeFunction parameter.
Definition VisualFlowPlane.h:53
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