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