Class GeomFactory2dfx
- java.lang.Object
-
- org.arakhne.afc.math.geometry.AbstractGeomFactoryBase
-
- org.arakhne.afc.math.geometry.d2.AbstractGeomFactory2D<Vector2dfx,Point2dfx>
-
- org.arakhne.afc.math.geometry.d2.dfx.GeomFactory2dfx
-
- All Implemented Interfaces:
GeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,GeomFactory2D<Vector2dfx,Point2dfx>,GeomFactoryBase
public class GeomFactory2dfx extends AbstractGeomFactory2D<Vector2dfx,Point2dfx> implements GeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
Factory of geometrical elements.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- mathfx
-
-
Field Summary
Fields Modifier and Type Field Description static GeomFactory2dfxSINGLETONThe singleton of the factory.
-
Constructor Summary
Constructors Constructor Description GeomFactory2dfx()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Point2dfxconvertToPoint(Point2D<?,?> pt)Convert the given point if it is not of the right type.Point2dfxconvertToPoint(Vector2D<?,?> v)Convert the given vector.Vector2dfxconvertToVector(Point2D<?,?> pt)Convert the given point.Vector2dfxconvertToVector(Vector2D<?,?> v)Convert the given vector.PathElement2dfxnewArcPathElement(double startX, double startY, double targetX, double targetY, double radiusX, double radiusY, double xAxisRotation, boolean largeArcFlag, boolean sweepFlag)Create an arc-to path element to the given point by following an ellipse arc.Rectangle2dfxnewBox()Create an empty bounding box.Rectangle2dfxnewBox(double x, double y, double width, double height)Create a bounding box.PathElement2dfxnewClosePathElement(double lastPointX, double lastPointY, double firstPointX, double firstPointY)Create a close path element.PathElement2dfxnewCurvePathElement(double startX, double startY, double controlX, double controlY, double targetX, double targetY)Create a quadratic curve path element to the given point through the given control point.PathElement2dfxnewCurvePathElement(double startX, double startY, double controlX1, double controlY1, double controlX2, double controlY2, double targetX, double targetY)Create a curve path element to the given point through the two given control points.PathElement2dfxnewLinePathElement(double startX, double startY, double targetX, double targetY)Create a line-to path element to the given point.PathElement2dfxnewMovePathElement(double x, double y)Create a move-to path element to the given point.MultiShape2dfx<?>newMultiShape()Create an empty multishape.Path2afp<?,?,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>newPath(PathWindingRule rule)Create an empty path with the given winding rule.Point2dfxnewPoint()Create a point.Point2dfxnewPoint(double x, double y)Create a point.Point2dfxnewPoint(int x, int y)Create a point.Point2dfxnewPoint(javafx.beans.property.DoubleProperty x, javafx.beans.property.DoubleProperty y)Create a point with properties.Segment2dfxnewSegment(double x1, double y1, double x2, double y2)Create a segment.Triangle2dfxnewTriangle(double x1, double y1, double x2, double y2, double x3, double y3)Create a triangle.Vector2dfxnewVector()Create a vector.Vector2dfxnewVector(double x, double y)Create a vector.Vector2dfxnewVector(int x, int y)Create a vector.-
Methods inherited from class org.arakhne.afc.math.geometry.AbstractGeomFactoryBase
getGlobalSplineApproximationRatio, getSplineApproximationRatio, setGlobalSplineApproximationRatio, setSplineApproximationRatio
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.GeomFactory2afp
convert
-
Methods inherited from interface org.arakhne.afc.math.geometry.GeomFactoryBase
getSplineApproximationRatio, setSplineApproximationRatio
-
-
-
-
Field Detail
-
SINGLETON
public static final GeomFactory2dfx SINGLETON
The singleton of the factory.
-
-
Method Detail
-
convertToPoint
public Point2dfx convertToPoint(Point2D<?,?> pt)
Description copied from interface:GeomFactory2DConvert the given point if it is not of the right type.- Specified by:
convertToPointin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
pt- the point to convert.- Returns:
pif it is of typeP, or a copy ofp.
-
convertToPoint
public Point2dfx convertToPoint(Vector2D<?,?> v)
Description copied from interface:GeomFactory2DConvert the given vector.- Specified by:
convertToPointin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
v- the vector to convert.- Returns:
- the point.
-
convertToVector
public Vector2dfx convertToVector(Point2D<?,?> pt)
Description copied from interface:GeomFactory2DConvert the given point.- Specified by:
convertToVectorin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
pt- the point to convert.- Returns:
- the vector.
-
convertToVector
public Vector2dfx convertToVector(Vector2D<?,?> v)
Description copied from interface:GeomFactory2DConvert the given vector.- Specified by:
convertToVectorin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
v- the vector to convert.- Returns:
- the vector.
-
newPoint
public Point2dfx newPoint(double x, double y)
Description copied from interface:GeomFactory2DCreate a point.- Specified by:
newPointin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
x- x coordinate of the point.y- y coordinate of the point.- Returns:
- the point.
-
newPoint
public Point2dfx newPoint(int x, int y)
Description copied from interface:GeomFactory2DCreate a point.- Specified by:
newPointin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
x- x coordinate of the point.y- y coordinate of the point.- Returns:
- the point.
-
newPoint
public Point2dfx newPoint(javafx.beans.property.DoubleProperty x, javafx.beans.property.DoubleProperty y)
Create a point with properties.- Parameters:
x- the x property.y- the y property.- Returns:
- the vector.
-
newPoint
public Point2dfx newPoint()
Description copied from interface:GeomFactory2DCreate a point.- Specified by:
newPointin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Returns:
- the point.
-
newVector
public Vector2dfx newVector(double x, double y)
Description copied from interface:GeomFactory2DCreate a vector.- Specified by:
newVectorin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
x- x coordinate of the vector.y- y coordinate of the vector.- Returns:
- the vector.
-
newVector
public Vector2dfx newVector(int x, int y)
Description copied from interface:GeomFactory2DCreate a vector.- Specified by:
newVectorin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Parameters:
x- x coordinate of the vector.y- y coordinate of the vector.- Returns:
- the vector.
-
newVector
public Vector2dfx newVector()
Description copied from interface:GeomFactory2DCreate a vector.- Specified by:
newVectorin interfaceGeomFactory2D<Vector2dfx,Point2dfx>- Returns:
- the vector.
-
newBox
public Rectangle2dfx newBox()
Description copied from interface:GeomFactory2afpCreate an empty bounding box.- Specified by:
newBoxin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the box.
-
newBox
public Rectangle2dfx newBox(double x, double y, double width, double height)
Description copied from interface:GeomFactory2afpCreate a bounding box.- Specified by:
newBoxin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- the x coordinate of the lower corner.y- the y coordinate of the lower corner.width- the width of the box.height- the height of the box.- Returns:
- the box.
-
newPath
public Path2afp<?,?,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx> newPath(PathWindingRule rule)
Description copied from interface:GeomFactory2afpCreate an empty path with the given winding rule.- Specified by:
newPathin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
rule- the rule.- Returns:
- the new path.
-
newMovePathElement
public PathElement2dfx newMovePathElement(double x, double y)
Description copied from interface:GeomFactory2afpCreate a move-to path element to the given point.- Specified by:
newMovePathElementin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- x coordinate of the target point.y- y coordinate of the target point.- Returns:
- the path element.
-
newLinePathElement
public PathElement2dfx newLinePathElement(double startX, double startY, double targetX, double targetY)
Description copied from interface:GeomFactory2afpCreate a line-to path element to the given point.- Specified by:
newLinePathElementin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
startX- x coordinate of the start point.startY- y coordinate of the start point.targetX- x coordinate of the target point.targetY- y coordinate of the target point.- Returns:
- the path element.
-
newClosePathElement
public PathElement2dfx newClosePathElement(double lastPointX, double lastPointY, double firstPointX, double firstPointY)
Description copied from interface:GeomFactory2afpCreate a close path element.- Specified by:
newClosePathElementin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
lastPointX- x coordinate of the last point on the pathlastPointY- y coordinate of the last point on the pathfirstPointX- x coordinate of the first point on the path.firstPointY- y coordinate of the first point on the path.- Returns:
- the path element.
-
newCurvePathElement
public PathElement2dfx newCurvePathElement(double startX, double startY, double controlX, double controlY, double targetX, double targetY)
Description copied from interface:GeomFactory2afpCreate a quadratic curve path element to the given point through the given control point.- Specified by:
newCurvePathElementin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
startX- x coordinate of the start point.startY- y coordinate of the start point.controlX- x coordinate of the control point.controlY- y coordinate of the control point.targetX- x coordinate of the target point.targetY- y coordinate of the target point.- Returns:
- the path element.
-
newCurvePathElement
public PathElement2dfx newCurvePathElement(double startX, double startY, double controlX1, double controlY1, double controlX2, double controlY2, double targetX, double targetY)
Description copied from interface:GeomFactory2afpCreate a curve path element to the given point through the two given control points.- Specified by:
newCurvePathElementin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
startX- x coordinate of the start point.startY- y coordinate of the start point.controlX1- x coordinate of the control point.controlY1- y coordinate of the control point.controlX2- x coordinate of the control point.controlY2- y coordinate of the control point.targetX- x coordinate of the target point.targetY- y coordinate of the target point.- Returns:
- the path element.
-
newArcPathElement
public PathElement2dfx newArcPathElement(double startX, double startY, double targetX, double targetY, double radiusX, double radiusY, double xAxisRotation, boolean largeArcFlag, boolean sweepFlag)
Description copied from interface:GeomFactory2afpCreate an arc-to path element to the given point by following an ellipse arc.- Specified by:
newArcPathElementin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
startX- x coordinate of the start point.startY- y coordinate of the start point.targetX- x coordinate of the target point.targetY- y coordinate of the target point.radiusX- the X radius of the tilted ellipse.radiusY- the Y radius of the tilted ellipse.xAxisRotation- the angle of tilt of the ellipse.largeArcFlag-trueiff the path will sweep the long way around the ellipse.sweepFlag-trueiff the path will sweep clockwise around the ellipse.- Returns:
- the path element.
-
newMultiShape
public MultiShape2dfx<?> newMultiShape()
Description copied from interface:GeomFactory2afpCreate an empty multishape.- Specified by:
newMultiShapein interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the new multishape.
-
newTriangle
public Triangle2dfx newTriangle(double x1, double y1, double x2, double y2, double x3, double y3)
Description copied from interface:GeomFactory2afpCreate a triangle.- Specified by:
newTrianglein interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x1- the x coordinate of the first point of the triangle.y1- the y coordinate of the first point of the triangle.x2- the x coordinate of the second point of the triangle.y2- the y coordinate of the second point of the triangle.x3- the x coordinate of the third point of the triangle.y3- the y coordinate of the third point of the triangle.- Returns:
- the new triangle.
-
newSegment
public Segment2dfx newSegment(double x1, double y1, double x2, double y2)
Description copied from interface:GeomFactory2afpCreate a segment.- Specified by:
newSegmentin interfaceGeomFactory2afp<PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x1- the x coordinate of the first point of the segment.y1- the y coordinate of the first point of the segment.x2- the x coordinate of the second point of the segment.y2- the y coordinate of the second point of the segment.- Returns:
- the new segment.
-
-