CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
2d_point.cpp
Go to the documentation of this file.
1
12
13/*===============================================================================================================================
14This file is part of CoastalME, the Coastal Modelling Environment.
15
16CoastalME 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.
17
18This 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.
19
20You 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.
21===============================================================================================================================*/
22#include "cme.h"
23#include "2d_point.h"
24
27: dX(0),
28 dY(0)
29{
30}
31
33CGeom2DPoint::CGeom2DPoint(double const dNewX, double const dNewY)
34: dX(dNewX),
35 dY(dNewY)
36{
37}
38
40double CGeom2DPoint::dGetX(void) const
41{
42 return dX;
43}
44
46double CGeom2DPoint::dGetY(void) const
47{
48 return dY;
49}
50
52void CGeom2DPoint::SetX(double const dNewX)
53{
54 dX = dNewX;
55}
56
58void CGeom2DPoint::SetY(double const dNewY)
59{
60 dY = dNewY;
61}
62
63// void CGeom2DPoint::SetXY(double const dNewX, double const dNewY)
64// {
65// dX = dNewX;
66// dY = dNewY;
67// }
68
69// void CGeom2DPoint::SetXY(CGeom2DPoint const* Pt)
70// {
71// dX = Pt->dGetX();
72// dY = Pt->dGetY();
73// }
74
75
78{
79 dX = pPt->dGetX();
80 dY = pPt->dGetY();
81}
82
85{
86 if ((bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) && (bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
87 return true;
88
89 return false;
90}
91
94{
95 if ((bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) && (bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
96 return true;
97
98 return false;
99}
100
103{
104 if ((! bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) || (! bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
105 return true;
106
107 return false;
108}
109
112{
113 if ((! bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) || (! bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
114 return true;
115
116 return false;
117}
118
Contains CGeom2DPoint definitions.
void SetY(double const)
The double parameter sets a value for the CGeom2DIPoint object's Y coordinate.
Definition 2d_point.cpp:58
void operator=(CGeom2DPoint const *)
Sets one CGeom2DPoint object equal to another.
Definition 2d_point.cpp:77
double dGetY(void) const
Returns the CGeom2DPoint object's double Y coordinate.
Definition 2d_point.cpp:46
double dGetX(void) const
Returns the CGeom2DPoint object's double X coordinate.
Definition 2d_point.cpp:40
CGeom2DPoint(void)
Constructor with no parameters (the X and Y coordinates of the CGeom2DPoint object are set to zero)
Definition 2d_point.cpp:26
double dY
The y coordinate.
Definition 2d_point.h:33
bool operator!=(CGeom2DPoint const *) const
Compares two CGeom2DPoint pointed-to objects for inequality.
Definition 2d_point.cpp:102
double dX
The x coordinate.
Definition 2d_point.h:30
bool operator==(CGeom2DPoint const *) const
Compares two CGeom2DPoint pointed-to objects for equality.
Definition 2d_point.cpp:84
void SetX(double const)
The double parameter sets a value for the CGeom2DIPoint object's X coordinate.
Definition 2d_point.cpp:52
This file contains global definitions for CoastalME.
double const TOLERANCE
Definition cme.h:698
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1176