org.opengts.util
Class PixelPoint

java.lang.Object
  extended by org.opengts.util.PixelPoint
All Implemented Interfaces:
java.lang.Cloneable

public class PixelPoint
extends java.lang.Object
implements java.lang.Cloneable

A pixel point in 3D space


Constructor Summary
PixelPoint()
          Constructor
PixelPoint(double x, double y)
          Constructor
PixelPoint(double x, double y, double z)
          Constructor
PixelPoint(int x, int y)
          Constructor
PixelPoint(int x, int y, int z)
          Constructor
PixelPoint(PixelPoint pp)
          Copy Constructor
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this PixelPoint
 double distanceToPixel(PixelPoint pp)
          Returns the distance from this PixelPoint to the specified PixelPoint.
 PixelPoint fromWorldCoordinates(double thetaDeg)
          Transforms this PixelPoint frame (in world/parent coordinates) to a new coordinate frame rotated by the specified number of degrees.
 int getIntX()
          Gets the X coordinate value as an integer
 int getIntY()
          Gets the Y coordinate value as an integer
 int getIntZ()
          Gets the Z coordinate value as an integer
 double getX()
          Gets the X coordinate value
 double getY()
          Gets the Y coordinate value
 double getZ()
          Gets the Z coordinate value
static void main(java.lang.String[] argv)
          Main entry point for testing/debugging
 void setX(double x)
          Sets the X coordinate value
 void setX(int x)
          Sets the X coordinate value
 void setY(double y)
          Sets the Y coordinate value
 void setY(int y)
          Sets the Y coordinate value
 void setZ(double z)
          Sets the Z coordinate value
 void setZ(int z)
          Sets the Z coordinate value
 java.lang.String toString()
          Returns a string representation of this PixelPoint
 java.lang.String toString(int dec)
          Returns a string representation of this PixelPoint
 PixelPoint toWorldCoordinates(double thetaDeg)
          Transforms this PixelPoint frame to world/parent 2D coordinates.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PixelPoint

public PixelPoint()
Constructor


PixelPoint

public PixelPoint(int x,
                  int y)
Constructor

Parameters:
x - X coordinate
y - Y coordinate

PixelPoint

public PixelPoint(int x,
                  int y,
                  int z)
Constructor

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

PixelPoint

public PixelPoint(double x,
                  double y)
Constructor

Parameters:
x - X coordinate
y - Y coordinate

PixelPoint

public PixelPoint(double x,
                  double y,
                  double z)
Constructor

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

PixelPoint

public PixelPoint(PixelPoint pp)
Copy Constructor

Parameters:
pp - The PixelPoint to copy
Method Detail

clone

public java.lang.Object clone()
Returns a copy of this PixelPoint

Overrides:
clone in class java.lang.Object
Returns:
A copy of this PixelPoint object

setX

public void setX(int x)
Sets the X coordinate value

Parameters:
x - The X coordinate value

setX

public void setX(double x)
Sets the X coordinate value

Parameters:
x - The X coordinate value

getX

public double getX()
Gets the X coordinate value

Returns:
The X coordinate value

getIntX

public int getIntX()
Gets the X coordinate value as an integer

Returns:
The X coordinate integer value

setY

public void setY(int y)
Sets the Y coordinate value

Parameters:
y - The Y coordinate value

setY

public void setY(double y)
Sets the Y coordinate value

Parameters:
y - The Y coordinate value

getY

public double getY()
Gets the Y coordinate value

Returns:
The Y coordinate value

getIntY

public int getIntY()
Gets the Y coordinate value as an integer

Returns:
The Y coordinate integer value

setZ

public void setZ(int z)
Sets the Z coordinate value

Parameters:
z - The Z coordinate value

setZ

public void setZ(double z)
Sets the Z coordinate value

Parameters:
z - The Z coordinate value

getZ

public double getZ()
Gets the Z coordinate value

Returns:
The Z coordinate value

getIntZ

public int getIntZ()
Gets the Z coordinate value as an integer

Returns:
The Z coordinate integer value

distanceToPixel

public double distanceToPixel(PixelPoint pp)
Returns the distance from this PixelPoint to the specified PixelPoint.

Parameters:
pp - The other PixelPoint
Returns:
The distance to the other PixelPoint

toWorldCoordinates

public PixelPoint toWorldCoordinates(double thetaDeg)
Transforms this PixelPoint frame to world/parent 2D coordinates.

Parameters:
thetaDeg - The degrees rotations in the world/parent coordinate frame.
Returns:
The new PixelPoint in world/parent 2D coordinates

fromWorldCoordinates

public PixelPoint fromWorldCoordinates(double thetaDeg)
Transforms this PixelPoint frame (in world/parent coordinates) to a new coordinate frame rotated by the specified number of degrees.

Parameters:
thetaDeg - The degrees rotations in the world/parent coordinate frame.
Returns:
The new PixelPoint in world/parent coordinates

toString

public java.lang.String toString(int dec)
Returns a string representation of this PixelPoint

Parameters:
dec - The number of decimal places
Returns:
The string representation of this PixelPoint

toString

public java.lang.String toString()
Returns a string representation of this PixelPoint

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this PixelPoint

main

public static void main(java.lang.String[] argv)
Main entry point for testing/debugging

Parameters:
argv - Comand-line arguments