CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
i_line.cpp
Go to the documentation of this file.
1
12
13/* ==============================================================================================================================
14
15 This file is part of CoastalME, the Coastal Modelling Environment.
16
17 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.
18
19 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.
20
21 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.
22
23==============================================================================================================================*/
24#include <iostream>
25using std::ios;
26
27#include "i_line.h"
28
33
38
39// //! Returns the point at a given place in the line
40// CGeom2DIPoint* CGeomILine::pPtiGetAt(int const n)
41// {
42// return &m_VPoints[n];
43// }
44
45// int CGeomILine::nGetXAt(int const n)
46// {
47// return m_VPoints[n].nGetX();
48// }
49//
50// int CGeomILine::nGetYAt(int const n)
51// {
52// return m_VPoints[n].nGetY();
53// }
54
55// //! Sets the X value of a point at a given place in the line
56// void CGeomILine::SetXAt(int const n, int const nX)
57// {
58// m_VPoints[n].SetX(nX);
59// }
60
61// //! Sets the Y value of a point at a given place in the line
62// void CGeomILine::SetYAt(int const n, int const nY)
63// {
64// m_VPoints[n].SetY(nY);
65// }
66
68bool CGeomILine::bIsPresent(int const nX, int const nY)
69{
70 int const nSize = static_cast<int>(m_VPoints.size());
71
72 if (nSize == 0)
73 return false;
74
75 for (int n = 0; n < nSize; n++)
76 {
77 if ((nX == m_VPoints[n].nGetX()) && (nY == m_VPoints[n].nGetY()))
78 return true;
79 }
80
81 return false;
82}
83
86{
87}
vector< CGeom2DIPoint > m_VPoints
The integer points which comprise the integer-coordinate 2D shape.
Definition 2di_shape.h:38
bool bIsPresent(int const, int const)
Returns true if the point is present in the line.
Definition i_line.cpp:68
~CGeomILine(void) override
Destructor.
Definition i_line.cpp:35
void Display(void) override
Instantiates the pure virtual function in the abstract parent class, so that CGeomILine is not an abs...
Definition i_line.cpp:85
CGeomILine(void)
Constructor.
Definition i_line.cpp:30
Contains CGeomILine definitions.