21 #ifndef GEOS_GEOM_LINESEGMENT_H 22 #define GEOS_GEOM_LINESEGMENT_H 37 class CoordinateSequence;
38 class GeometryFactory;
73 LineSegment(
double x0,
double y0,
double x1,
double y1);
80 const Coordinate& operator[](std::size_t i)
const;
86 double getLength()
const;
92 bool isHorizontal()
const;
98 bool isVertical()
const;
121 int orientationIndex(
const LineSegment& seg)
const;
124 int orientationIndex(
const LineSegment* seg)
const;
142 int orientationIndex(
const Coordinate& p)
const;
155 double angle()
const;
173 double distancePerpendicular(
const Coordinate& p)
const;
189 void pointAlong(
double segmentLengthFraction,
Coordinate& ret)
const;
215 void pointAlongOffset(
double segmentLengthFraction,
216 double offsetDistance,
236 double projectionFactor(
const Coordinate& p)
const;
253 double segmentFraction(
const Coordinate& inputPt)
const;
320 std::array<Coordinate, 2> closestPoints(
const LineSegment& line);
322 std::array<Coordinate, 2> closestPoints(
const LineSegment* line);
362 std::unique_ptr<LineString> toGeometry(
const GeometryFactory& gf)
const;
366 size_t h = std::hash<double>{}(s.
p0.
x);
367 h ^= (std::hash<double>{}(s.
p0.
y) << 1);
368 h ^= (std::hash<double>{}(s.
p1.
x) << 1);
369 return h ^ (std::hash<double>{}(s.
p1.
y) << 1);
384 # include "geos/geom/LineSegment.inl" 387 #endif // ndef GEOS_GEOM_LINESEGMENT_H
Coordinate p1
Segment start.
Coordinate is the lightweight class used to store coordinates.
size_t operator()(const LineSegment &s) const
std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Basic namespace for all GEOS functionalities.
bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.