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
19This file is part of CoastalME, the Coastal Modelling Environment.
20
21CoastalME 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
23This 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
25You 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 "cme.h"
29#include "2d_point.h"
30#include "2di_point.h"
31#include "multi_line.h"
32#include "raster_grid.h"
33
35{
36private:
39
42
45
48
51
54
57
60
63
66
69
72
75
78
81
84
87
90
93
96
99
101 vector<CGeom2DIPoint> m_VCellInProfile;
102
103 // The following have the same length as m_VCellInProfile
105 vector<CGeom2DPoint> m_VCellInProfileExtCRS;
106
107 // Is this profile point part of a multi-line?
108// vector<bool> m_bVShared;
109
110protected:
111
112public:
113 explicit CGeomProfile(int const, int const, int const, int const, CGeom2DIPoint const*, CGeom2DIPoint const*, bool const);
114 ~CGeomProfile(void) override;
115
116 int nGetCoastID(void) const;
117 int nGetGlobalID(void) const;
118 int nGetCoastPoint(void) const;
119
121 void SetEndPoint(CGeom2DIPoint const*);
123
124 void SetStartOfCoast(bool const);
125 bool bStartOfCoast(void) const;
126 void SetEndOfCoast(bool const);
127 bool bEndOfCoast(void) const;
128
129 void SetCShoreProblem(bool const);
130 bool bCShoreProblem(void) const;
131
132 void SetHitLand(bool const);
133 bool bHitLand(void) const;
134 void SetHitIntervention(bool const);
135 bool bHitIntervention(void) const;
136 void SetHitCoast(bool const);
137 bool bHitCoast(void) const;
138 void SetTooShort(bool const);
139 bool bTooShort(void) const;
140 void SetTruncated(bool const);
141 bool bTruncated(void) const;
142 void SetHitAnotherProfile(bool const);
143 bool bHitAnotherProfile(void) const;
144
145 bool bProfileOK(void) const;
146 bool bProfileOKIncTruncated(void) const;
147 bool bOKIncStartAndEndOfCoast(void) const;
148 // bool bOKIncStartOfCoast(void) const;
149
150 void SetPointsInProfile(vector<CGeom2DPoint> const*);
151 void SetPointInProfile(int const, double const, double const);
152 void AppendPointInProfile(double const, double const);
154 void TruncateProfile(int const);
155// void TruncateAndSetPointInProfile(int const, double const, double const);
156 bool bInsertIntersection(double const, double const, int const);
157// void ShowProfile(void) const;
158 int nGetProfileSize(void) const;
161 vector<CGeom2DPoint> PtVGetThisPointAndAllAfter(int const);
162 // void RemoveLineSegment(int const);
163 bool bIsPointInProfile(double const, double const);
164 bool bIsPointInProfile(double const, double const, int&);
165// int nFindInsertionLineSeg(double const, double const);
166
167// void AppendPointShared(bool const);
168// bool bPointShared(int const) const;
169
174
176 void AppendCellInProfile(int const, int const);
177// void SetCellsInProfile(vector<CGeom2DIPoint>*);
178 vector<CGeom2DIPoint>* pPtiVGetCellsInProfile(void);
180 int nGetNumCellsInProfile(void) const;
181
182 void AppendCellInProfileExtCRS(double const, double const);
184// vector<CGeom2DPoint>* PtVGetCellsInProfileExtCRS(void);
185
186 int nGetCellGivenDepth(CGeomRasterGrid const*, double const);
187
188 void SetProfileDeepWaterWaveHeight(double const);
189 double dGetProfileDeepWaterWaveHeight(void) const;
190
191 void SetProfileDeepWaterWaveAngle(double const);
192 double dGetProfileDeepWaterWaveAngle(void) const;
193
194 void SetProfileDeepWaterWavePeriod(double const);
195 double dGetProfileDeepWaterWavePeriod(void) const;
196
197 bool bIsIntervention(void) const;
198};
199#endif //PROFILE_H
200
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:38
void TruncateProfile(int const)
Truncates the profile.
Definition profile.cpp:322
int m_nCoastPoint
The coastline point at which this profile hits the coast (not necessarily coincident wih the profile ...
Definition profile.h:71
double m_dDeepWaterWaveHeight
The wave height at the end of the profile.
Definition profile.h:80
CGeomProfile * m_pUpCoastAdjacentProfile
Pointer to the adjacent up-coast profile (may be an invalid profile)
Definition profile.h:95
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:540
void SetEndOfCoast(bool const)
Sets a switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:115
bool m_bHitCoast
Has this profile hit a coastline?
Definition profile.h:53
void AppendPointInProfile(double const, double const)
Appends a point to the profile.
Definition profile.cpp:291
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_nCoastID
The this-coast ID of the profile.
Definition profile.h:74
int m_nGlobalID
The global ID of the profile.
Definition profile.h:77
int nGetCoastPoint(void) const
Returns the coast point at which the profile starts.
Definition profile.cpp:79
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:65
bool bIsPointInProfile(double const, double const)
Removes a line segment from the profile.
Definition profile.cpp:368
void SetHitCoast(bool const)
Sets a switch which indicates whether this profile has hit a coast.
Definition profile.cpp:163
vector< CGeom2DPoint > m_VCellInProfileExtCRS
In external CRS, the coords of cells 'under' this profile.
Definition profile.h:105
CGeomProfile * m_pDownCoastAdjacentProfile
Pointer to the adjacent down-coast profile (may be an invalid profile)
Definition profile.h:98
bool m_bCShoreProblem
Has this profile encountered a CShore problem?
Definition profile.h:44
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:229
bool m_bHitAnotherProfile
Has this profile hit another profile?
Definition profile.h:62
void SetStartOfCoast(bool const)
Sets a switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:103
CGeomProfile * pGetUpCoastAdjacentProfile(void) const
Definition profile.cpp:456
CGeomProfile * pGetDownCoastAdjacentProfile(void) const
Definition profile.cpp:466
void AppendCellInProfileExtCRS(double const, double const)
Appends a cell (specified in the external coordinate system) to the profile.
Definition profile.cpp:526
void SetUpCoastAdjacentProfile(CGeomProfile *)
Definition profile.cpp:451
double m_dDeepWaterWaveAngle
The wave orientation at the end of the profile.
Definition profile.h:83
CGeom2DIPoint * pPtiGetCellInProfile(int const)
Returns a single cell in the profile.
Definition profile.cpp:499
void SetHitAnotherProfile(bool const)
Sets a switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:199
vector< CGeom2DPoint > PtVGetThisPointAndAllAfter(int const)
Returns a given point from the profile, and all points after this.
Definition profile.cpp:355
void SetTruncated(bool const)
Sets a switch which indicates whether this profile is truncated.
Definition profile.cpp:187
bool bHitAnotherProfile(void) const
Returns the switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:205
bool bInsertIntersection(double const, double const, int const)
Inserts an intersection into the profile.
Definition profile.cpp:303
CGeom2DIPoint PtiEnd
The seaward end point of the profile in grid CRS.
Definition profile.h:92
bool bHitLand(void) const
Returns the switch which indicates whether this profile has hit land.
Definition profile.cpp:145
CGeom2DIPoint PtiStart
The on-coast start point of the profile in grid CRS.
Definition profile.h:89
int nGetNumCellsInProfile(void) const
Returns the number of cells in the profile.
Definition profile.cpp:513
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:36
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:101
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:211
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:181
void SetDownCoastAdjacentProfile(CGeomProfile *)
Definition profile.cpp:461
bool bHitCoast(void) const
Returns the switch which indicates whether this profile has hit a coast.
Definition profile.cpp:169
bool bIsIntervention(void) const
Returns true if this is an intervention profile.
Definition profile.cpp:607
int nGetGlobalID(void) const
Returns the profile's global ID.
Definition profile.cpp:73
void SetHitIntervention(bool const)
Sets a switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:151
bool m_bEndOfCoast
Is this an end-of-coast profile?
Definition profile.h:41
~CGeomProfile(void) override
Destructor.
Definition profile.cpp:62
bool m_bTruncated
Has this profile been truncated?
Definition profile.h:59
CGeom2DIPoint * pPtiGetEndPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile ends.
Definition profile.cpp:97
void SetCShoreProblem(bool const)
Sets a switch to indicate whether this profile has a CShore problem.
Definition profile.cpp:127
CGeom2DPoint * pPtGetPointInProfile(int const)
Returns a single point in the profile.
Definition profile.cpp:349
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:246
int nGetCoastID(void) const
Returns the profile's coast ID.
Definition profile.cpp:67
void AppendCellInProfile(CGeom2DIPoint const *)
Appends a cell to the profile.
Definition profile.cpp:472
void SetPointInProfile(int const, double const, double const)
Sets a single point in the profile.
Definition profile.cpp:284
int nGetProfileSize(void) const
Returns the number of points in the profile.
Definition profile.cpp:342
CGeom2DIPoint * pPtiGetStartPoint(void)
Returns a pointer to the location of the cell (grid CRS) on which the profile starts.
Definition profile.cpp:85
bool m_bTooShort
Is this profile too short?
Definition profile.h:56
bool bStartOfCoast(void) const
Returns the switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:109
void SetEndPoint(CGeom2DIPoint const *)
Sets the the location of the cell (grid CRS) on which the profile ends.
Definition profile.cpp:91
bool bTruncated(void) const
Returns the switch which indicates whether this profile is truncated.
Definition profile.cpp:193
void SetHitLand(bool const)
Sets a switch which indicates whether this profile has hit land.
Definition profile.cpp:139
void SetPointsInProfile(vector< CGeom2DPoint > const *)
Sets all points in the profile.
Definition profile.cpp:278
int m_nCoast
The coast from which this profile projects.
Definition profile.h:68
vector< CGeom2DIPoint > * pPtiVGetCellsInProfile(void)
Returns all cells in the profile.
Definition profile.cpp:492
CGeom2DIPoint * pPtiGetLastCellInProfile(void)
Returns the last cell in the profile.
Definition profile.cpp:506
bool m_bHitIntervention
Has this profile hit an intervention?
Definition profile.h:50
double m_dDeepWaterWavePeriod
The wave period at the end of the profile.
Definition profile.h:86
bool bEndOfCoast(void) const
Returns the switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:121
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:133
bool bHitIntervention(void) const
Returns the switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:157
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:47
void SetTooShort(bool const)
Sets a switch which indicates whether this profile is too short to be useful.
Definition profile.cpp:175
Geometry cass used to represent the raster grid of cell objects.
Definition raster_grid.h:35
This file contains global definitions for CoastalME.
Contains CGeomMultiLine definitions.
Contains CGeomRasterGrid definitions.