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