23 #include <geos/export.h>
24 #include <geos/geom/Coordinate.h>
25 #include <geos/geom/CoordinateSequence.h>
26 #include <geos/noding/Octant.h>
33 class LineIntersector;
49 typedef std::vector<const SegmentString*> ConstVect;
50 typedef std::vector<SegmentString*> NonConstVect;
52 friend std::ostream& operator<< (std::ostream& os,
91 std::size_t size()
const {
95 template<
typename CoordType = geom::Coordinate>
96 const CoordType& getCoordinate(std::size_t i)
const {
97 return seq->getAt<CoordType>(i);
123 if (index >= size() - 1) {
126 return safeOctant(seq->getAt<geom::CoordinateXY>(index),
127 seq->getAt<geom::CoordinateXY>(index + 1));
130 static int getSegmentOctant(
const SegmentString& ss, std::size_t index) {
134 bool isClosed()
const {
135 return seq->front<geom::CoordinateXY>().equals(seq->back<geom::CoordinateXY>());
138 virtual std::ostream& print(std::ostream& os)
const;
141 geom::CoordinateSequence* seq;
146 static int safeOctant(
const geom::CoordinateXY& p0,
const geom::CoordinateXY& p1)
148 if(p0.equals2D(p1)) {
155 SegmentString(
const SegmentString& other) =
delete;
156 SegmentString& operator=(
const SegmentString& rhs) =
delete;
159 std::ostream& operator<< (std::ostream& os,
const SegmentString& ss);
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
static int octant(double dx, double dy)
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:47
SegmentString(const void *newContext, geom::CoordinateSequence *newSeq)
Construct a SegmentString.
Definition: SegmentString.h:60
int getSegmentOctant(std::size_t index) const
Gets the octant of the segment starting at vertex index.
Definition: SegmentString.h:121
const geom::CoordinateSequence * getCoordinates() const
Return a pointer to the CoordinateSequence associated with this SegmentString.
Definition: SegmentString.h:106
const void * getData() const
Gets the user-defined data for this segment string.
Definition: SegmentString.h:75
void setData(const void *data)
Sets the user-defined data for this segment string.
Definition: SegmentString.h:86
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25