GEOS  3.8.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 namespace geos {
32 namespace algorithm {
33 //class LineIntersector;
34 }
35 }
36 
37 namespace geos {
38 namespace noding { // geos.noding
39 
49 class GEOS_DLL BasicSegmentString : public SegmentString {
50 
51 public:
52 
59  const void* newContext)
60  :
61  SegmentString(newContext),
62  pts(newPts)
63  {}
64 
65  ~BasicSegmentString() override
66  {}
67 
68  // see dox in SegmentString.h
69  size_t
70  size() const override
71  {
72  return pts->size();
73  }
74 
75  // see dox in SegmentString.h
76  const geom::Coordinate& getCoordinate(size_t i) const override;
77 
79  geom::CoordinateSequence* getCoordinates() const override;
80 
81  // see dox in SegmentString.h
82  bool isClosed() const override;
83 
84  // see dox in SegmentString.h
85  std::ostream& print(std::ostream& os) const override;
86 
94  int getSegmentOctant(size_t index) const;
95 
96 private:
97 
98  geom::CoordinateSequence* pts;
99 
100 };
101 
102 } // namespace geos.noding
103 } // namespace geos
104 
105 #endif // ndef GEOS_NODING_BASICSEGMENTSTRING_H
106 
BasicSegmentString(geom::CoordinateSequence *newPts, const void *newContext)
Construct a BasicSegmentString.
Definition: BasicSegmentString.h:58
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:49
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58