com.guiseframework.geometry
Class Point

java.lang.Object
  extended by com.guiseframework.geometry.Point

public class Point
extends java.lang.Object

A point in three-dimensional space.

Author:
Garret Wilson

Field Summary
static Point ORIGIN_POINT
          A predefined point with zero coordinates.
 
Constructor Summary
Point(double x, double y)
          Two-dimensional primitive pixel coordinate constructor.
Point(double x, double y, double z)
          Primitive pixel coordinate constructor.
Point(double x, double y, double z, Unit unit)
          Primitive coordinate and unit constructor.
Point(double x, double y, Unit unit)
          Two-dimensional primitive coordinate and unit constructor.
Point(Extent x, Extent y)
          Two-dimensional coordinate constructor.
Point(Extent x, Extent y, Extent z)
          Coordinate constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
          Indicates whether some other object is "equal to" this one.
 Extent getX()
           
 Extent getY()
           
 Extent getZ()
           
 int hashCode()
           
 java.lang.String toString()
           
 Point translate(Dimensions dimensions)
          Translates this point by the given dimensions.
 Point translate(double dx, double dy)
          Translates this point in two dimensions by the given primitive coordinate deltas.
 Point translate(double dx, double dy, double dz)
          Translates this point by the given primitive coordinate deltas.
 Point translate(Extent dx, Extent dy)
          Translates this point in two dimensions by the given coordinate deltas.
 Point translate(Extent dx, Extent dy, Extent dz)
          Translates this point by the given coordinate deltas.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIGIN_POINT

public static final Point ORIGIN_POINT
A predefined point with zero coordinates.

Constructor Detail

Point

public Point(double x,
             double y)
Two-dimensional primitive pixel coordinate constructor.

Parameters:
x - The X coordinate.
y - The Y coordinate.

Point

public Point(double x,
             double y,
             double z)
Primitive pixel coordinate constructor.

Parameters:
x - The X coordinate.
y - The Y coordinate.
z - The Z coordinate.

Point

public Point(double x,
             double y,
             Unit unit)
Two-dimensional primitive coordinate and unit constructor.

Parameters:
x - The X coordinate.
y - The Y coordinate.
unit - The unit in which the point is measured.

Point

public Point(double x,
             double y,
             double z,
             Unit unit)
Primitive coordinate and unit constructor.

Parameters:
x - The X coordinate.
y - The Y coordinate.
z - The Z coordinate.
unit - The unit in which the point is measured.

Point

public Point(Extent x,
             Extent y)
Two-dimensional coordinate constructor.

Parameters:
x - The X coordinate.
y - The Y coordinate.
Throws:
java.lang.NullPointerException - if one of the given coordinates is null.

Point

public Point(Extent x,
             Extent y,
             Extent z)
Coordinate constructor.

Parameters:
x - The X coordinate.
y - The Y coordinate.
z - The Z coordinate.
Throws:
java.lang.NullPointerException - if one of the given coordinates is null.
Method Detail

getX

public Extent getX()
Returns:
The X coordinate.

getY

public Extent getY()
Returns:
The Y coordinate.

getZ

public Extent getZ()
Returns:
The Z coordinate.

translate

public Point translate(Extent dx,
                       Extent dy)
Translates this point in two dimensions by the given coordinate deltas.

Parameters:
dx - The X coordinate delta.
dy - The Y coordinate delta.
Returns:
A new point translated by the given deltas.

translate

public Point translate(Extent dx,
                       Extent dy,
                       Extent dz)
Translates this point by the given coordinate deltas.

Parameters:
dx - The X coordinate delta.
dy - The Y coordinate delta.
dz - The Z coordinate delta.
Returns:
A new point translated by the given deltas.

translate

public Point translate(double dx,
                       double dy)
Translates this point in two dimensions by the given primitive coordinate deltas.

Parameters:
dx - The X coordinate delta.
dy - The Y coordinate delta.
Returns:
A new point translated by the given deltas.

translate

public Point translate(double dx,
                       double dy,
                       double dz)
Translates this point by the given primitive coordinate deltas.

Parameters:
dx - The X coordinate delta.
dy - The Y coordinate delta.
dz - The Z coordinate delta.
Returns:
A new point translated by the given deltas.

translate

public Point translate(Dimensions dimensions)
Translates this point by the given dimensions.

Parameters:
dimensions - The dimension by which to translate this point
Returns:
A new point translated by the given dimensions.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for the object.

equals

public boolean equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one. This implementation returns whether the object is another point with equivalent coordinates.

Overrides:
equals in class java.lang.Object
Parameters:
object - The reference object with which to compare.
Returns:
true if this object is equivalent to the given object.

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.