CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
2d_shape.h
Go to the documentation of this file.
1
12
13#ifndef C2DSHAPE_H
14#define C2DSHAPE_H
15/* ===============================================================================================================================
16 This file is part of CoastalME, the Coastal Modelling Environment.
17
18 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.
19
20 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.
21
22 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.
23===============================================================================================================================*/
24#include <vector>
25using std::vector;
26
27#include <algorithm>
28using std::reverse;
29
30#include "2d_point.h"
31
33{
34 private:
35 protected:
37 vector<CGeom2DPoint> m_VPoints;
38
39 CA2DShape(void);
40 virtual ~CA2DShape(void);
41
42 // void Clear(void);
43
44 // void InsertAtFront(double const, double const);
45 // void SetPoints(const vector<CGeom2DPoint>*);
46 // int nLookUp(CGeom2DPoint*);
47 // double dGetLength(void) const;
48 // CGeom2DPoint PtGetCentroid(void);
49
50 virtual void Display() = 0;
51
52 public:
53 void Reverse(void);
54
55 int nGetSize(void) const;
56 void Resize(int const);
57
58 void Append(CGeom2DPoint const*);
59 void Append(double const, double const);
60 void AppendIfNotPrevious(double const, double const);
61 CGeom2DPoint* pPtBack(void);
62
63 CGeom2DPoint& operator[](int const);
64 vector<CGeom2DPoint>* pPtVGetPoints(void);
65};
66#endif // C2DSHAPE_H
Contains CGeom2DPoint definitions.
vector< CGeom2DPoint > m_VPoints
The points which comprise the float-coordinate 2D shape.
Definition 2d_shape.h:37
void Append(CGeom2DPoint const *)
Appends a point to this 2D shape.
Definition 2d_shape.cpp:64
vector< CGeom2DPoint > * pPtVGetPoints(void)
Returns the address of the vector which represents this 2D shape.
Definition 2d_shape.cpp:127
void Reverse(void)
Reverses the sequence of points in the vector which represents this 2D polygon.
Definition 2d_shape.cpp:163
CA2DShape(void)
Constructor.
Definition 2d_shape.cpp:24
CGeom2DPoint * pPtBack(void)
Returns the last element of this 2D shape.
Definition 2d_shape.cpp:88
virtual void Display()=0
int nGetSize(void) const
Definition 2d_shape.cpp:53
void Resize(int const)
Resizes the vector which represents this 2D shape.
Definition 2d_shape.cpp:47
void AppendIfNotPrevious(double const, double const)
Appends a point to this 2D shape only if the point is not the same as the previous point in the vecto...
Definition 2d_shape.cpp:76
CGeom2DPoint & operator[](int const)
Operator to return one point of this 2D shape.
Definition 2d_shape.cpp:34
virtual ~CA2DShape(void)
Destructor.
Definition 2d_shape.cpp:29
Geometry class used to represent 2D point objects with floating-point coordinates.
Definition 2d_point.h:25