- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.d.PathElement2d
-
- All Implemented Interfaces:
Serializable,Cloneable,PathElement2afp,PathElement2D
- Direct Known Subclasses:
PathElement2d.ArcPathElement2d,PathElement2d.ClosePathElement2d,PathElement2d.CurvePathElement2d,PathElement2d.LinePathElement2d,PathElement2d.MovePathElement2d,PathElement2d.QuadPathElement2d
public abstract class PathElement2d extends Object implements PathElement2afp
An element of the path with 2 double precision floating-point numbers.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classPathElement2d.ArcPathElement2dAn element of the path that represents aArc_TO.(package private) static classPathElement2d.ClosePathElement2dAn element of the path that represents aCLOSE.(package private) static classPathElement2d.CurvePathElement2dAn element of the path that represents aCURVE_TO.(package private) static classPathElement2d.LinePathElement2dAn element of the path that represents aLINE_TO.(package private) static classPathElement2d.MovePathElement2dAn element of the path that represents aMOVE_TO.(package private) static classPathElement2d.QuadPathElement2dAn element of the path that represents aQUAD_TO.
-
Field Summary
Fields Modifier and Type Field Description protected doubletoXTarget point.protected doubletoYTarget point.protected PathElementTypetypeType of the element.
-
Constructor Summary
Constructors Constructor Description PathElement2d(PathElementType type, double tox, double toy)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanequals(Object obj)doublegetCtrlX1()Replies the x coordinate of the first control point.doublegetCtrlX2()Replies the x coordinate of the second control point.doublegetCtrlY1()Replies the y coordinate of the first control point.doublegetCtrlY2()Replies the y coordinate of the second control point.booleangetLargeArcFlag()Replies if the arc-to will sweep clockwise around the ellipse.doublegetRadiusX()Replies the x radius of the arc-to ellipse.doublegetRadiusY()Replies the y radius of the arc-to ellipse.doublegetRotationX()Replies the rotation of the x axis of the arc-to ellipse.booleangetSweepFlag()Replies if the arc-to will sweep the long way around the ellipse.doublegetToX()Replies the x coordinate of the target point.doublegetToY()Replies the y coordinate of the target point.PathElementTypegetType()Replies the type of the element.abstract inthashCode()abstract double[]toArray()Copy the coords into an array, except the source point.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.PathElement2afp
getFromX, getFromY, toArray, toArray
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.PathElement2D
isDrawable, isEmpty
-
-
-
-
Field Detail
-
type
protected final PathElementType type
Type of the element.
-
toX
protected final double toX
Target point.
-
toY
protected final double toY
Target point.
-
-
Constructor Detail
-
PathElement2d
PathElement2d(PathElementType type, double tox, double toy)
Constructor.- Parameters:
type- is the type of the element.tox- the x coordinate of the target point.toy- the x coordinate of the target point.
-
-
Method Detail
-
getToX
@Pure public final double getToX()
Description copied from interface:PathElement2afpReplies the x coordinate of the target point.- Specified by:
getToXin interfacePathElement2afp- Returns:
- the x coordinate.
-
getToY
@Pure public final double getToY()
Description copied from interface:PathElement2afpReplies the y coordinate of the target point.- Specified by:
getToYin interfacePathElement2afp- Returns:
- the y coordinate.
-
getType
@Pure public final PathElementType getType()
Description copied from interface:PathElement2DReplies the type of the element.- Specified by:
getTypein interfacePathElement2afp- Specified by:
getTypein interfacePathElement2D- Returns:
trueif the points are the same; otherwisefalse.
-
getCtrlX1
public double getCtrlX1()
Description copied from interface:PathElement2afpReplies the x coordinate of the first control point.- Specified by:
getCtrlX1in interfacePathElement2afp- Returns:
- the x coordinate, or
0if the type isPathElementType.MOVE_TO,PathElementType.LINE_TO, orPathElementType.CLOSE.
-
getCtrlY1
public double getCtrlY1()
Description copied from interface:PathElement2afpReplies the y coordinate of the first control point.- Specified by:
getCtrlY1in interfacePathElement2afp- Returns:
- the y coordinate, or
0if the type isPathElementType.MOVE_TO,PathElementType.LINE_TO, orPathElementType.CLOSE.
-
getCtrlX2
public double getCtrlX2()
Description copied from interface:PathElement2afpReplies the x coordinate of the second control point.- Specified by:
getCtrlX2in interfacePathElement2afp- Returns:
- the x coordinate, or
0if the type isPathElementType.MOVE_TO,PathElementType.LINE_TO,PathElementType.QUAD_TO, orPathElementType.CLOSE.
-
getCtrlY2
public double getCtrlY2()
Description copied from interface:PathElement2afpReplies the y coordinate of the second control point.- Specified by:
getCtrlY2in interfacePathElement2afp- Returns:
- the y coordinate, or
0if the type isPathElementType.MOVE_TO,PathElementType.LINE_TO,PathElementType.QUAD_TO, orPathElementType.CLOSE.
-
getRadiusX
public double getRadiusX()
Description copied from interface:PathElement2afpReplies the x radius of the arc-to ellipse.- Specified by:
getRadiusXin interfacePathElement2afp- Returns:
- the x radius, or
0if the type is notPathElementType.ARC_TO.
-
getRadiusY
public double getRadiusY()
Description copied from interface:PathElement2afpReplies the y radius of the arc-to ellipse.- Specified by:
getRadiusYin interfacePathElement2afp- Returns:
- the y radius, or
0if the type is notPathElementType.ARC_TO.
-
getRotationX
public double getRotationX()
Description copied from interface:PathElement2afpReplies the rotation of the x axis of the arc-to ellipse.- Specified by:
getRotationXin interfacePathElement2afp- Returns:
- the x axis rotation, or
0if the type is notPathElementType.ARC_TO.
-
getSweepFlag
public boolean getSweepFlag()
Description copied from interface:PathElement2afpReplies if the arc-to will sweep the long way around the ellipse.- Specified by:
getSweepFlagin interfacePathElement2afp- Returns:
trueiff the element will sweep clockwise around the ellipse, or0if the type is notPathElementType.ARC_TO.
-
getLargeArcFlag
public boolean getLargeArcFlag()
Description copied from interface:PathElement2afpReplies if the arc-to will sweep clockwise around the ellipse.- Specified by:
getLargeArcFlagin interfacePathElement2afp- Returns:
trueiff the element will sweep clockwise around the ellipse, or0if the type is notPathElementType.ARC_TO.
-
toArray
@Pure public abstract double[] toArray()
Copy the coords into an array, except the source point.- Returns:
- the array of the points, except the source point.
-
-