Class Segment2dfx
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx<Segment2dfx>
-
- org.arakhne.afc.math.geometry.d2.dfx.Segment2dfx
-
- All Implemented Interfaces:
Serializable,Cloneable,Segment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2dfx<Segment2dfx>,Shape2D<Shape2dfx<?>,Segment2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>,JsonableObject
public class Segment2dfx extends AbstractShape2dfx<Segment2dfx> implements Segment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
A 2D segment/line encapsulating points with 2 double precision FX properties.This segment is defined by its two extremities. It should not differ from the original Segment2dfx except from storage type.
- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Thomas PIOTROWSKI, Stéphane GALLAND, Hamza JAFFALI
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- mathfx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Segment2afp
Segment2afp.SegmentPathIterator<T extends PathElement2afp>, Segment2afp.UncertainIntersection
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
boundingBox
-
-
Constructor Summary
Constructors Constructor Description Segment2dfx()Construct an empty segment.Segment2dfx(double x1, double y1, double x2, double y2)Construct a segment with the two given points.Segment2dfx(Segment2afp<?,?,?,?,?,?> segment)Constructor by copy.Segment2dfx(Point2dfx p1, Point2dfx p2)Constructor by setting the two given points.Segment2dfx(Segment2dfx segment)Constructor by setting.Segment2dfx(Point2D<?,?> p1, Point2D<?,?> p2)Construct a segment with the two given points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ObjectProperty<Rectangle2dfx>boundingBoxProperty()Replies the property that contains the bounding box for this shape.Segment2dfxclone()Clone this shape.Segment2dfxcreateTransformedShape(Transform2D transform)Apply the transformation to the shape and reply the result.Point2dfxgetP1()Replies the first point.Point2dfxgetP2()Replies the second point.doublegetX1()Replies the X of the first point.doublegetX2()Replies the X of the second point.doublegetY1()Replies the Y of the first point.doublegetY2()Replies the Y of the second point.inthashCode()voidset(double x1, double y1, double x2, double y2)Change the line.voidsetP1(double x, double y)Change the first point.voidsetP1(Point2dfx pt)Set the oriented point as the first point of this Segment2dfx to preserve length.voidsetP1(Point2D<?,?> pt)Change the first point.voidsetP2(double x, double y)Change the second point.voidsetP2(Point2dfx pt)Set the oriented point as the second point of this Segment2dfx to preserve length.voidsetP2(Point2D<?,?> pt)Change the second point.voidsetX1(double x)Sets a new value in the X of the first point.voidsetX2(double x)Sets a new value in the X of the second point.voidsetY1(double y)Sets a new value in the Y of the first point.voidsetY2(double y)Sets a new value in the Y of the second point.StringtoString()javafx.beans.property.DoublePropertyx1Property()Replies the property that is the x coordinate of the first segment point.javafx.beans.property.DoublePropertyx2Property()Replies the property that is the x coordinate of the second segment point.javafx.beans.property.DoublePropertyy1Property()Replies the property that is the y coordinate of the first segment point.javafx.beans.property.DoublePropertyy2Property()Replies the property that is the x coordinate of the second segment point.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
equals, getGeomFactory, toJson
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Segment2afp
clear, clipToRectangle, contains, contains, contains, equalsToShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getDistanceSquared, getFarthestPointTo, getLength, getLengthSquared, getPathIterator, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, isEmpty, set, set, toBoundingBox, transform, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Shape2afp
contains, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
Segment2dfx
public Segment2dfx()
Construct an empty segment.
-
Segment2dfx
public Segment2dfx(Point2dfx p1, Point2dfx p2)
Constructor by setting the two given points.- Parameters:
p1- the point to set as first point.p2- the point to set as second point.
-
Segment2dfx
public Segment2dfx(Point2D<?,?> p1, Point2D<?,?> p2)
Construct a segment with the two given points.- Parameters:
p1- first point.p2- second point.
-
Segment2dfx
public Segment2dfx(Segment2dfx segment)
Constructor by setting.- Parameters:
segment- the segment to set.
-
Segment2dfx
public Segment2dfx(Segment2afp<?,?,?,?,?,?> segment)
Constructor by copy.- Parameters:
segment- the segment to copy.
-
Segment2dfx
public Segment2dfx(double x1, double y1, double x2, double y2)Construct a segment with the two given points.- Parameters:
x1- x coordinate of the first point.y1- y coordinate of the first point.x2- x coordinate of the second point.y2- y coordinate of the second point.
-
-
Method Detail
-
clone
public Segment2dfx clone()
Description copied from interface:Shape2DClone this shape.- Specified by:
clonein interfaceShape2D<Shape2dfx<?>,Segment2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Overrides:
clonein classAbstractShape2dfx<Segment2dfx>- Returns:
- the clone.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classAbstractShape2dfx<Segment2dfx>
-
toString
@Pure public String toString()
- Overrides:
toStringin classAbstractShape2dfx<Segment2dfx>
-
createTransformedShape
@Pure public Segment2dfx createTransformedShape(Transform2D transform)
Description copied from interface:Shape2DApply the transformation to the shape and reply the result. This function does not change the current shape.- Specified by:
createTransformedShapein interfaceShape2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
createTransformedShapein interfaceShape2D<Shape2dfx<?>,Segment2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
transform- is the transformation to apply to the shape.- Returns:
- the result of the transformation.
-
set
public void set(double x1, double y1, double x2, double y2)Description copied from interface:Segment2afpChange the line.- Specified by:
setin interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x1- x coordinate of the first point.y1- y coordinate of the first point.x2- x coordinate of the second point.y2- y coordinate of the second point.
-
setX1
public void setX1(double x)
Description copied from interface:Segment2afpSets a new value in the X of the first point.- Specified by:
setX1in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- the new value double x
-
setY1
public void setY1(double y)
Description copied from interface:Segment2afpSets a new value in the Y of the first point.- Specified by:
setY1in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
y- the new value double y
-
setX2
public void setX2(double x)
Description copied from interface:Segment2afpSets a new value in the X of the second point.- Specified by:
setX2in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- the new value double x
-
setY2
public void setY2(double y)
Description copied from interface:Segment2afpSets a new value in the Y of the second point.- Specified by:
setY2in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
y- the new value double y
-
getX1
@Pure public double getX1()
Description copied from interface:Segment2afpReplies the X of the first point.- Specified by:
getX1in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the x of the first point.
-
x1Property
@Pure public javafx.beans.property.DoubleProperty x1Property()
Replies the property that is the x coordinate of the first segment point.- Returns:
- the x1 property.
-
getY1
@Pure public double getY1()
Description copied from interface:Segment2afpReplies the Y of the first point.- Specified by:
getY1in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the y of the first point.
-
y1Property
@Pure public javafx.beans.property.DoubleProperty y1Property()
Replies the property that is the y coordinate of the first segment point.- Returns:
- the y1 property.
-
getX2
@Pure public double getX2()
Description copied from interface:Segment2afpReplies the X of the second point.- Specified by:
getX2in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the x of the second point.
-
x2Property
@Pure public javafx.beans.property.DoubleProperty x2Property()
Replies the property that is the x coordinate of the second segment point.- Returns:
- the x2 property.
-
getY2
@Pure public double getY2()
Description copied from interface:Segment2afpReplies the Y of the second point.- Specified by:
getY2in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the y of the second point.
-
y2Property
@Pure public javafx.beans.property.DoubleProperty y2Property()
Replies the property that is the x coordinate of the second segment point.- Returns:
- the x2 property.
-
getP1
public Point2dfx getP1()
Description copied from interface:Segment2afpReplies the first point.- Specified by:
getP1in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the first point.
-
setP1
public void setP1(double x, double y)Description copied from interface:Segment2afpChange the first point.- Specified by:
setP1in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the first point.y- y coordinate of the first point.
-
setP1
public void setP1(Point2D<?,?> pt)
Description copied from interface:Segment2afpChange the first point.- Specified by:
setP1in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
pt- the first point.
-
setP1
public void setP1(Point2dfx pt)
Set the oriented point as the first point of this Segment2dfx to preserve length.- Parameters:
pt- the point.
-
getP2
public Point2dfx getP2()
Description copied from interface:Segment2afpReplies the second point.- Specified by:
getP2in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the second point.
-
setP2
public void setP2(double x, double y)Description copied from interface:Segment2afpChange the second point.- Specified by:
setP2in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the second point.y- y coordinate of the second point.
-
setP2
public void setP2(Point2D<?,?> pt)
Description copied from interface:Segment2afpChange the second point.- Specified by:
setP2in interfaceSegment2afp<Shape2dfx<?>,Segment2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
pt- the second point.
-
setP2
public void setP2(Point2dfx pt)
Set the oriented point as the second point of this Segment2dfx to preserve length.- Parameters:
pt- the point.
-
boundingBoxProperty
public javafx.beans.property.ObjectProperty<Rectangle2dfx> boundingBoxProperty()
Description copied from interface:Shape2dfxReplies the property that contains the bounding box for this shape.- Specified by:
boundingBoxPropertyin interfaceShape2dfx<Segment2dfx>- Returns:
- the bounding box.
-
-