|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<V>
net.von_gagern.martin.confoo.mesh.SimpleTriangle<Vertex2D>
net.von_gagern.martin.confoo.mesh.flat.Triangle2D
public class Triangle2D
A 2D triangle which is also a shape.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
Triangle2D(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Construct triangle from corner coordinates. |
|
Triangle2D(Point2D p1,
Point2D p2,
Point2D p3)
Construct triangle from three corner points. |
|
Triangle2D(Vertex2D p1,
Vertex2D p2,
Vertex2D p3)
Construct triangle from three vertices. |
|
| Method Summary | |
|---|---|
boolean |
contains(double x,
double y)
Determine whether a point given by its coordinates lies within the triangle. |
boolean |
contains(double x,
double y,
double w,
double h)
Determine whether the triangle completely contains a rectangle given by its coordinates. |
boolean |
contains(Point2D p)
Determine whether a given point lies within the triangle. |
boolean |
contains(Rectangle2D r)
Determine whether the triangle completely contains a given rectangle. |
Rectangle |
getBounds()
Calculate integer bounding box. |
Rectangle2D |
getBounds2D()
Calculate bounding box. |
PathIterator |
getPathIterator(AffineTransform at)
Get a path iterator for this shape. |
PathIterator |
getPathIterator(AffineTransform at,
double flatness)
Get a flattening path iterator for this shape. |
boolean |
intersects(double x,
double y,
double w,
double h)
Determine whether the triangle intersects a rectangle given by its coordinates. |
boolean |
intersects(Rectangle2D r)
Determine whether the triangle intersects a given rectangle. |
| Methods inherited from class net.von_gagern.martin.confoo.mesh.SimpleTriangle |
|---|
equal, equals, get, getCorner, hashCode, size |
| Methods inherited from class java.util.AbstractList |
|---|
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public Triangle2D(Vertex2D p1,
Vertex2D p2,
Vertex2D p3)
p1 - first vertexp2 - second vertexp3 - third vertex
public Triangle2D(Point2D p1,
Point2D p2,
Point2D p3)
Vertex2D objects. After that,
changes to the points won't affect the triangle object.
p1 - first corner pointp2 - second corner pointp3 - third corner point
public Triangle2D(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
x1 - first corner x coordinatey1 - first corner y coordinatex2 - second corner x coordinatey2 - second corner y coordinatex3 - third corner x coordinatey3 - third corner y coordinate| Method Detail |
|---|
public Rectangle getBounds()
getBounds in interface ShapegetBounds2D()public Rectangle2D getBounds2D()
getBounds2D in interface Shape
public boolean contains(double x,
double y)
contains in interface Shapex - the x coordinate of a pointy - the y coordinate of a point
public boolean contains(Point2D p)
contains in interface Shapep - a point to check for insideness
public boolean contains(double x,
double y,
double w,
double h)
contains in interface Shapex - the x coordinate of a rectangley - the y coordinate of a rectanglew - width of a rectangleh - height of a rectangle
public boolean contains(Rectangle2D r)
contains in interface Shaper - a rectangle to check for containment
public boolean intersects(double x,
double y,
double w,
double h)
intersects in interface Shapex - the x coordinate of a rectangley - the y coordinate of a rectanglew - width of a rectangleh - height of a rectangle
public boolean intersects(Rectangle2D r)
intersects in interface Shaper - a rectangle to check for intersection
public PathIterator getPathIterator(AffineTransform at)
getPathIterator in interface Shapeat - a transformation to be applied to all coordinates
public PathIterator getPathIterator(AffineTransform at,
double flatness)
getPathIterator in interface Shapeat - a transformation to be applied to all coordinates
getPathIterator(AffineTransform)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||