jpl.mipl.mica.pig
Class PigPoint

java.lang.Object
  extended byjpl.mipl.mica.pig.PigPoint
Direct Known Subclasses:
PigVector

public class PigPoint
extends Object

PigPoint - is a java proxy object used to surface the functions inside jpl's Planetary Imaging Graphics lib(PIG). This proxy is a little different than other proxies in the MICA package in that this proxy also has java variables. The underlying native code maintains the state of these java variables (changing the state as the Pig PigVector under it changes.


NOTE: This object is a proxy object for a C++ implementation. The C++ implementation is part of the NASA/JPL Planetary Image Geometry (PIG) library. This object holds a pointer to an underlying C++ PIG object and makes its methods available to Java. For information on how to create and use PIG objects in Java, see the jpl.mipl.mica.pig package information. For more information on the PIG library and other related JPL software, see MIPS.

All native methods through out this file throw a number of exceptions:

IllegalArgumentException - the native impl handed a bad thing to the jvm

NoSuchFieldError - the native impl asked for a field that is missing

InstantiationException - no memory is one way to get this.

These exceptions will be thrown when the classpath is wrong or files are not compiled properly.


Field Summary
 boolean infinity
          inifinity - the jpl pig vector does not have this flag.
 
Constructor Summary
PigPoint()
          PigPoint - construct the c++ impl.
PigPoint(double xx, double yy, double zz)
          PigPoint - construct the c++ impl.
PigPoint(double xx, double yy, double zz, boolean inf)
          PigPoint - construct the c++ impl.
PigPoint(PigPoint v)
          PigPoint - construct the c++ impl.
 
Method Summary
 void add(PigPoint v)
          add - this vector + the input vector v
 void addNtv(PigPoint v)
          call the native impl to add
 double dot(PigPoint v1)
          dot - compute the scalar dot product of this and v1
 double getX()
          getX - retrieve the x value fro the c++ impl
 double getY()
          getY - retrieve the y value fro the c++ impl
 double getZ()
          getZ - retrieve the z value fro the c++ impl
 void invert()
          invert - reverse the sig of both the native impl and the java vars.
protected  double magnitude()
          magnitude - call native impl to return the length
 void normalize()
          normalize - call the native impl and manage the java vars.
protected  void normalizeNtv()
          normalize - call the native impl to normailize this vector
 void setPoint(PigPoint pp)
          setPoint - call the native impl and manage the java vars.
 void setX(double xx)
          setX - call the native impl and manage the java var x.
protected  double setXNtv(double xx)
          setXNtv - change the native impl
 void setY(double xx)
          setY - call the native impl and manage the java var y.
protected  double setYNtv(double xx)
          setYNtv - change the native impl
 void setZ(double xx)
          setZ - call the native impl and manage the java var z.
protected  double setZNtv(double xx)
          setZNtv - change the native impl
 void subtract(PigPoint v)
          subtract - this vector - the input vector v
 void subtractNtv(PigPoint v)
          subtractNtv - call the native impl to subtract
 String toString()
          toString - pretty print the vector contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

infinity

public boolean infinity
inifinity - the jpl pig vector does not have this flag. We implement it for convienience.

Constructor Detail

PigPoint

public PigPoint()
PigPoint - construct the c++ impl.


PigPoint

public PigPoint(double xx,
                double yy,
                double zz)
PigPoint - construct the c++ impl.


PigPoint

public PigPoint(double xx,
                double yy,
                double zz,
                boolean inf)
PigPoint - construct the c++ impl.


PigPoint

public PigPoint(PigPoint v)
PigPoint - construct the c++ impl.

Method Detail

toString

public String toString()
toString - pretty print the vector contents.


getX

public double getX()
getX - retrieve the x value fro the c++ impl


getY

public double getY()
getY - retrieve the y value fro the c++ impl


getZ

public double getZ()
getZ - retrieve the z value fro the c++ impl


setX

public void setX(double xx)
setX - call the native impl and manage the java var x.


setY

public void setY(double xx)
setY - call the native impl and manage the java var y.


setZ

public void setZ(double xx)
setZ - call the native impl and manage the java var z.


setPoint

public void setPoint(PigPoint pp)
setPoint - call the native impl and manage the java vars.


invert

public void invert()
invert - reverse the sig of both the native impl and the java vars.


setXNtv

protected double setXNtv(double xx)
                  throws IllegalArgumentException,
                         NoSuchFieldError
setXNtv - change the native impl

Throws:
IllegalArgumentException
NoSuchFieldError

setYNtv

protected double setYNtv(double xx)
                  throws IllegalArgumentException,
                         NoSuchFieldError
setYNtv - change the native impl

Throws:
IllegalArgumentException
NoSuchFieldError

setZNtv

protected double setZNtv(double xx)
                  throws IllegalArgumentException,
                         NoSuchFieldError
setZNtv - change the native impl

Throws:
IllegalArgumentException
NoSuchFieldError

dot

public double dot(PigPoint v1)
           throws IllegalArgumentException,
                  NoSuchFieldError
dot - compute the scalar dot product of this and v1

Throws:
IllegalArgumentException
NoSuchFieldError

subtract

public void subtract(PigPoint v)
subtract - this vector - the input vector v


add

public void add(PigPoint v)
add - this vector + the input vector v


subtractNtv

public void subtractNtv(PigPoint v)
                 throws IllegalArgumentException,
                        NoSuchFieldError
subtractNtv - call the native impl to subtract

Throws:
IllegalArgumentException
NoSuchFieldError

addNtv

public void addNtv(PigPoint v)
            throws IllegalArgumentException,
                   NoSuchFieldError
call the native impl to add

Throws:
IllegalArgumentException
NoSuchFieldError

normalize

public void normalize()
normalize - call the native impl and manage the java vars.


normalizeNtv

protected void normalizeNtv()
                     throws IllegalArgumentException,
                            NoSuchFieldError
normalize - call the native impl to normailize this vector

Throws:
IllegalArgumentException
NoSuchFieldError

magnitude

protected double magnitude()
                    throws IllegalArgumentException,
                           NoSuchFieldError
magnitude - call native impl to return the length

Throws:
IllegalArgumentException
NoSuchFieldError