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/* ===============================================================================================================================
14 This file is part of CoastalME, the Coastal Modelling Environment.
15
16 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.
17
18 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.
19
20 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.
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
77{
78 dX = pPt->dGetX();
79 dY = pPt->dGetY();
80}
81
84{
85 if ((bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) && (bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
86 return true;
87
88 return false;
89}
90
93{
94 if ((bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) && (bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
95 return true;
96
97 return false;
98}
99
102{
103 if ((! bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) || (! bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
104 return true;
105
106 return false;
107}
108
111{
112 if ((! bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) || (! bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
113 return true;
114
115 return false;
116}
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:76
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:101
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:83
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:811
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1284