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::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
51 for (int n = 0; n <= nNum; n++)
52 m_VPoints.push_back(pPt);
53}
54
59
61double CGeomLine::dGetXAt(int const n)
62{
63 return m_VPoints[n].dGetX();
64}
65
67double CGeomLine::dGetYAt(int const n)
68{
69 return m_VPoints[n].dGetY();
70}
71
74{
75 return &m_VPoints[n];
76}
77
78// //! Sets the X value at a given place in the line
79// void CGeomLine::SetXAt(int const n, double const x)
80// {
81// m_VPoints[n].SetX(x);
82// }
83
84// //! Sets the Y value at a given place in the line
85// void CGeomLine::SetYAt(int const n, double const y)
86// {
87// m_VPoints[n].SetY(y);
88// }
89
90// bool CGeomLine::bIsPresent(CGeom2DPoint* Pt)
91// {
92// if (find(m_VPoints.begin(), m_VPoints.end(), *Pt) != m_VPoints.end())
93// return true;
94//
95// return false;
96// }
97
100{
101}
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:73
double dGetYAt(int const)
Returns the Y value at a given place in the line.
Definition line.cpp:67
void Display(void) override
Instantiates the pure virtual function in the abstract parent class, so that CGeomLine is not an abst...
Definition line.cpp:99
double dGetXAt(int const)
Returns the X value at a given place in the line.
Definition line.cpp:61
~CGeomLine(void) override
Destructor.
Definition line.cpp:56
CGeomLine(void)
Constructor.
Definition line.cpp:34
This file contains global definitions for CoastalME.
Contains CGeomLine definitions.