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
14
15#ifndef C2DSHAPE_H
16#define C2DSHAPE_H
17/* ===============================================================================================================================
18 This file is part of CoastalME, the Coastal Modelling Environment.
19
20 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.
21
22 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.
23
24 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.
25===============================================================================================================================*/
26#include <vector>
27using std::vector;
28
29#include <algorithm>
30using std::reverse;
31
32#include "2d_point.h"
33
35{
36 private:
37 protected:
39 vector<CGeom2DPoint> m_VPoints;
40
41 CA2DShape(void);
42 virtual ~CA2DShape(void);
43
44 void Clear(void);
45
46 // void InsertAtFront(double const, double const);
47 // void SetPoints(const vector<CGeom2DPoint>*);
48 // int nLookUp(CGeom2DPoint*);
49 // double dGetLength(void) const;
50 // CGeom2DPoint PtGetCentroid(void);
51
52 virtual void Display() = 0;
53
54 public:
55 void Reverse(void);
56
57 int nGetSize(void) const;
58 void Resize(int const);
59
60 void Append(CGeom2DPoint const*);
61 void Append(double const, double const);
62 void AppendIfNotAlready(double const, double const);
63 CGeom2DPoint* pPtBack(void);
64
65 CGeom2DPoint& operator[](int const);
66 vector<CGeom2DPoint>* pPtVGetPoints(void);
67};
68#endif // C2DSHAPE_H
Contains CGeom2DPoint definitions.
vector< CGeom2DPoint > m_VPoints
The points which comprise the float-coordinate 2D shape.
Definition 2d_shape.h:39
void Append(CGeom2DPoint const *)
Appends a point to this 2D shape.
Definition 2d_shape.cpp:67
vector< CGeom2DPoint > * pPtVGetPoints(void)
Returns the address of the vector which represents this 2D shape.
Definition 2d_shape.cpp:130
void Reverse(void)
Reverses the sequence of points in the vector which represents this 2D polygon.
Definition 2d_shape.cpp:166
void Clear(void)
Clears this 2D shape.
Definition 2d_shape.cpp:44
CA2DShape(void)
Constructor.
Definition 2d_shape.cpp:27
CGeom2DPoint * pPtBack(void)
Returns the last element of this 2D shape.
Definition 2d_shape.cpp:91
virtual void Display()=0
void AppendIfNotAlready(double const, double const)
Appends a point to this 2D shape only if it isn't already in the shape vector.
Definition 2d_shape.cpp:79
int nGetSize(void) const
Definition 2d_shape.cpp:56
void Resize(int const)
Resizes the vector which represents this 2D shape.
Definition 2d_shape.cpp:50
CGeom2DPoint & operator[](int const)
Operator to return one point of this 2D shape.
Definition 2d_shape.cpp:37
virtual ~CA2DShape(void)
Destructor.
Definition 2d_shape.cpp:32
Geometry class used to represent 2D point objects with floating-point coordinates.
Definition 2d_point.h:27