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
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 "2d_point.h"
28#include "line.h"
29
34
37{
38 m_VPoints.push_back(*pPt1);
39 m_VPoints.push_back(*pPt2);
40}
41
43CGeomLine::CGeomLine(int const nNum)
44{
45 CGeom2DPoint const pPt;
46 m_VPoints.reserve(nNum);
47
48 for (int n = 0; n <= nNum; n++)
49 m_VPoints.push_back(pPt);
50}
51
56
58double CGeomLine::dGetXAt(int const n)
59{
60 return m_VPoints[n].dGetX();
61}
62
64double CGeomLine::dGetYAt(int const n)
65{
66 return m_VPoints[n].dGetY();
67}
68
71{
72 return &m_VPoints[n];
73}
74
75// //! Sets the X value at a given place in the line
76// void CGeomLine::SetXAt(int const n, double const x)
77// {
78// m_VPoints[n].SetX(x);
79// }
80
81// //! Sets the Y value at a given place in the line
82// void CGeomLine::SetYAt(int const n, double const y)
83// {
84// m_VPoints[n].SetY(y);
85// }
86
87// bool CGeomLine::bIsPresent(CGeom2DPoint* Pt)
88// {
89// if (find(m_VPoints.begin(), m_VPoints.end(), *Pt) != m_VPoints.end())
90// return true;
91//
92// return false;
93// }
94
97{
98}
Contains CGeom2DPoint definitions.
vector< CGeom2DPoint > m_VPoints
The points which comprise the float-coordinate 2D shape.
Definition 2d_shape.h:39
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:70
double dGetYAt(int const)
Returns the Y value at a given place in the line.
Definition line.cpp:64
void Display(void) override
Instantiates the pure virtual function in the abstract parent class, so that CGeomLine is not an abst...
Definition line.cpp:96
double dGetXAt(int const)
Returns the X value at a given place in the line.
Definition line.cpp:58
~CGeomLine(void) override
Destructor.
Definition line.cpp:53
CGeomLine(void)
Constructor.
Definition line.cpp:31
Contains CGeomLine definitions.