de.javagl.swogl.geometry
Class DefaultBox

java.lang.Object
  extended by de.javagl.swogl.geometry.DefaultBox
All Implemented Interfaces:
Box

public final class DefaultBox
extends java.lang.Object
implements Box

A simple implementation of a Box


Constructor Summary
DefaultBox()
          Creates a new box
DefaultBox(Box other)
          Creates a new box as a copy of the given one
DefaultBox(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
          Creates a new box with the given size
 
Method Summary
 void combine(Box other)
          Combines this box with another box
 void combine(float x, float y, float z)
          Combines this box with the given point
 void combine(javax.vecmath.Point3f point)
          Combines this box with the given point
 void getCenter(javax.vecmath.Tuple3f center)
          Stores in the given tuple the center of this box
 void getMax(javax.vecmath.Tuple3f max)
          Stores in the given tuple the maximum point of this box
 float getMaxX()
          Returns the maximum x value of this box
 float getMaxY()
          Returns the maximum y value of this box
 float getMaxZ()
          Returns the maximum z value of this box
 void getMin(javax.vecmath.Tuple3f min)
          Stores in the given tuple the minimum point of this box
 float getMinX()
          Returns the minimum x value of this box
 float getMinY()
          Returns the minimum y value of this box
 float getMinZ()
          Returns the minimum z value of this box
 float getSizeX()
          Returns the size of this box in x direction
 float getSizeY()
          Returns the size of this box in y direction
 float getSizeZ()
          Returns the size of this box in z direction
 void setMax(javax.vecmath.Point3f max)
          Set the maximum point of this BoundinBox
 void setMaxX(float maxX)
          Set the maximum x value of this box
 void setMaxY(float maxY)
          Set the maximum y value of this box
 void setMaxZ(float maxZ)
          Set the maximum z value of this box
 void setMin(javax.vecmath.Point3f min)
          Set the minimum point of this BoundinBox
 void setMinX(float minX)
          Set the minimum x value of this box
 void setMinY(float minY)
          Set the minimum y value of this box
 void setMinZ(float minZ)
          Set the minimum z value of this box
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultBox

public DefaultBox()
Creates a new box


DefaultBox

public DefaultBox(float minX,
                  float minY,
                  float minZ,
                  float maxX,
                  float maxY,
                  float maxZ)
Creates a new box with the given size

Parameters:
minX - The minimum x value of this box
minY - The minimum y value of this box
minZ - The minimum z value of this box
maxX - The maximum x value of this box
maxY - The maximum y value of this box
maxZ - The maximum z value of this box

DefaultBox

public DefaultBox(Box other)
Creates a new box as a copy of the given one

Parameters:
other - The box that serves as input for this
Method Detail

getMinX

public float getMinX()
Description copied from interface: Box
Returns the minimum x value of this box

Specified by:
getMinX in interface Box
Returns:
The minimum x value of this box

setMinX

public void setMinX(float minX)
Set the minimum x value of this box

Parameters:
minX - The minimum x value of this box

getMinY

public float getMinY()
Description copied from interface: Box
Returns the minimum y value of this box

Specified by:
getMinY in interface Box
Returns:
The minimum y value of this box

setMinY

public void setMinY(float minY)
Set the minimum y value of this box

Parameters:
minY - The minimum y value of this box

getMinZ

public float getMinZ()
Description copied from interface: Box
Returns the minimum z value of this box

Specified by:
getMinZ in interface Box
Returns:
The minimum z value of this box

setMinZ

public void setMinZ(float minZ)
Set the minimum z value of this box

Parameters:
minZ - The minimum z value of this box

getMaxX

public float getMaxX()
Description copied from interface: Box
Returns the maximum x value of this box

Specified by:
getMaxX in interface Box
Returns:
The maximum x value of this box

setMaxX

public void setMaxX(float maxX)
Set the maximum x value of this box

Parameters:
maxX - The maximum x value of this box

getMaxY

public float getMaxY()
Description copied from interface: Box
Returns the maximum y value of this box

Specified by:
getMaxY in interface Box
Returns:
The maximum y value of this box

setMaxY

public void setMaxY(float maxY)
Set the maximum y value of this box

Parameters:
maxY - The maximum y value of this box

getMaxZ

public float getMaxZ()
Description copied from interface: Box
Returns the maximum z value of this box

Specified by:
getMaxZ in interface Box
Returns:
The maximum z value of this box

setMaxZ

public void setMaxZ(float maxZ)
Set the maximum z value of this box

Parameters:
maxZ - The maximum z value of this box

getMin

public void getMin(javax.vecmath.Tuple3f min)
Description copied from interface: Box
Stores in the given tuple the minimum point of this box

Specified by:
getMin in interface Box
Parameters:
min - The minimum point of this box

setMin

public void setMin(javax.vecmath.Point3f min)
Set the minimum point of this BoundinBox

Parameters:
min - The minimum point of this BoundinBox

getMax

public void getMax(javax.vecmath.Tuple3f max)
Description copied from interface: Box
Stores in the given tuple the maximum point of this box

Specified by:
getMax in interface Box
Parameters:
max - The maximum point of this box

setMax

public void setMax(javax.vecmath.Point3f max)
Set the maximum point of this BoundinBox

Parameters:
max - The maximum point of this BoundinBox

getSizeX

public float getSizeX()
Description copied from interface: Box
Returns the size of this box in x direction

Specified by:
getSizeX in interface Box
Returns:
The size of this box in x direction

getSizeY

public float getSizeY()
Description copied from interface: Box
Returns the size of this box in y direction

Specified by:
getSizeY in interface Box
Returns:
The size of this box in y direction

getSizeZ

public float getSizeZ()
Description copied from interface: Box
Returns the size of this box in z direction

Specified by:
getSizeZ in interface Box
Returns:
The size of this box in z direction

getCenter

public void getCenter(javax.vecmath.Tuple3f center)
Description copied from interface: Box
Stores in the given tuple the center of this box

Specified by:
getCenter in interface Box
Parameters:
center - The center of this box

combine

public void combine(javax.vecmath.Point3f point)
Combines this box with the given point

Parameters:
point - The point this box should be combined with

combine

public void combine(Box other)
Combines this box with another box

Parameters:
other - The box this box should be combined with

combine

public void combine(float x,
                    float y,
                    float z)
Combines this box with the given point

Parameters:
x - The x coordinate of the point
y - The y coordinate of the point
z - The z coordinate of the point

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object