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
34 : dX(pPt->dGetX()),
35 dY(pPt->dGetY())
36{
37}
38
40CGeom2DPoint::CGeom2DPoint(double const dNewX, double const dNewY)
41 : dX(dNewX),
42 dY(dNewY)
43{
44}
45
47double CGeom2DPoint::dGetX(void) const
48{
49 return dX;
50}
51
53double CGeom2DPoint::dGetY(void) const
54{
55 return dY;
56}
57
59void CGeom2DPoint::SetX(double const dNewX)
60{
61 dX = dNewX;
62}
63
65void CGeom2DPoint::SetY(double const dNewY)
66{
67 dY = dNewY;
68}
69
70// void CGeom2DPoint::SetXY(double const dNewX, double const dNewY)
71// {
72// dX = dNewX;
73// dY = dNewY;
74// }
75
76// void CGeom2DPoint::SetXY(CGeom2DPoint const* Pt)
77// {
78// dX = Pt->dGetX();
79// dY = Pt->dGetY();
80// }
81
84{
85 dX = pPt->dGetX();
86 dY = pPt->dGetY();
87 return *this;
88}
89
92{
93 if ((bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) && (bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
94 return true;
95
96 return false;
97}
98
101{
102 if ((bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) && (bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
103 return true;
104
105 return false;
106}
107
110{
111 if ((!bFPIsEqual(pPt->dGetX(), dX, TOLERANCE)) || (!bFPIsEqual(pPt->dGetY(), dY, TOLERANCE)))
112 return true;
113
114 return false;
115}
116
119{
120 if ((!bFPIsEqual(Pt.dGetX(), dX, TOLERANCE)) || (!bFPIsEqual(Pt.dGetY(), dY, TOLERANCE)))
121 return true;
122
123 return false;
124}
Contains CGeom2DPoint definitions.
void SetY(double const)
The double parameter sets a value for the CGeom2DIPoint object's Y coordinate.
Definition 2d_point.cpp:65
double dGetY(void) const
Returns the CGeom2DPoint object's double Y coordinate.
Definition 2d_point.cpp:53
double dGetX(void) const
Returns the CGeom2DPoint object's double X coordinate.
Definition 2d_point.cpp:47
CGeom2DPoint & operator=(CGeom2DPoint const *)
Sets one CGeom2DPoint object equal to another.
Definition 2d_point.cpp:83
CGeom2DPoint(void)
Constructor with no parameters (the X and Y coordinates of the new CGeom2DPoint object are set to zer...
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:109
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:91
void SetX(double const)
The double parameter sets a value for the CGeom2DIPoint object's X coordinate.
Definition 2d_point.cpp:59
This file contains global definitions for CoastalME.
double const TOLERANCE
Definition cme.h:814
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1297