maspack.geometry
Class Polygon3d

java.lang.Object
  extended by maspack.geometry.Polygon3d
Direct Known Subclasses:
ConvexPolygon3d

public class Polygon3d
extends java.lang.Object


Constructor Summary
Polygon3d()
           
Polygon3d(double[] coords)
           
Polygon3d(Point3d[] pnts)
           
 
Method Summary
 void addVertexAfter(PolygonVertex3d vtx, PolygonVertex3d ref)
           
 void appendVertex(PolygonVertex3d vtx)
           
 void clear()
           
 boolean epsilonEquals(Polygon3d poly, double eps)
          Returns true if this polygon is equal to another polygon within a prescribed tolerance eps.
 boolean equals(Polygon3d poly)
          Returns true if this polygon is equal to another polygon.
 void getBounds(Point3d minValues, Point3d maxValues)
           
 PolygonVertex3d getFirstVertex()
           
 PolygonVertex3d getLastVertex()
           
 double getMaxCoordinate()
           
 java.util.ListIterator getVertices()
           
 void inverseTransform(AffineTransform3dBase X)
          Applies an inverse affine transformation to the vertices of this polygon.
 boolean isEmpty()
           
 int numVertices()
           
 void prependVertex(PolygonVertex3d vtx)
           
 void scan(ReaderTokenizer rtok)
           
 void set(double[] coords, int numVertices)
           
 void set(Point3d[] pnts, int numVertices)
           
 void set(Polygon3d poly)
           
 java.lang.String toString()
           
 java.lang.String toString(NumberFormat fmt)
           
 java.lang.String toString(java.lang.String fmtStr)
           
 void transform(AffineTransform3dBase X)
          Applies a affine transformation to the vertices of this polygon.
 void updateBounds(Point3d minValues, Point3d maxValues)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Polygon3d

public Polygon3d()

Polygon3d

public Polygon3d(double[] coords)

Polygon3d

public Polygon3d(Point3d[] pnts)
Method Detail

getVertices

public java.util.ListIterator getVertices()

numVertices

public int numVertices()

getMaxCoordinate

public double getMaxCoordinate()

getBounds

public void getBounds(Point3d minValues,
                      Point3d maxValues)

updateBounds

public void updateBounds(Point3d minValues,
                         Point3d maxValues)

addVertexAfter

public void addVertexAfter(PolygonVertex3d vtx,
                           PolygonVertex3d ref)

appendVertex

public void appendVertex(PolygonVertex3d vtx)

prependVertex

public void prependVertex(PolygonVertex3d vtx)

isEmpty

public boolean isEmpty()

getLastVertex

public PolygonVertex3d getLastVertex()

getFirstVertex

public PolygonVertex3d getFirstVertex()

clear

public void clear()

set

public void set(Polygon3d poly)

set

public void set(double[] coords,
                int numVertices)

set

public void set(Point3d[] pnts,
                int numVertices)

toString

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

toString

public java.lang.String toString(java.lang.String fmtStr)

toString

public java.lang.String toString(NumberFormat fmt)

scan

public void scan(ReaderTokenizer rtok)
          throws java.io.IOException
Throws:
java.io.IOException

epsilonEquals

public boolean epsilonEquals(Polygon3d poly,
                             double eps)
Returns true if this polygon is equal to another polygon within a prescribed tolerance eps. The two polyons are considered to be equal if their vertex lists are equal (within the specified tolerance) except for possibly being shifted with respect to each other.

Parameters:
poly - polygon to be compared with
eps - tolerance value
Returns:
true if the polygons are equal
See Also:
epsilonEquals(maspack.geometry.Polygon3d, double)

equals

public boolean equals(Polygon3d poly)
Returns true if this polygon is equal to another polygon. The two polyons are considered to be equal if their vertex lists are equal except for possibly being shifted with respect to each other.

Parameters:
poly - polygon to be compared with
Returns:
true if the polygons are equal
See Also:
epsilonEquals(maspack.geometry.Polygon3d, double)

transform

public void transform(AffineTransform3dBase X)
Applies a affine transformation to the vertices of this polygon.

Parameters:
X - affine transformation

inverseTransform

public void inverseTransform(AffineTransform3dBase X)
Applies an inverse affine transformation to the vertices of this polygon.

Parameters:
X - affine transformation