CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
profile.h
Go to the documentation of this file.
1
12
13#ifndef PROFILE_H
14#define PROFILE_H
15/* ===============================================================================================================================
16 This file is part of CoastalME, the Coastal Modelling Environment.
17
18 CoastalME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
19
20 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23===============================================================================================================================*/
24#include <vector>
25using std::vector;
26
27#include "2d_point.h"
28#include "2di_point.h"
29#include "multi_line.h"
30#include "raster_grid.h"
31
33{
34 private:
37
40
43
46
49
52
55
58
61
64
67
70
73
76
79
82
85
88
91
93 vector<CGeom2DIPoint> m_VCellInProfile;
94
96 // vector<CGeom2DPoint> m_VCellInProfileExtCRS;
97
98 // Is this profile point part of a multi-line? (Has have the same length as m_VCellInProfile)
99 // vector<bool> m_bVShared;
100
101 protected:
102 public:
103 explicit CGeomProfile(int const, int const, int const, bool const);
104 ~CGeomProfile(void) override;
105
106 int nGetCoastID(void) const;
107 int nGetProfileID(void) const;
108 int nGetCoastPoint(void) const;
109
112
113 void SetStartOfCoast(bool const);
114 bool bStartOfCoast(void) const;
115 void SetEndOfCoast(bool const);
116 bool bEndOfCoast(void) const;
117 bool bIsGridEdge(void) const;
118
119 void SetCShoreProblem(bool const);
120 bool bCShoreProblem(void) const;
121
122 void SetHitLand(bool const);
123 bool bHitLand(void) const;
124 void SetHitIntervention(bool const);
125 bool bHitIntervention(void) const;
126 void SetHitCoast(bool const);
127 bool bHitCoast(void) const;
128 void SetTooShort(bool const);
129 bool bTooShort(void) const;
130 void SetTruncatedSameCoast(bool const);
131 bool bTruncatedSameCoast(void) const;
132 void SetTruncatedDifferentCoast(bool const);
133 bool bTruncatedDifferentCoast(void) const;
134 void SetHitAnotherProfile(bool const);
135 bool bHitAnotherProfile(void) const;
136
137 bool bProfileOK(void) const;
138 bool bProfileOKIncTruncated(void) const;
139 bool bOKIncStartAndEndOfCoast(void) const;
140 // bool bOKIncStartOfCoast(void) const;
141
142 void SetPointsInProfile(vector<CGeom2DPoint> const*);
143 void SetPointInProfile(int const, double const, double const);
144 void AppendPointInProfile(double const, double const);
146 void TruncateProfile(int const);
147 // void TruncateAndSetPointInProfile(int const, double const, double const);
148 bool bInsertIntersection(double const, double const, int const);
149 // void ShowProfile(void) const;
150 int nGetProfileSize(void) const;
152 vector<CGeom2DPoint> PtVGetThisPointAndAllAfter(int const);
153 // void RemoveLineSegment(int const);
154 bool bIsPointInProfile(double const, double const);
155 bool bIsPointInProfile(double const, double const, int&);
156 // int nFindInsertionLineSeg(double const, double const);
157
158 // void AppendPointShared(bool const);
159 // bool bPointShared(int const) const;
160
162 // CGeomProfile* pGetUpCoastAdjacentProfile(void) const;
165
167 void AppendCellInProfile(int const, int const);
168 void SetCellsInProfile(vector<CGeom2DIPoint> const*);
169 vector<CGeom2DIPoint>* pPtiVGetCellsInProfile(void);
171 int nGetNumCellsInProfile(void) const;
172 // int nGetIndexOfCellInProfile(int const, int const);
175
176 int nGetCellGivenDepth(CGeomRasterGrid const*, double const);
177
178 void SetProfileDeepWaterWaveHeight(double const);
179 double dGetProfileDeepWaterWaveHeight(void) const;
180
181 void SetProfileDeepWaterWaveAngle(double const);
182 double dGetProfileDeepWaterWaveAngle(void) const;
183
184 void SetProfileDeepWaterWavePeriod(double const);
185 double dGetProfileDeepWaterWavePeriod(void) const;
186
187 bool bIsIntervention(void) const;
188};
189#endif // PROFILE_H
Contains CGeom2DPoint definitions.
Contains CGeom2DIPoint definitions.
Geometry class used to represent 2D point objects with integer coordinates.
Definition 2di_point.h:25
Geometry class used to represent 2D point objects with floating-point coordinates.
Definition 2d_point.h:25
CGeomMultiLine(void)
Constructor, no parameters.
bool m_bStartOfCoast
Is this a start-of-coast profile?
Definition profile.h:36
void TruncateProfile(int const)
Truncates the profile's CGeomLine (external CRS points)
Definition profile.cpp:338
int m_nCoastPoint
The coastline point at which this profile hits the coast (not necessarily coincident wih the profile ...
Definition profile.h:72
double m_dDeepWaterWaveHeight
The wave height at the end of the profile.
Definition profile.h:78
CGeomProfile * m_pUpCoastAdjacentProfile
Pointer to the adjacent up-coast profile (may be an invalid profile)
Definition profile.h:87
int nGetCellGivenDepth(CGeomRasterGrid const *, double const)
Returns the index of the cell on this profile which has a sea depth which is just less than a given d...
Definition profile.cpp:545
void SetEndOfCoast(bool const)
Sets a switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:110
bool m_bHitCoast
Has this profile hit a coastline?
Definition profile.h:51
void AppendPointInProfile(double const, double const)
Appends a point (external CRS) to the profile.
Definition profile.cpp:307
void SetCellsInProfile(vector< CGeom2DIPoint > const *)
Sets the profile's vector of cells (grid CRS)
Definition profile.cpp:506
double dGetProfileDeepWaterWaveAngle(void) const
Returns the deep-water wave orientation for this profile.
Definition profile.cpp:589
double dGetProfileDeepWaterWaveHeight(void) const
Returns the deep-water wave height for this profile.
Definition profile.cpp:577
int m_nProfileID
The this-coast ID of the profile (note that a profile in a different coast may have the same ID as th...
Definition profile.h:75
int nGetProfileID(void) const
Returns the profile's this-coast ID.
Definition profile.cpp:74
CGeomProfile(int const, int const, int const, bool const)
In external CRS, the coords of cells 'under' this profile (has the same length as m_VCellInProfile)
Definition profile.cpp:39
int nGetCoastPoint(void) const
Returns the coast point at which the profile starts.
Definition profile.cpp:80
void SetProfileDeepWaterWavePeriod(double const)
Sets the deep-water wave period for this profile.
Definition profile.cpp:595
bool m_bIntervention
Is this an intervention profile?
Definition profile.h:66
bool bIsPointInProfile(double const, double const)
Removes a line segment from the profile.
Definition profile.cpp:383
void SetHitCoast(bool const)
Sets a switch which indicates whether this profile has hit a coast.
Definition profile.cpp:167
CGeomProfile * m_pDownCoastAdjacentProfile
Pointer to the adjacent down-coast profile (may be an invalid profile)
Definition profile.h:90
bool m_bCShoreProblem
Has this profile encountered a CShore problem?
Definition profile.h:42
bool bProfileOKIncTruncated(void) const
Returns true if this is a problem-free profile, and is not a start-of-coast and is not an end-of-coas...
Definition profile.cpp:245
bool m_bHitAnotherProfile
Has this profile hit another profile?
Definition profile.h:63
void SetStartOfCoast(bool const)
Sets a switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:98
CGeomProfile * pGetDownCoastAdjacentProfile(void) const
Returns the down-coast adjacent profile, returns NULL if there is no down-coast adjacent profile.
Definition profile.cpp:488
void SetUpCoastAdjacentProfile(CGeomProfile *)
Sets the up-coast adjacent profile.
Definition profile.cpp:470
double m_dDeepWaterWaveAngle
The wave orientation at the end of the profile.
Definition profile.h:81
bool bTruncatedDifferentCoast(void) const
Returns the switch which indicates whether this profile has been truncated, due to hitting another pr...
Definition profile.cpp:209
CGeom2DIPoint * pPtiGetCellInProfile(int const)
Returns a single cell (grid CRS) in the profile.
Definition profile.cpp:518
void SetHitAnotherProfile(bool const)
Sets a switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:215
vector< CGeom2DPoint > PtVGetThisPointAndAllAfter(int const)
Returns a given external CRS point from the profile, and all points after this.
Definition profile.cpp:370
bool bHitAnotherProfile(void) const
Returns the switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:221
bool bInsertIntersection(double const, double const, int const)
Inserts an intersection (at a point specified in external CRS, with a line segment) into the profile.
Definition profile.cpp:319
bool m_bTruncatedDifferentCoast
Has this profile been truncated by hitting another profile from a different coast?
Definition profile.h:60
bool bHitLand(void) const
Returns the switch which indicates whether this profile has hit land.
Definition profile.cpp:149
bool bIsGridEdge(void) const
Returns true if this is a start-of-coast or an end-of-coast profile.
Definition profile.cpp:122
void SetTruncatedSameCoast(bool const)
Sets a switch which indicates whether this profile is truncated, due to hitting another profile from ...
Definition profile.cpp:191
int nGetNumCellsInProfile(void) const
Returns the number of cells in the profile.
Definition profile.cpp:539
vector< CGeom2DIPoint > m_VCellInProfile
In the grid CRS, the integer coordinates of the cells 'under' this profile, point zero is the same as...
Definition profile.h:93
bool bProfileOK(void) const
Returns true if this is a problem-free profile, and is not a start-of-coast and is not an end-of-coas...
Definition profile.cpp:227
void SetProfileDeepWaterWaveHeight(double const)
Sets the deep-water wave height for this profile.
Definition profile.cpp:571
bool bTooShort(void) const
Returns the switch which indicates whether this profile is too short to be useful.
Definition profile.cpp:185
void SetDownCoastAdjacentProfile(CGeomProfile *)
Sets the down-coast adjacent profile.
Definition profile.cpp:482
bool bHitCoast(void) const
Returns the switch which indicates whether this profile has hit a coast.
Definition profile.cpp:173
bool bIsIntervention(void) const
Returns true if this is an intervention profile.
Definition profile.cpp:607
void SetHitIntervention(bool const)
Sets a switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:155
bool m_bEndOfCoast
Is this an end-of-coast profile?
Definition profile.h:39
~CGeomProfile(void) override
Destructor.
Definition profile.cpp:63
CGeom2DIPoint * pPtiGetEndPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile ends.
Definition profile.cpp:92
void SetCShoreProblem(bool const)
Sets a switch to indicate whether this profile has a CShore problem.
Definition profile.cpp:131
CGeom2DPoint * pPtGetPointInProfile(int const)
Returns a single point (external CRS) from the profile.
Definition profile.cpp:364
bool bOKIncStartAndEndOfCoast(void) const
Returns true if this is a problem-free profile (however it could be a start-of-coast or an end-of-coa...
Definition profile.cpp:262
int nGetCoastID(void) const
Returns this profile's coast ID.
Definition profile.cpp:68
void AppendCellInProfile(CGeom2DIPoint const *)
Appends a cell (grid CRS) to the profile.
Definition profile.cpp:494
void SetPointInProfile(int const, double const, double const)
Sets a single point (external CRS) in the profile.
Definition profile.cpp:300
int nGetProfileSize(void) const
Returns the number of external CRS points in the profile (only two, initally; and always just two for...
Definition profile.cpp:358
CGeom2DIPoint * pPtiGetStartPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile starts.
Definition profile.cpp:86
bool m_bTooShort
Is this profile too short?
Definition profile.h:54
bool bStartOfCoast(void) const
Returns the switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:104
bool bTruncatedSameCoast(void) const
Returns the switch which indicates whether this profile has been truncated, due to hitting another pr...
Definition profile.cpp:197
void SetHitLand(bool const)
Sets a switch which indicates whether this profile has hit land.
Definition profile.cpp:143
void SetPointsInProfile(vector< CGeom2DPoint > const *)
Sets points (external CRS) in the profile. Note that only two points, the start and end point,...
Definition profile.cpp:294
CGeom2DIPoint * pPtiGetFirstCellInProfile(void)
Returns the first cell (grid CRS) in the profile.
Definition profile.cpp:532
int m_nCoast
The coast from which this profile projects.
Definition profile.h:69
vector< CGeom2DIPoint > * pPtiVGetCellsInProfile(void)
Returns all cells (grid CRS) in the profile.
Definition profile.cpp:512
CGeom2DIPoint * pPtiGetLastCellInProfile(void)
Returns the last cell (grid CRS) in the profile.
Definition profile.cpp:525
bool m_bHitIntervention
Has this profile hit an intervention?
Definition profile.h:48
void SetTruncatedDifferentCoast(bool const)
Sets a switch which indicates whether this profile is truncated, due to hitting another profile from ...
Definition profile.cpp:203
bool m_bTruncatedSameCoast
Has this profile been truncated by hitting another profile from the same coast?
Definition profile.h:57
double m_dDeepWaterWavePeriod
The wave period at the end of the profile.
Definition profile.h:84
bool bEndOfCoast(void) const
Returns the switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:116
double dGetProfileDeepWaterWavePeriod(void) const
Returns the deep-water wave period for this profile.
Definition profile.cpp:601
bool bCShoreProblem(void) const
Returns the switch which indicates whether this profile has a CShore problem.
Definition profile.cpp:137
bool bHitIntervention(void) const
Returns the switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:161
void SetProfileDeepWaterWaveAngle(double const)
Sets the deep-water wave orientation for this profile.
Definition profile.cpp:583
bool m_bHitLand
Has this profile hit land?
Definition profile.h:45
void SetTooShort(bool const)
Sets a switch which indicates whether this profile is too short to be useful.
Definition profile.cpp:179
Geometry cass used to represent the raster grid of cell objects.
Definition raster_grid.h:29
Contains CGeomMultiLine definitions.
Contains CGeomRasterGrid definitions.