Class Segment
java.lang.Object
org.locationtech.jts.triangulate.Segment
Models a constraint segment in a triangulation.
A constraint segment is an oriented straight line segment between a start point
and an end point.
- Author:
- David Skea, Martin Davis
-
Constructor Summary
ConstructorsConstructorDescriptionSegment(double x1, double y1, double z1, double x2, double y2, double z2) Creates a new instance for the given ordinates.Creates a new instance for the given ordinates, with associated external data.Segment(Coordinate p0, Coordinate p1) Creates a new instance for the given points.Segment(Coordinate p0, Coordinate p1, Object data) Creates a new instance for the given points, with associated external data. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether two segments are topologically equal.getData()Gets the external data associated with this segmentgetEnd()Gets the end coordinate of the segmentdoublegetEndX()Gets the end X ordinate of the segmentdoublegetEndY()Gets the end Y ordinate of the segmentdoublegetEndZ()Gets the end Z ordinate of the segmentGets a LineSegment modelling this segment.getStart()Gets the start coordinate of the segmentdoubleGets the start X ordinate of the segmentdoubleGets the start Y ordinate of the segmentdoubleGets the start Z ordinate of the segmentComputes the intersection point between this segment and another one.voidSets the external data to be associated with this segmenttoString()Computes a string representation of this segment.
-
Constructor Details
-
Segment
public Segment(double x1, double y1, double z1, double x2, double y2, double z2) Creates a new instance for the given ordinates. -
Segment
Creates a new instance for the given ordinates, with associated external data. -
Segment
Creates a new instance for the given points, with associated external data.- Parameters:
p0- the start pointp1- the end pointdata- an external data object
-
Segment
Creates a new instance for the given points.- Parameters:
p0- the start pointp1- the end point
-
-
Method Details
-
getStart
-
getEnd
-
getStartX
public double getStartX()Gets the start X ordinate of the segment- Returns:
- the X ordinate value
-
getStartY
public double getStartY()Gets the start Y ordinate of the segment- Returns:
- the Y ordinate value
-
getStartZ
public double getStartZ()Gets the start Z ordinate of the segment- Returns:
- the Z ordinate value
-
getEndX
public double getEndX()Gets the end X ordinate of the segment- Returns:
- the X ordinate value
-
getEndY
public double getEndY()Gets the end Y ordinate of the segment- Returns:
- the Y ordinate value
-
getEndZ
public double getEndZ()Gets the end Z ordinate of the segment- Returns:
- the Z ordinate value
-
getLineSegment
Gets a LineSegment modelling this segment.- Returns:
- a LineSegment
-
getData
-
setData
Sets the external data to be associated with this segment- Parameters:
data- a data object
-
equalsTopo
Determines whether two segments are topologically equal. I.e. equal up to orientation.- Parameters:
s- a segment- Returns:
- true if the segments are topologically equal
-
intersection
Computes the intersection point between this segment and another one.- Parameters:
s- a segment- Returns:
- the intersection point, or
nullif there is none
-
toString
-