com.altair.hwm.beans.utils
Class HWMPoint

java.lang.Object
  extended by com.altair.hwm.beans.utils.HWMPoint
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class HWMPoint
extends java.lang.Object
implements java.io.Externalizable

Title: HWMPoint

Description: This is a utility class that represents a 3D point

Company: Altair Engineering, Inc.

See Also:
Serialized Form

Constructor Summary
HWMPoint()
          Constructor
HWMPoint(double[] arrdCoords)
          Constructor
HWMPoint(double dXCoord, double dYCoord, double dZCoord)
          Constructor
 
Method Summary
 double[] GetCoordinates()
          Get the coordinates of the point as an array of 3 elements
 double GetDistance(HWMPoint hwmPoint)
          Evaluate the distance between this point and another point
 double GetX()
          Gets the X coordinate for the point
 double GetY()
          Gets the Y coordinate for the point
 double GetZ()
          Gets the Z coordinate for the point
 void readExternal(java.io.ObjectInput objInput)
          Loads the version and then calls the appropriate read function for the version
 void SetCoordinates(double[] arrCoords)
          Set the coordinates of the point from an array of 3 elements
 void SetCoordinates(double dXCoord, double dYCoord, double dZCoord)
          Sets the coordinates for the point
 java.lang.String toString()
          Represents the point as a String in the format of (x,Y,Z)
 HWMPoint Translate(HWMVector hwmVector)
          Translate the point by a magnitude and direction specified by a vector, and return the translated point
 void writeExternal(java.io.ObjectOutput objOutput)
          Save the persistent properties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HWMPoint

public HWMPoint()
Constructor


HWMPoint

public HWMPoint(double dXCoord,
                double dYCoord,
                double dZCoord)
Constructor

Parameters:
dXCoord - The X coordinate
dYCoord - The Y coordinate
dZCoord - The Z coordinate

HWMPoint

public HWMPoint(double[] arrdCoords)
Constructor

Parameters:
-
Method Detail

SetCoordinates

public void SetCoordinates(double dXCoord,
                           double dYCoord,
                           double dZCoord)
Sets the coordinates for the point

Parameters:
dXCoord - The X coordinate
dYCoord - The Y coordinate
dZCoord - The Z coordinate

SetCoordinates

public void SetCoordinates(double[] arrCoords)
                    throws java.lang.ArrayIndexOutOfBoundsException
Set the coordinates of the point from an array of 3 elements

Parameters:
arrCoords - The coords of the point
Throws:
java.lang.ArrayIndexOutOfBoundsException

GetX

public double GetX()
Gets the X coordinate for the point

Returns:
double The X coordinate for the point

GetY

public double GetY()
Gets the Y coordinate for the point

Returns:
double The Y coordinate for the point

GetZ

public double GetZ()
Gets the Z coordinate for the point

Returns:
double The Z coordinate for the point

GetCoordinates

public double[] GetCoordinates()
Get the coordinates of the point as an array of 3 elements

Returns:
double[3] The coords of the point

GetDistance

public double GetDistance(HWMPoint hwmPoint)
Evaluate the distance between this point and another point

Parameters:
hwmPoint - The second point to which the distance is to be evaluated
Returns:
double The distance between the two points

Translate

public HWMPoint Translate(HWMVector hwmVector)
Translate the point by a magnitude and direction specified by a vector, and return the translated point

Parameters:
hwmVector - The vector by which the point will be translated
Returns:
HWMPoint The translated point

toString

public java.lang.String toString()
Represents the point as a String in the format of (x,Y,Z)

Overrides:
toString in class java.lang.Object
Returns:
String point as a String in the format of (x,Y,Z)

writeExternal

public void writeExternal(java.io.ObjectOutput objOutput)
                   throws java.io.IOException
Save the persistent properties

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
objOutput - The stream to which data will be written
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput objInput)
                  throws java.lang.ClassNotFoundException,
                         java.io.IOException
Loads the version and then calls the appropriate read function for the version

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
objInput - The stream from which data will be read
Throws:
IOException, - ClassNotFoundException
java.lang.ClassNotFoundException
java.io.IOException