com.tensegrity.graphics
Class BBoxOperations

java.lang.Object
  extended bycom.tensegrity.graphics.BBoxOperations

public class BBoxOperations
extends java.lang.Object

This clas provides static utilitiy methods useful when working with Boundaries and BoundingBoxes.

Version:
$Id: BBoxOperations.java,v 1.3 2005/06/28 12:17:32 BurkhardWick Exp $
Author:
MKegel

Field Summary
static int CHECK_AGAINST_BBOX
          Constants specifying the different modes for method contains.
static int CHECK_AGAINST_CENTER
          Constants specifying the different modes for method contains.
 
Method Summary
static boolean contains(int checkAgainstMode, Boundary bboxCheckFor, Boundary bboxCheckAgainst)
          Checking whether the given Boundary bboxCheckAgainst contains the Boundary bboxCheckFor.
static boolean contains(int checkAgainstMode, Boundary bboxCheckFor, BoundingBox bboxCheckAgainst)
          Checking whether the given BoundingBox bboxCheckAgainst contains the Boundary bboxCheckFor.
static void resizeBoundingBox(Boundary b, int hAlign, int vAlign, int minWidth, int minHeight)
          Resizes the given boundary to be at least as big as the given minimum size.
static Boundary transform_createnew(Transform2D xform, Boundary bbox)
          Returns a new Boundary that is a transformation of the given Boundary by meams of the given Tramsform2D.
static BoundingBox transform_createnew(Transform2D xform, BoundingBox bbox)
          Returns a new Boundary that is a transformation of the given Boundary by meams of the given Tramsform2D.
static void transform(Transform2D xform, Boundary bbox)
          Transforms the given Boundary by meams of the given Tramsform2D.
static void transform(Transform2D xform, BoundingBox bbox)
          Transforms the given Boundary by meams of the given Tramsform2D.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHECK_AGAINST_CENTER

public static final int CHECK_AGAINST_CENTER
Constants specifying the different modes for method contains.

See Also:
Constant Field Values

CHECK_AGAINST_BBOX

public static final int CHECK_AGAINST_BBOX
Constants specifying the different modes for method contains.

See Also:
Constant Field Values
Method Detail

transform

public static final void transform(Transform2D xform,
                                   Boundary bbox)
Transforms the given Boundary by meams of the given Tramsform2D.

Parameters:
xform - the Transform2D to apply.
bbox - the Boundary to transform.

transform_createnew

public static final Boundary transform_createnew(Transform2D xform,
                                                 Boundary bbox)
Returns a new Boundary that is a transformation of the given Boundary by meams of the given Tramsform2D. The given Boundary is left unchanged.

Parameters:
xform - the Transform2D to apply.
bbox - the Boundary to transform.
Returns:
a new transformed Boundary.

transform

public static final void transform(Transform2D xform,
                                   BoundingBox bbox)
Transforms the given Boundary by meams of the given Tramsform2D.

Parameters:
xform - the Transform2D to apply.
bbox - the BoundingBox to transform.

transform_createnew

public static final BoundingBox transform_createnew(Transform2D xform,
                                                    BoundingBox bbox)
Returns a new Boundary that is a transformation of the given Boundary by meams of the given Tramsform2D. The given Boundary is left unchanged.

Parameters:
xform - the Transform2D to apply.
bbox - the BoundingBox to transform.
Returns:
a new transformed Boundary.

contains

public static final boolean contains(int checkAgainstMode,
                                     Boundary bboxCheckFor,
                                     BoundingBox bboxCheckAgainst)
Checking whether the given BoundingBox bboxCheckAgainst contains the Boundary bboxCheckFor.

Parameters:
checkAgainstMode - the mode to use. Valid modes are CHECK_AGAINST_CENTER and CHECK_AGAINST_BBOX.
bboxCheckFor - the Boundary to check.
bboxCheckAgainst - the BoundingBox to check against.
Returns:
true, if the given BoundingBox bboxCheckAgainst contains the Boundary bboxCheckFor.

contains

public static final boolean contains(int checkAgainstMode,
                                     Boundary bboxCheckFor,
                                     Boundary bboxCheckAgainst)
Checking whether the given Boundary bboxCheckAgainst contains the Boundary bboxCheckFor.

Parameters:
checkAgainstMode - the mode to use. Valid modes are CHECK_AGAINST_CENTER and CHECK_AGAINST_BBOX.
bboxCheckFor - the Boundary to check.
bboxCheckAgainst - the Boundary to check against.
Returns:
true, if the given Boundary bboxCheckAgainst contains the Boundary bboxCheckFor.

resizeBoundingBox

public static void resizeBoundingBox(Boundary b,
                                     int hAlign,
                                     int vAlign,
                                     int minWidth,
                                     int minHeight)
Resizes the given boundary to be at least as big as the given minimum size.

Parameters:
b - The boundary to resize
hAlign - The alignment of the new boundary relative to the old one
vAlign - The alignment of the new boundary relative to the old one
minWidth - The minimum width of the boundary
minHeight - The minimum height of the boundary


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.