Class OrientedRectangle2dfx
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx<OrientedRectangle2dfx>
-
- org.arakhne.afc.math.geometry.d2.dfx.OrientedRectangle2dfx
-
- All Implemented Interfaces:
Serializable,Cloneable,OrientedRectangle2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Parallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2dfx<OrientedRectangle2dfx>,Shape2D<Shape2dfx<?>,OrientedRectangle2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>,JsonableObject
public class OrientedRectangle2dfx extends AbstractShape2dfx<OrientedRectangle2dfx> implements OrientedRectangle2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
Oriented rectangle with 2 double precision floating-point FX properties.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Stéphane GALLAND, Nicolas GAUD, Maxime Grolleau
- 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.OrientedRectangle2afp
OrientedRectangle2afp.AbstractOrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.OrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.ProjectionToOrientedRectangleLocalCoordinateSystemPathIterator<T extends PathElement2afp>, OrientedRectangle2afp.TransformedOrientedRectanglePathIterator<T extends PathElement2afp>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
Parallelogram2afp.AbstractParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ProjectionToParallelogramLocalCoordinateSystemPathIterator<T extends PathElement2afp>, Parallelogram2afp.TransformedParallelogramPathIterator<T extends PathElement2afp>
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
boundingBox
-
-
Constructor Summary
Constructors Constructor Description OrientedRectangle2dfx()Create an empty oriented rectangle.OrientedRectangle2dfx(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent)Construct an oriented rectangle.OrientedRectangle2dfx(Iterable<? extends Point2D<?,?>> pointCloud)Construct an oriented rectangle from the given cloud of points.OrientedRectangle2dfx(OrientedRectangle2afp<?,?,?,?,?,?> obr)Create an oriented rectangle from the given OBR.OrientedRectangle2dfx(Point2D<?,?>... pointCloud)Construct an oriented rectangle from the given cloud of points.OrientedRectangle2dfx(Point2D<?,?> center, Vector2D<?,?> axis1, double axis1Extent, double axis2Extent)Construct an oriented rectangle.
-
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.DoublePropertycenterXProperty()Replies the property for the x coordinate of the rectangle's center.javafx.beans.property.DoublePropertycenterYProperty()Replies the property for the y coordinate of the rectangle's center.OrientedRectangle2dfxclone()Clone this shape.javafx.beans.property.DoublePropertyfirstAxisExtentProperty()Replies the property for the extent of the first rectangle axis.UnitVectorPropertyfirstAxisProperty()Replies the property for the first rectangle axis.Point2dfxgetCenter()Replies the center.doublegetCenterX()Replies the center x.doublegetCenterY()Replies the center y.Vector2dfxgetFirstAxis()Replies the first axis of the oriented rectangle.doublegetFirstAxisExtent()Replies the demi-size of the rectangle along its first axis.doublegetFirstAxisX()Replies coordinate x of the first axis of the oriented rectangle.doublegetFirstAxisY()Replies coordinate y of the first axis of the oriented rectangle.Vector2dfxgetSecondAxis()Replies the second axis of the oriented rectangle.doublegetSecondAxisExtent()Replies the demi-size of the rectangle along its second axis.doublegetSecondAxisX()Replies coordinate x of the second axis of the oriented rectangle.doublegetSecondAxisY()Replies coordinate y of the second axis of the oriented rectangle.inthashCode()javafx.beans.property.DoublePropertysecondAxisExtentProperty()Replies the property for the extent of the second rectangle axis.ReadOnlyUnitVectorPropertysecondAxisProperty()Replies the property for the second rectangle axis.voidset(double centerX, double centerY, double axis1x, double axis1y, double axis1Extent, double axis2Extent)Set the oriented rectangle.voidsetCenter(double cx, double cy)Set the center.voidsetCenterX(double cx)Set the center's x.voidsetCenterY(double cy)Set the center's y.voidsetFirstAxis(double x, double y, double extent)Set the first axis of the rectangle.voidsetFirstAxisExtent(double extent)Change the demi-size of the rectangle along its first axis.voidsetSecondAxis(double x, double y, double extent)Set the second axis of the rectangle.voidsetSecondAxisExtent(double extent)Change the demi-size of the rectangle along its second axis.-
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.OrientedRectangle2afp
clear, contains, contains, equalsToShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getPathIterator, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, rotate, set, set, set, setFromPointCloud, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
isCCW, isEmpty, set, setCenter, setFirstAxis, setFirstAxis, setFirstAxis, setFromPointCloud, setSecondAxis, setSecondAxis, setSecondAxis
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Shape2afp
contains, contains, createTransformedShape, 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
-
-
-
-
Constructor Detail
-
OrientedRectangle2dfx
public OrientedRectangle2dfx()
Create an empty oriented rectangle.
-
OrientedRectangle2dfx
public OrientedRectangle2dfx(OrientedRectangle2afp<?,?,?,?,?,?> obr)
Create an oriented rectangle from the given OBR.- Parameters:
obr- the oriented rectangle to copy.
-
OrientedRectangle2dfx
public OrientedRectangle2dfx(Iterable<? extends Point2D<?,?>> pointCloud)
Construct an oriented rectangle from the given cloud of points.- Parameters:
pointCloud- - the cloud of points.
-
OrientedRectangle2dfx
public OrientedRectangle2dfx(Point2D<?,?>... pointCloud)
Construct an oriented rectangle from the given cloud of points.- Parameters:
pointCloud- - the cloud of points.
-
OrientedRectangle2dfx
public OrientedRectangle2dfx(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent)Construct an oriented rectangle.- Parameters:
centerX- is the X coordinate of the OBR center.centerY- is the Y coordinate of the OBR center.axis1X- is the X coordinate of first axis of the OBR.axis1Y- is the Y coordinate of first axis of the OBR.axis1Extent- is the extent of the first axis.axis2Extent- is the extent of the second axis.
-
OrientedRectangle2dfx
public OrientedRectangle2dfx(Point2D<?,?> center, Vector2D<?,?> axis1, double axis1Extent, double axis2Extent)
Construct an oriented rectangle.- Parameters:
center- is the OBR center.axis1- is the first axis of the OBR.axis1Extent- is the extent of the first axis.axis2Extent- is the extent of the second axis.
-
-
Method Detail
-
clone
public OrientedRectangle2dfx clone()
Description copied from interface:Shape2DClone this shape.- Specified by:
clonein interfaceShape2D<Shape2dfx<?>,OrientedRectangle2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Overrides:
clonein classAbstractShape2dfx<OrientedRectangle2dfx>- Returns:
- the clone.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classAbstractShape2dfx<OrientedRectangle2dfx>
-
getCenter
@Pure public Point2dfx getCenter()
Description copied from interface:Parallelogram2afpReplies the center.- Specified by:
getCenterin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the center.
-
getCenterX
@Pure public double getCenterX()
Description copied from interface:Parallelogram2afpReplies the center x.- Specified by:
getCenterXin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the center x.
-
getCenterY
@Pure public double getCenterY()
Description copied from interface:Parallelogram2afpReplies the center y.- Specified by:
getCenterYin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the center y.
-
centerXProperty
@Pure public javafx.beans.property.DoubleProperty centerXProperty()
Replies the property for the x coordinate of the rectangle's center.- Returns:
- the centerX property.
-
centerYProperty
@Pure public javafx.beans.property.DoubleProperty centerYProperty()
Replies the property for the y coordinate of the rectangle's center.- Returns:
- the centerY property.
-
setCenter
public void setCenter(double cx, double cy)Description copied from interface:Parallelogram2afpSet the center.- Specified by:
setCenterin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
cx- the center x.cy- the center y.
-
setCenterX
public void setCenterX(double cx)
Description copied from interface:Parallelogram2afpSet the center's x.- Specified by:
setCenterXin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
cx- the center x.
-
setCenterY
public void setCenterY(double cy)
Description copied from interface:Parallelogram2afpSet the center's y.- Specified by:
setCenterYin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
cy- the center y.
-
getFirstAxis
@Pure public Vector2dfx getFirstAxis()
Description copied from interface:Parallelogram2afpReplies the first axis of the oriented rectangle.- Specified by:
getFirstAxisin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the unit vector of the first axis.
-
getFirstAxisX
@Pure public double getFirstAxisX()
Description copied from interface:Parallelogram2afpReplies coordinate x of the first axis of the oriented rectangle.- Specified by:
getFirstAxisXin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the coordinate x of the unit vector of the first axis.
-
getFirstAxisY
@Pure public double getFirstAxisY()
Description copied from interface:Parallelogram2afpReplies coordinate y of the first axis of the oriented rectangle.- Specified by:
getFirstAxisYin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the coordinate y of the unit vector of the first axis.
-
getSecondAxis
@Pure public Vector2dfx getSecondAxis()
Description copied from interface:Parallelogram2afpReplies the second axis of the oriented rectangle.- Specified by:
getSecondAxisin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the unit vector of the second axis.
-
getSecondAxisX
@Pure public double getSecondAxisX()
Description copied from interface:Parallelogram2afpReplies coordinate x of the second axis of the oriented rectangle.- Specified by:
getSecondAxisXin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the coordinate x of the unit vector of the second axis.
-
getSecondAxisY
@Pure public double getSecondAxisY()
Description copied from interface:Parallelogram2afpReplies coordinate y of the second axis of the oriented rectangle.- Specified by:
getSecondAxisYin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the coordinate y of the unit vector of the second axis.
-
firstAxisProperty
@Pure public UnitVectorProperty firstAxisProperty()
Replies the property for the first rectangle axis.- Returns:
- the firstAxis property.
-
secondAxisProperty
@Pure public ReadOnlyUnitVectorProperty secondAxisProperty()
Replies the property for the second rectangle axis.- Returns:
- the secondAxis property.
-
getFirstAxisExtent
@Pure public double getFirstAxisExtent()
Description copied from interface:Parallelogram2afpReplies the demi-size of the rectangle along its first axis.- Specified by:
getFirstAxisExtentin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the extent along the first axis.
-
setFirstAxisExtent
public void setFirstAxisExtent(double extent)
Description copied from interface:Parallelogram2afpChange the demi-size of the rectangle along its first axis.- Specified by:
setFirstAxisExtentin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
extent- - the extent along the first axis.
-
firstAxisExtentProperty
@Pure public javafx.beans.property.DoubleProperty firstAxisExtentProperty()
Replies the property for the extent of the first rectangle axis.- Returns:
- the firstAxisExtent property.
-
getSecondAxisExtent
@Pure public double getSecondAxisExtent()
Description copied from interface:Parallelogram2afpReplies the demi-size of the rectangle along its second axis.- Specified by:
getSecondAxisExtentin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the extent along the second axis.
-
setSecondAxisExtent
public void setSecondAxisExtent(double extent)
Description copied from interface:Parallelogram2afpChange the demi-size of the rectangle along its second axis.- Specified by:
setSecondAxisExtentin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
extent- - the extent along the second axis.
-
secondAxisExtentProperty
@Pure public javafx.beans.property.DoubleProperty secondAxisExtentProperty()
Replies the property for the extent of the second rectangle axis.- Returns:
- the secondAxisExtent property.
-
setFirstAxis
public void setFirstAxis(double x, double y, double extent)Description copied from interface:Parallelogram2afpSet the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.- Specified by:
setFirstAxisin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the first axis.y- y coordinate of the first axis.extent- the demi-size of th parallelogram along the first axis.
-
setSecondAxis
public void setSecondAxis(double x, double y, double extent)Description copied from interface:Parallelogram2afpSet the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.- Specified by:
setSecondAxisin interfaceParallelogram2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the second axis.y- y coordinate of the second axis.extent- the demi-size of the parallelogram along the second axis.
-
set
public void set(double centerX, double centerY, double axis1x, double axis1y, double axis1Extent, double axis2Extent)Description copied from interface:OrientedRectangle2afpSet the oriented rectangle. The second axis is automatically computed.- Specified by:
setin interfaceOrientedRectangle2afp<Shape2dfx<?>,OrientedRectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
centerX- is the X coordinate of the oriented rectangle center.centerY- is the Y coordinate of the oriented rectangle center.axis1x- is the X coordinate of first axis of the oriented rectangle.axis1y- is the Y coordinate of first axis of the oriented rectangle.axis1Extent- is the extent of the first axis.axis2Extent- is the extent of the second axis.
-
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<OrientedRectangle2dfx>- Returns:
- the bounding box.
-
-