gumbo.graphic.math
Class Size3

java.lang.Object
  |
  +--gumbo.graphic.math.Tuple3
        |
        +--gumbo.graphic.math.Size3
All Implemented Interfaces:
Graphic, GraphicGeometry, java.io.Serializable

public class Size3
extends Tuple3

A 3D spatial element representing a non-transformable axis-aligned non-negative spatial size. Throws an exception if negative dimension values are used. Typically used to define the extent of a finite reference space, such as a shape's local space, or an absolute world, display, or screen space.

Version:
$Revision: 1.9 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.
See Also:
Serialized Form

Constructor Summary
Size3()
           
Size3(double[] val)
          Creates an instance using a mutator.
Size3(double x, double y, double z)
          Creates an instance using a mutator.
Size3(Tuple3 tuple)
          Creates an instance using a mutator.
 
Method Summary
 Point3 center(Point3 retVal)
          Returns the center point of this size.
 boolean equals(java.lang.Object obj)
           
 Size3 getSize3()
          Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object.
protected  Size3 implGetSize3()
          Master whole state accessor.
protected  Tuple3 implSetTuple3(double[] val)
          Master whole state mutator.
protected  Tuple3 implSetTuple3(int dim, double val)
          Master partial state mutator.
 Size3 set(Point3 pointA, Point3 pointB)
          Sets this size from the absolute difference of two points.
 
Methods inherited from class gumbo.graphic.math.Tuple3
abs, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clear, clearArray, div, div, get, get, getGraphic, getGraphicLocalSpace, getTuple3, getX, getY, getZ, implGetTuple3, implGetTuple3, implGetTuple3, implInitTuple3, isEqual, isEqual, isGreaterEqual, isInsideEqual, isLessEqual, isOutside, isZero, isZero, max, max, min, min, mult, mult, neg, noise, random, round, set, set, set, set, setArray, setX, setY, setZ, sub, sub, sum, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Size3

public Size3()

Size3

public Size3(double x,
             double y,
             double z)
Creates an instance using a mutator.


Size3

public Size3(double[] val)
Creates an instance using a mutator.


Size3

public Size3(Tuple3 tuple)
Creates an instance using a mutator.

Method Detail

set

public Size3 set(Point3 pointA,
                 Point3 pointB)
Sets this size from the absolute difference of two points.


getSize3

public Size3 getSize3()
Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object.

Returns:
The view. Never null.

center

public Point3 center(Point3 retVal)
Returns the center point of this size.


implGetSize3

protected Size3 implGetSize3()
Master whole state accessor.


implSetTuple3

protected Tuple3 implSetTuple3(int dim,
                               double val)
Description copied from class: Tuple3
Master partial state mutator.

Overrides:
implSetTuple3 in class Tuple3
Parameters:
dim - Dimension. Throws an exception if out of range.
val - New value for the dimension.
Returns:
This tuple.
Throws:
java.lang.IllegalArgumentException - Dimension values must be non-negative.

implSetTuple3

protected Tuple3 implSetTuple3(double[] val)
Description copied from class: Tuple3
Master whole state mutator.

Overrides:
implSetTuple3 in class Tuple3
Parameters:
val - New value [3].
Throws:
java.lang.IllegalArgumentException - Dimension values must be non-negative.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Tuple3