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
105 // The following have the same length as m_VCellInProfile
107 vector<CGeom2DPoint> m_VCellInProfileExtCRS;
108
109 // Is this profile point part of a multi-line?
110 // vector<bool> m_bVShared;
111
112 protected:
113 public:
114 explicit CGeomProfile(int const, int const, int const, int const, CGeom2DIPoint const*, CGeom2DIPoint const*, bool const);
115 ~CGeomProfile(void) override;
116
117 int nGetCoastID(void) const;
118 int nGetGlobalID(void) const;
119 int nGetCoastPoint(void) const;
120
122 void SetEndPoint(CGeom2DIPoint const*);
124
125 void SetStartOfCoast(bool const);
126 bool bStartOfCoast(void) const;
127 void SetEndOfCoast(bool const);
128 bool bEndOfCoast(void) const;
129
130 void SetCShoreProblem(bool const);
131 bool bCShoreProblem(void) const;
132
133 void SetHitLand(bool const);
134 bool bHitLand(void) const;
135 void SetHitIntervention(bool const);
136 bool bHitIntervention(void) const;
137 void SetHitCoast(bool const);
138 bool bHitCoast(void) const;
139 void SetTooShort(bool const);
140 bool bTooShort(void) const;
141 void SetTruncated(bool const);
142 bool bTruncated(void) const;
143 void SetHitAnotherProfile(bool const);
144 bool bHitAnotherProfile(void) const;
145
146 bool bProfileOK(void) const;
147 bool bProfileOKIncTruncated(void) const;
148 bool bOKIncStartAndEndOfCoast(void) const;
149 // bool bOKIncStartOfCoast(void) const;
150
151 void SetPointsInProfile(vector<CGeom2DPoint> const*);
152 void SetPointInProfile(int const, double const, double const);
153 void AppendPointInProfile(double const, double const);
155 void TruncateProfile(int const);
156 // void TruncateAndSetPointInProfile(int const, double const, double const);
157 bool bInsertIntersection(double const, double const, int const);
158 // void ShowProfile(void) const;
159 int nGetProfileSize(void) const;
162 vector<CGeom2DPoint> PtVGetThisPointAndAllAfter(int const);
163 // void RemoveLineSegment(int const);
164 bool bIsPointInProfile(double const, double const);
165 bool bIsPointInProfile(double const, double const, int&);
166 // int nFindInsertionLineSeg(double const, double const);
167
168 // void AppendPointShared(bool const);
169 // bool bPointShared(int const) const;
170
175
177 void AppendCellInProfile(int const, int const);
178 // void SetCellsInProfile(vector<CGeom2DIPoint>*);
179 vector<CGeom2DIPoint>* pPtiVGetCellsInProfile(void);
181 int nGetNumCellsInProfile(void) const;
182
183 void AppendCellInProfileExtCRS(double const, double const);
185 // vector<CGeom2DPoint>* PtVGetCellsInProfileExtCRS(void);
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.
Definition profile.cpp:330
int m_nCoastPoint
The coastline point at which this profile hits the coast (not necessarily coincident wih the profile ...
Definition profile.h:73
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:552
void SetEndOfCoast(bool const)
Sets a switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:123
bool m_bHitCoast
Has this profile hit a coastline?
Definition profile.h:55
void AppendPointInProfile(double const, double const)
Appends a point to the profile.
Definition profile.cpp:299
double dGetProfileDeepWaterWaveAngle(void) const
Returns the deep-water wave orientation for this profile.
Definition profile.cpp:602
double dGetProfileDeepWaterWaveHeight(void) const
Returns the deep-water wave height for this profile.
Definition profile.cpp:590
int m_nCoastID
The this-coast ID of the profile.
Definition profile.h:76
int m_nGlobalID
The global ID of the profile.
Definition profile.h:79
int nGetCoastPoint(void) const
Returns the coast point at which the profile starts.
Definition profile.cpp:87
void SetProfileDeepWaterWavePeriod(double const)
Sets the deep-water wave Period for this profile.
Definition profile.cpp:608
bool m_bIntervention
Is this an intervention profile?
Definition profile.h:67
bool bIsPointInProfile(double const, double const)
Removes a line segment from the profile.
Definition profile.cpp:376
void SetHitCoast(bool const)
Sets a switch which indicates whether this profile has hit a coast.
Definition profile.cpp:171
vector< CGeom2DPoint > m_VCellInProfileExtCRS
In external CRS, the coords of cells 'under' this profile.
Definition profile.h:107
CGeomProfile * m_pDownCoastAdjacentProfile
Pointer to the adjacent down-coast profile (may be an invalid profile)
Definition profile.h:100
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 or an end-of-coast profil...
Definition profile.cpp:237
bool m_bHitAnotherProfile
Has this profile hit another profile?
Definition profile.h:64
void SetStartOfCoast(bool const)
Sets a switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:111
CGeomProfile * pGetUpCoastAdjacentProfile(void) const
Definition profile.cpp:468
CGeomProfile * pGetDownCoastAdjacentProfile(void) const
Definition profile.cpp:478
void AppendCellInProfileExtCRS(double const, double const)
Appends a cell (specified in the external coordinate system) to the profile.
Definition profile.cpp:538
void SetUpCoastAdjacentProfile(CGeomProfile *)
Definition profile.cpp:463
double m_dDeepWaterWaveAngle
The wave orientation at the end of the profile.
Definition profile.h:85
CGeom2DIPoint * pPtiGetCellInProfile(int const)
Returns a single cell in the profile.
Definition profile.cpp:511
void SetHitAnotherProfile(bool const)
Sets a switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:207
vector< CGeom2DPoint > PtVGetThisPointAndAllAfter(int const)
Returns a given point from the profile, and all points after this.
Definition profile.cpp:363
void SetTruncated(bool const)
Sets a switch which indicates whether this profile is truncated.
Definition profile.cpp:195
bool bHitAnotherProfile(void) const
Returns the switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:213
bool bInsertIntersection(double const, double const, int const)
Inserts an intersection into the profile.
Definition profile.cpp:311
CGeom2DIPoint PtiEnd
The seaward end point of the profile in grid CRS.
Definition profile.h:94
bool bHitLand(void) const
Returns the switch which indicates whether this profile has hit land.
Definition profile.cpp:153
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:525
CGeomProfile(int const, int const, int const, int const, CGeom2DIPoint const *, CGeom2DIPoint const *, bool const)
Constructor with initialization list, requires one parameter (the coast point at which the profile st...
Definition profile.cpp:44
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 or an end-of-coast profil...
Definition profile.cpp:219
void SetProfileDeepWaterWaveHeight(double const)
Sets the deep-water wave height for this profile.
Definition profile.cpp:584
bool bTooShort(void) const
Returns the switch which indicates whether this profile is too short to be useful.
Definition profile.cpp:189
void SetDownCoastAdjacentProfile(CGeomProfile *)
Definition profile.cpp:473
bool bHitCoast(void) const
Returns the switch which indicates whether this profile has hit a coast.
Definition profile.cpp:177
bool bIsIntervention(void) const
Returns true if this is an intervention profile.
Definition profile.cpp:620
int nGetGlobalID(void) const
Returns the profile's global ID.
Definition profile.cpp:81
void SetHitIntervention(bool const)
Sets a switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:159
bool m_bEndOfCoast
Is this an end-of-coast profile?
Definition profile.h:43
~CGeomProfile(void) override
Destructor.
Definition profile.cpp:70
bool m_bTruncated
Has this profile been truncated?
Definition profile.h:61
CGeom2DIPoint * pPtiGetEndPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile ends.
Definition profile.cpp:105
void SetCShoreProblem(bool const)
Sets a switch to indicate whether this profile has a CShore problem.
Definition profile.cpp:135
CGeom2DPoint * pPtGetPointInProfile(int const)
Returns a single point in the profile.
Definition profile.cpp:357
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:254
int nGetCoastID(void) const
Returns the profile's coast ID.
Definition profile.cpp:75
void AppendCellInProfile(CGeom2DIPoint const *)
Appends a cell to the profile.
Definition profile.cpp:484
void SetPointInProfile(int const, double const, double const)
Sets a single point in the profile.
Definition profile.cpp:292
int nGetProfileSize(void) const
Returns the number of points in the profile.
Definition profile.cpp:350
CGeom2DIPoint * pPtiGetStartPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile starts.
Definition profile.cpp:93
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:117
void SetEndPoint(CGeom2DIPoint const *)
Sets the the location of the cell (grid CRS) on which the profile ends.
Definition profile.cpp:99
bool bTruncated(void) const
Returns the switch which indicates whether this profile is truncated.
Definition profile.cpp:201
void SetHitLand(bool const)
Sets a switch which indicates whether this profile has hit land.
Definition profile.cpp:147
void SetPointsInProfile(vector< CGeom2DPoint > const *)
Sets all points in the profile.
Definition profile.cpp:286
int m_nCoast
The coast from which this profile projects.
Definition profile.h:70
vector< CGeom2DIPoint > * pPtiVGetCellsInProfile(void)
Returns all cells in the profile.
Definition profile.cpp:504
CGeom2DIPoint * pPtiGetLastCellInProfile(void)
Returns the last cell in the profile.
Definition profile.cpp:518
bool m_bHitIntervention
Has this profile hit an intervention?
Definition profile.h:52
double m_dDeepWaterWavePeriod
The wave period at the end of the profile.
Definition profile.h:88
bool bEndOfCoast(void) const
Returns the switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:129
double dGetProfileDeepWaterWavePeriod(void) const
Returns the deep-water wave Period for this profile.
Definition profile.cpp:614
bool bCShoreProblem(void) const
Returns the switch which indicates whether this profile has a CShore problem.
Definition profile.cpp:141
bool bHitIntervention(void) const
Returns the switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:165
void SetProfileDeepWaterWaveAngle(double const)
Sets the deep-water wave orientation for this profile.
Definition profile.cpp:596
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:183
Geometry cass used to represent the raster grid of cell objects.
Definition raster_grid.h:34
Contains CGeomMultiLine definitions.
Contains CGeomRasterGrid definitions.