java.lang.Object
org.bzdev.geom.Rectangle3D
org.bzdev.geom.Rectangle3D.Float
- Enclosing class:
- Rectangle3D
Subclass of
Rectangle3D
that stores its values as
single-precision numbers.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.geom.Rectangle3D
Rectangle3D.Double, Rectangle3D.Float
-
Field Summary
Fields inherited from class org.bzdev.geom.Rectangle3D
STACKTRACE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDepth()
Get the depth of this rectangular cuboid.double
Get the height of this rectangular cuboid.double
getMinX()
Get the minimum X coordinate for this rectangular cuboiddouble
getMinY()
Get the minimum Y coordinate for this rectangular cuboiddouble
getMinZ()
Get the minimum Z coordinate for this rectangular cuboiddouble
getWidth()
Get the width of this rectangular cuboid.boolean
isEmpty()
Tests if a Rectangle3D object is empty.void
setRect
(double x, double y, double z, double w, double h, double d) Set the configuration of this object given explicit coordinates and dimensionstoString()
Methods inherited from class org.bzdev.geom.Rectangle3D
add, add, add, clone, contains, contains, contains, contains, createIntersection, createUnion, equals, getBoundary, getBounds, getCenterX, getCenterY, getCenterZ, getComponent, getMaxX, getMaxY, getMaxZ, getSurfaceIterator, getSurfaceIterator, hashCode, intersect, intersects, intersects, isClosedManifold, isOriented, numberOfComponents, setColor, setRect, setRectFromCenter, setRectFromCenter, setRectFromDiagonal, setRectFromDiagonal, union
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bzdev.geom.Shape3D
getBoundary
-
Constructor Details
-
Float
public Float()Constructor. The rectangle will have zero size and will be located at (0, 0, 0). -
Float
Constructor with a tag. The rectangle will have zero size and will be located at (0, 0, 0).- Parameters:
tag
- a tag naming this object;Rectangle3D.STACKTRACE
to tag this object with a stacktrace
-
Float
public Float(float x, float y, float z, float w, float h, float d) Constructor providing dimensions of a rectangular cuboid.- Parameters:
x
- the X coordinate of the vertex whose coordinates have a minimal value.y
- the Y coordinate of the vertex whose coordinates have a minimal value.z
- the Z coordinate of the vertex whose coordinates have a minimal value.w
- the width of the object (the length in the X direction)h
- the height of the object (the length in the Y direction)d
- the depth of the object (the length in the Z direction)
-
Float
Constructor providing dimensions of a rectangular cuboid and providing a tag.- Parameters:
x
- the X coordinate of the vertex whose coordinates have a minimal value.y
- the Y coordinate of the vertex whose coordinates have a minimal value.z
- the Z coordinate of the vertex whose coordinates have a minimal value.w
- the width of the object (the length in the X direction)h
- the height of the object (the length in the Y direction)d
- the depth of the object (the length in the Z direction)tag
- a tag naming this object;Rectangle3D.STACKTRACE
to tag this object with a stacktrace
-
-
Method Details
-
getMinX
public double getMinX()Description copied from class:Rectangle3D
Get the minimum X coordinate for this rectangular cuboid- Specified by:
getMinX
in classRectangle3D
- Returns:
- the minimum X coordinate
-
getMinY
public double getMinY()Description copied from class:Rectangle3D
Get the minimum Y coordinate for this rectangular cuboid- Specified by:
getMinY
in classRectangle3D
- Returns:
- the minimum Y coordinate
-
getMinZ
public double getMinZ()Description copied from class:Rectangle3D
Get the minimum Z coordinate for this rectangular cuboid- Specified by:
getMinZ
in classRectangle3D
- Returns:
- the minimum Z coordinate
-
getWidth
public double getWidth()Description copied from class:Rectangle3D
Get the width of this rectangular cuboid. The width is defined as the length in the X direction.- Specified by:
getWidth
in classRectangle3D
- Returns:
- the width
-
getHeight
public double getHeight()Description copied from class:Rectangle3D
Get the height of this rectangular cuboid. The height is defined as the length in the Y direction.- Specified by:
getHeight
in classRectangle3D
- Returns:
- the height
-
getDepth
public double getDepth()Description copied from class:Rectangle3D
Get the depth of this rectangular cuboid. The depth is defined as the length in the Z direction.- Specified by:
getDepth
in classRectangle3D
- Returns:
- the depth
-
setRect
public void setRect(double x, double y, double z, double w, double h, double d) Description copied from class:Rectangle3D
Set the configuration of this object given explicit coordinates and dimensions- Specified by:
setRect
in classRectangle3D
- Parameters:
x
- the X coordinate of the vertex whose coordinates have a minimal value.y
- the Y coordinate of the vertex whose coordinates have a minimal value.z
- the Z coordinate of the vertex whose coordinates have a minimal value.w
- the width of the object (the length in the X direction)h
- the height of the object (the length in the Y direction)d
- the depth of the object (the length in the Z direction)
-
isEmpty
public boolean isEmpty()Description copied from class:Rectangle3D
Tests if a Rectangle3D object is empty. A Rectangle3D is empty if its width, height, and depth are all zero.- Overrides:
isEmpty
in classRectangle3D
- Returns:
- true if this object is empty; false otherwise
-
toString
-