GEOS  3.9.0dev
BasicSegmentString.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2009 Sandro Santilli <strk@kbt.io>
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: noding/BasicSegmentString.java rev. 1.1 (JTS-1.9)
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_NODING_BASICSEGMENTSTRING_H
20 #define GEOS_NODING_BASICSEGMENTSTRING_H
21 
22 #include <geos/export.h>
23 #include <geos/noding/SegmentString.h> // for inheritance
24 #include <geos/geom/CoordinateSequence.h> // for inlines (size())
25 
26 #include <geos/inline.h>
27 
28 #include <vector>
29 
30 // Forward declarations
31 
32 namespace geos {
33 namespace noding { // geos.noding
34 
44 class GEOS_DLL BasicSegmentString : public SegmentString {
45 
46 public:
47 
54  const void* newContext)
55  :
56  SegmentString(newContext),
57  pts(newPts)
58  {}
59 
60  ~BasicSegmentString() override
61  {}
62 
63  // see dox in SegmentString.h
64  size_t
65  size() const override
66  {
67  return pts->size();
68  }
69 
70  // see dox in SegmentString.h
71  const geom::Coordinate& getCoordinate(size_t i) const override;
72 
74  geom::CoordinateSequence* getCoordinates() const override;
75 
76  // see dox in SegmentString.h
77  bool isClosed() const override;
78 
79  // see dox in SegmentString.h
80  std::ostream& print(std::ostream& os) const override;
81 
89  int getSegmentOctant(size_t index) const;
90 
91 private:
92 
93  geom::CoordinateSequence* pts;
94 
95 };
96 
97 } // namespace geos.noding
98 } // namespace geos
99 
100 #ifdef GEOS_INLINE
101 #include <geos/noding/BasicSegmentString.inl>
102 #endif
103 
104 #endif // ndef GEOS_NODING_BASICSEGMENTSTRING_H
BasicSegmentString(geom::CoordinateSequence *newPts, const void *newContext)
Construct a BasicSegmentString.
Definition: BasicSegmentString.h:53
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Represents a list of contiguous line segments, and supports noding the segments.
Definition: BasicSegmentString.h:44
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58