org.kabeja.dxf
Class Bounds

java.lang.Object
  extended by org.kabeja.dxf.Bounds

public class Bounds
extends java.lang.Object

This class is a helper class and reflect a viewport of a entity/layer or document

Author:
Field Summary
protected  double max_x
           
protected  double max_y
           
protected  double max_z
           
protected  double min_x
           
protected  double min_y
           
protected  double min_z
           
protected  boolean set
           
 
Constructor Summary
Bounds()
           
Bounds(Bounds b)
           
Bounds(double max_x, double min_x, double max_y, double min_y)
           
Bounds(double max_x, double min_x, double max_y, double min_y, double max_z, double min_z)
           
 
Method Summary
 void addToBounds(Bounds bounds)
          Enlarge the Bounds to the given Bounds if they enlarge the area.
 void addToBounds(double x, double y, double z)
          Enlarge the Bounds if the given bounds enlarge the coordinates
 void addToBounds(Point p)
           
 boolean contains(Bounds bounds)
          Determines if the given bounding box part or inside the bounds.
 boolean contains(Point p)
           
 void debug()
           
 boolean enclose(Bounds bounds)
          Determines if the given bounds are enclosed.
 double getDepth()
           
 double getHeight()
           
 double getMaximumX()
           
 double getMaximumY()
           
 double getMaximumZ()
           
 double getMinimumX()
           
 double getMinimumY()
           
 double getMinimumZ()
           
 double getWidth()
           
 boolean isValid()
           
 void setMaximumX(double max_x)
           
 void setMaximumY(double max_y)
           
 void setMaximumZ(double max_z)
           
 void setMinimumX(double min_x)
           
 void setMinimumY(double min_y)
           
 void setMinimumZ(double min_z)
           
 void setValid(boolean set)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

max_x

protected double max_x

min_x

protected double min_x

max_y

protected double max_y

min_y

protected double min_y

max_z

protected double max_z

min_z

protected double min_z

set

protected boolean set
Constructor Detail

Bounds

public Bounds()

Bounds

public Bounds(double max_x,
              double min_x,
              double max_y,
              double min_y,
              double max_z,
              double min_z)

Bounds

public Bounds(double max_x,
              double min_x,
              double max_y,
              double min_y)

Bounds

public Bounds(Bounds b)
Method Detail

getMaximumX

public double getMaximumX()
Returns:
Returns the max_x.

setMaximumX

public void setMaximumX(double max_x)
Parameters:
max_x - The max_x to set.

getMaximumY

public double getMaximumY()
Returns:
Returns the max_y.

setMaximumY

public void setMaximumY(double max_y)
Parameters:
max_y - The max_y to set.

getMinimumX

public double getMinimumX()
Returns:
Returns the min_x.

setMinimumX

public void setMinimumX(double min_x)
Parameters:
min_x - The min_x to set.

getMinimumY

public double getMinimumY()
Returns:
Returns the min_y.

setMinimumY

public void setMinimumY(double min_y)
Parameters:
min_y - The min_y to set.

getMinimumZ

public double getMinimumZ()

setMinimumZ

public void setMinimumZ(double min_z)

getMaximumZ

public double getMaximumZ()

setMaximumZ

public void setMaximumZ(double max_z)

addToBounds

public void addToBounds(Bounds bounds)
Enlarge the Bounds to the given Bounds if they enlarge the area.

Parameters:
bounds -

addToBounds

public void addToBounds(double x,
                        double y,
                        double z)
Enlarge the Bounds if the given bounds enlarge the coordinates

Parameters:
x -
y -
z -

addToBounds

public void addToBounds(Point p)

getWidth

public double getWidth()

getHeight

public double getHeight()

getDepth

public double getDepth()

isValid

public boolean isValid()
Returns:
Returns the set.

setValid

public void setValid(boolean set)
Parameters:
set - The set to set.

debug

public void debug()

contains

public boolean contains(Bounds bounds)
Determines if the given bounding box part or inside the bounds.

Parameters:
bounds -
Returns:
true if the bounding box is part or inside the bounds

contains

public boolean contains(Point p)

enclose

public boolean enclose(Bounds bounds)
Determines if the given bounds are enclosed.

Parameters:
bounds -
Returns: