Marine systems simulation
CNetElementDef.h
1
11
12#ifndef CNetElementDef_H
13#define CNetElementDef_H
14
15// Includes
16#include "SNetSectionData.h"
17#include "CExceptions.h"
18//#include "CPrintDuringExec.h"
19//Class definition
20
22{
23public:
24 enum NodePosition
25 {
26 NODE_ON_EDGE_AB = 100,
27 NODE_ON_EDGE_BC = 101,
28 NODE_ON_EDGE_CA = 102,
29 NODE_NOT_ON_EDGE = -100
30 };
31
34
37
39 bool Divide(int aiNodes[2], int iNewNode, int iNewElementID, CNetElementDef** ppSNewPanel);
40
42 bool Panel2Triangles(int iNewElementID, CNetElementDef* pSNewPanel);
43
45 bool Check() const;
46
48 double CalcEdgeLength(int iEdgeIndex) const;
49
51 unsigned short FindLongestEdge() const;
52
54 double CalcLongestEdge() const;
55
57 double CalcLengthFactor() const;
58
60 bool PanelEdge2Nodes(unsigned short iEdge, int aiNodes[2]) const;
61
63 double FindLongestEdge(int aiNodes[2]) const;
64
65 void DivideEdge(int iNewNode, int iNewElementID, CNetElementDef* pSNewPanel, int iNodeNoOldPanel, int iNodeNoNewPanel, double dDivideAtDistance=0.5);
66
67 NodePosition NodesDefineEdge(int aiNodes[2]);
68
69private:
70 bool Test(bool bOk, std::string sMessage) const;
71 bool Test(int iIn1, int iIn2, bool bShouldBeEqual, std::string sArg1) const;
72 bool Test(double dIn1, double dIn2, bool bShouldBeEqual, std::string sArg1) const;
73 bool Test(std::string sIn1, std::string sIn2, bool bShouldBeEqual, std::string sArg1) const;
74
75};
76#endif
Class containing the description of a net panel and methods necessary for taking this over to triangu...
Definition: CNetElementDef.h:22
bool Divide(int aiNodes[2], int iNewNode, int iNewElementID, CNetElementDef **ppSNewPanel)
Divides the panel in two, if the panel has an edge between the two provided nodes.
bool PanelEdge2Nodes(unsigned short iEdge, int aiNodes[2]) const
Finds the global nodes connected to the specified edge.
double FindLongestEdge(int aiNodes[2]) const
Finds the nodes connected to the longest edge of the panel.
double CalcLengthFactor() const
Calculates the largest length factor of the panel.
bool Check() const
Does the initialization and checking to make sure that the panel is ready for simulation.
double CalcLongestEdge() const
Calculates the longest edge length of the panel.
bool Panel2Triangles(int iNewElementID, CNetElementDef *pSNewPanel)
Divides the panel in two triangular ones, if the panel is quadrangular.
double dRefineFactor
The refine factor of the panel.
Definition: CNetElementDef.h:32
CNetElementDef()
Constructor.
unsigned short FindLongestEdge() const
Finds the longest edge of the panel.
double CalcEdgeLength(int iEdgeIndex) const
Calculates the length of the specified edge.
Definition: SNetSectionData.h:11
Definition: NTrawlSpec.h:217