com.partnersoft.v3x.geometry.single
Class Polyline

java.lang.Object
  extended by com.partnersoft.v3x.geometry.single.Polyline

public class Polyline
extends java.lang.Object

A single, FloatBuffer-based polyline.


Field Summary
 FloatBuffer coords
           
 
Constructor Summary
Polyline()
           
Polyline(FloatBuffer buffy)
           
Polyline(int size)
           
Polyline(Polyline copyThis)
           
 
Method Summary
 PolylineArray clipOutRectangle(float x, float y, float width, float height)
          Clips a rectangle out of the polyline to a rectangle, producing zero or more resultant polylines that are outside the rectangle.
 PolylineArray clipOutRectangle(Rectangle rectangle)
           
 void clipOutRectangle(Rectangle rectangle, PolylineArray results)
          This is the fastest public clipOutRectangle variation - passing a reuseable PolylineArray can reduce allocation overhead.
 PolylineArray clipOutRectangles(Rectangle[] rectangles)
          Cuts a collection of rectangular holes out.
 Point getCentroid()
           
 Rectangle getExtents()
           
 float getLength()
           
 void reduceDetail(float granularity)
           
static void reduceDetail(FloatBuffer coords, float granularity)
          Attempts to reduce the complexity of the line by eliminating points which add nothing to the detail at a certain granularity.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

coords

public FloatBuffer coords
Constructor Detail

Polyline

public Polyline()

Polyline

public Polyline(int size)

Polyline

public Polyline(FloatBuffer buffy)

Polyline

public Polyline(Polyline copyThis)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

reduceDetail

public final void reduceDetail(float granularity)

reduceDetail

public static final void reduceDetail(FloatBuffer coords,
                                      float granularity)
Attempts to reduce the complexity of the line by eliminating points which add nothing to the detail at a certain granularity. Granularity is defined as a discretizing parameter - it sets up a grid of that cell size and points which fall into the same grid cell are regarded as identical.


getCentroid

public final Point getCentroid()

getLength

public final float getLength()

getExtents

public final Rectangle getExtents()

clipOutRectangle

public final PolylineArray clipOutRectangle(float x,
                                            float y,
                                            float width,
                                            float height)
Clips a rectangle out of the polyline to a rectangle, producing zero or more resultant polylines that are outside the rectangle.


clipOutRectangle

public final PolylineArray clipOutRectangle(Rectangle rectangle)

clipOutRectangle

public final void clipOutRectangle(Rectangle rectangle,
                                   PolylineArray results)
This is the fastest public clipOutRectangle variation - passing a reuseable PolylineArray can reduce allocation overhead. The others eventually call this.


clipOutRectangles

public final PolylineArray clipOutRectangles(Rectangle[] rectangles)
Cuts a collection of rectangular holes out.