math.geom2d.circulinear
Class GenericCirculinearRing2D

java.lang.Object
  extended by math.geom2d.curve.CurveArray2D<T>
      extended by math.geom2d.curve.PolyCurve2D<T>
          extended by math.geom2d.domain.PolyOrientedCurve2D<T>
              extended by math.geom2d.circulinear.PolyCirculinearCurve2D<CirculinearElement2D>
                  extended by math.geom2d.circulinear.GenericCirculinearRing2D
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<CirculinearElement2D>, CirculinearBoundary2D, CirculinearContinuousCurve2D, CirculinearContour2D, CirculinearCurve2D, CirculinearRing2D, CirculinearShape2D, ContinuousCurve2D, Curve2D, CurveSet2D<CirculinearElement2D>, Boundary2D, ContinuousOrientedCurve2D, Contour2D, OrientedCurve2D, GeometricObject2D, Shape2D, ShapeSet2D<CirculinearElement2D>

public class GenericCirculinearRing2D
extends PolyCirculinearCurve2D<CirculinearElement2D>
implements CirculinearRing2D

A basic implementation of a CirculinearRing2D, which is assumed to be always bounded and closed.

Author:
dlegland

Constructor Summary
GenericCirculinearRing2D()
           
GenericCirculinearRing2D(CirculinearElement2D... curves)
           
GenericCirculinearRing2D(java.util.Collection<? extends CirculinearElement2D> curves)
           
GenericCirculinearRing2D(int size)
           
 
Method Summary
 java.util.Collection<? extends GenericCirculinearRing2D> continuousCurves()
          Returns a collection of PolyCurve2D that contains only this instance.
static GenericCirculinearRing2D create(CirculinearElement2D... curves)
          Static factory for creating a new GenericCirculinearRing2D from an array of curves.
static
<T extends CirculinearElement2D>
GenericCirculinearRing2D
create(java.util.Collection<T> curves)
          Static factory for creating a new GenericCirculinearRing2D from a collection of curves.
 CirculinearDomain2D domain()
          Returns the domain delimited by this boundary.
 void fill(java.awt.Graphics2D g2)
          Fills the interior of the boundary, using the Graphics current Paint.
 CirculinearRing2D parallel(double dist)
          Creates a new curve, formed by the points with parameterization: p(t) = c(t) + d*n(t)/|n(t)|, with p(t) being a point of the original curve, n(t) the normal of the curve, and |n| being the norm of n.
 GenericCirculinearRing2D reverse()
          Returns the reverse curve of this PolyCurve2D.
 BoundaryPolyCurve2D<ContinuousOrientedCurve2D> transform(AffineTransform2D trans)
          Transforms each smooth piece in this PolyCurve2D and returns a new instance of PolyCurve2D.
 GenericCirculinearRing2D transform(CircleInversion2D inv)
          Transforms the shape by a circle inversion.
 
Methods inherited from class math.geom2d.circulinear.PolyCirculinearCurve2D
buffer, clip, create, create, create, createClosed, length, length, position, smoothPieces, subCurve
 
Methods inherited from class math.geom2d.domain.PolyOrientedCurve2D
equals, isInside, signedDistance, signedDistance, windingAngle
 
Methods inherited from class math.geom2d.curve.PolyCurve2D
appendPath, asPolyline, curvature, draw, getGeneralPath, isClosed, leftTangent, rightTangent, setClosed
 
Methods inherited from class math.geom2d.curve.CurveArray2D
add, add, almostEquals, asAwtShape, boundingBox, childCurve, clear, clone, contains, contains, contains, curveIndex, curves, distance, distance, firstCurve, firstPoint, get, getT0, getT1, globalPosition, indexOf, intersections, isBounded, isEmpty, isSingular, iterator, lastCurve, lastPoint, localPosition, point, position, project, remove, remove, singularPoints, size, t0, t1, vertices
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface math.geom2d.circulinear.CirculinearContinuousCurve2D
clip, smoothPieces, subCurve
 
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
appendPath, asPolyline, curvature, isClosed, leftTangent, rightTangent
 
Methods inherited from interface math.geom2d.circulinear.CirculinearBoundary2D
clip
 
Methods inherited from interface math.geom2d.circulinear.CirculinearCurve2D
length, length, position
 
Methods inherited from interface math.geom2d.circulinear.CirculinearShape2D
buffer
 
Methods inherited from interface math.geom2d.domain.Boundary2D
isInside
 
Methods inherited from interface math.geom2d.domain.OrientedCurve2D
signedDistance, signedDistance, windingAngle
 

Constructor Detail

GenericCirculinearRing2D

public GenericCirculinearRing2D()

GenericCirculinearRing2D

public GenericCirculinearRing2D(int size)

GenericCirculinearRing2D

public GenericCirculinearRing2D(CirculinearElement2D... curves)

GenericCirculinearRing2D

public GenericCirculinearRing2D(java.util.Collection<? extends CirculinearElement2D> curves)
Method Detail

create

public static <T extends CirculinearElement2D> GenericCirculinearRing2D create(java.util.Collection<T> curves)
Static factory for creating a new GenericCirculinearRing2D from a collection of curves.

Since:
0.8.1

create

public static GenericCirculinearRing2D create(CirculinearElement2D... curves)
Static factory for creating a new GenericCirculinearRing2D from an array of curves.

Since:
0.8.1

parallel

public CirculinearRing2D parallel(double dist)
Description copied from interface: CirculinearCurve2D
Creates a new curve, formed by the points with parameterization: p(t) = c(t) + d*n(t)/|n(t)|, with p(t) being a point of the original curve, n(t) the normal of the curve, and |n| being the norm of n.
In the case of a continuous curve formed by several smooth circulinear elements, the parallels of contiguous elements are joined by a circle arc.

Specified by:
parallel in interface CirculinearBoundary2D
Specified by:
parallel in interface CirculinearContinuousCurve2D
Specified by:
parallel in interface CirculinearContour2D
Specified by:
parallel in interface CirculinearCurve2D
Specified by:
parallel in interface CirculinearRing2D
Overrides:
parallel in class PolyCirculinearCurve2D<CirculinearElement2D>
Parameters:
dist - the distance between the original curve and he parallel curve.
Returns:
the parallel curve

continuousCurves

public java.util.Collection<? extends GenericCirculinearRing2D> continuousCurves()
Description copied from class: PolyCurve2D
Returns a collection of PolyCurve2D that contains only this instance.

Specified by:
continuousCurves in interface CirculinearBoundary2D
Specified by:
continuousCurves in interface CirculinearCurve2D
Specified by:
continuousCurves in interface Curve2D
Specified by:
continuousCurves in interface Boundary2D
Overrides:
continuousCurves in class PolyCirculinearCurve2D<CirculinearElement2D>
Returns:
a collection of continuous curves.

transform

public GenericCirculinearRing2D transform(CircleInversion2D inv)
Description copied from interface: CirculinearShape2D
Transforms the shape by a circle inversion. The result is still an instance a CirculinearShape2D.

Specified by:
transform in interface CirculinearBoundary2D
Specified by:
transform in interface CirculinearContinuousCurve2D
Specified by:
transform in interface CirculinearContour2D
Specified by:
transform in interface CirculinearCurve2D
Specified by:
transform in interface CirculinearShape2D
Overrides:
transform in class PolyCirculinearCurve2D<CirculinearElement2D>
Parameters:
inv - the circle inversion
Returns:
the transformed shape

fill

public void fill(java.awt.Graphics2D g2)
Description copied from interface: Boundary2D
Fills the interior of the boundary, using the Graphics current Paint.

Specified by:
fill in interface Boundary2D
Parameters:
g2 - the Graphics to fill on

domain

public CirculinearDomain2D domain()
Description copied from interface: Boundary2D
Returns the domain delimited by this boundary.

Specified by:
domain in interface CirculinearBoundary2D
Specified by:
domain in interface CirculinearRing2D
Specified by:
domain in interface Boundary2D
Returns:
the domain delimited by this boundary

reverse

public GenericCirculinearRing2D reverse()
Description copied from class: PolyCurve2D
Returns the reverse curve of this PolyCurve2D.

Specified by:
reverse in interface CirculinearBoundary2D
Specified by:
reverse in interface CirculinearContinuousCurve2D
Specified by:
reverse in interface CirculinearContour2D
Specified by:
reverse in interface CirculinearCurve2D
Specified by:
reverse in interface CirculinearRing2D
Specified by:
reverse in interface ContinuousCurve2D
Specified by:
reverse in interface Curve2D
Specified by:
reverse in interface Boundary2D
Specified by:
reverse in interface ContinuousOrientedCurve2D
Specified by:
reverse in interface Contour2D
Specified by:
reverse in interface OrientedCurve2D
Overrides:
reverse in class PolyCirculinearCurve2D<CirculinearElement2D>

transform

public BoundaryPolyCurve2D<ContinuousOrientedCurve2D> transform(AffineTransform2D trans)
Description copied from class: PolyCurve2D
Transforms each smooth piece in this PolyCurve2D and returns a new instance of PolyCurve2D.

Specified by:
transform in interface ContinuousCurve2D
Specified by:
transform in interface Curve2D
Specified by:
transform in interface CurveSet2D<CirculinearElement2D>
Specified by:
transform in interface Boundary2D
Specified by:
transform in interface ContinuousOrientedCurve2D
Specified by:
transform in interface Contour2D
Specified by:
transform in interface OrientedCurve2D
Specified by:
transform in interface Shape2D
Overrides:
transform in class PolyOrientedCurve2D<CirculinearElement2D>
Parameters:
trans - an affine transform
Returns:
the transformed shape