|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.RectangularShape java.awt.geom.Rectangle2D java.awt.geom.Rectangle2D.Double math.geom2d.polygon.HRectangle2D
@Deprecated public class HRectangle2D
HRectangle2D defines a rectangle with edges parallel to main axis. Thus, it
can not be rotated, contrary to Rectangle2D. This class is actually simply a
wrapper of class java.awt.geom.Rectangle2D.Double
with
interface AbstractPolygon
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
---|
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
Field Summary |
---|
Fields inherited from class java.awt.geom.Rectangle2D.Double |
---|
height, width, x, y |
Fields inherited from class java.awt.geom.Rectangle2D |
---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
Fields inherited from interface math.geom2d.Shape2D |
---|
ACCURACY |
Constructor Summary | |
---|---|
HRectangle2D()
Deprecated. Empty constructor (size and position zero) |
|
HRectangle2D(double x0,
double y0,
double w,
double h)
Deprecated. Main constructor |
|
HRectangle2D(Point2D point,
double w,
double h)
Deprecated. Main constructor |
|
HRectangle2D(java.awt.geom.Rectangle2D rect)
Deprecated. Constructor from awt, to allow easy construction from existing apps. |
Method Summary | |
---|---|
void |
addVertex(Point2D point)
Deprecated. Adds a vertex as last vertex of this polygon. |
boolean |
almostEquals(GeometricObject2D obj,
double eps)
Deprecated. Checks if the two objects are similar up to a given threshold value. |
double |
area()
Deprecated. Computes the signed area of the polygon. |
Polygon2D |
asPolygon(int n)
Deprecated. Returns an approximation of the domain as a polygon, or a MultiPolygon. |
CirculinearContourArray2D<LinearRing2D> |
boundary()
Deprecated. Overrides the definition of boundary() such that the boundary of a polygon is defined as a set of LinearRing2D. |
Box2D |
boundingBox()
Deprecated. Returns the bounding box of the shape. |
CirculinearDomain2D |
buffer(double dist)
Deprecated. Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d. |
Point2D |
centroid()
Deprecated. Computes the centroid (center of mass) of the polygon. |
HRectangle2D |
clip(Box2D box)
Deprecated. Returns the clipping of the rectangle, as an instance of HRectangle2D. |
int |
closestVertexIndex(Point2D point)
Deprecated. Computes the index of the closest vertex to the input point. |
Polygon2D |
complement()
Deprecated. Returns the complementary polygon. |
boolean |
contains(Point2D p)
Deprecated. Checks if the shape contains the given point. |
java.util.Collection<LinearRing2D> |
contours()
Deprecated. Returns the set of contours that enclose this domain. |
double |
distance(double x,
double y)
Deprecated. Returns the distance of the point to the polygon. |
double |
distance(Point2D p)
Deprecated. Returns the distance of the point to the polygon. |
void |
draw(java.awt.Graphics2D g2)
Deprecated. Draws the shape on the given graphics. |
int |
edgeNumber()
Deprecated. Returns the number of edges of the polygon |
java.util.Collection<LineSegment2D> |
edges()
Deprecated. Return the edges as line segments of the polygon |
boolean |
equals(java.lang.Object obj)
Deprecated. Test if rectangles are the same. |
void |
fill(java.awt.Graphics2D g2)
Deprecated. Fills the interior of the domain, using the Graphics current Paint. |
void |
insertVertex(int i,
Point2D point)
Deprecated. Inserts a vertex at the specified position. |
boolean |
isBounded()
Deprecated. Always returns true, because a rectangle is always bounded. |
void |
removeVertex(int i)
Deprecated. Removes the vertex at the given index. |
void |
setVertex(int i,
Point2D point)
Deprecated. Sets the position of the i-th vertex |
SimplePolygon2D |
transform(AffineTransform2D trans)
Deprecated. Return the new Polygon created by an affine transform of this polygon. |
CirculinearDomain2D |
transform(CircleInversion2D inv)
Deprecated. Transforms the shape by a circle inversion. |
Point2D |
vertex(int i)
Deprecated. Returns the i-th vertex of the polygon. |
int |
vertexNumber()
Deprecated. Returns the number of vertex, which is 4. |
java.util.Collection<Point2D> |
vertices()
Deprecated. Returns the vertices (singular points) of the polygon |
Methods inherited from class java.awt.geom.Rectangle2D.Double |
---|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect, toString |
Methods inherited from class java.awt.geom.Rectangle2D |
---|
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
Methods inherited from class java.awt.geom.RectangularShape |
---|
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface math.geom2d.Shape2D |
---|
contains, isEmpty |
Constructor Detail |
---|
public HRectangle2D(double x0, double y0, double w, double h)
public HRectangle2D()
public HRectangle2D(java.awt.geom.Rectangle2D rect)
public HRectangle2D(Point2D point, double w, double h)
Method Detail |
---|
public java.util.Collection<Point2D> vertices()
Polygon2D
vertices
in interface Polygon2D
public Point2D vertex(int i)
vertex
in interface Polygon2D
i
- index of the vertex, between 0 and 3public void setVertex(int i, Point2D point)
Polygon2D
setVertex
in interface Polygon2D
i
- the vertex indexpoint
- the new position of the vertexpublic void addVertex(Point2D point)
Polygon2D
addVertex
in interface Polygon2D
point
- the position of the new vertexpublic void insertVertex(int i, Point2D point)
Polygon2D
insertVertex
in interface Polygon2D
i
- index at which the specified vertex is to be insertedpoint
- the position of the new vertexpublic void removeVertex(int i)
Polygon2D
removeVertex
in interface Polygon2D
i
- index of the vertex to removepublic int vertexNumber()
vertexNumber
in interface Polygon2D
public int closestVertexIndex(Point2D point)
closestVertexIndex
in interface Polygon2D
public java.util.Collection<LineSegment2D> edges()
Polygon2D
edges
in interface Polygon2D
public int edgeNumber()
Polygon2D
edgeNumber
in interface Polygon2D
public double area()
area
in interface Polygon2D
public Point2D centroid()
centroid
in interface Polygon2D
public CirculinearDomain2D transform(CircleInversion2D inv)
CirculinearShape2D
transform
in interface CirculinearDomain2D
transform
in interface CirculinearShape2D
inv
- the circle inversion
public CirculinearDomain2D buffer(double dist)
CirculinearShape2D
buffer
in interface CirculinearShape2D
dist
- the maximal distance between a point of the buffer and the
shape
public Polygon2D asPolygon(int n)
Domain2D
asPolygon
in interface Domain2D
public CirculinearContourArray2D<LinearRing2D> boundary()
Polygon2D
boundary
in interface CirculinearDomain2D
boundary
in interface Domain2D
boundary
in interface Polygon2D
public java.util.Collection<LinearRing2D> contours()
Domain2D
contours
in interface CirculinearDomain2D
contours
in interface Domain2D
contours
in interface Polygon2D
Contour2D
public Polygon2D complement()
Polygon2D
complement
in interface CirculinearDomain2D
complement
in interface Domain2D
complement
in interface Polygon2D
public double distance(Point2D p)
distance
in interface Shape2D
public double distance(double x, double y)
distance
in interface Shape2D
public HRectangle2D clip(Box2D box)
clip
in interface Domain2D
clip
in interface Polygon2D
clip
in interface Shape2D
box
- the clipping box
public boolean isBounded()
isBounded
in interface Shape2D
public Box2D boundingBox()
Shape2D
boundingBox
in interface Shape2D
public SimplePolygon2D transform(AffineTransform2D trans)
transform
in interface Domain2D
transform
in interface Polygon2D
transform
in interface Shape2D
trans
- an affine transform
public void draw(java.awt.Graphics2D g2)
Shape2D
draw
in interface Domain2D
draw
in interface Shape2D
g2
- the Graphics to draw onpublic void fill(java.awt.Graphics2D g2)
Domain2D
fill
in interface Domain2D
g2
- the Graphics to fill onpublic boolean almostEquals(GeometricObject2D obj, double eps)
GeometricObject2D
almostEquals
in interface GeometricObject2D
obj
- the object to compareeps
- a threshold value, for example the minimal coordinate difference
public boolean equals(java.lang.Object obj)
equals
in class java.awt.geom.Rectangle2D
public boolean contains(Point2D p)
Shape2D
contains
in interface Shape2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |