Class Triangle2dfx
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx<Triangle2dfx>
-
- org.arakhne.afc.math.geometry.d2.dfx.Triangle2dfx
-
- All Implemented Interfaces:
Serializable,Cloneable,Shape2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Triangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2dfx<Triangle2dfx>,Shape2D<Shape2dfx<?>,Triangle2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>,JsonableObject
public class Triangle2dfx extends AbstractShape2dfx<Triangle2dfx> implements Triangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
A triangle with 2 double precision floating-point FX properties.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Stéphane GALLAND
- 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.Triangle2afp
Triangle2afp.AbstractTrianglePathIterator<T extends PathElement2afp>, Triangle2afp.TransformedTrianglePathIterator<T extends PathElement2afp>, Triangle2afp.TriangleFeature, Triangle2afp.TrianglePathIterator<T extends PathElement2afp>
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
boundingBox
-
-
Constructor Summary
Constructors Constructor Description Triangle2dfx()Construct an empty triangle.Triangle2dfx(double x1, double y1, double x2, double y2, double x3, double y3)Construct a triangle with the three given points.Triangle2dfx(Triangle2afp<?,?,?,?,?,?> triangle)Constructor by copy.Triangle2dfx(Point2dfx point1, Point2dfx point2, Point2dfx point3)Construct a triangle by setting the three given points.Triangle2dfx(Triangle2dfx triangle)Constructor by setting.Triangle2dfx(Point2D<?,?> p1, Point2D<?,?> p2, Point2D<?,?> p3)Construct a triangle with the three 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.javafx.beans.property.ReadOnlyBooleanPropertyccwProperty()Replies the property that indictes if the triangle's points are defined in a counter-clockwise order.Triangle2dfxclone()Clone this shape.Triangle2dfxcreateTransformedShape(Transform2D transform)Apply the transformation to the shape and reply the result.doublegetX1()Replies the first point X.doublegetX2()Replies the second point X.doublegetX3()Replies the third point X.doublegetY1()Replies the first point Y.doublegetY2()Replies the second point Y.doublegetY3()Replies the third point Y.inthashCode()booleanisCCW()Replies if the points of the triangle are defined in a counter-clockwise order.voidset(double x1, double y1, double x2, double y2, double x3, double y3)Change the triangle.voidsetX1(double x)Change the x coordinate of the first point.voidsetX2(double x)Change the x coordinate of the second point.voidsetX3(double x)Change the x coordinate of the third point.voidsetY1(double y)Change the y coordinate of the first point.voidsetY2(double y)Change the y coordinate of the second point.voidsetY3(double y)Change the y coordinate of the third point.javafx.beans.property.DoublePropertyx1Property()Replies the property that is the x coordinate of the first triangle point.javafx.beans.property.DoublePropertyx2Property()Replies the property that is the x coordinate of the second triangle point.javafx.beans.property.DoublePropertyx3Property()Replies the property that is the x coordinate of the third triangle point.javafx.beans.property.DoublePropertyy1Property()Replies the property that is the y coordinate of the first triangle point.javafx.beans.property.DoublePropertyy2Property()Replies the property that is the y coordinate of the second triangle point.javafx.beans.property.DoublePropertyy3Property()Replies the property that is the y coordinate of the third triangle point.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
equals, getGeomFactory, toJson, toString
-
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.Shape2afp
contains, contains, getClosestPointTo, getClosestPointTo, getDistanceSquared, 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
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Triangle2afp
clear, contains, contains, equalsToShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getP1, getP2, getP3, getPathIterator, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, isEmpty, set, setP1, setP1, setP2, setP2, setP3, setP3, toBoundingBox, translate
-
-
-
-
Constructor Detail
-
Triangle2dfx
public Triangle2dfx()
Construct an empty triangle.
-
Triangle2dfx
public Triangle2dfx(Point2D<?,?> p1, Point2D<?,?> p2, Point2D<?,?> p3)
Construct a triangle with the three given points.- Parameters:
p1- first point.p2- second point.p3- third point.
-
Triangle2dfx
public Triangle2dfx(Point2dfx point1, Point2dfx point2, Point2dfx point3)
Construct a triangle by setting the three given points.- Parameters:
point1- the point to set as first point.point2- the point to set as second point.point3- the point to set as third point.
-
Triangle2dfx
public Triangle2dfx(Triangle2afp<?,?,?,?,?,?> triangle)
Constructor by copy.- Parameters:
triangle- the triangle to copy.
-
Triangle2dfx
public Triangle2dfx(Triangle2dfx triangle)
Constructor by setting.- Parameters:
triangle- the triangle to set.
-
Triangle2dfx
public Triangle2dfx(double x1, double y1, double x2, double y2, double x3, double y3)Construct a triangle with the three 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.x3- x coordinate of the third point.y3- y coordinate of the third point.
-
-
Method Detail
-
clone
public Triangle2dfx clone()
Description copied from interface:Shape2DClone this shape.- Specified by:
clonein interfaceShape2D<Shape2dfx<?>,Triangle2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Overrides:
clonein classAbstractShape2dfx<Triangle2dfx>- Returns:
- the clone.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classAbstractShape2dfx<Triangle2dfx>
-
createTransformedShape
@Pure public Triangle2dfx 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<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
createTransformedShapein interfaceShape2D<Shape2dfx<?>,Triangle2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
transform- is the transformation to apply to the shape.- Returns:
- the result of the transformation.
-
getX1
public double getX1()
Description copied from interface:Triangle2afpReplies the first point X.- Specified by:
getX1in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the first point x.
-
x1Property
@Pure public javafx.beans.property.DoubleProperty x1Property()
Replies the property that is the x coordinate of the first triangle point.- Returns:
- the x1 property.
-
getY1
public double getY1()
Description copied from interface:Triangle2afpReplies the first point Y.- Specified by:
getY1in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the first point y.
-
y1Property
@Pure public javafx.beans.property.DoubleProperty y1Property()
Replies the property that is the y coordinate of the first triangle point.- Returns:
- the y1 property.
-
getX2
public double getX2()
Description copied from interface:Triangle2afpReplies the second point X.- Specified by:
getX2in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the second point x.
-
x2Property
@Pure public javafx.beans.property.DoubleProperty x2Property()
Replies the property that is the x coordinate of the second triangle point.- Returns:
- the x2 property.
-
getY2
public double getY2()
Description copied from interface:Triangle2afpReplies the second point Y.- Specified by:
getY2in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the second point y.
-
y2Property
@Pure public javafx.beans.property.DoubleProperty y2Property()
Replies the property that is the y coordinate of the second triangle point.- Returns:
- the y2 property.
-
getX3
public double getX3()
Description copied from interface:Triangle2afpReplies the third point X.- Specified by:
getX3in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the third point x.
-
x3Property
@Pure public javafx.beans.property.DoubleProperty x3Property()
Replies the property that is the x coordinate of the third triangle point.- Returns:
- the x3 property.
-
getY3
public double getY3()
Description copied from interface:Triangle2afpReplies the third point Y.- Specified by:
getY3in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the third point y.
-
y3Property
@Pure public javafx.beans.property.DoubleProperty y3Property()
Replies the property that is the y coordinate of the third triangle point.- Returns:
- the y3 property.
-
setX1
public void setX1(double x)
Description copied from interface:Triangle2afpChange the x coordinate of the first point.- Specified by:
setX1in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the point.
-
setY1
public void setY1(double y)
Description copied from interface:Triangle2afpChange the y coordinate of the first point.- Specified by:
setY1in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
y- y coordinate of the point.
-
setX2
public void setX2(double x)
Description copied from interface:Triangle2afpChange the x coordinate of the second point.- Specified by:
setX2in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the point.
-
setY2
public void setY2(double y)
Description copied from interface:Triangle2afpChange the y coordinate of the second point.- Specified by:
setY2in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
y- y coordinate of the point.
-
setX3
public void setX3(double x)
Description copied from interface:Triangle2afpChange the x coordinate of the third point.- Specified by:
setX3in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the point.
-
setY3
public void setY3(double y)
Description copied from interface:Triangle2afpChange the y coordinate of the third point.- Specified by:
setY3in interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
y- y coordinate of the point.
-
set
public void set(double x1, double y1, double x2, double y2, double x3, double y3)Description copied from interface:Triangle2afpChange the triangle.- Specified by:
setin interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,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.x3- x coordinate of the third point.y3- y coordinate of the third point.
-
isCCW
public boolean isCCW()
Description copied from interface:Triangle2afpReplies if the points of the triangle are defined in a counter-clockwise order.- Specified by:
isCCWin interfaceTriangle2afp<Shape2dfx<?>,Triangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
trueif the triangle points are defined in a counter-clockwise order.
-
ccwProperty
@Pure public javafx.beans.property.ReadOnlyBooleanProperty ccwProperty()
Replies the property that indictes if the triangle's points are defined in a counter-clockwise order.- Returns:
- the ccw property.
-
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<Triangle2dfx>- Returns:
- the bounding box.
-
-