org.geotools.renderer.geom
Class Clipper

java.lang.Object
  extended byorg.geotools.renderer.geom.Clipper

public final class Clipper
extends java.lang.Object

The clipping area to apply on a Geometry object. A Clipper object contains the clip as a Rectangle2D and its CoordinateSystem.

Version:
$Id: Clipper.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Geometry.clip(org.geotools.renderer.geom.Clipper)

Constructor Summary
Clipper(java.awt.geom.Rectangle2D mapClip, CoordinateSystem mapCS)
          Constructs a clipping area.
 
Method Summary
protected  Polyline clip(Polyline polyline)
          Returns a polyline which only contains the points of polyline that appear in the rectangle specified to the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clipper

public Clipper(java.awt.geom.Rectangle2D mapClip,
               CoordinateSystem mapCS)
Constructs a clipping area.

Parameters:
mapClip - The limits of the region to keep.
mapCS - The clip's coordinate system.
Method Detail

clip

protected Polyline clip(Polyline polyline)
Returns a polyline which only contains the points of polyline that appear in the rectangle specified to the constructor. If none of the polyline's points appear inside clip, this method returns null. If all the polyline's points appear inside clip, this method returns polyline. Otherwise, this method returns a polyline that contains the points that appear inside clip. These polylines will share the same data as polyline where possible, so that memory consumption should remain reasonable.

Parameters:
polyline - Polyline to clip in a region.
Returns:
Clipped polyline, or null if the polyline doesn't intersects the clip.


Copyright © GeoTools. All Rights Reserved.