FEDEM Model Database  R8.0
Source code of the FEDEM model database
FmSeaState.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
8 #ifndef FM_SEA_STATE_H
9 #define FM_SEA_STATE_H
10 
11 #include "vpmDB/FmIsRenderedBase.H"
12 #include "vpmDB/FmEngine.H"
13 #include "vpmDB/FmColor.H"
16 
17 
19 {
21 
22  using FmRange = std::pair<double,double>;
23 
24 public:
25  FmSeaState();
26 
27  virtual const char* getUITypeName() const { return "Sea state"; }
28 
29  virtual bool clone(FmBase* obj, int depth);
30  virtual std::ostream& writeFMF(std::ostream& os = std::cout);
31  static bool readAndConnect(std::istream& is, std::ostream& os = std::cout);
32  virtual void onEventSwitched(const FmSimulationEvent*) { this->draw(); }
33 
34  bool setMeanSeaLevel(double z0, bool redraw = true);
35  bool setWaveDir(const FaVec3& dir, bool redraw = true);
36  bool setSeaDepth(double z, bool redraw = true);
37  bool setLengthX(double x, bool redraw = true);
38  bool setLengthY(double y, bool redraw = true);
39 
40  const FmColor& getRGBColor() const { return myRGBColor.getValue(); }
41  bool setRGBColor(const FmColor& col, bool redraw = true);
42 
43  double getTransparency() const { return myTransparency.getValue(); }
44  bool setTransparency(double var, bool redraw = true);
45 
46  int getQuantization() const { return myQuantization.getValue(); }
47  bool setQuantization(double var, bool redraw = true);
48  bool getShowGrid() const { return showGrid.getValue(); }
49  bool setShowGrid(bool var, bool redraw = true);
50  bool getShowSolid() const { return showSolid.getValue(); }
51  bool setShowSolid(bool var, bool redraw = true);
52 
53  double getX() const { return x.getValue(); }
54  bool setX(double var, bool redraw = true);
55  double getY() const { return y.getValue(); }
56  bool setY(double var, bool redraw = true);
57 
58  const FaMat34& getLocalCS() const;
59  const FaVec3& getGrav() const;
60 
61 protected:
62  virtual ~FmSeaState();
63 
64  virtual bool cloneLocal(FmBase* obj, int depth);
65 
66 public:
71 
75 
78 
81 
84 
87 
90 
91  // Sea visualization fields
94 
95 private:
103 
104  mutable FaMat34 myCS;
105 };
106 
107 #endif
Position matrices in 3D space.
Point vectors in 3D space.
const ValueT & getValue() const
Returns a const reference to myData.
Definition: FFaField.H:56
Class for positions in 3D space.
Definition: FFaMat34.H:32
Class for point vectors in 3D space.
Definition: FFaVec3.H:40
Base parent class for the model data structure entries.
Definition: FmBase.H:37
Representation of a RGB color by floats in range [0.0,1.0].
Definition: FmColor.H:24
Definition: FmIsRenderedBase.H:23
bool draw()
Definition: FmIsRenderedBase.C:39
Definition: FmSeaState.H:19
bool setQuantization(double var, bool redraw=true)
Definition: FmSeaState.C:163
virtual ~FmSeaState()
Definition: FmSeaState.C:64
int getQuantization() const
Definition: FmSeaState.H:46
FFaField< double > y
Definition: FmSeaState.H:102
FFaField< FFaReferenceBase * > currScaleField
Definition: FmSeaState.H:86
FmSeaState()
Definition: FmSeaState.C:26
bool setTransparency(double var, bool redraw=true)
Definition: FmSeaState.C:130
FFaReference< FmMathFuncBase > currFunction
Definition: FmSeaState.H:79
bool setShowGrid(bool var, bool redraw=true)
Definition: FmSeaState.C:174
FFaField< bool > showGrid
Definition: FmSeaState.H:99
FFaField< double > waterDensity
Definition: FmSeaState.H:67
bool setX(double var, bool redraw=true)
Definition: FmSeaState.C:141
FFaField< double > growthThickness
Definition: FmSeaState.H:73
virtual bool cloneLocal(FmBase *obj, int depth)
Clones the data fields of *obj into *this.
Definition: FmSeaState.C:82
const FmColor & getRGBColor() const
Definition: FmSeaState.H:40
FFaField< double > x
Definition: FmSeaState.H:101
FFaField< double > myTransparency
Definition: FmSeaState.H:97
bool getShowGrid() const
Definition: FmSeaState.H:48
FFaField< FFaReferenceBase * > hdfScaleField
Definition: FmSeaState.H:89
FFaField< double > xLength
Definition: FmSeaState.H:92
FFaReference< FmEngine > hdfScale
Definition: FmSeaState.H:88
bool setMeanSeaLevel(double z0, bool redraw=true)
Definition: FmSeaState.C:196
FaMat34 myCS
Definition: FmSeaState.H:104
double getY() const
Definition: FmSeaState.H:55
FFaField< double > seaDepth
Definition: FmSeaState.H:69
FFaField< FmColor > myRGBColor
Definition: FmSeaState.H:96
bool setWaveDir(const FaVec3 &dir, bool redraw=true)
Definition: FmSeaState.C:207
bool setSeaDepth(double z, bool redraw=true)
Definition: FmSeaState.C:218
virtual std::ostream & writeFMF(std::ostream &os=std::cout)
Writes out this object in the model database file format.
Definition: FmSeaState.C:94
bool setLengthX(double x, bool redraw=true)
Definition: FmSeaState.C:229
double getTransparency() const
Definition: FmSeaState.H:43
double getX() const
Definition: FmSeaState.H:53
virtual void onEventSwitched(const FmSimulationEvent *)
Hook for simulation event handling.
Definition: FmSeaState.H:32
FFaField< FmRange > growthLimit
Definition: FmSeaState.H:74
FFaReference< FmEngine > currScale
Definition: FmSeaState.H:85
bool getShowSolid() const
Definition: FmSeaState.H:50
FFaField< double > meanSeaLevel
Definition: FmSeaState.H:68
Fmd_DB_HEADER_INIT()
bool setShowSolid(bool var, bool redraw=true)
Definition: FmSeaState.C:185
FFaField< int > myQuantization
Definition: FmSeaState.H:98
virtual const char * getUITypeName() const
Returns the type name of this object for use in the GUI.
Definition: FmSeaState.H:27
const FaMat34 & getLocalCS() const
Definition: FmSeaState.C:251
FFaField< bool > showSolid
Definition: FmSeaState.H:100
std::pair< double, double > FmRange
Definition: FmSeaState.H:22
FFaField< FFaReferenceBase * > currentDirField
Definition: FmSeaState.H:83
FFaField< double > yLength
Definition: FmSeaState.H:93
const FaVec3 & getGrav() const
Definition: FmSeaState.C:260
FFaField< FaVec3 > waveDir
Definition: FmSeaState.H:70
bool setRGBColor(const FmColor &col, bool redraw=true)
Definition: FmSeaState.C:119
bool setLengthY(double y, bool redraw=true)
Definition: FmSeaState.C:240
FFaField< double > growthDensity
Definition: FmSeaState.H:72
FFaField< FFaReferenceBase * > waveFunctionField
Definition: FmSeaState.H:77
FFaReference< FmMathFuncBase > waveFunction
Definition: FmSeaState.H:76
static bool readAndConnect(std::istream &is, std::ostream &os=std::cout)
Definition: FmSeaState.C:103
FFaField< FFaReferenceBase * > currFunctionField
Definition: FmSeaState.H:80
FFaReference< FmMathFuncBase > currentDir
Definition: FmSeaState.H:82
bool setY(double var, bool redraw=true)
Definition: FmSeaState.C:152
Definition: FmSimulationEvent.H:18
virtual bool clone(FmBase *, int)
Copies the fields of another object into *this.
Definition: FmBase.H:109