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
14
15#ifndef PROFILE_H
16#define PROFILE_H
17/* ===============================================================================================================================
18
19 This file is part of CoastalME, the Coastal Modelling Environment.
20
21 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.
22
23 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.
24
25 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.
26
27===============================================================================================================================*/
28#include <vector>
29using std::vector;
30
31#include "2d_point.h"
32#include "2di_point.h"
33#include "multi_line.h"
34#include "raster_grid.h"
35
37{
38 private:
41
44
47
50
53
56
59
62
65
68
71
74
77
80
83
86
89
92
95
98
101
103 vector<CGeom2DIPoint> m_VCellInProfile;
104
106 // vector<CGeom2DPoint> m_VCellInProfileExtCRS;
107
108 // Is this profile point part of a multi-line? (Has have the same length as m_VCellInProfile)
109 // vector<bool> m_bVShared;
110
111 protected:
112 public:
113 explicit CGeomProfile(int const, int const, int const, CGeom2DIPoint const*, CGeom2DIPoint const*, bool const);
114 ~CGeomProfile(void) override;
115
116 int nGetCoast(void) const;
117
118 int nGetProfileID(void) const;
119 int nGetProfileCoastID(void) const;
120 int nGetCoastPoint(void) const;
121
123 void SetEndPoint(CGeom2DIPoint const*);
125
126 void SetStartOfCoast(bool const);
127 bool bStartOfCoast(void) const;
128 void SetEndOfCoast(bool const);
129 bool bEndOfCoast(void) const;
130
131 void SetCShoreProblem(bool const);
132 bool bCShoreProblem(void) const;
133
134 void SetHitLand(bool const);
135 bool bHitLand(void) const;
136 void SetHitIntervention(bool const);
137 bool bHitIntervention(void) const;
138 void SetHitCoast(bool const);
139 bool bHitCoast(void) const;
140 void SetTooShort(bool const);
141 bool bTooShort(void) const;
142 void SetTruncatedSameCoast(bool const);
143 bool bTruncatedSameCoast(void) const;
144 void SetTruncatedDifferentCoast(bool const);
145 bool bTruncatedDifferentCoast(void) const;
146 void SetHitAnotherProfile(bool const);
147 bool bHitAnotherProfile(void) const;
148
149 bool bProfileOK(void) const;
150 bool bProfileOKIncTruncated(void) const;
151 bool bOKIncStartAndEndOfCoast(void) const;
152 // bool bOKIncStartOfCoast(void) const;
153
154 void SetPointsInProfile(vector<CGeom2DPoint> const*);
155 void SetPointInProfile(int const, double const, double const);
156 void AppendPointInProfile(double const, double const);
158 void TruncateProfile(int const);
159 // void TruncateAndSetPointInProfile(int const, double const, double const);
160 bool bInsertIntersection(double const, double const, int const);
161 // void ShowProfile(void) const;
162 int nGetProfileSize(void) const;
165 vector<CGeom2DPoint> PtVGetThisPointAndAllAfter(int const);
166 // void RemoveLineSegment(int const);
167 bool bIsPointInProfile(double const, double const);
168 bool bIsPointInProfile(double const, double const, int&);
169 // int nFindInsertionLineSeg(double const, double const);
170
171 // void AppendPointShared(bool const);
172 // bool bPointShared(int const) const;
173
178
180 void AppendCellInProfile(int const, int const);
181 void SetCellsInProfile(vector<CGeom2DIPoint>*);
182 vector<CGeom2DIPoint>* pPtiVGetCellsInProfile(void);
184 int nGetNumCellsInProfile(void) const;
185 int nGetIndexOfCellInProfile(int const, int const);
186
187 int nGetCellGivenDepth(CGeomRasterGrid const*, double const);
188
189 void SetProfileDeepWaterWaveHeight(double const);
190 double dGetProfileDeepWaterWaveHeight(void) const;
191
192 void SetProfileDeepWaterWaveAngle(double const);
193 double dGetProfileDeepWaterWaveAngle(void) const;
194
195 void SetProfileDeepWaterWavePeriod(double const);
196 double dGetProfileDeepWaterWavePeriod(void) const;
197
198 bool bIsIntervention(void) const;
199};
200#endif // PROFILE_H
Contains CGeom2DPoint definitions.
Contains CGeom2DIPoint definitions.
Geometry class used to represent 2D point objects with integer coordinates.
Definition 2di_point.h:29
Geometry class used to represent 2D point objects with floating-point coordinates.
Definition 2d_point.h:27
CGeomMultiLine(void)
Constructor, no parameters.
bool m_bStartOfCoast
Is this a start-of-coast profile?
Definition profile.h:40
void TruncateProfile(int const)
Truncates the profile's CGeomLine (external CRS points)
Definition profile.cpp:341
int m_nCoastPoint
The coastline point at which this profile hits the coast (not necessarily coincident wih the profile ...
Definition profile.h:76
double m_dDeepWaterWaveHeight
The wave height at the end of the profile.
Definition profile.h:82
CGeomProfile * m_pUpCoastAdjacentProfile
Pointer to the adjacent up-coast profile (may be an invalid profile)
Definition profile.h:97
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:541
void SetEndOfCoast(bool const)
Sets a switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:122
bool m_bHitCoast
Has this profile hit a coastline?
Definition profile.h:55
void AppendPointInProfile(double const, double const)
Appends a point (external CRS) to the profile.
Definition profile.cpp:310
double dGetProfileDeepWaterWaveAngle(void) const
Returns the deep-water wave orientation for this profile.
Definition profile.cpp:585
CGeomProfile(int const, int const, int const, CGeom2DIPoint const *, CGeom2DIPoint const *, bool const)
In external CRS, the coords of cells 'under' this profile (has the same length as m_VCellInProfile)
Definition profile.cpp:44
double dGetProfileDeepWaterWaveHeight(void) const
Returns the deep-water wave height for this profile.
Definition profile.cpp:573
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:79
int nGetProfileID(void) const
Returns the profile's this-coast ID.
Definition profile.cpp:80
int nGetCoastPoint(void) const
Returns the coast point at which the profile starts.
Definition profile.cpp:86
void SetProfileDeepWaterWavePeriod(double const)
Sets the deep-water wave period for this profile.
Definition profile.cpp:591
bool m_bIntervention
Is this an intervention profile?
Definition profile.h:70
bool bIsPointInProfile(double const, double const)
Removes a line segment from the profile.
Definition profile.cpp:386
void SetHitCoast(bool const)
Sets a switch which indicates whether this profile has hit a coast.
Definition profile.cpp:170
CGeomProfile * m_pDownCoastAdjacentProfile
Pointer to the adjacent down-coast profile (may be an invalid profile)
Definition profile.h:100
int nGetCoast(void) const
Returns this profile's coast.
Definition profile.cpp:74
bool m_bCShoreProblem
Has this profile encountered a CShore problem?
Definition profile.h:46
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:248
bool m_bHitAnotherProfile
Has this profile hit another profile?
Definition profile.h:67
void SetStartOfCoast(bool const)
Sets a switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:110
CGeomProfile * pGetUpCoastAdjacentProfile(void) const
Returns the up-coast adjacent profile, returns NULL if there is no up-coast adjacent profile.
Definition profile.cpp:479
CGeomProfile * pGetDownCoastAdjacentProfile(void) const
Returns the down-coast adjacent profile, returns NULL if there is no down-coast adjacent profile.
Definition profile.cpp:491
void SetUpCoastAdjacentProfile(CGeomProfile *)
Sets the up-coast adjacent profile.
Definition profile.cpp:473
double m_dDeepWaterWaveAngle
The wave orientation at the end of the profile.
Definition profile.h:85
bool bTruncatedDifferentCoast(void) const
Returns the switch which indicates whether this profile has been truncated, due to hitting another pr...
Definition profile.cpp:212
CGeom2DIPoint * pPtiGetCellInProfile(int const)
Returns a single cell (grid CRS) in the profile.
Definition profile.cpp:521
void SetHitAnotherProfile(bool const)
Sets a switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:218
vector< CGeom2DPoint > PtVGetThisPointAndAllAfter(int const)
Returns a given external CRS point from the profile, and all points after this.
Definition profile.cpp:373
bool bHitAnotherProfile(void) const
Returns the switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:224
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:322
CGeom2DIPoint PtiEnd
The seaward end point of the profile in grid CRS.
Definition profile.h:94
bool m_bTruncatedDifferentCoast
Has this profile been truncated by hitting another profile from a different coast?
Definition profile.h:64
bool bHitLand(void) const
Returns the switch which indicates whether this profile has hit land.
Definition profile.cpp:152
void SetTruncatedSameCoast(bool const)
Sets a switch which indicates whether this profile is truncated, due to hitting another profile from ...
Definition profile.cpp:194
CGeom2DIPoint PtiStart
The on-coast start point of the profile in grid CRS.
Definition profile.h:91
int nGetNumCellsInProfile(void) const
Returns the number of cells in the profile.
Definition profile.cpp:535
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:103
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:230
void SetProfileDeepWaterWaveHeight(double const)
Sets the deep-water wave height for this profile.
Definition profile.cpp:567
bool bTooShort(void) const
Returns the switch which indicates whether this profile is too short to be useful.
Definition profile.cpp:188
void SetDownCoastAdjacentProfile(CGeomProfile *)
Sets the down-coast adjacent profile.
Definition profile.cpp:485
int nGetProfileCoastID(void) const
bool bHitCoast(void) const
Returns the switch which indicates whether this profile has hit a coast.
Definition profile.cpp:176
bool bIsIntervention(void) const
Returns true if this is an intervention profile.
Definition profile.cpp:603
void SetHitIntervention(bool const)
Sets a switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:158
bool m_bEndOfCoast
Is this an end-of-coast profile?
Definition profile.h:43
~CGeomProfile(void) override
Destructor.
Definition profile.cpp:69
CGeom2DIPoint * pPtiGetEndPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile ends.
Definition profile.cpp:104
void SetCShoreProblem(bool const)
Sets a switch to indicate whether this profile has a CShore problem.
Definition profile.cpp:134
CGeom2DPoint * pPtGetPointInProfile(int const)
Returns a single point (external CRS) from the profile.
Definition profile.cpp:367
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:265
void AppendCellInProfile(CGeom2DIPoint const *)
Appends a cell (grid CRS) to the profile.
Definition profile.cpp:497
void SetPointInProfile(int const, double const, double const)
Sets a single point (external CRS) in the profile.
Definition profile.cpp:303
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:361
CGeom2DIPoint * pPtiGetStartPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile starts.
Definition profile.cpp:92
bool m_bTooShort
Is this profile too short?
Definition profile.h:58
bool bStartOfCoast(void) const
Returns the switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:116
bool bTruncatedSameCoast(void) const
Returns the switch which indicates whether this profile has been truncated, due to hitting another pr...
Definition profile.cpp:200
void SetEndPoint(CGeom2DIPoint const *)
Sets the the location of the cell (grid CRS) on which the profile ends.
Definition profile.cpp:98
void SetHitLand(bool const)
Sets a switch which indicates whether this profile has hit land.
Definition profile.cpp:146
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:297
int m_nCoast
The coast from which this profile projects.
Definition profile.h:73
vector< CGeom2DIPoint > * pPtiVGetCellsInProfile(void)
Returns all cells (grid CRS) in the profile.
Definition profile.cpp:515
CGeom2DIPoint * pPtiGetLastCellInProfile(void)
Returns the last cell (grid CRS) in the profile.
Definition profile.cpp:528
void SetCellsInProfile(vector< CGeom2DIPoint > *)
Sets the profile's vector of cells (grid CRS)
Definition profile.cpp:509
bool m_bHitIntervention
Has this profile hit an intervention?
Definition profile.h:52
void SetTruncatedDifferentCoast(bool const)
Sets a switch which indicates whether this profile is truncated, due to hitting another profile from ...
Definition profile.cpp:206
bool m_bTruncatedSameCoast
Has this profile been truncated by hitting another profile from the same coast?
Definition profile.h:61
double m_dDeepWaterWavePeriod
The wave period at the end of the profile.
Definition profile.h:88
int nGetIndexOfCellInProfile(int const, int const)
Returns the index of a given cell in the vector of profile cells; returns INT_NODATA if not found.
Definition profile.cpp:609
bool bEndOfCoast(void) const
Returns the switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:128
double dGetProfileDeepWaterWavePeriod(void) const
Returns the deep-water wave period for this profile.
Definition profile.cpp:597
bool bCShoreProblem(void) const
Returns the switch which indicates whether this profile has a CShore problem.
Definition profile.cpp:140
bool bHitIntervention(void) const
Returns the switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:164
void SetProfileDeepWaterWaveAngle(double const)
Sets the deep-water wave orientation for this profile.
Definition profile.cpp:579
bool m_bHitLand
Has this profile hit land?
Definition profile.h:49
void SetTooShort(bool const)
Sets a switch which indicates whether this profile is too short to be useful.
Definition profile.cpp:182
Geometry cass used to represent the raster grid of cell objects.
Definition raster_grid.h:33
Contains CGeomMultiLine definitions.
Contains CGeomRasterGrid definitions.