GEOS  3.8.0dev
LinearRing.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2001-2002 Vivid Solutions Inc.
7  * Copyright (C) 2005 2006 Refractions Research Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: geom/LinearRing.java r320 (JTS-1.12)
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_GEOS_LINEARRING_H
21 #define GEOS_GEOS_LINEARRING_H
22 
23 #include <geos/export.h>
24 #include <string>
25 #include <vector>
26 #include <geos/geom/LineString.h>
27 
28 #include <geos/inline.h>
29 
30 // Forward declarations
31 namespace geos {
32 namespace geom { // geos::geom
33 class Coordinate;
34 class CoordinateArraySequence;
35 }
36 }
37 
38 namespace geos {
39 namespace geom { // geos::geom
40 
56 class GEOS_DLL LinearRing : public LineString {
57 
58 public:
59 
64  static const unsigned int MINIMUM_VALID_SIZE = 4;
65 
66  LinearRing(const LinearRing& lr);
67 
81  const GeometryFactory* newFactory);
82 
84  LinearRing(CoordinateSequence::Ptr points,
85  const GeometryFactory* newFactory);
86 
87  Geometry*
88  clone() const override
89  {
90  return new LinearRing(*this);
91  }
92 
93  ~LinearRing() override;
94 
101  int getBoundaryDimension() const override;
102 
103  bool isClosed() const override;
104 
105  std::string getGeometryType() const override;
106 
107  GeometryTypeId getGeometryTypeId() const override;
108 
109  void setPoints(CoordinateSequence* cl);
110 
111  Geometry* reverse() const override;
112 
113 protected:
114 
115  int
116  getSortIndex() const override
117  {
118  return SORTINDEX_LINEARRING;
119  };
120 
121 
122 private:
123 
124  void validateConstruction();
125 };
126 
127 
128 } // namespace geos::geom
129 } // namespace geos
130 
131 #endif // ndef GEOS_GEOS_LINEARRING_H
Geometry * clone() const override
Make a deep-copy of this Geometry.
Definition: LinearRing.h:88
GeometryTypeId
Geometry types.
Definition: Geometry.h:74
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:187
Definition: LineString.h:69
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
Models an OGC SFS LinearRing.
Definition: LinearRing.h:56
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58