|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hedgehog.HObject
com.hedgehog.geo.GeometricObject
com.hedgehog.geo.twod.GeometricObject2D
com.hedgehog.geo.twod.shapes.Shape2D
com.hedgehog.geo.twod.shapes.Polygon2D
com.hedgehog.geo.twod.shapes.StraightEdgePolygon2D
com.hedgehog.geo.twod.shapes.ConvexStraightEdgePolygon2D
public class ConvexStraightEdgePolygon2D
Title: ConvexStraightEdgePolygon2D - models a convex polygon.
Description: Extends StraightEdgePolygon2D specifically for convex polygons.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software..
| Field Summary |
|---|
| Fields inherited from class com.hedgehog.geo.twod.shapes.Polygon2D |
|---|
mVertices |
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
ConvexStraightEdgePolygon2D()
Default constructor. |
|
ConvexStraightEdgePolygon2D(ConvexStraightEdgePolygon2D object)
Copy constructor. |
|
ConvexStraightEdgePolygon2D(Point2D p0,
Point2D p1,
Point2D p2)
Constructor. |
|
ConvexStraightEdgePolygon2D(Point2D p0,
Point2D p1,
Point2D p2,
Point2D p3)
Constructor. |
|
ConvexStraightEdgePolygon2D(java.util.Vector<Point2D> vertices)
Constructor. |
|
| Method Summary | |
|---|---|
StraightEdgeTriangle2D |
centroidEdgeConeTriangle(int edgeIndex)
Returns the triangle formed by the centroid and the intersection of the lines through the specified edge and this triangle's bounding centroid circle. |
StraightEdgeTriangle2D |
centroidEdgeConeTriangle(int edgeIndex,
double radius)
Returns the triangle formed by the centroid and the intersection of the lines through the specified edge and a circle of the specified radius centred at this triangle's centroid. |
java.util.Vector<StraightEdgeTriangle2D> |
centroidEdgeConeTriangles()
Returns vector of triangles formed by the centroid and the intersection of the lines through all triangle edges and this triangle's centroid focused bounding circle. |
java.util.Vector<StraightEdgeTriangle2D> |
centroidEdgeConeTriangles(double radius)
Returns vector of triangles formed by the centroid and the intersection of the lines through all triangle edges and a circle of the specified radius centred at this triangle's centroid. |
StraightEdgeTriangle2D |
centroidEdgeTriangle(int edgeIndex)
Returns the triangle formed by the centroid and the two end-points of the specified edge. |
java.util.Vector<StraightEdgeTriangle2D> |
centroidEdgeTriangles()
Returns the vector of the 3 centroid focused edge triangles for this triangle. |
double |
exteriorVertexAngle(int vertexIndex,
boolean degrees)
Returns the exterior angle at the specified vertex. |
double |
interiorVertexAngle(int vertexIndex,
boolean degrees)
Returns the interior angle at the specified vertex. |
boolean |
isAllInteriorAnglesSame(double tolerance)
Tests whether or not all interior angles are the same. |
boolean |
isEquilateralTriangle(double tolerance)
Tests whether or not this polygon is an equilateral triangle. |
boolean |
isRegular(double tolerance)
Tests whether or not this convex polygon is regular; ie all edges are of the same length and all interior angles are equal. |
PairPQ<StraightEdgeTriangle2D,HInteger> |
pointInCentroidEdgeConeTriangle(Point2D p,
double radius,
double tolerance)
Returns the centroid edge cone triangle that the specified point is inside or on the boundary. |
PairPQ<StraightEdgeTriangle2D,HInteger> |
pointInCentroidEdgeTriangle(Point2D p,
double tolerance)
Returns the centroid edge triangle that the specified point is inside or on the boundary. |
boolean |
pointInside(Point2D p,
double tolerance)
Tests whether or not the specified point is inside this polygon. |
boolean |
pointInside(Point2D p,
Point2D centroid,
double tolerance)
Tests whether or not the specified point is inside this polygon. |
java.util.Vector<PairPQ<StraightLine2D,HInteger>> |
pointTangents(Point2D p,
boolean pTestInside,
double tolerance)
Returns the tangents from the specified point to the vertices of this polygon. |
java.util.Vector<PairPQ<StraightLine2D,HInteger>> |
pointTangents(Point2D p,
java.util.Vector<StraightEdgeTriangle2D> centroidEdgeConeTriangles,
boolean pTestInside,
double tolerance)
Returns the tangents from the specified point to the vertices of this polygon. |
double |
sumExteriorVertexAngles(boolean degrees)
Returns the sum of all the exterior vertex angles of this polygon. |
double |
sumInteriorVertexAngles(boolean degrees)
Returns the sum of all the interior vertex angles of this polygon. |
| Methods inherited from class com.hedgehog.geo.twod.shapes.Shape2D |
|---|
areaDifference, is2D, is3D, isCurve, isGrid, isMesh, isPoint, isPointSet, isShape, isSurface, translate |
| Methods inherited from class com.hedgehog.geo.GeometricObject |
|---|
objectDimension |
| Methods inherited from class com.hedgehog.HObject |
|---|
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.hedgehog.model.ModelObject |
|---|
childModelObjects, databaseInsertStatement, databaseUpdateStatement, fromDatabase, fromXMLNode, toX3DNode, toXMLNode |
| Constructor Detail |
|---|
public ConvexStraightEdgePolygon2D()
public ConvexStraightEdgePolygon2D(java.util.Vector<Point2D> vertices)
throws java.lang.IllegalArgumentException
vertices - Vector polygon vertices.
java.lang.IllegalArgumentException - Thrown if argument vertices does not have at least 3 elements.
public ConvexStraightEdgePolygon2D(Point2D p0,
Point2D p1,
Point2D p2)
p0 - Point 0.p1 - Point 1.p2 - Point 2.
public ConvexStraightEdgePolygon2D(Point2D p0,
Point2D p1,
Point2D p2,
Point2D p3)
p0 - Point 0.p1 - Point 1.p2 - Point 2.p3 - Point 3.public ConvexStraightEdgePolygon2D(ConvexStraightEdgePolygon2D object)
object - Object to copy.| Method Detail |
|---|
public StraightEdgeTriangle2D centroidEdgeTriangle(int edgeIndex)
throws java.lang.IllegalArgumentException
edgeIndex - Polygon edge index.
java.lang.IllegalArgumentException - Thrown if edgeIndex is invalid.public java.util.Vector<StraightEdgeTriangle2D> centroidEdgeTriangles()
public StraightEdgeTriangle2D centroidEdgeConeTriangle(int edgeIndex)
throws java.lang.IllegalArgumentException
edgeIndex - Triangle edge index.
java.lang.IllegalArgumentException - Thrown if edgeIndex is invalid.
public StraightEdgeTriangle2D centroidEdgeConeTriangle(int edgeIndex,
double radius)
throws java.lang.IllegalArgumentException
edgeIndex - Triangle edge index.radius - Circle radius.
java.lang.IllegalArgumentException - Thrown if edgeIndex is invalid or radius<=0.
public java.util.Vector<StraightEdgeTriangle2D> centroidEdgeConeTriangles()
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - Thrown if this triangle's bounding centroid circle radius is zero.
public java.util.Vector<StraightEdgeTriangle2D> centroidEdgeConeTriangles(double radius)
throws java.lang.IllegalArgumentException
radius - Radus of bounding circle focused at this triangle's centroid.
java.lang.IllegalArgumentException - Thrown if radius<=0.0.
public PairPQ<StraightEdgeTriangle2D,HInteger> pointInCentroidEdgeTriangle(Point2D p,
double tolerance)
p - Point to test.tolerance - Required tolerance.
public PairPQ<StraightEdgeTriangle2D,HInteger> pointInCentroidEdgeConeTriangle(Point2D p,
double radius,
double tolerance)
p - Point to test.radius - Enclosing outer radius.tolerance - Required tolerance.
public boolean pointInside(Point2D p,
Point2D centroid,
double tolerance)
pointInside in class StraightEdgePolygon2Dp - Point to test.centroid - Polygon centroid. In fact any interior point can be used.tolerance - Required tolerance.
public boolean pointInside(Point2D p,
double tolerance)
pointInside in class StraightEdgePolygon2Dp - Point to test.tolerance - Required tolerance.
public java.util.Vector<PairPQ<StraightLine2D,HInteger>> pointTangents(Point2D p,
boolean pTestInside,
double tolerance)
p - Point from which to generate the tangents.pTestInside - Specifies whether or not to test if p is inside this polygon. Used for saving a p-inside test if the point
is known to be outside.tolerance - Required tolerance.
public java.util.Vector<PairPQ<StraightLine2D,HInteger>> pointTangents(Point2D p,
java.util.Vector<StraightEdgeTriangle2D> centroidEdgeConeTriangles,
boolean pTestInside,
double tolerance)
p - Point from which to find the tangents.centroidEdgeConeTriangles - Vector of triangles focused at this polygon's centroid, extending out to a previously specified radius. The
ordering of centroidEdgeConeTriangles corresponds to the edge ordering of this polygon.pTestInside - Specifies whether or not to test if p is inside this polygon. Used for saving a p-inside test if the point
is known to be outside.tolerance - Required tolerance.
public double interiorVertexAngle(int vertexIndex,
boolean degrees)
throws java.lang.IllegalArgumentException
interiorVertexAngle in class StraightEdgePolygon2DvertexIndex - Vertex index.degrees - Specifies whether or not the returned angle is in degrees or radians.
java.lang.IllegalArgumentException - Thrown if the specified vertex index is out of range.
public double exteriorVertexAngle(int vertexIndex,
boolean degrees)
throws java.lang.IllegalArgumentException
exteriorVertexAngle in class StraightEdgePolygon2DvertexIndex - Vertex index.degrees - Specifies whether or not the returned angle is in degrees or radians.
java.lang.IllegalArgumentException - Thrown if the specified vertex index is out of range.public boolean isAllInteriorAnglesSame(double tolerance)
tolerance - Required tolerance.
public double sumInteriorVertexAngles(boolean degrees)
degrees - Specifies whether or not the returned angle is in degrees or radians.
public double sumExteriorVertexAngles(boolean degrees)
degrees - Specifies whether or not the returned angle is in degrees or radians.
public boolean isRegular(double tolerance)
tolerance - Required tolerance.
public boolean isEquilateralTriangle(double tolerance)
tolerance - Required tolerance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||