org.shapelogic.polygon
Class BBox

java.lang.Object
  extended by 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

Field Summary
 IPoint2D maxVal
           
 IPoint2D minVal
           
 
Constructor Summary
BBox()
           
 
Method Summary
 void add(BBox bBox)
           
 void addPoint(int x, int y)
           
 void addPoint(IPoint2D pointIn)
           
 double getAspectRatio()
          Defined as x/y
 IPoint2D getCenter()
           
 IPoint2D getDiagonalVector()
           
 IPoint2D getDiagonalVector(double fraction)
          A point on the diagonal line
 double getDiameter()
           
 java.awt.Rectangle getRectangle()
           
 boolean isEmpty()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minVal

public IPoint2D minVal

maxVal

public IPoint2D maxVal
Constructor Detail

BBox

public BBox()
Method Detail

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 © 2009. All Rights Reserved.