CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
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 "line.h"
32
37
40{
41 m_VPoints.push_back(*pPt1);
42 m_VPoints.push_back(*pPt2);
43}
44
46CGeomLine::CGeomLine(int const nNum)
47{
48 CGeom2DPoint pPt;
49 m_VPoints.reserve(nNum);
50 for (int n = 0; n <= nNum; n++)
51 m_VPoints.push_back(pPt);
52}
53
58
60double CGeomLine::dGetXAt(int const n)
61{
62 return m_VPoints[n].dGetX();
63}
64
66double CGeomLine::dGetYAt(int const n)
67{
68 return m_VPoints[n].dGetY();
69}
70
73{
74 return &m_VPoints[n];
75}
76
77// //! Sets the X value at a given place in the line
78// void CGeomLine::SetXAt(int const n, double const x)
79// {
80// m_VPoints[n].SetX(x);
81// }
82
83// //! Sets the Y value at a given place in the line
84// void CGeomLine::SetYAt(int const n, double const y)
85// {
86// m_VPoints[n].SetY(y);
87// }
88
89// bool CGeomLine::bIsPresent(CGeom2DPoint* Pt)
90// {
91// if (find(m_VPoints.begin(), m_VPoints.end(), *Pt) != m_VPoints.end())
92// return true;
93//
94// return false;
95// }
96
99{
100}
vector< CGeom2DPoint > m_VPoints
The points which comprise the float-coordinate 2D shape.
Definition 2d_shape.h:40
Geometry class used to represent 2D point objects with floating-point coordinates.
Definition 2d_point.h:27
CGeom2DPoint * pPtGetAt(int const)
Returns the point at a given place in the line.
Definition line.cpp:72
double dGetYAt(int const)
Returns the Y value at a given place in the line.
Definition line.cpp:66
void Display(void) override
Instantiates the pure virtual function in the abstract parent class, so that CGeomLine is not an abst...
Definition line.cpp:98
double dGetXAt(int const)
Returns the X value at a given place in the line.
Definition line.cpp:60
~CGeomLine(void) override
Destructor.
Definition line.cpp:55
CGeomLine(void)
Constructor.
Definition line.cpp:34
This file contains global definitions for CoastalME.
Contains CGeomLine definitions.