public class XyzPolyline extends java.lang.Object implements XyzShape<XyzPolyline>
Copyright 2007 Partner Software, Inc.
| Constructor and Description |
|---|
XyzPolyline(double... coords) |
XyzPolyline(double[] coordsX,
double[] coordsY,
double[] coordsZ) |
XyzPolyline(java.util.List<XyzPoint> points) |
XyzPolyline(XyzPoint... points) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(XyzPoint point) |
XyzBounds |
getBounds()
Returns an XyzBounds object representing the rectangular extents of this
shape.
|
java.util.Iterator<XyzPoint> |
iterator() |
XyzPolyline |
scale(double factor)
Return a scaled version of the shape by multiplying all coordinates by
the given factor in both dimensions.
|
XyzPolyline |
scale(double factorX,
double factorY,
double factorZ) |
XyzPolyline |
simplify(double granularity)
Simplify the polyline by eliminating segments whose length is less than
the given granularity.
|
XyzPolyline |
simplify2(double granularity) |
XyzPolyline |
transform(XyzTransform transform)
Transform the shape using the given transform.
|
XyzPolyline |
translate(double offsetX,
double offsetY,
double offsetZ)
Translate the shape by adding all coordinates to the given x, y, and z
offsets.
|
public XyzPolyline(double... coords)
public XyzPolyline(double[] coordsX,
double[] coordsY,
double[] coordsZ)
public XyzPolyline(XyzPoint... points)
public XyzPolyline(java.util.List<XyzPoint> points)
public XyzPolyline simplify(double granularity)
More accurately, what this method does is define a grid with square cells the size of the granularity. It then iterates through the polyline and eliminates points falling into the same cell as the previous point. This provides similar results to the elimination of short segments but much more efficiently. There will be edge effects, however (e.g. where point[i] is just barely to one side of a grid line and point[i + 1] is just barely to the other).
granularity - size of the discreteness grid applied to eliminate points that
are too closepublic XyzPolyline simplify2(double granularity)
public XyzPolyline scale(double factorX, double factorY, double factorZ)
public XyzPolyline scale(double factor)
XyzShapescale in interface XyzShape<XyzPolyline>factor - scaling factorpublic XyzPolyline translate(double offsetX, double offsetY, double offsetZ)
XyzShapetranslate in interface XyzShape<XyzPolyline>offsetX - offset for the x dimensionoffsetY - offset for the y dimensionoffsetZ - offset for the z dimensionpublic XyzPolyline transform(XyzTransform transform)
XyzShapetransform in interface XyzShape<XyzPolyline>transform - affine transform to apply.public XyzBounds getBounds()
XyzShapegetBounds in interface XyzShape<XyzPolyline>public boolean contains(XyzPoint point)