public class Segment extends Object
Constructor and Description |
---|
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.
|
Segment(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Creates a new instance for the given ordinates.
|
Segment(double x1,
double y1,
double z1,
double x2,
double y2,
double z2,
Object data)
Creates a new instance for the given ordinates, with associated external data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equalsTopo(Segment s)
Determines whether two segments are topologically equal.
|
Object |
getData()
Gets the external data associated with this segment
|
Coordinate |
getEnd()
Gets the end coordinate of the segment
|
double |
getEndX()
Gets the end X ordinate of the segment
|
double |
getEndY()
Gets the end Y ordinate of the segment
|
double |
getEndZ()
Gets the end Z ordinate of the segment
|
LineSegment |
getLineSegment()
Gets a LineSegment modelling this segment.
|
Coordinate |
getStart()
Gets the start coordinate of the segment
|
double |
getStartX()
Gets the start X ordinate of the segment
|
double |
getStartY()
Gets the start Y ordinate of the segment
|
double |
getStartZ()
Gets the start Z ordinate of the segment
|
Coordinate |
intersection(Segment s)
Computes the intersection point between this segment and another one.
|
void |
setData(Object data)
Sets the external data to be associated with this segment
|
String |
toString()
Computes a string representation of this segment.
|
public Segment(double x1, double y1, double z1, double x2, double y2, double z2)
public Segment(double x1, double y1, double z1, double x2, double y2, double z2, Object data)
public Segment(Coordinate p0, Coordinate p1, Object data)
p0
- the start pointp1
- the end pointdata
- an external data objectpublic Segment(Coordinate p0, Coordinate p1)
p0
- the start pointp1
- the end pointpublic Coordinate getStart()
public Coordinate getEnd()
public double getStartX()
public double getStartY()
public double getStartZ()
public double getEndX()
public double getEndY()
public double getEndZ()
public LineSegment getLineSegment()
public Object getData()
public void setData(Object data)
data
- a data objectpublic boolean equalsTopo(Segment s)
s
- a segmentpublic Coordinate intersection(Segment s)
s
- a segmentnull
if there is noneCopyright © 2022. All rights reserved.