|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart3djava.ChartRectangle3D
public class ChartRectangle3D
A simple 3D rectangle class, analogous to the java Rectangle2D.Double class.
Constructor Summary | |
---|---|
ChartRectangle3D()
The default ChartRectangle3D constructor |
|
ChartRectangle3D(ChartRectangle3D r)
This constructor creates an ChartRectangle3D object based on the properties of a ChartRectangle3D object. |
|
ChartRectangle3D(double xx,
double yy,
double ww,
double hh)
This constructor creates an ChartRectangle3D object defined by its position, height and width. |
|
ChartRectangle3D(double xx,
double yy,
double zz,
double ww,
double hh,
double dd)
This constructor creates an ChartRectangle3D object defined by its position, height and width. |
|
ChartRectangle3D(java.awt.Rectangle r)
This constructor creates an ChartRectangle3D object based on the properties of a RectangleF object. |
|
ChartRectangle3D(java.awt.geom.Rectangle2D.Float r)
This constructor creates an ChartRectangle3D object based on the properties of a RectangleF object. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns an object that is a clone of this ChartRectangle3D object. |
boolean |
contains(ChartPoint3D p)
Returns true if the point p is contained in the rectangle. |
boolean |
contains(ChartRectangle3D testr)
Returns true if the rectangle testr is contained by the rectangle. |
boolean |
contains(double xx,
double yy)
Returns true if the point (xx,yy) is contained in the rectangle. |
boolean |
contains(double xx,
double yy,
double zz)
Returns true if the point (xx,yy) is contained in the rectangle. |
void |
copy(ChartRectangle3D source)
Copies the source ChartRectangle3D object. |
void |
fixRectangle()
Adjust the rectangle to enforce positive height, width and depth. |
double |
getCenterX()
Returns the x-value of the center of the rectangle. |
double |
getCenterY()
Returns the y-value of the center of the rectangle. |
double |
getCenterZ()
Returns the z-value of the center of the rectangle. |
double |
getDepth()
Returns the depth of the rectangle. |
ChartPoint3D |
getDiagonalCorner()
This method returns the corner opposite the x,y position of the rectangle. |
double |
getHeight()
Returns the height of the rectangle. |
java.awt.Rectangle |
getRectangle()
Returns the the position and size of the rectangle as a Rectangle object. |
java.awt.geom.Rectangle2D.Double |
getRectangleD()
Returns the the position and size of the rectangle as a RectangleF object. |
java.awt.geom.Rectangle2D.Float |
getRectangleF()
Returns the the position and size of the rectangle as a RectangleF object. |
double |
getWidth()
Returns the width of the rectangle. |
double |
getX()
Returns the upper left of the rectangle. |
double |
getX1()
Returns the upper left x-position of the rectangle. |
double |
getX2()
Returns the lower right x-position of the rectangle. |
double |
getY()
Returns the upper left y-position of the rectangle. |
double |
getY1()
Returns the upper left y-position of the rectangle. |
double |
getY2()
Returns the lower right y-position of the rectangle. |
double |
getZ()
Returns the upper left z-position of the rectangle. |
double |
getZ1()
Returns the upper left z-position of the rectangle. |
double |
getZ2()
Returns the lower right z-position of the rectangle. |
boolean |
intersectsWith(ChartRectangle3D rect)
Returns true if the specifie rectangle intersects the current rectangle. |
boolean |
intersectsWith2(ChartRectangle3D testr)
Returns true if the rectangle testr intersects the rectangle. |
void |
normalizeHW()
Defines the position and size of the ChartRectangle3D object. |
void |
setDepth(double value)
Sets the depth of the rectangle. |
void |
setDiagonalCorner(ChartPoint3D p)
Sets the corner opposite the x,y position of the rectangle. |
void |
setFrame(ChartRectangle3D r)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrame(double xx,
double yy,
double ww,
double hh)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrame(double xx,
double yy,
double zz,
double ww,
double hh,
double dd)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrame(java.awt.Rectangle r)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrame(java.awt.geom.Rectangle2D.Double r)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrame(java.awt.geom.Rectangle2D.Float r)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrameFromDiaglonal(double x1,
double y1,
double x2,
double y2)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrameFromDiaglonal(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Defines the position and size of the ChartRectangle3D object. |
void |
setFrameFromDiagonal(ChartPoint3D p1,
ChartPoint3D p2)
Initializes a rectangle object based on a pair of opposite corners. |
void |
setFrameFromDiagonal(double x1,
double y1,
double x2,
double y2)
Initializes a rectangle object based on a pair of opposite corners. |
void |
setFrameFromDiagonal(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Initializes a rectangle object based on a pair of opposite corners. |
void |
setHeight(double value)
Sets the height of the rectangle. |
void |
setLocation(double xx,
double yy)
Defines the position the ChartRectangle3D object. |
void |
setLocation(double xx,
double yy,
double zz)
Defines the position the ChartRectangle3D object. |
void |
setWidth(double value)
Sets the width of the rectangle. |
void |
setX1(double xx)
Sets the upper left x-position of the rectangle. |
void |
setX2(double x2)
Sets the lower right x-position of the rectangle. |
void |
setY1(double yy)
Sets the upper left y-position of the rectangle. |
void |
setY2(double y2)
Sets the lower right y-position of the rectangle. |
void |
setZ1(double zz)
Sets the upper left z-position of the rectangle. |
void |
setZ2(double z2)
Sets the lower right z-position of the rectangle. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartRectangle3D()
public ChartRectangle3D(double xx, double yy, double zz, double ww, double hh, double dd)
xx
- The x-position of the upper left of the rectangle.yy
- The y-position of the upper left of the rectangle.zz
- The z-position of the upper left of the rectangle.ww
- w The width of the rectangle.hh
- h The height of the rectangle.dd
- h The depth of the rectangle.public ChartRectangle3D(double xx, double yy, double ww, double hh)
xx
- The x-position of the upper left of the rectangle.yy
- The y-position of the upper left of the rectangle.ww
- w The width of the rectangle.hh
- h The height of the rectangle.public ChartRectangle3D(ChartRectangle3D r)
r
- The source rectangle.public ChartRectangle3D(java.awt.geom.Rectangle2D.Float r)
r
- The source rectangle.public ChartRectangle3D(java.awt.Rectangle r)
r
- The source rectangle.Method Detail |
---|
public void copy(ChartRectangle3D source)
source
- The source ChartRectangle3D object.public java.lang.Object clone()
clone
in class java.lang.Object
public void normalizeHW()
public void setFrame(double xx, double yy, double zz, double ww, double hh, double dd)
xx
- The x-position of the upper left of the rectangle.yy
- The y-position of the upper left of the rectangle.zz
- The z-position of the upper left of the rectangle.ww
- The width of the rectangle.hh
- The height of the rectangle.dd
- The depth of the rectangle.public void setFrame(double xx, double yy, double ww, double hh)
xx
- The x-position of the upper left of the rectangle.yy
- The y-position of the upper left of the rectangle.ww
- The width of the rectangle.hh
- The height of the rectangle.public void setFrame(ChartRectangle3D r)
r
- Specifies the size of the rectangle.public void setFrame(java.awt.Rectangle r)
r
- Specifies the size of the rectangle.public void setFrame(java.awt.geom.Rectangle2D.Float r)
r
- Specifies the size of the rectangle.public void setFrame(java.awt.geom.Rectangle2D.Double r)
r
- Specifies the size of the rectangle.public void setFrameFromDiaglonal(double x1, double y1, double z1, double x2, double y2, double z2)
x1
- The x-position of the upper left of the rectangle.y1
- The y-position of the upper left of the rectangle.z1
- The z-position of the upper left of the rectangle.x2
- The x-position of the opposite corner of the rectangle.y2
- The y-position of the opposite corner of the rectangle.z2
- The z-position of the opposite corner of the rectangle.public void setFrameFromDiaglonal(double x1, double y1, double x2, double y2)
x1
- The x-position of the upper left of the rectangle.y1
- The y-position of the upper left of the rectangle.x2
- The x-position of the opposite corner of the rectangle.y2
- The y-position of the opposite corner of the rectangle.public void setLocation(double xx, double yy, double zz)
xx
- The x-position of the upper left of the rectangle.yy
- The y-position of the upper left of the rectangle.zz
- The z-position of the upper left of the rectangle.public void setLocation(double xx, double yy)
xx
- The x-position of the upper left of the rectangle.yy
- The y-position of the upper left of the rectangle.public void setDiagonalCorner(ChartPoint3D p)
p
- A point defining the position of lower right corner of the rectangle.public ChartPoint3D getDiagonalCorner()
public void setFrameFromDiagonal(double x1, double y1, double z1, double x2, double y2, double z2)
x1
- The x-position of the upper left of the rectangle.y1
- The y-position of the upper left of the rectangle.z1
- The z-position of the upper left of the rectangle.x2
- The x-position of the lower right of the rectangle.y2
- The y-position of the lower right of the rectangle.z2
- The z-position of the lower right of the rectangle.public void setFrameFromDiagonal(ChartPoint3D p1, ChartPoint3D p2)
p1
- The position of the upper left of the rectangle.p2
- The position of the lower right of the rectangle.public void setFrameFromDiagonal(double x1, double y1, double x2, double y2)
x1
- The x-position of the upper left of the rectangle.y1
- The y-position of the upper left of the rectangle.x2
- The x-position of the lower right of the rectangle.y2
- The y-position of the lower right of the rectangle.public void fixRectangle()
public double getX()
public double getY()
public double getZ()
public double getX1()
public double getY1()
public double getZ1()
public double getWidth()
public double getHeight()
public double getDepth()
public void setWidth(double value)
value
- Sets the width of the rectangle.public void setHeight(double value)
value
- Sets the height of the rectangle.public void setDepth(double value)
value
- Sets the depth of the rectangle.public double getX2()
public double getY2()
public double getZ2()
public void setX1(double xx)
xx
- Sets the upper left x-position of the rectangle.public void setY1(double yy)
yy
- Sets the upper left y-position of the rectangle.public void setZ1(double zz)
zz
- Sets the upper left y-position of the rectangle.public void setX2(double x2)
x2
- Sets the lower right x-position of the rectangle.public void setY2(double y2)
y2
- Sets the lower right y-position of the rectangle.public void setZ2(double z2)
z2
- Sets the lower right z-position of the rectangle.public double getCenterX()
public double getCenterY()
public double getCenterZ()
public java.awt.geom.Rectangle2D.Float getRectangleF()
public java.awt.geom.Rectangle2D.Double getRectangleD()
public java.awt.Rectangle getRectangle()
public boolean contains(double xx, double yy, double zz)
xx
- The x-value of the test point.yy
- The y-value of the test point.zz
- The z-value of the test point.
public boolean contains(double xx, double yy)
xx
- The x-value of the test point.yy
- The y-value of the test point.
public boolean contains(ChartPoint3D p)
p
- The test point.
public boolean intersectsWith(ChartRectangle3D rect)
rect
- The test rectangle.
public boolean intersectsWith2(ChartRectangle3D testr)
testr
- The test rectangle.
public boolean contains(ChartRectangle3D testr)
testr
- The test rectangle.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |