|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.ihmc.utilities.math.geometry.ConvexPolygon2d
public class ConvexPolygon2d
Title:
Description:
Copyright: Copyright (c) 2007
Company:
Nested Class Summary | |
---|---|
static class |
ConvexPolygon2d.FewerThanOnePointException
|
Constructor Summary | |
---|---|
ConvexPolygon2d(ConvexPolygon2d convexPolygon2d)
|
|
ConvexPolygon2d(double[][] pointList)
|
|
ConvexPolygon2d(java.util.List<javax.vecmath.Point2d> pointList)
|
Method Summary | |
---|---|
void |
applyTransform(javax.media.j3d.Transform3D transform)
|
void |
applyTransform(javax.media.j3d.Transform3D transform,
boolean requireTransformInPlane)
|
ConvexPolygon2d |
applyTransformCopy(javax.media.j3d.Transform3D transform)
|
ConvexPolygon2d |
applyTransformCopy(javax.media.j3d.Transform3D transform,
boolean requireTransformInPlane)
|
static boolean |
areAdjacentInClockwiseOrder(int index1,
int index2,
int numVertices)
|
boolean |
areAllPointsInside(javax.vecmath.Point2d[] points)
areAllPointsInside Determines whether all the points in points are inside the convex polygon. |
static ConvexPolygon2dAndConnectingEdges |
combineDisjointPolygons(ConvexPolygon2d polygon1,
ConvexPolygon2d polygon2)
Efficiently combines two Disjoint Polygons. |
static ConvexPolygon2d |
combinePolygons(ConvexPolygon2d firstPolygon,
ConvexPolygon2d secondPolygon)
combinePolygons Creates new convex polygon. |
static ConvexPolygon2d |
computeIntersectionOfPolygons(ConvexPolygon2d polygonP,
ConvexPolygon2d polygonQ)
Computes the intersection of two convex polygons. |
static ConvexPolygon2d |
constructFromInteriorOfRays(java.util.ArrayList<Line2d> rays)
|
double |
distance(ConvexPolygon2d convexPolygon)
|
double |
distance(Line2d line)
|
double |
distance(LineSegment2d lineSegment)
|
double |
distance(javax.vecmath.Point2d point)
|
double |
distanceToClosestVertex(javax.vecmath.Point2d point)
|
double[] |
distanceToEachVertex(javax.vecmath.Point2d point)
|
boolean |
epsilonEquals(ConvexPolygon2d convexPolygon,
double threshold)
|
java.util.ArrayList<javax.vecmath.Point2d> |
getAllVisibleVerticesFromOutsideLeftToRight(javax.vecmath.Point2d observerPoint2d)
Returns all of the vertices that are visible from the observerPoint2d, in left to right order. |
double |
getArea()
|
LineSegment2d[] |
getAroundTheCornerEdges(javax.vecmath.Point2d observerPoint2d)
Returns the two LineSegment2ds that are the first segments around the corner that cannot be seen from the observerPoint2d. |
BoundingBox2d |
getBoundingBoxCopy()
|
javax.vecmath.Point2d |
getCentroid()
|
void |
getCentroid(javax.vecmath.Point2d centroid)
|
javax.vecmath.Point2d |
getCentroidCopy()
|
java.util.List<javax.vecmath.Point2d> |
getClockwiseOrderedListOfPoints()
|
java.util.ArrayList<javax.vecmath.Point2d> |
getClockwiseOrderedListOfPointsCopy()
|
java.util.ArrayList<javax.vecmath.Point3d> |
getClockwiseOrderedListOfPointsCopy(double z)
|
LineSegment2d |
getClosestEdge(javax.vecmath.Point2d point)
|
int[] |
getClosestEdgeVertexIndicesInClockwiseOrderedList(javax.vecmath.Point2d point)
|
javax.vecmath.Point2d |
getClosestVertexCopy(Line2d line)
|
javax.vecmath.Point2d |
getClosestVertexCopy(javax.vecmath.Point2d point)
|
java.util.ArrayList<javax.vecmath.Point2d> |
getCounterClockwiseOrderedListOfPointsCopy()
|
LineSegment2d[] |
getIntersectingEdges(Line2d line2d)
|
javax.vecmath.Point2d[] |
getLineOfSightVertices(javax.vecmath.Point2d observerPoint2d)
|
Line2d[] |
getLinesOfSight(javax.vecmath.Point2d observerPoint)
|
javax.vecmath.Point2d |
getMeanPoint()
|
static int |
getMidEdgeOppositeClockwiseOrdering(int leftEdgeIndex,
int rightEdgeIndex,
int numEdges)
|
LineSegment2d[] |
getNearestEdges(javax.vecmath.Point2d testPoint)
|
int |
getNumberOfVertices()
|
java.util.ArrayList<javax.vecmath.Vector2d> |
getOutSideFacingOrthoNormalVectors()
|
java.util.ArrayList<javax.vecmath.Point2d> |
getStartingFromLeftMostClockwiseOrderedListOfPointsCopy()
|
static javax.vecmath.Point2d[] |
intersection(LineSegment2d lineSegment,
ConvexPolygon2d convexPolygon)
|
ConvexPolygon2d |
intersectionWith(ConvexPolygon2d convexPolygon)
|
javax.vecmath.Point2d[] |
intersectionWith(Line2d line)
|
javax.vecmath.Point2d[] |
intersectionWith(LineSegment2d lineSegment2d)
|
javax.vecmath.Point2d[] |
intersectionWithRay(Line2d ray)
|
boolean |
isCompletelyInside(ConvexPolygon2d polygonQ)
|
boolean |
isPointInside(double x,
double y)
|
boolean |
isPointInside(double x,
double y,
double epsilon)
isPointInside Determines whether a point is inside the convex polygon (point in polygon test). |
boolean |
isPointInside(javax.vecmath.Point2d point)
|
boolean |
isPointInside(javax.vecmath.Point2d point,
double epsilon)
isPointInside Determines whether a point is inside the convex polygon (point in polygon test). |
boolean |
isPolygonInside(ConvexPolygon2d polygon2)
checks to see if the passed polygon is inside of this one. |
boolean |
isTransformationInPlane(javax.media.j3d.Transform3D transform)
|
javax.vecmath.Point2d |
maxXMaxYPointCopy()
|
javax.vecmath.Point2d |
maxXMinYPointCopy()
|
javax.vecmath.Point2d |
minXMaxYPointCopy()
|
javax.vecmath.Point2d |
minXMinYPointCopy()
|
void |
orthogonalProjection(javax.vecmath.Point2d point2d)
|
javax.vecmath.Point2d |
orthogonalProjectionCopy(javax.vecmath.Point2d point)
|
double |
perimeter()
|
boolean |
pointIsOnPerimeter(javax.vecmath.Point2d point)
|
javax.vecmath.Point2d |
pointOnPerimeterGivenParameter(double parameter)
|
void |
pullPointTowardsCentroid(javax.vecmath.Point2d point,
double percent)
|
javax.vecmath.Point2d |
pullTowardsCentroidCopy(javax.vecmath.Point2d point,
double percent)
|
static ConvexPolygon2d |
shrinkConstantDistanceInto(double distance,
ConvexPolygon2d polygonQ)
|
static ConvexPolygon2d |
shrinkInto(ConvexPolygon2d polygonP,
javax.vecmath.Point2d referencePointInP,
ConvexPolygon2d polygonQ)
|
java.lang.String |
toString()
|
ConvexPolygon2d |
translateCopy(javax.vecmath.Tuple2d translation)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConvexPolygon2d(java.util.List<javax.vecmath.Point2d> pointList)
public ConvexPolygon2d(double[][] pointList)
public ConvexPolygon2d(ConvexPolygon2d convexPolygon2d)
Method Detail |
---|
public double getArea()
public void getCentroid(javax.vecmath.Point2d centroid)
public javax.vecmath.Point2d getCentroid()
public javax.vecmath.Point2d getCentroidCopy()
public BoundingBox2d getBoundingBoxCopy()
public java.util.List<javax.vecmath.Point2d> getClockwiseOrderedListOfPoints()
public java.util.ArrayList<javax.vecmath.Point2d> getClockwiseOrderedListOfPointsCopy()
public java.util.ArrayList<javax.vecmath.Point2d> getCounterClockwiseOrderedListOfPointsCopy()
public java.util.ArrayList<javax.vecmath.Point2d> getStartingFromLeftMostClockwiseOrderedListOfPointsCopy()
public java.util.ArrayList<javax.vecmath.Point3d> getClockwiseOrderedListOfPointsCopy(double z)
public int getNumberOfVertices()
public double[] distanceToEachVertex(javax.vecmath.Point2d point)
public javax.vecmath.Point2d getClosestVertexCopy(javax.vecmath.Point2d point)
public javax.vecmath.Point2d getClosestVertexCopy(Line2d line)
public double distanceToClosestVertex(javax.vecmath.Point2d point)
public boolean isPointInside(javax.vecmath.Point2d point)
public boolean isPointInside(javax.vecmath.Point2d point, double epsilon)
point
- Point2d the point to be tested
public ConvexPolygon2d translateCopy(javax.vecmath.Tuple2d translation)
public boolean isPointInside(double x, double y)
public boolean isPointInside(double x, double y, double epsilon)
x
- y
-
public boolean areAllPointsInside(javax.vecmath.Point2d[] points)
points
- Point2d[]
public boolean isPolygonInside(ConvexPolygon2d polygon2)
polygon2
-
public Line2d[] getLinesOfSight(javax.vecmath.Point2d observerPoint)
public java.util.ArrayList<javax.vecmath.Point2d> getAllVisibleVerticesFromOutsideLeftToRight(javax.vecmath.Point2d observerPoint2d)
observerPoint2d
- Point2d
public javax.vecmath.Point2d[] getLineOfSightVertices(javax.vecmath.Point2d observerPoint2d)
public LineSegment2d[] getAroundTheCornerEdges(javax.vecmath.Point2d observerPoint2d)
observerPoint2d
- Point2d marking the point of observation of this ConvexPolygon2d.
public LineSegment2d[] getNearestEdges(javax.vecmath.Point2d testPoint)
public static boolean areAdjacentInClockwiseOrder(int index1, int index2, int numVertices)
public static int getMidEdgeOppositeClockwiseOrdering(int leftEdgeIndex, int rightEdgeIndex, int numEdges)
public javax.vecmath.Point2d[] intersectionWith(LineSegment2d lineSegment2d)
intersectionWith
in interface Geometry2d
public javax.vecmath.Point2d[] intersectionWith(Line2d line)
intersectionWith
in interface Geometry2d
public javax.vecmath.Point2d[] intersectionWithRay(Line2d ray)
public LineSegment2d[] getIntersectingEdges(Line2d line2d)
public ConvexPolygon2d intersectionWith(ConvexPolygon2d convexPolygon)
intersectionWith
in interface Geometry2d
public LineSegment2d getClosestEdge(javax.vecmath.Point2d point)
public int[] getClosestEdgeVertexIndicesInClockwiseOrderedList(javax.vecmath.Point2d point)
public double distance(Line2d line)
distance
in interface Geometry2d
public double distance(LineSegment2d lineSegment)
distance
in interface Geometry2d
public double distance(ConvexPolygon2d convexPolygon)
distance
in interface Geometry2d
public java.lang.String toString()
toString
in class java.lang.Object
public void applyTransform(javax.media.j3d.Transform3D transform)
applyTransform
in interface Geometry2d
public void applyTransform(javax.media.j3d.Transform3D transform, boolean requireTransformInPlane)
applyTransform
in interface Geometry2d
public ConvexPolygon2d applyTransformCopy(javax.media.j3d.Transform3D transform)
applyTransformCopy
in interface Geometry2d
public ConvexPolygon2d applyTransformCopy(javax.media.j3d.Transform3D transform, boolean requireTransformInPlane)
applyTransformCopy
in interface Geometry2d
public boolean isTransformationInPlane(javax.media.j3d.Transform3D transform)
public javax.vecmath.Point2d minXMaxYPointCopy()
public javax.vecmath.Point2d minXMinYPointCopy()
public javax.vecmath.Point2d maxXMaxYPointCopy()
public javax.vecmath.Point2d maxXMinYPointCopy()
public double perimeter()
public javax.vecmath.Point2d pointOnPerimeterGivenParameter(double parameter)
public void pullPointTowardsCentroid(javax.vecmath.Point2d point, double percent)
public javax.vecmath.Point2d pullTowardsCentroidCopy(javax.vecmath.Point2d point, double percent)
public static ConvexPolygon2d combinePolygons(ConvexPolygon2d firstPolygon, ConvexPolygon2d secondPolygon)
firstPolygon
- ConvexPolygon2dsecondPolygon
- ConvexPolygon2d
public static ConvexPolygon2dAndConnectingEdges combineDisjointPolygons(ConvexPolygon2d polygon1, ConvexPolygon2d polygon2)
polygon1
- ConvexPolygon2dpolygon2
- ConvexPolygon2d
public boolean pointIsOnPerimeter(javax.vecmath.Point2d point)
public static ConvexPolygon2d computeIntersectionOfPolygons(ConvexPolygon2d polygonP, ConvexPolygon2d polygonQ)
polygonP
- ConvexPolygon2dpolygonQ
- ConvexPolygon2d
public boolean isCompletelyInside(ConvexPolygon2d polygonQ)
public boolean epsilonEquals(ConvexPolygon2d convexPolygon, double threshold)
public static ConvexPolygon2d shrinkConstantDistanceInto(double distance, ConvexPolygon2d polygonQ)
public static ConvexPolygon2d constructFromInteriorOfRays(java.util.ArrayList<Line2d> rays)
public static ConvexPolygon2d shrinkInto(ConvexPolygon2d polygonP, javax.vecmath.Point2d referencePointInP, ConvexPolygon2d polygonQ)
public javax.vecmath.Point2d getMeanPoint()
public java.util.ArrayList<javax.vecmath.Vector2d> getOutSideFacingOrthoNormalVectors()
public double distance(javax.vecmath.Point2d point)
distance
in interface Geometry2d
public javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point)
orthogonalProjectionCopy
in interface Geometry2d
public void orthogonalProjection(javax.vecmath.Point2d point2d)
orthogonalProjection
in interface Geometry2d
public static javax.vecmath.Point2d[] intersection(LineSegment2d lineSegment, ConvexPolygon2d convexPolygon)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |