Class Circle2afp.AbstractCirclePathIterator<T extends PathElement2afp>
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.afp.Circle2afp.AbstractCirclePathIterator<T>
-
- Type Parameters:
T
- the type of the path elements.
- All Implemented Interfaces:
Cloneable
,Iterator<T>
,PathIterator2afp<T>
,PathIterator2D<T>
- Direct Known Subclasses:
Circle2afp.CirclePathIterator
,Circle2afp.TransformedCirclePathIterator
- Enclosing interface:
- Circle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Circle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>
public abstract static class Circle2afp.AbstractCirclePathIterator<T extends PathElement2afp> extends Object implements PathIterator2afp<T>
Abstract iterator on the path elements of the circle.Discretization of the circle with Bezier
For n segments on the circle, the optimal distance to the control points, in the sense that the middle of the curve lies on the circle itself, is (4/3)*tan(pi/(2n)).
In the case of a discretization with 4 bezier curves, the distance is is (4/3)*tan(pi/8) = 4*(sqrt(2)-1)/3 = 0.552284749831.
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Field Summary
Fields Modifier and Type Field Description static double[][]
BEZIER_CONTROL_POINTS
Contains the control points for a set of 4 cubic bezier curves that approximate a circle of radius 1 centered at (0, 0).protected Circle2afp<?,?,T,?,?,?>
circle
The iterated shape.static double
CTRL_POINT_DISTANCE
Distance from a Bezier curve control point on the circle to the other control point.protected static int
NUMBER_ELEMENTS
4 segments + close.
-
Constructor Summary
Constructors Constructor Description AbstractCirclePathIterator(Circle2afp<?,?,T,?,?,?> circle)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeomFactory2afp<T,?,?,?>
getGeomFactory()
Replies the factory of geometrical elements.PathWindingRule
getWindingRule()
Replies the winding rule for the path.boolean
isCurved()
Replies the path contains a curve.boolean
isMultiParts()
Replies the path has multiple parts, i.e. multipleMOVE_TO
are inside.boolean
isPolygon()
Replies the path is composed only by oneMOVE_TO
, a sequence ofLINE_TO
orQUAD_TO
orCURVE_TO
orARC_TO
, and a singleCLOSE
primitives.boolean
isPolyline()
Replies the path is composed only by oneMOVE_TO
, and a sequence ofLINE_TO
primitives.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.PathIterator2afp
restartIterations
-
-
-
-
Field Detail
-
CTRL_POINT_DISTANCE
public static final double CTRL_POINT_DISTANCE
Distance from a Bezier curve control point on the circle to the other control point.4/3 tan (PI/(2*n)), where n is the number on points on the circle.
- See Also:
- Constant Field Values
-
BEZIER_CONTROL_POINTS
public static final double[][] BEZIER_CONTROL_POINTS
Contains the control points for a set of 4 cubic bezier curves that approximate a circle of radius 1 centered at (0, 0).
-
NUMBER_ELEMENTS
protected static final int NUMBER_ELEMENTS
4 segments + close.- See Also:
- Constant Field Values
-
circle
protected final Circle2afp<?,?,T extends PathElement2afp,?,?,?> circle
The iterated shape.
-
-
Constructor Detail
-
AbstractCirclePathIterator
public AbstractCirclePathIterator(Circle2afp<?,?,T,?,?,?> circle)
Constructor.- Parameters:
circle
- the circle.
-
-
Method Detail
-
getGeomFactory
public GeomFactory2afp<T,?,?,?> getGeomFactory()
Description copied from interface:PathIterator2D
Replies the factory of geometrical elements.- Specified by:
getGeomFactory
in interfacePathIterator2afp<T extends PathElement2afp>
- Specified by:
getGeomFactory
in interfacePathIterator2D<T extends PathElement2afp>
- Returns:
- the factory.
-
getWindingRule
@Pure public PathWindingRule getWindingRule()
Description copied from interface:PathIterator2D
Replies the winding rule for the path.- Specified by:
getWindingRule
in interfacePathIterator2D<T extends PathElement2afp>
- Returns:
- the winding rule for the path.
-
isPolyline
@Pure public boolean isPolyline()
Description copied from interface:PathIterator2D
Replies the path is composed only by oneMOVE_TO
, and a sequence ofLINE_TO
primitives.- Specified by:
isPolyline
in interfacePathIterator2D<T extends PathElement2afp>
- Returns:
true
if the path does not contain curve primitives,false
otherwise.
-
isCurved
public boolean isCurved()
Description copied from interface:PathIterator2D
Replies the path contains a curve.- Specified by:
isCurved
in interfacePathIterator2D<T extends PathElement2afp>
- Returns:
true
if the path contains curve primitives,false
otherwise.
-
isPolygon
public boolean isPolygon()
Description copied from interface:PathIterator2D
Replies the path is composed only by oneMOVE_TO
, a sequence ofLINE_TO
orQUAD_TO
orCURVE_TO
orARC_TO
, and a singleCLOSE
primitives.- Specified by:
isPolygon
in interfacePathIterator2D<T extends PathElement2afp>
- Returns:
true
if the path does not contain curve primitives,false
otherwise.
-
isMultiParts
@Pure public boolean isMultiParts()
Description copied from interface:PathIterator2D
Replies the path has multiple parts, i.e. multipleMOVE_TO
are inside. primitives.- Specified by:
isMultiParts
in interfacePathIterator2D<T extends PathElement2afp>
- Returns:
true
if the path has multiple move-to primitive,false
otherwise.
-
-