Class PathElement2i.ArcPathElement2i
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.i.PathElement2i
-
- org.arakhne.afc.math.geometry.d2.i.PathElement2i.ArcPathElement2i
-
- All Implemented Interfaces:
Serializable
,Cloneable
,PathElement2ai
,PathElement2D
- Enclosing class:
- PathElement2i
static class PathElement2i.ArcPathElement2i extends PathElement2i
An element of the path that represents aArc_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.i.PathElement2i
PathElement2i.ArcPathElement2i, PathElement2i.ClosePathElement2i, PathElement2i.CurvePathElement2i, PathElement2i.LinePathElement2i, PathElement2i.MovePathElement2i, PathElement2i.QuadPathElement2i
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.i.PathElement2i
toX, toY, type
-
-
Constructor Summary
Constructors Constructor Description ArcPathElement2i(int fromx, int fromy, int tox, int toy, int xradius, int yradius, double xrotation, boolean largeArcFlag, boolean sweepFlag)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getFromX()
Replies the x coordinate of the starting point.int
getFromY()
Replies the y coordinate of the starting point.boolean
getLargeArcFlag()
Replies if the arc-to will sweep clockwise around the ellipse.int
getRadiusX()
Replies the x radius of the arc-to ellipse.int
getRadiusY()
Replies the y radius of the arc-to ellipse.double
getRotationX()
Replies the rotation of the x axis of the arc-to ellipse.boolean
getSweepFlag()
Replies if the arc-to will sweep the long way around the ellipse.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.int[]
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.
-
-
-
Constructor Detail
-
ArcPathElement2i
ArcPathElement2i(int fromx, int fromy, int tox, int toy, int xradius, int yradius, double xrotation, boolean largeArcFlag, boolean sweepFlag)
Constructor.- Parameters:
fromx
- x coordinate of the origin point.fromy
- y coordinate of the origin point.tox
- x coordinate of the target point.toy
- y coordinate of the target point.xradius
- radius of the ellipse along its x axis.yradius
- radius of the ellipse along its y axis.xrotation
- rotation (in radians) of the ellipse's x axis.largeArcFlag
-true
iff the path will sweep the long way around the ellipse.sweepFlag
-true
iff the path will sweep clockwise around the ellipse.
-
-
Method Detail
-
equals
@Pure public boolean equals(Object obj)
- Specified by:
equals
in classPathElement2i
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCode
in classPathElement2i
-
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:PathElement2ai
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:PathElement2ai
Copy the coords into the given array, except the source point.- Parameters:
array
- the output array.
-
toArray
@Pure public int[] toArray()
Description copied from class:PathElement2i
Copy the coords into an array, except the source point.- Specified by:
toArray
in classPathElement2i
- Returns:
- the array of the points, except the source point.
-
getFromX
public int getFromX()
Description copied from interface:PathElement2ai
Replies the x coordinate of the starting point.- Returns:
- the x coordinate, or
Double.NaN
if the type isPathElementType.MOVE_TO
.
-
getFromY
public int getFromY()
Description copied from interface:PathElement2ai
Replies the y coordinate of the starting point.- Returns:
- the y coordinate, or
Double.NaN
if the type isPathElementType.MOVE_TO
.
-
getRadiusX
public int getRadiusX()
Description copied from interface:PathElement2ai
Replies the x radius of the arc-to ellipse.- Specified by:
getRadiusX
in interfacePathElement2ai
- Overrides:
getRadiusX
in classPathElement2i
- Returns:
- the x radius, or
0
if the type is notPathElementType.ARC_TO
.
-
getRadiusY
public int getRadiusY()
Description copied from interface:PathElement2ai
Replies the y radius of the arc-to ellipse.- Specified by:
getRadiusY
in interfacePathElement2ai
- Overrides:
getRadiusY
in classPathElement2i
- Returns:
- the y radius, or
0
if the type is notPathElementType.ARC_TO
.
-
getRotationX
public double getRotationX()
Description copied from interface:PathElement2ai
Replies the rotation of the x axis of the arc-to ellipse.- Specified by:
getRotationX
in interfacePathElement2ai
- Overrides:
getRotationX
in classPathElement2i
- Returns:
- the x axis rotation, or
0
if the type is notPathElementType.ARC_TO
.
-
getSweepFlag
public boolean getSweepFlag()
Description copied from interface:PathElement2ai
Replies if the arc-to will sweep the long way around the ellipse.- Specified by:
getSweepFlag
in interfacePathElement2ai
- Overrides:
getSweepFlag
in classPathElement2i
- Returns:
true
iff the element will sweep clockwise around the ellipse, or0
if the type is notPathElementType.ARC_TO
.
-
getLargeArcFlag
public boolean getLargeArcFlag()
Description copied from interface:PathElement2ai
Replies if the arc-to will sweep clockwise around the ellipse.- Specified by:
getLargeArcFlag
in interfacePathElement2ai
- Overrides:
getLargeArcFlag
in classPathElement2i
- Returns:
true
iff the element will sweep clockwise around the ellipse, or0
if the type is notPathElementType.ARC_TO
.
-
-