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 
50 class GEOS_DLL BasicSegmentString : public SegmentString {
51 
52 public:
53 
55  //
61  const void* newContext)
62  :
63  SegmentString(newContext),
64  pts(newPts)
65  {}
66 
67  ~BasicSegmentString() override
68  {}
69 
71  size_t
72  size() const override
73  {
74  return pts->size();
75  }
76 
78  const geom::Coordinate& getCoordinate(size_t i) const override;
79 
81  geom::CoordinateSequence* getCoordinates() const override;
82 
84  bool isClosed() const override;
85 
87  std::ostream& print(std::ostream& os) const override;
88 
96  int getSegmentOctant(size_t index) const;
97 
98 private:
99 
101 
102 };
103 
104 } // namespace geos.noding
105 } // namespace geos
106 
107 #endif // ndef GEOS_NODING_BASICSEGMENTSTRING_H
108 
BasicSegmentString(geom::CoordinateSequence *newPts, const void *newContext)
Construct a BasicSegmentString.
Definition: BasicSegmentString.h:60
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Definition: BasicSegmentString.h:50
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
size_t size() const override
see dox in SegmentString.h
Definition: BasicSegmentString.h:72
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58