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
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 <iostream>
21using std::ios;
22
23#include "i_line.h"
24
29
34
35// //! Returns the point at a given place in the line
36// CGeom2DIPoint* CGeomILine::pPtiGetAt(int const n)
37// {
38// return &m_VPoints[n];
39// }
40
41// int CGeomILine::nGetXAt(int const n)
42// {
43// return m_VPoints[n].nGetX();
44// }
45//
46// int CGeomILine::nGetYAt(int const n)
47// {
48// return m_VPoints[n].nGetY();
49// }
50
51// //! Sets the X value of a point at a given place in the line
52// void CGeomILine::SetXAt(int const n, int const nX)
53// {
54// m_VPoints[n].SetX(nX);
55// }
56
57// //! Sets the Y value of a point at a given place in the line
58// void CGeomILine::SetYAt(int const n, int const nY)
59// {
60// m_VPoints[n].SetY(nY);
61// }
62
64bool CGeomILine::bIsPresent(int const nX, int const nY)
65{
66 int const nSize = static_cast<int>(m_VPoints.size());
67
68 if (nSize == 0)
69 return false;
70
71 for (int n = 0; n < nSize; n++)
72 {
73 if ((nX == m_VPoints[n].nGetX()) && (nY == m_VPoints[n].nGetY()))
74 return true;
75 }
76
77 return false;
78}
79
82{
83}
vector< CGeom2DIPoint > m_VPoints
The integer points which comprise the integer-coordinate 2D shape.
Definition 2di_shape.h:34
bool bIsPresent(int const, int const)
Returns true if the point is present in the line.
Definition i_line.cpp:64
~CGeomILine(void) override
Destructor.
Definition i_line.cpp:31
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:81
CGeomILine(void)
Constructor.
Definition i_line.cpp:26
Contains CGeomILine definitions.