math.geom2d.domain
Class PolyOrientedCurve2D<T extends ContinuousOrientedCurve2D>

Package class diagram package PolyOrientedCurve2D
java.lang.Object
  extended by math.geom2d.curve.CurveSet2D<T>
      extended by math.geom2d.curve.CurveArray2D<T>
          extended by math.geom2d.curve.PolyCurve2D<T>
              extended by math.geom2d.domain.PolyOrientedCurve2D<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, ContinuousCurve2D, Curve2D, ContinuousOrientedCurve2D, OrientedCurve2D, Shape2D
Direct Known Subclasses:
BoundaryPolyCurve2D, PolyCirculinearCurve2D

public class PolyOrientedCurve2D<T extends ContinuousOrientedCurve2D>
extends PolyCurve2D<T>
implements ContinuousOrientedCurve2D

A PolyOrientedCurve2D is a set of piecewise smooth curve arcs, such that the end of a curve is the beginning of the next curve, and such that they do not intersect nor self-intersect.

Author:
dlegland
See Also:
Serialized Form

Field Summary
 
Fields inherited from class math.geom2d.curve.PolyCurve2D
closed
 
Fields inherited from class math.geom2d.curve.CurveSet2D
curves
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY
 
Constructor Summary
PolyOrientedCurve2D()
           
PolyOrientedCurve2D(Collection<? extends T> curves)
           
PolyOrientedCurve2D(Collection<? extends T> curves, boolean closed)
           
PolyOrientedCurve2D(int size)
           
PolyOrientedCurve2D(T[] curves)
           
PolyOrientedCurve2D(T[] curves, boolean closed)
           
 
Method Summary
 CurveSet2D<? extends ContinuousOrientedCurve2D> clip(Box2D box)
          Clip the PolyCurve2D by a box.
 PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D> getReverseCurve()
          Returns the curve with same trace on the plane with parametrization in reverse order.
 double getSignedDistance(double x, double y)
          The same as getSignedDistance(Point2D), but by passing 2 double as arguments.
 double getSignedDistance(Point2D p)
          Get the signed distance of the curve to the given point: this distance is positive if the point lies outside the shape, and is negative if the point lies inside the shape.
 PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D> getSubCurve(double t0, double t1)
          Return an instance of PolyOrientedCurve2D.
 double getWindingAngle(Point2D point)
          Return the angle portion that the curve turn around the given point.
 boolean isInside(Point2D point)
          Returns true if the point is 'inside' the domain bounded by the curve.
 PolyOrientedCurve2D<?> transform(AffineTransform2D trans)
          Transforms each curve, and build a new CurveArray2D with the set of transformed curves.
 
Methods inherited from class math.geom2d.curve.PolyCurve2D
appendPath, draw, equals, getAsPolyline, getContinuousCurves, getGeneralPath, getLeftTangent, getRightTangent, getSmoothPieces, isClosed, setClosed, wrapCurve
 
Methods inherited from class math.geom2d.curve.CurveArray2D
addCurve, clearCurves, clone, contains, contains, containsCurve, getAsAWTShape, getBoundingBox, getChildCurve, getCurve, getCurveIndex, getCurveNumber, getCurves, getDistance, getDistance, getFirstCurve, getFirstPoint, getGlobalPosition, getIntersections, getLastCurve, getLastPoint, getLocalPosition, getPoint, getPosition, getSingularPoints, getT0, getT1, isBounded, isEmpty, isSingular, iterator, project, removeCurve
 
Methods inherited from class math.geom2d.curve.CurveSet2D
fromUnitSegment, toUnitSegment
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
appendPath, getAsPolyline, getLeftTangent, getRightTangent, getSmoothPieces, isClosed
 
Methods inherited from interface math.geom2d.curve.Curve2D
clone, draw, getAsAWTShape, getContinuousCurves, getFirstPoint, getIntersections, getLastPoint, getPoint, getPosition, getSingularPoints, getT0, getT1, isSingular, project
 
Methods inherited from interface math.geom2d.Shape2D
contains, contains, getBoundingBox, getDistance, getDistance, isBounded, isEmpty
 

Constructor Detail

PolyOrientedCurve2D

public PolyOrientedCurve2D()

PolyOrientedCurve2D

public PolyOrientedCurve2D(int size)

PolyOrientedCurve2D

public PolyOrientedCurve2D(T[] curves)

PolyOrientedCurve2D

public PolyOrientedCurve2D(T[] curves,
                           boolean closed)

PolyOrientedCurve2D

public PolyOrientedCurve2D(Collection<? extends T> curves)

PolyOrientedCurve2D

public PolyOrientedCurve2D(Collection<? extends T> curves,
                           boolean closed)
Method Detail

getWindingAngle

public double getWindingAngle(Point2D point)
Description copied from interface: OrientedCurve2D
Return the angle portion that the curve turn around the given point. Result is a signed angle.

Specified by:
getWindingAngle in interface OrientedCurve2D
Parameters:
point - a point of the plane
Returns:
a signed angle

getSignedDistance

public double getSignedDistance(Point2D p)
Description copied from interface: OrientedCurve2D
Get the signed distance of the curve to the given point: this distance is positive if the point lies outside the shape, and is negative if the point lies inside the shape. In this case, absolute value of distance is equals to the distance to the border of the shape.

Specified by:
getSignedDistance in interface OrientedCurve2D
Parameters:
p - a point of the plane
Returns:
the signed distance to the curve

getSignedDistance

public double getSignedDistance(double x,
                                double y)
Description copied from interface: OrientedCurve2D
The same as getSignedDistance(Point2D), but by passing 2 double as arguments.

Specified by:
getSignedDistance in interface OrientedCurve2D
Parameters:
x - x-coord of a point
y - y-coord of a point
Returns:
the signed distance of the point (x,y) to the curve

isInside

public boolean isInside(Point2D point)
Description copied from interface: OrientedCurve2D
Returns true if the point is 'inside' the domain bounded by the curve.

Specified by:
isInside in interface OrientedCurve2D
Parameters:
point - a point in the plane
Returns:
true if the point is on the left side of the curve.

getReverseCurve

public PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D> getReverseCurve()
Description copied from interface: Curve2D
Returns the curve with same trace on the plane with parametrization in reverse order.

Specified by:
getReverseCurve in interface ContinuousCurve2D
Specified by:
getReverseCurve in interface Curve2D
Specified by:
getReverseCurve in interface ContinuousOrientedCurve2D
Specified by:
getReverseCurve in interface OrientedCurve2D
Overrides:
getReverseCurve in class PolyCurve2D<T extends ContinuousOrientedCurve2D>

getSubCurve

public PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D> getSubCurve(double t0,
                                                                            double t1)
Return an instance of PolyOrientedCurve2D.

Specified by:
getSubCurve in interface ContinuousCurve2D
Specified by:
getSubCurve in interface Curve2D
Specified by:
getSubCurve in interface ContinuousOrientedCurve2D
Overrides:
getSubCurve in class PolyCurve2D<T extends ContinuousOrientedCurve2D>
Parameters:
t0 - position of the start of the sub-curve
t1 - position of the end of the sub-curve
Returns:
the portion of original curve comprised between t0 and t1.

clip

public CurveSet2D<? extends ContinuousOrientedCurve2D> clip(Box2D box)
Clip the PolyCurve2D by a box. The result is an instance of CurveSet2D, which contains only instances of ContinuousOrientedCurve2D. If the PolyCurve2D is not clipped, the result is an instance of CurveSet2D which contains 0 curves.

Specified by:
clip in interface ContinuousCurve2D
Specified by:
clip in interface Curve2D
Specified by:
clip in interface ContinuousOrientedCurve2D
Specified by:
clip in interface OrientedCurve2D
Specified by:
clip in interface Shape2D
Overrides:
clip in class PolyCurve2D<T extends ContinuousOrientedCurve2D>
Parameters:
box - the clipping box
Returns:
the clipped shape

transform

public PolyOrientedCurve2D<?> transform(AffineTransform2D trans)
Description copied from class: CurveArray2D
Transforms each curve, and build a new CurveArray2D with the set of transformed curves.

Specified by:
transform in interface ContinuousCurve2D
Specified by:
transform in interface Curve2D
Specified by:
transform in interface ContinuousOrientedCurve2D
Specified by:
transform in interface OrientedCurve2D
Specified by:
transform in interface Shape2D
Overrides:
transform in class PolyCurve2D<T extends ContinuousOrientedCurve2D>
Parameters:
trans - an affine transform
Returns:
the transformed shape


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.