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#include <string>
24
25#ifdef FH_VISUALIZATION
26# include "OgreColourValue.h"
27#endif
28
30{
31public:
34
37
39 void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, double barD, double barRho, double barE,
40 double barL, double N, double T1, double T2, double T3 = -1, double cutN = 0,
41 double cutB = 0, double cutT = 0, double reinforcementRatio = 0, double refineFactor = 1
42#ifdef FH_VISUALIZATION
43 ,
44 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
45#endif
46 );
47
49 void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SNetSection NetSection);
50
52 void AddSectionToFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SMeshBar SBar,
53 TrawlSpec::SPanelCut SCut, double reinforcementRatio = 0, double refineFactor = 1
54#ifdef FH_VISUALIZATION
55 ,
56 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
57#endif
58 );
59
61 void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, double barD, double barRho, double barE,
62 double barL, double N, double T1, double T2, double T3 = -1, double cutN = 0,
63 double cutB = 0, double cutT = 0, double reinforcementRatio = 0, double refineFactor = 1
64#ifdef FH_VISUALIZATION
65 ,
66 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
67#endif
68 );
69
71 void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SNetSection NetSection);
72
74 void AddSectionToBack(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::SMeshBar SBar,
75 TrawlSpec::SPanelCut SCut, double reinforcementRatio = 0, double refineFactor = 1
76#ifdef FH_VISUALIZATION
77 ,
78 Ogre::ColourValue twineColour = Ogre::ColourValue(0.1f, 0.3f, 0.2f, 0.5f)
79#endif
80 );
81
83 TrawlSpec::SNetSection GetSection(TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
84
86 void DeleteSection(TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
87
89 void DeletePanel(TrawlSpec::EPanel_t EWhichPanel);
90
92 void UpdateSection(TrawlSpec::SNetSection NetSection, TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
93
95 int GetNumBellySections(TrawlSpec::EPanel_t EWhichPanel);
96
98 int GetNumSplitterSections(TrawlSpec::EPanel_t EWhichPanel);
99
101 int GetNumSections(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge);
102
104 int GetNumWingSections(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge);
105
107 void AddLine(int sectionNum, TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::ESectionSide_t side,
108 double L, double D, double E, double rho);
109
111 void AddLine(int sectionNum, TrawlSpec::EPanel_t EWhichPanel,
112 TrawlSpec::ESectionSide_t side, SCableSectionData SCableSection);
113
115 void AddLine(SCableSectionData SCableSection);
116
118 SCableSectionData GetLine(TrawlSpec::EPanel_t EWhichPanel, int iLineIndex);
119
121 SCableSectionData* GetLinePtr(TrawlSpec::EPanel_t EWhichPanel, int iLineIndex);
122
124 int GetNumLines(TrawlSpec::EPanel_t EWhichPanel);
125
127 void SetExternalNodeIndices(std::set<TrawlSpec::ENetExternalNodes_t> ViExternalNodes);
128
130 void AddExternalConnection(TrawlSpec::ENetExternalNodes_t ENode);
131
133 void AddExternalNodeOutput(TrawlSpec::ENetExternalNodes_t ENode);
134
136 void SetNumConnectedSections(TrawlSpec::EPanel_t EWhichPanel, int iNumSections);
137
139 int GetNumConnectedSections(TrawlSpec::EPanel_t EWhichPanel);
140
142 void SetAftMostSectionNumber(TrawlSpec::EPanel_t EWhichPanel, int iAftSection);
143
145 int GetAftMostSectionNumber(TrawlSpec::EPanel_t EWhichPanel);
146
149
151 bool HasError();
152
154 std::string GetError();
155
157 void ResetInput(bool bResetError);
158
161
163 std::set<TrawlSpec::ENetExternalNodes_t> GetExternalConnections();
164
166 const std::set<TrawlSpec::ENetExternalNodes_t>& GetExternalOutputs() const { return m_ViExternalNodesOutput; }
167
169 bool SetMirrorWings(TrawlSpec::EPanel_t EWhichPanel, bool bMirror);
170
172 bool GetMirrorWings(TrawlSpec::EPanel_t EWhichPanel);
173
176
178 double GetStretchedEdge(int sectionNum, TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::ESectionSide_t side);
179
180#ifdef FH_VISUALIZATION
182 void SetNetSectionColour(Ogre::ColourValue twineColour, TrawlSpec::EPanel_t EWhichPanel, int iSecNo, bool bFromBack = true);
183
185 void SetNetColour(Ogre::ColourValue twineColour);
186#endif
187
188protected:
190 TrawlSpec::SNetPanel* GetPanelPtr(TrawlSpec::EPanel_t EWhichPanel);
191
193 bool IsSidepanel(TrawlSpec::EPanel_t EWhichPanel);
194
196 void SetError(std::string sErrorMsg);
197
199 TrawlSpec::ESectionType_t DetermineSectionType(TrawlSpec::EPanel_t EWhichPanel, int iSecNo);
200
202 std::string GetPanelString(TrawlSpec::EPanel_t EWhichPanel);
203
204 // Tells if the front element of the specified panel and edge is triangular.
205 bool HasTriangularFront(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge);
206
207 // Tells if the aft element of the specified panel and edge is triangular.
208 bool HasTriangularAft(TrawlSpec::EPanel_t EWhichPanel);
209
211 int GetWingSectionIndex(TrawlSpec::EPanel_t EWhichPanel, TrawlSpec::EPanelEdge_t EWhichEdge, int iWingSecNum);
212
214 void MirrorWings(TrawlSpec::EPanel_t EWhichPanel);
215
216
217 //TrawlSpec::SNetPanel SUpperPanel; ///< A structure containing the sections comprising the upper panel.
218 //TrawlSpec::SNetPanel SLowerPanel; ///< A structure containing the sections comprising the lower panel.
219 //TrawlSpec::SNetPanel SSidePanel; ///< A structure containing the sections comprising the sidepanels.
220 std::vector<TrawlSpec::SNetPanel> m_VSPanelInfo;
221 std::string m_sError;
224 std::set<TrawlSpec::ENetExternalNodes_t> m_ViExternalConnections;
225 std::set<TrawlSpec::ENetExternalNodes_t> m_ViExternalNodesOutput;
232};
233
234#endif
Class used to collect and contain the specification of a trawl net.
Definition CTrawlNetSpec.h:30
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:231
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:229
bool m_bHasSidePanel
A bool telling if the trawl net has four panels.
Definition CTrawlNetSpec.h:227
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:226
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:230
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:228
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:224
int m_aiAftSection[3]
The relative section number of the aftmost section of each panel, counted from the aft.
Definition CTrawlNetSpec.h:223
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:148
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:225
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:222
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:166
std::string m_sError
A string describing the first error string.
Definition CTrawlNetSpec.h:221
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:220
Definition SCableSectionData.h:10
Definition NTrawlSpec.h:79
Definition SNetPanel.h:24
Definition NTrawlSpec.h:128
Definition NTrawlSpec.h:95