FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
CTrawlNetSpec.h
1
10#ifndef C_TRAWL_NET_SPEC_H
11#define C_TRAWL_NET_SPEC_H
12
13#include "CModelWriter.h"
14#include "SCableSectionData.h"
15#include "SNetPanel.h"
16#include "net/NetElementDef.h"
17#include "net/NTrawlSpec.h"
18#include "net/SNetSectionData.h"
19
20#include <assert.h>
21#include <vector>
22#include <set>
23
24#ifdef FH_VISUALIZATION
25# include "OgreColourValue.h"
26#endif
27
29{
30public:
33
36
38 void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, double barD, double barRho, double barE,
39 double barL, double N, double T1, double T2, double T3 = -1, double cutN = 0,
40 double cutB = 0, double cutT = 0, double reinforcementRatio = 0, double refineFactor = 1
41#ifdef FH_VISUALIZATION
42 ,
43 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
44#endif
45 );
46
48 void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SNetSection NetSection);
49
51 void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SMeshBar SBar,
52 TrawlSpec::SPanelCut SCut, double reinforcementRatio = 0, double refineFactor = 1
53#ifdef FH_VISUALIZATION
54 ,
55 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
56#endif
57 );
58
60 void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, double barD, double barRho, double barE,
61 double barL, double N, double T1, double T2, double T3 = -1, double cutN = 0,
62 double cutB = 0, double cutT = 0, double reinforcementRatio = 0, double refineFactor = 1
63#ifdef FH_VISUALIZATION
64 ,
65 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
66#endif
67 );
68
70 void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SNetSection NetSection);
71
73 void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SMeshBar SBar,
74 TrawlSpec::SPanelCut SCut, double reinforcementRatio = 0, double refineFactor = 1
75#ifdef FH_VISUALIZATION
76 ,
77 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
78#endif
79 );
80
82 TrawlSpec::SNetSection GetSection(TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
83
85 void DeleteSection(TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
86
88 void DeletePanel(TrawlSpec::EPanel_t EWhichPanel);
89
91 void UpdateSection(TrawlSpec::SNetSection NetSection, TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
92
94 int GetNumBellySections(TrawlSpec::EPanel_t EWhichPanel);
95
97 int GetNumSplitterSections(TrawlSpec::EPanel_t EWhichPanel);
98
100 int GetNumSections(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge);
101
103 int GetNumWingSections(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge);
104
106 void AddLine(int sectionNum, TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::ESectionSide_t side,
107 double L, double D, double E, double rho);
108
110 void AddLine(int sectionNum, TrawlSpec::EPanel_t EWhichPanel,
111 TrawlSpec::ESectionSide_t side, SCableSectionData SCableSection);
112
114 void AddLine(SCableSectionData SCableSection);
115
117 SCableSectionData GetLine(TrawlSpec::EPanel_t EWhichPanel, int iLineIndex);
118
120 SCableSectionData* GetLinePtr(TrawlSpec::EPanel_t EWhichPanel, int iLineIndex);
121
123 int GetNumLines(TrawlSpec::EPanel_t EWhichPanel);
124
126 void SetExternalNodeIndices(std::set<TrawlSpec::ENetExternalNodes_t> ViExternalNodes);
127
129 void AddExternalConnection(TrawlSpec::ENetExternalNodes_t ENode);
130
132 void AddExternalNodeOutput(TrawlSpec::ENetExternalNodes_t ENode);
133
135 void SetNumConnectedSections(TrawlSpec::EPanel_t EWhichPanel, int iNumSections);
136
138 int GetNumConnectedSections(TrawlSpec::EPanel_t EWhichPanel);
139
141 void SetAftMostSectionNumber(TrawlSpec::EPanel_t EWhichPanel, int iAftSection);
142
144 int GetAftMostSectionNumber(TrawlSpec::EPanel_t EWhichPanel);
145
148
150 bool HasError();
151
153 std::string GetError();
154
156 void ResetInput(bool bResetError);
157
160
162 std::set<TrawlSpec::ENetExternalNodes_t> GetExternalConnections();
163
165 const std::set<TrawlSpec::ENetExternalNodes_t>& GetExternalOutputs() const { return m_ViExternalNodesOutput; }
166
168 bool SetMirrorWings(TrawlSpec::EPanel_t EWhichPanel, bool bMirror);
169
171 bool GetMirrorWings(TrawlSpec::EPanel_t EWhichPanel);
172
175
177 double GetStretchedEdge(int sectionNum, TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::ESectionSide_t side);
178
179#ifdef FH_VISUALIZATION
181 void SetNetSectionColour(Ogre::ColourValue twineColour, TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
182
184 void SetNetColour(Ogre::ColourValue twineColour);
185#endif
186
187protected:
189 TrawlSpec::SNetPanel* GetPanelPtr(TrawlSpec::EPanel_t EWhichPanel);
190
192 bool IsSidepanel(TrawlSpec::EPanel_t EWhichPanel);
193
195 void SetError(std::string sErrorMsg);
196
198 TrawlSpec::ESectionType_t DetermineSectionType(TrawlSpec::EPanel_t EWhichPanel, int iSecNo);
199
201 std::string GetPanelString(TrawlSpec::EPanel_t EWhichPanel);
202
203 // Tells if the front element of the specified panel and edge is triangular.
204 bool HasTriangularFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge);
205
206 // Tells if the aft element of the specified panel and edge is triangular.
207 bool HasTriangularAft(TrawlSpec::EPanel_t EWhichPanel);
208
210 int GetWingSectionIndex(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge, int iWingSecNum);
211
213 void MirrorWings(TrawlSpec::EPanel_t EWhichPanel);
214
215
216 //TrawlSpec::SNetPanel SUpperPanel; ///< A structure containing the sections comprising the upper panel.
217 //TrawlSpec::SNetPanel SLowerPanel; ///< A structure containing the sections comprising the lower panel.
218 //TrawlSpec::SNetPanel SSidePanel; ///< A structure containing the sections comprising the sidepanels.
219 std::vector<TrawlSpec::SNetPanel> m_VSPanelInfo;
220 std::string m_sError;
223 std::set<TrawlSpec::ENetExternalNodes_t> m_ViExternalConnections;
224 std::set<TrawlSpec::ENetExternalNodes_t> m_ViExternalNodesOutput;
231};
232
233#endif
Class used to collect and contain the specification of a trawl net.
Definition CTrawlNetSpec.h:29
void SetError(std::string sErrorMsg)
Sets the error state.
bool m_bMirrorWingsIsDone[3]
Reflects for which panels the wings have been mirrored.
Definition CTrawlNetSpec.h:230
int GetNumExternalConnections()
Gets the number of external connections on each side of the trawl net.
void AddLine(int sectionNum, TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::ESectionSide_t side, SCableSectionData SCableSection)
Adds a line, chain, gear or Headline to the trawl net.
bool m_bExternalNodesAreSet
Indicates if the external nodes have been set by calling SetExternalNodeIndices.
Definition CTrawlNetSpec.h:228
bool m_bHasSidePanel
A bool telling if the trawl net has four panels.
Definition CTrawlNetSpec.h:226
CTrawlNetSpec(void)
Constructor.
void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SMeshBar SBar, TrawlSpec::SPanelCut SCut, double reinforcementRatio=0, double refineFactor=1)
Adds a section to the front of the trawl net.
int GetNumSections(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge)
Gets the number of sections in a panel.
double m_dMinNodeSeparation
The minimum separation between two nodes in front or aft of a section before it is handled as one nod...
Definition CTrawlNetSpec.h:225
void AddLine(SCableSectionData SCableSection)
Adds a line, chain, gear or Headline to the trawl net.
bool SetMirrorWings(TrawlSpec::EPanel_t EWhichPanel, bool bMirror)
Sets the wings of a specified panel to be mirrored or not.
TrawlSpec::ESectionType_t DetermineSectionType(TrawlSpec::EPanel_t EWhichPanel, int iSecNo)
Determines if the section is a wing, splitter or belly section, based on its placement.
double GetStretchedEdge(int sectionNum, TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::ESectionSide_t side)
Get stretched length of section side.
void AddExternalConnection(TrawlSpec::ENetExternalNodes_t ENode)
Adds an external connection to the net.
TrawlSpec::SNetSection GetSection(TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack=true)
Gets the specification of a specified net section.
void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, double barD, double barRho, double barE, double barL, double N, double T1, double T2, double T3=-1, double cutN=0, double cutB=0, double cutT=0, double reinforcementRatio=0, double refineFactor=1)
Adds a section to the front of the trawl net.
void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SNetSection NetSection)
Adds a section to the front of the trawl net.
int GetNumBellySections(TrawlSpec::EPanel_t EWhichPanel)
Gets the number of belly sections in a panel, not counting splitter section.
void MirrorWings(TrawlSpec::EPanel_t EWhichPanel)
Mirrors the wings for the specified panels.
void SetAftMostSectionNumber(TrawlSpec::EPanel_t EWhichPanel, int iAftSection)
Defines the aft-forward placement of a panel in relation to a common baseline.
bool m_bMirrorWings[3]
Reflects for which panels the wings should be mirrored.
Definition CTrawlNetSpec.h:229
void ResetInput(bool bResetError)
Resets both input and output data of the object.
bool GetMirrorWings(TrawlSpec::EPanel_t EWhichPanel)
Gets if the wings of a specified panel are to be mirrored or not.
void AddLine(int sectionNum, TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::ESectionSide_t side, double L, double D, double E, double rho)
Adds a line or chain to the trawl net.
bool HasError()
Returns if an error has occured in this class.
bool m_bHasError
Have there been any errors in this object?
Definition CTrawlNetSpec.h:227
std::set< TrawlSpec::ENetExternalNodes_t > m_ViExternalConnections
The indices of the nodes to select for external connections. 0 - 5 designate the wings,...
Definition CTrawlNetSpec.h:223
int m_aiAftSection[3]
The relative section number of the aftmost section of each panel, counted from the aft.
Definition CTrawlNetSpec.h:222
double GetMinNodeSeparation() const
The mesh count under which an aft or front end edge of a panel is meshed as a point.
Definition CTrawlNetSpec.h:147
void SetNumConnectedSections(TrawlSpec::EPanel_t EWhichPanel, int iNumSections)
Defines how far forward the a panel is connected to other panels.
void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, double barD, double barRho, double barE, double barL, double N, double T1, double T2, double T3=-1, double cutN=0, double cutB=0, double cutT=0, double reinforcementRatio=0, double refineFactor=1)
Adds a section to the back of the trawl net.
int GetNumSplitterSections(TrawlSpec::EPanel_t EWhichPanel)
Gets the number of splitter sections in a panel.
std::string GetPanelString(TrawlSpec::EPanel_t EWhichPanel)
Creates a string specifying the panel.
std::set< TrawlSpec::ENetExternalNodes_t > m_ViExternalNodesOutput
The indices of the nodes to select for external connections. 0 - 5 designate the wings,...
Definition CTrawlNetSpec.h:224
void AddExternalNodeOutput(TrawlSpec::ENetExternalNodes_t ENode)
Adds an external output node to the net.
int m_aiConnectedSections[3]
The number of sections connected to each panel.
Definition CTrawlNetSpec.h:221
int MirrorWings()
Mirrors the wings for the appropriate panels.
void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SMeshBar SBar, TrawlSpec::SPanelCut SCut, double reinforcementRatio=0, double refineFactor=1)
Adds a section to the back of the trawl net.
const std::set< TrawlSpec::ENetExternalNodes_t > & GetExternalOutputs() const
Gets the external nodes that only output their positions and velocities (AddExternalNodeOutput).
Definition CTrawlNetSpec.h:165
std::string m_sError
A string describing the first error string.
Definition CTrawlNetSpec.h:220
bool IsSidepanel(TrawlSpec::EPanel_t EWhichPanel)
Tests if a specified panel is a side panel;.
void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SNetSection NetSection)
Adds a section to the back of the trawl net.
int GetWingSectionIndex(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge, int iWingSecNum)
Gets the index of a specified wing section.
void DeletePanel(TrawlSpec::EPanel_t EWhichPanel)
Deletes all net sections of the specified panel.
void UpdateSection(TrawlSpec::SNetSection NetSection, TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack=true)
Updates the specified net section.
int GetNumLines(TrawlSpec::EPanel_t EWhichPanel)
Gets the number of lines in a specified panel.
int GetNumWingSections(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge)
Gets the number of wing sections in a panel.
void SetExternalNodeIndices(std::set< TrawlSpec::ENetExternalNodes_t > ViExternalNodes)
Sets the indices of the nodes to be used for external connections.
TrawlSpec::SNetPanel * GetPanelPtr(TrawlSpec::EPanel_t EWhichPanel)
Gets a pointer to the panel defined by an enum.
int GetAftMostSectionNumber(TrawlSpec::EPanel_t EWhichPanel)
Gets the aft-forward placement of a panel in relation to a common baseline.
SCableSectionData GetLine(TrawlSpec::EPanel_t EWhichPanel, int iLineIndex)
Gets the specification of a line connected to the trawl net.
~CTrawlNetSpec(void)
Destructor.
std::set< TrawlSpec::ENetExternalNodes_t > GetExternalConnections()
Gets the external connections on each side of the trawl net.
std::string GetError()
Returns a string specifying the first error that occured in this class.
SCableSectionData * GetLinePtr(TrawlSpec::EPanel_t EWhichPanel, int iLineIndex)
Gets a pointer to a line connected to the trawl net.
void DeleteSection(TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack=true)
Deletes the specified net section.
int GetNumConnectedSections(TrawlSpec::EPanel_t EWhichPanel)
Gets how far forward the upper panel is connected to other panels.
std::vector< TrawlSpec::SNetPanel > m_VSPanelInfo
A vector of structures containing the sections comprising the various panels.
Definition CTrawlNetSpec.h:219
Definition SCableSectionData.h:17
Definition NTrawlSpec.h:79
Definition SNetPanel.h:22
Definition NTrawlSpec.h:128
Definition NTrawlSpec.h:95