Class PathElement2d.LinePathElement2d
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.d.PathElement2d
-
- org.arakhne.afc.math.geometry.d2.d.PathElement2d.LinePathElement2d
-
- All Implemented Interfaces:
Serializable
,Cloneable
,PathElement2afp
,PathElement2D
- Enclosing class:
- PathElement2d
static class PathElement2d.LinePathElement2d extends PathElement2d
An element of the path that represents aLINE_TO
.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.arakhne.afc.math.geometry.d2.d.PathElement2d
PathElement2d.ArcPathElement2d, PathElement2d.ClosePathElement2d, PathElement2d.CurvePathElement2d, PathElement2d.LinePathElement2d, PathElement2d.MovePathElement2d, PathElement2d.QuadPathElement2d
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.d.PathElement2d
toX, toY, type
-
-
Constructor Summary
Constructors Constructor Description LinePathElement2d(double fromx, double fromy, double tox, double toy)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getFromX()
Replies the x coordinate of the starting point.double
getFromY()
Replies the y coordinate of the starting point.int
hashCode()
boolean
isDrawable()
Replies if the element is not empty and is drawable.boolean
isEmpty()
Replies if the element is empty, ie. the points are the same.double[]
toArray()
Copy the coords into an array, except the source point.void
toArray(double[] array)
Copy the coords into the given array, except the source point.void
toArray(int[] array)
Copy the coords into the given array, except the source point.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.d.PathElement2d
getCtrlX1, getCtrlX2, getCtrlY1, getCtrlY2, getLargeArcFlag, getRadiusX, getRadiusY, getRotationX, getSweepFlag, getToX, getToY, getType, toString
-
-
-
-
Method Detail
-
equals
@Pure public boolean equals(Object obj)
- Specified by:
equals
in classPathElement2d
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCode
in classPathElement2d
-
isEmpty
@Pure public boolean isEmpty()
Description copied from interface:PathElement2D
Replies if the element is empty, ie. the points are the same.- Returns:
true
if the points are the same; otherwisefalse
.
-
isDrawable
@Pure public boolean isDrawable()
Description copied from interface:PathElement2D
Replies if the element is not empty and is drawable.Only the path elements that may produce pixels on the screen must reply
true
in this function.- Returns:
true
if the path element is drawable; otherwisefalse
.
-
toArray
public void toArray(int[] array)
Description copied from interface:PathElement2afp
Copy the coords into the given array, except the source point.- Parameters:
array
- the output array.
-
toArray
public void toArray(double[] array)
Description copied from interface:PathElement2afp
Copy the coords into the given array, except the source point.- Parameters:
array
- the output array.
-
toArray
@Pure public double[] toArray()
Description copied from class:PathElement2d
Copy the coords into an array, except the source point.- Specified by:
toArray
in classPathElement2d
- Returns:
- the array of the points, except the source point.
-
getFromX
public double getFromX()
Description copied from interface:PathElement2afp
Replies the x coordinate of the starting point.- Returns:
- the x coordinate, or
0
if the type isPathElementType.MOVE_TO
.
-
getFromY
public double getFromY()
Description copied from interface:PathElement2afp
Replies the y coordinate of the starting point.- Returns:
- the y coordinate, or
0
if the type isPathElementType.MOVE_TO
.
-
-