org.shapelogic.polygon
Class BBox
java.lang.Object
org.shapelogic.polygon.BBox
- All Implemented Interfaces:
- GeometricShape2D
public class BBox
- extends java.lang.Object
- implements GeometricShape2D
This BBox should work for all underlying types
I think that this should be immutable
I would have to change the fields to be private and have getters
- Author:
- Sami Badawi
Constructor Summary |
BBox()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
minVal
public IPoint2D minVal
maxVal
public IPoint2D maxVal
BBox
public BBox()
isEmpty
public boolean isEmpty()
addPoint
public void addPoint(IPoint2D pointIn)
addPoint
public void addPoint(int x,
int y)
getCenter
public IPoint2D getCenter()
- Specified by:
getCenter
in interface GeometricShape2D
getDiagonalVector
public IPoint2D getDiagonalVector()
getDiagonalVector
public IPoint2D getDiagonalVector(double fraction)
- A point on the diagonal line
- Parameters:
fraction
- 0 -> minVal, 1 -> maxVal, 0.5 -> middle point
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getDiameter
public double getDiameter()
- Specified by:
getDiameter
in interface GeometricShape2D
getRectangle
public java.awt.Rectangle getRectangle()
getAspectRatio
public double getAspectRatio()
- Defined as x/y
add
public void add(BBox bBox)
Copyright © 2008. All Rights Reserved.