math.geom2d.domain
Class Boundaries2D

java.lang.Object
  extended by math.geom2d.domain.Boundaries2D

public abstract class Boundaries2D
extends java.lang.Object

Collects some useful methods for operating on boundary curves.

Author:
dlegland

Constructor Summary
Boundaries2D()
           
 
Method Summary
static ContourArray2D<Contour2D> clipBoundary(Boundary2D boundary, Box2D box)
          Clips a boundary and closes the result curve.
static CurveSet2D<ContinuousOrientedCurve2D> clipContinuousOrientedCurve(ContinuousOrientedCurve2D curve, Box2D box)
          Clip a curve, and return a CurveSet2D.
static int findNextCurveIndex(double[] positions, double pos)
           
static Polyline2D getBoundaryPortion(Box2D box, Point2D p0, Point2D p1)
          Extracts a portion of the boundary of a bounded box.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Boundaries2D

public Boundaries2D()
Method Detail

clipContinuousOrientedCurve

public static final CurveSet2D<ContinuousOrientedCurve2D> clipContinuousOrientedCurve(ContinuousOrientedCurve2D curve,
                                                                                      Box2D box)
Clip a curve, and return a CurveSet2D. If the curve is totally outside the box, return a CurveSet2D with 0 curves inside. If the curve is totally inside the box, return a CurveSet2D with only one curve, which is the original curve.


clipBoundary

public static final ContourArray2D<Contour2D> clipBoundary(Boundary2D boundary,
                                                           Box2D box)
Clips a boundary and closes the result curve. Returns an instance of ContourArray2D.


findNextCurveIndex

public static final int findNextCurveIndex(double[] positions,
                                           double pos)

getBoundaryPortion

public static final Polyline2D getBoundaryPortion(Box2D box,
                                                  Point2D p0,
                                                  Point2D p1)
Extracts a portion of the boundary of a bounded box.

Parameters:
box - the box from which one extract a portion of boundary
p0 - the first point of the portion
p1 - the last point of the portion
Returns:
the portion of the bounding box boundary as a Polyline2D