|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.graphic.math.Tuple3
An abstract base class for a 3D spatial element (3-tuple), with double precision.
Constructor Summary | |
Tuple3()
|
|
Tuple3(double[] val)
Creates an instance using a mutator. |
|
Tuple3(double x,
double y,
double z)
Creates an instance using a mutator. |
|
Tuple3(Tuple3 tuple)
Creates an instance using a mutator. |
Method Summary | |
Tuple3 |
abs(Tuple3 tuple)
this = tuple < 0 ? -tuple : tuple |
Tuple3 |
add(Tuple3 tuple,
double val)
this = tuple + val |
Tuple3 |
add(Tuple3 tupleA,
Tuple3 tupleB)
this = tupleA + tupleB |
Tuple3 |
clamp(Tuple3 tuple,
double min,
double max)
this = clampMax(clampMin(tuple)) |
Tuple3 |
clamp(Tuple3 tuple,
Tuple3 min,
Tuple3 max)
this = clampMax(clampMin(tuple)) |
Tuple3 |
clampMax(Tuple3 tuple,
double max)
this = tuple > max ? max : tuple |
Tuple3 |
clampMax(Tuple3 tuple,
Tuple3 max)
this = tuple > max ? max : tuple |
Tuple3 |
clampMin(Tuple3 tuple,
double min)
this = tuple < min ? min : tuple |
Tuple3 |
clampMin(Tuple3 tuple,
Tuple3 min)
this = tuple < min ? min : tuple |
Tuple3 |
clear()
this = (0, 0, 0). |
static void |
clearArray(double[] retVal)
Sets a length 3 array to all zeros. |
Tuple3 |
div(Tuple3 tuple,
double val)
this = tuple / val |
Tuple3 |
div(Tuple3 tupleA,
Tuple3 tupleB)
this = tupleA / tupleB |
boolean |
equals(java.lang.Object obj)
|
double[] |
get(double[] retVal)
Gets the value of this tuple. |
double |
get(int dim)
Gets a dimension value in this tuple. |
java.lang.Object |
getGraphic()
Default implementation: Returns this (non-native implementation). |
SpaceNode |
getGraphicLocalSpace()
Default implementation: Returns null (absolute reference space). |
Tuple3 |
getTuple3()
Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object. |
double |
getX()
Gets the X dimension value of this tuple. |
double |
getY()
Gets the Y dimension value of this tuple. |
double |
getZ()
Gets the Z dimension value of this tuple. |
protected Tuple3 |
implGetTuple3()
Master whole state accessor. |
protected double[] |
implGetTuple3(double[] retVal)
Master whole state accessor. |
protected double |
implGetTuple3(int dim)
Master partial state accessor. |
protected Tuple3 |
implInitTuple3(double x,
double y,
double z)
Master whole state initializer intended for use by constructors to establish an initial state without interference from mutator overrides. |
protected Tuple3 |
implSetTuple3(double[] val)
Master whole state mutator. |
protected Tuple3 |
implSetTuple3(int dim,
double val)
Master partial state mutator. |
boolean |
isEqual(Tuple3 tuple)
Returns true if the dimension values of a tuple are exactly equal to those of this tuple. |
boolean |
isEqual(Tuple3 tuple,
double tolerance)
Returns true if the dimension values of a tuple are approximately equal to those of this tuple, within plus or minus a tolerance, inclusive. |
boolean |
isGreaterEqual(Tuple3 tuple)
Returns true if the dimension values of a tuple are all greater than or equal to those of this tuple. |
boolean |
isInsideEqual(Tuple3 min,
Tuple3 max)
Returns true if the dimension values of this tuple are all within or equal to those of the min and max bounds. |
boolean |
isLessEqual(Tuple3 tuple)
Returns true if the dimension values of a tuple are all less than or equal to those of this tuple. |
boolean |
isOutside(Tuple3 min,
Tuple3 max)
Returns true if the dimension values of this tuple are all outside those of the min and max bounds. |
boolean |
isZero()
Returns true if all dimension values of this tuple are exactly zero. |
boolean |
isZero(double tolerance)
Returns true if all dimension values of this tuple are approximately zero, within plus or minus a tolerance, inclusive. |
Tuple3 |
max(Tuple3 tuple,
double val)
this = tuple > val ? tupleA : val |
Tuple3 |
max(Tuple3 tupleA,
Tuple3 tupleB)
this = tupleA > tupleB ? tupleA : tupleB |
Tuple3 |
min(Tuple3 tuple,
double val)
this = tuple < val ? tuple : val |
Tuple3 |
min(Tuple3 tupleA,
Tuple3 tupleB)
this = tupleA < tupleB ? tupleA : tupleB |
Tuple3 |
mult(Tuple3 tuple,
double val)
this = tuple * val |
Tuple3 |
mult(Tuple3 tupleA,
Tuple3 tupleB)
this = tupleA * tupleB |
Tuple3 |
neg(Tuple3 tuple)
this = -tuple |
Tuple3 |
noise()
this = rand[-1,1) |
Tuple3 |
random()
this = rand[0,1) |
Tuple3 |
round(Tuple3 tuple)
Rounds each dimension to the nearest integer value. |
Tuple3 |
set(double[] val)
Sets this tuple. |
Tuple3 |
set(double x,
double y,
double z)
Sets this tuple to the specified dimension values. |
Tuple3 |
set(int dim,
double val)
Sets a dimension value in this tuple to a given value. |
void |
set(Tuple3 tuple)
Sets this tuple to the value of another tuple. |
static void |
setArray(double x,
double y,
double z,
double[] retVal)
Sets the dimension values of a length 3 array. |
Tuple3 |
setX(double val)
Sets the X dimension value of this tuple. |
Tuple3 |
setY(double val)
Sets the Y dimension value of this tuple. |
Tuple3 |
setZ(double val)
Sets the Z dimension value of this tuple. |
Tuple3 |
sub(Tuple3 tuple,
double val)
this = tuple - val |
Tuple3 |
sub(Tuple3 tupleA,
Tuple3 tupleB)
this = tupleA - tupleB |
double |
sum()
Returns the sum of this tuple's elements. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Tuple3()
public Tuple3(double x, double y, double z)
public Tuple3(double[] val)
public Tuple3(Tuple3 tuple)
Method Detail |
public Tuple3 setX(double val)
val
- The dimension value.public Tuple3 setY(double val)
val
- The dimension value.public Tuple3 setZ(double val)
val
- The dimension value.public Tuple3 set(int dim, double val)
dim
- Dimension (0-2). Throws an exception if out of range.val
- New value for the dimension.
public Tuple3 set(double x, double y, double z)
x
- X dimension value.y
- Y dimension value.z
- Z dimension value.
public Tuple3 set(double[] val)
val
- New value [3]. Never null.public void set(Tuple3 tuple)
tuple
- Tuple to copy. Never null.public Tuple3 clear()
public Tuple3 neg(Tuple3 tuple)
public Tuple3 abs(Tuple3 tuple)
public Tuple3 round(Tuple3 tuple)
public Tuple3 random()
public Tuple3 noise()
public Tuple3 add(Tuple3 tuple, double val)
public Tuple3 add(Tuple3 tupleA, Tuple3 tupleB)
public Tuple3 sub(Tuple3 tuple, double val)
public Tuple3 sub(Tuple3 tupleA, Tuple3 tupleB)
public Tuple3 mult(Tuple3 tuple, double val)
public Tuple3 mult(Tuple3 tupleA, Tuple3 tupleB)
public Tuple3 div(Tuple3 tuple, double val)
public Tuple3 div(Tuple3 tupleA, Tuple3 tupleB)
public Tuple3 min(Tuple3 tuple, double val)
public Tuple3 min(Tuple3 tupleA, Tuple3 tupleB)
public Tuple3 max(Tuple3 tuple, double val)
public Tuple3 max(Tuple3 tupleA, Tuple3 tupleB)
public final Tuple3 clampMin(Tuple3 tuple, double min)
public final Tuple3 clampMin(Tuple3 tuple, Tuple3 min)
public final Tuple3 clampMax(Tuple3 tuple, double max)
public final Tuple3 clampMax(Tuple3 tuple, Tuple3 max)
public Tuple3 clamp(Tuple3 tuple, double min, double max)
public Tuple3 clamp(Tuple3 tuple, Tuple3 min, Tuple3 max)
public double getX()
public double getY()
public double getZ()
public double get(int dim)
dim
- Dimension. Returns zero if <0 or >2.
public double[] get(double[] retVal)
retVal
- Return value object [3]. Never null.public Tuple3 getTuple3()
public boolean isZero()
public boolean isZero(double tolerance)
tolerance
- >=0. Zero if <0.public boolean isEqual(Tuple3 tuple)
public boolean isEqual(Tuple3 tuple, double tolerance)
tolerance
- Magnitude of the tolerance positive extent.
Must be >=zero.public boolean isLessEqual(Tuple3 tuple)
public boolean isGreaterEqual(Tuple3 tuple)
public boolean isInsideEqual(Tuple3 min, Tuple3 max)
public boolean isOutside(Tuple3 min, Tuple3 max)
public double sum()
public java.lang.String toString()
toString
in class java.lang.Object
protected Tuple3 implSetTuple3(int dim, double val)
dim
- Dimension. Throws an exception if out of range.val
- New value for the dimension.
protected Tuple3 implSetTuple3(double[] val)
val
- New value [3].protected double implGetTuple3(int dim)
dim
- Dimension. Throws an exception if out of range.
protected double[] implGetTuple3(double[] retVal)
retVal
- Return value object [3]. Never null.protected Tuple3 implGetTuple3()
protected final Tuple3 implInitTuple3(double x, double y, double z)
public SpaceNode getGraphicLocalSpace()
getGraphicLocalSpace
in interface GraphicGeometry
public java.lang.Object getGraphic()
getGraphic
in interface Graphic
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static void setArray(double x, double y, double z, double[] retVal)
public static void clearArray(double[] retVal)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |