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
15This file is part of CoastalME, the Coastal Modelling Environment.
16
17CoastalME 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
19This 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
21You 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::cout;
26using std::cerr;
27using std::endl;
28using std::ios;
29
30#include "cme.h"
31#include "i_line.h"
32
37
42
43// //! Returns the point at a given place in the line
44// CGeom2DIPoint* CGeomILine::pPtiGetAt(int const n)
45// {
46// return &m_VPoints[n];
47// }
48
49// int CGeomILine::nGetXAt(int const n)
50// {
51// return m_VPoints[n].nGetX();
52// }
53//
54// int CGeomILine::nGetYAt(int const n)
55// {
56// return m_VPoints[n].nGetY();
57// }
58
59// //! Sets the X value of a point at a given place in the line
60// void CGeomILine::SetXAt(int const n, int const nX)
61// {
62// m_VPoints[n].SetX(nX);
63// }
64
65// //! Sets the Y value of a point at a given place in the line
66// void CGeomILine::SetYAt(int const n, int const nY)
67// {
68// m_VPoints[n].SetY(nY);
69// }
70
72bool CGeomILine::bIsPresent(int const nX, int const nY)
73{
74 int nSize = static_cast<int>(m_VPoints.size());
75 if (nSize == 0)
76 return false;
77
78 for (int n = 0; n < nSize; n++)
79 {
80 if ((nX == m_VPoints[n].nGetX()) && (nY == m_VPoints[n].nGetY()))
81 return true;
82 }
83
84 return false;
85}
86
89{
90}
vector< CGeom2DIPoint > m_VPoints
The integer points which comprise the integer-coordinate 2D shape.
Definition 2di_shape.h:39
bool bIsPresent(int const, int const)
Returns true if the point is present in the line.
Definition i_line.cpp:72
~CGeomILine(void) override
Destructor.
Definition i_line.cpp:39
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:88
CGeomILine(void)
Constructor.
Definition i_line.cpp:34
This file contains global definitions for CoastalME.
Contains CGeomILine definitions.