Class Segment2ifx
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.ifx.AbstractShape2ifx<Segment2ifx>
-
- org.arakhne.afc.math.geometry.d2.ifx.Segment2ifx
-
- All Implemented Interfaces:
Serializable,Cloneable,Segment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>,Shape2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>,Shape2ifx<Segment2ifx>,Shape2D<Shape2ifx<?>,Segment2ifx,PathIterator2ai<PathElement2ifx>,Point2ifx,Vector2ifx,Rectangle2ifx>,JsonableObject
public class Segment2ifx extends AbstractShape2ifx<Segment2ifx> implements Segment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>
A 2D segment/line encapsulating points with 2 integer FX properties.This segment is defined by its two extremities. It should not differ from the original Segment2ifx 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.ai.Segment2ai
Segment2ai.AbstractSegmentPathIterator<IE extends PathElement2ai>, Segment2ai.BresenhamLineIterator<P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>, Segment2ai.SegmentPathIterator<IE extends PathElement2ai>, Segment2ai.TransformedSegmentPathIterator<IE extends PathElement2ai>
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.ifx.AbstractShape2ifx
boundingBox
-
-
Constructor Summary
Constructors Constructor Description Segment2ifx()Construct an empty segment.Segment2ifx(int x1, int y1, int x2, int y2)Construct a segment with the two given points.Segment2ifx(Segment2ai<?,?,?,?,?,?> segment)Constructor by copy.Segment2ifx(Point2ifx p1, Point2ifx p2)Construct a segment by setting the two given points.Segment2ifx(Segment2ifx segment)Constructor by setting.Segment2ifx(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<Rectangle2ifx>boundingBoxProperty()Replies the property that contains the bounding box for this shape.Segment2ifxclone()Clone this shape.Segment2ifxcreateTransformedShape(Transform2D transform)Apply the transformation to the shape and reply the result.Point2ifxgetP1()Replies the first point.Point2ifxgetP2()Replies the second point.intgetX1()Replies the X of the first point.intgetX2()Replies the X of the second point.intgetY1()Replies the Y of the first point.intgetY2()Replies the Y of the second point.inthashCode()voidset(int x1, int y1, int x2, int y2)Change the line.voidsetP1(int x, int y)Change the first point.voidsetP1(OrientedPoint2ifx pt)Set the oriented point as the first point of this SegmentPoint2dfx to preserve length.voidsetP1(Point2D<?,?> pt)Change the first point.voidsetP2(int x, int y)Change the second point.voidsetP2(OrientedPoint2ifx pt)Set the oriented point as the second point of this SegmentPoint2dfx to preserve length.voidsetP2(Point2D<?,?> pt)Change the second point.voidsetX1(int x)Change the X of the first point.voidsetX2(int x)Change the X of the second point.voidsetY1(int y)Change the Y of the first point.voidsetY2(int y)Change the Y of the second point.StringtoString()javafx.beans.property.IntegerPropertyx1Property()Replies the property that is the x coordinate of the first segment point.javafx.beans.property.IntegerPropertyx2Property()Replies the property that is the x coordinate of the second segment point.javafx.beans.property.IntegerPropertyy1Property()Replies the property that is the y coordinate of the first segment point.javafx.beans.property.IntegerPropertyy2Property()Replies the property that is the x coordinate of the second segment point.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.ifx.AbstractShape2ifx
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.ai.Segment2ai
clear, clipToRectangle, contains, contains, contains, equalsToShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getDistanceSquared, getDistanceSquared, getFarthestPointTo, getPathIterator, getPointIterator, intersects, intersects, intersects, intersects, intersects, isEmpty, set, set, toBoundingBox, transform, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.ai.Shape2ai
contains, getClosestPointTo, getClosestPointTo, 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
-
Segment2ifx
public Segment2ifx()
Construct an empty segment.
-
Segment2ifx
public Segment2ifx(Point2ifx p1, Point2ifx p2)
Construct a segment by setting the two given points.- Parameters:
p1- the point to set as the first point.p2- the point to set as the second point.
-
Segment2ifx
public Segment2ifx(Point2D<?,?> p1, Point2D<?,?> p2)
Construct a segment with the two given points.- Parameters:
p1- first point.p2- second point.
-
Segment2ifx
public Segment2ifx(Segment2ifx segment)
Constructor by setting.- Parameters:
segment- the segment to set.
-
Segment2ifx
public Segment2ifx(Segment2ai<?,?,?,?,?,?> segment)
Constructor by copy.- Parameters:
segment- the segment to copy.
-
Segment2ifx
public Segment2ifx(int x1, int y1, int x2, int 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 Segment2ifx clone()
Description copied from interface:Shape2DClone this shape.- Specified by:
clonein interfaceShape2D<Shape2ifx<?>,Segment2ifx,PathIterator2ai<PathElement2ifx>,Point2ifx,Vector2ifx,Rectangle2ifx>- Overrides:
clonein classAbstractShape2ifx<Segment2ifx>- Returns:
- the clone.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classAbstractShape2ifx<Segment2ifx>
-
toString
@Pure public String toString()
- Overrides:
toStringin classAbstractShape2ifx<Segment2ifx>
-
createTransformedShape
@Pure public Segment2ifx 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 interfaceShape2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Specified by:
createTransformedShapein interfaceShape2D<Shape2ifx<?>,Segment2ifx,PathIterator2ai<PathElement2ifx>,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
transform- is the transformation to apply to the shape.- Returns:
- the result of the transformation.
-
set
public void set(int x1, int y1, int x2, int y2)Description copied from interface:Segment2aiChange the line.- Specified by:
setin interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- 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(int x)
Description copied from interface:Segment2aiChange the X of the first point.- Specified by:
setX1in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
x- the x of the first point.
-
setY1
public void setY1(int y)
Description copied from interface:Segment2aiChange the Y of the first point.- Specified by:
setY1in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
y- the y of the first point.
-
setX2
public void setX2(int x)
Description copied from interface:Segment2aiChange the X of the second point.- Specified by:
setX2in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
x- the x of the second point.
-
setY2
public void setY2(int y)
Description copied from interface:Segment2aiChange the Y of the second point.- Specified by:
setY2in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
y- the y of the second point.
-
getX1
@Pure public int getX1()
Description copied from interface:Segment2aiReplies the X of the first point.- Specified by:
getX1in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Returns:
- the x of the first point.
-
x1Property
@Pure public javafx.beans.property.IntegerProperty x1Property()
Replies the property that is the x coordinate of the first segment point.- Returns:
- the x1 property.
-
getY1
@Pure public int getY1()
Description copied from interface:Segment2aiReplies the Y of the first point.- Specified by:
getY1in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Returns:
- the y of the first point.
-
y1Property
@Pure public javafx.beans.property.IntegerProperty y1Property()
Replies the property that is the y coordinate of the first segment point.- Returns:
- the y1 property.
-
getX2
@Pure public int getX2()
Description copied from interface:Segment2aiReplies the X of the second point.- Specified by:
getX2in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Returns:
- the x of the second point.
-
x2Property
@Pure public javafx.beans.property.IntegerProperty x2Property()
Replies the property that is the x coordinate of the second segment point.- Returns:
- the x2 property.
-
getY2
@Pure public int getY2()
Description copied from interface:Segment2aiReplies the Y of the second point.- Specified by:
getY2in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Returns:
- the y of the second point.
-
y2Property
@Pure public javafx.beans.property.IntegerProperty y2Property()
Replies the property that is the x coordinate of the second segment point.- Returns:
- the x2 property.
-
getP1
public Point2ifx getP1()
Description copied from interface:Segment2aiReplies the first point.- Specified by:
getP1in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Returns:
- the first point.
-
getP2
public Point2ifx getP2()
Description copied from interface:Segment2aiReplies the second point.- Specified by:
getP2in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Returns:
- the second point.
-
setP1
public void setP1(int x, int y)Description copied from interface:Segment2aiChange the first point.- Specified by:
setP1in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- 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:Segment2aiChange the first point.- Specified by:
setP1in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
pt- the first point.
-
setP1
public void setP1(OrientedPoint2ifx pt)
Set the oriented point as the first point of this SegmentPoint2dfx to preserve length.- Parameters:
pt- the point.
-
setP2
public void setP2(int x, int y)Description copied from interface:Segment2aiChange the second point.- Specified by:
setP2in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
x- x coordinate the second point.y- y coordinate the second point.
-
setP2
public void setP2(Point2D<?,?> pt)
Description copied from interface:Segment2aiChange the second point.- Specified by:
setP2in interfaceSegment2ai<Shape2ifx<?>,Segment2ifx,PathElement2ifx,Point2ifx,Vector2ifx,Rectangle2ifx>- Parameters:
pt- the second point.
-
setP2
public void setP2(OrientedPoint2ifx pt)
Set the oriented point as the second point of this SegmentPoint2dfx to preserve length.- Parameters:
pt- the point.
-
boundingBoxProperty
public javafx.beans.property.ObjectProperty<Rectangle2ifx> boundingBoxProperty()
Description copied from interface:Shape2ifxReplies the property that contains the bounding box for this shape.- Specified by:
boundingBoxPropertyin interfaceShape2ifx<Segment2ifx>- Returns:
- the bounding box.
-
-