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
10
11/* ===============================================================================================================================
12 This file is part of CoastalME, the Coastal Modelling Environment.
13
14 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.
15
16 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.
17
18 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.
19===============================================================================================================================*/
20#include "cme.h"
21#include "2d_point.h"
22
25 : dX(0),
26 dY(0)
27{
28}
29
32 : dX(pPt->dGetX()),
33 dY(pPt->dGetY())
34{
35}
36
38CGeom2DPoint::CGeom2DPoint(double const dNewX, double const dNewY)
39 : dX(dNewX),
40 dY(dNewY)
41{
42}
43
45double CGeom2DPoint::dGetX(void) const
46{
47 return dX;
48}
49
51double CGeom2DPoint::dGetY(void) const
52{
53 return dY;
54}
55
57void CGeom2DPoint::SetX(double const dNewX)
58{
59 dX = dNewX;
60}
61
63void CGeom2DPoint::SetY(double const dNewY)
64{
65 dY = dNewY;
66}
67
68// void CGeom2DPoint::SetXY(double const dNewX, double const dNewY)
69// {
70// dX = dNewX;
71// dY = dNewY;
72// }
73
74// void CGeom2DPoint::SetXY(CGeom2DPoint const* Pt)
75// {
76// dX = Pt->dGetX();
77// dY = Pt->dGetY();
78// }
79
82{
83 dX = pPt->dGetX();
84 dY = pPt->dGetY();
85 return *this;
86}
87
90{
91 if ((bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) && (bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
92 return true;
93
94 return false;
95}
96
99{
100 if ((bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) && (bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
101 return true;
102
103 return false;
104}
105
108{
109 if ((! bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) || (! bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
110 return true;
111
112 return false;
113}
114
117{
118 if ((! bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) || (! bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
119 return true;
120
121 return false;
122}
Contains CGeom2DPoint definitions.
void SetY(double const)
The double parameter sets a value for the CGeom2DIPoint object's Y coordinate.
Definition 2d_point.cpp:63
double dGetY(void) const
Returns the CGeom2DPoint object's double Y coordinate.
Definition 2d_point.cpp:51
double dGetX(void) const
Returns the CGeom2DPoint object's double X coordinate.
Definition 2d_point.cpp:45
CGeom2DPoint & operator=(CGeom2DPoint const *)
Sets one CGeom2DPoint object equal to another.
Definition 2d_point.cpp:81
CGeom2DPoint(void)
Constructor with no parameters (the X and Y coordinates of the new CGeom2DPoint object are set to zer...
Definition 2d_point.cpp:24
double dY
The y coordinate.
Definition 2d_point.h:31
bool operator!=(CGeom2DPoint const *) const
Compares two CGeom2DPoint pointed-to objects for inequality.
Definition 2d_point.cpp:107
double dX
The x coordinate.
Definition 2d_point.h:28
bool operator==(CGeom2DPoint const *) const
Compares two CGeom2DPoint pointed-to objects for equality.
Definition 2d_point.cpp:89
void SetX(double const)
The double parameter sets a value for the CGeom2DIPoint object's X coordinate.
Definition 2d_point.cpp:57
This file contains global definitions for CoastalME.
double const TOLERANCE
Definition cme.h:725
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1213