|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hedgehog.HObject
com.hedgehog.geo.GeometricObject
com.hedgehog.geo.threed.GeometricObject3D
com.hedgehog.geo.threed.points.Point3D
com.hedgehog.geo.threed.points.Point3DWithAdjacentPoints
public class Point3DWithAdjacentPoints
Title: Point3DWithAdjacentPoints - extends Point3D by appending point adjacency information.
Description: Extends Point3D by appending a vector of adjacent points to a point.
Useful for modelling systems such as mass-spring point nets in which it is required for points to know their immediate neighbours.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software.
| Field Summary | |
|---|---|
protected java.util.Vector<Point3D> |
mAdjacentPoints
Vector of adjacent points. |
| Fields inherited from class com.hedgehog.geo.threed.points.Point3D |
|---|
mx, my, mz |
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
Point3DWithAdjacentPoints()
Default constructor. |
|
Point3DWithAdjacentPoints(double x,
double y,
double z)
Constructor. |
|
Point3DWithAdjacentPoints(double x,
double y,
double z,
java.util.Vector<Point3D> adjacentPoints)
Constructor. |
|
Point3DWithAdjacentPoints(Point3DWithAdjacentPoints object)
Copy constructor. |
|
| Method Summary | |
|---|---|
boolean |
addAdjacentPoint(Point3D adjacentPoint)
Adds the specified point provided it is not already an adjacent member. |
void |
addAdjacentPoints(java.util.Vector<Point3D> adjacentPoints)
Adds the specified vector of points. |
int[] |
adjacentPointIDs()
Returns an array of this object's adjacent point IDs. |
int |
adjacentPointIndex(Point3D adjacentPoint)
Returns the adjacentPoints index of the specified adjacent point, or -1 if adjacentPoint is null or index not identified. |
java.util.Vector<Point3D> |
adjacentPointsInCommon(Point3DWithAdjacentPoints adjacentPoint)
Returns a vector of points whose adjacencies are shared between this point and the specified point |
FloatingPointVector |
anglesBetweenThisPointAndAdjacentPoints(boolean degrees)
Returns a vector of angles between this point and it's adjacent points. |
Point3D |
centroidOfAdjacentPoints()
Returns the centroid of this point's adjacent points. |
Point3D |
centroidOfThisPointAndAdjacentPoints()
Returns the centroid of this point and its adjacent points. |
java.util.Vector<ModelObject> |
childModelObjects()
Returns a vector of this object's child ModelObject objects. |
java.sql.PreparedStatement |
databaseInsertStatement(java.sql.Connection connection,
int modelID)
Returns a prepared statement for inserting (INSERT command) a ModelObject object into a database. |
java.sql.PreparedStatement |
databaseUpdateStatement(java.sql.Connection connection,
int modelID)
Returns a prepared statement for updating (UPDATE command) a ModelObject object into a database. |
double |
distanceSumToAdjacentPoints(boolean distanceSquared)
Returns the total distance from this point to all adjacent specified points. |
double |
distanceToAdjacentPoint(int adjacentPointIndex,
boolean distanceSquared)
Returns the distance from this point to the specified point. |
double |
distanceToAdjacentPoint(Point3D adjacentPoint,
boolean distanceSquared)
Returns the distance from this point to the specified adjacent point. |
ModelObject |
fromDatabase(java.sql.Connection connection,
Model model,
int modelID,
int objectID)
Returns a model object from the specified database table. |
ModelObject |
fromXMLNode(org.w3c.dom.Document document,
org.w3c.dom.Node documentRootNode,
org.w3c.dom.Node node,
Model model)
Returns a model object from the specified xml node. |
java.util.Vector<Point3D> |
getAdjacentPoints()
Returns the vector of adjacent points. |
boolean |
hasAdjacentPoints()
Tests whether or not this point has adjacent points. |
boolean |
isAdjacentPoint(Point3D adjacentPoint)
Tests whether or not the specified point is in the vector of adjacent points. |
boolean |
isAdjacentPointIndex(int adjacentPoint)
Tests whether or not the specified adjacent point index is valid. |
int |
numberAdjacentPoints()
Returns the number of adjacent points. |
boolean |
sameSense(Point3DWithAdjacentPoints originalPoint,
double tolerance)
Tests whether or not this point has the same sense as the specified point. |
void |
setAdjacentPoints(java.util.Vector<Point3D> adjacentPoints)
Sets the vector of adjacent points to the specified vector. |
void |
setToCentroidOfAdjacentPoints()
Sets this point to the centroid of it's adjacent points. |
java.lang.String |
toString()
Returns a String representation of a Point3DWithAdjacentPoints object. |
org.w3c.dom.Element |
toXMLNode(org.w3c.dom.Document document,
org.w3c.dom.Element documentRootNode)
Returns the xml node of this object. |
| Methods inherited from class com.hedgehog.geo.GeometricObject |
|---|
objectDimension |
| Methods inherited from class com.hedgehog.HObject |
|---|
compare, compareTo, getID, getName, hashCode, hasID, hasName, setID, setName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.hedgehog.model.ModelObject |
|---|
toX3DNode |
| Field Detail |
|---|
protected java.util.Vector<Point3D> mAdjacentPoints
| Constructor Detail |
|---|
public Point3DWithAdjacentPoints()
public Point3DWithAdjacentPoints(double x,
double y,
double z)
x - x-coordinate of point.y - y-coordinate of point.z - z-coordinate of point.
public Point3DWithAdjacentPoints(double x,
double y,
double z,
java.util.Vector<Point3D> adjacentPoints)
x - x-coordinate of point.y - y-coordinate of point.z - z-coordinate of point.adjacentPoints - Vector of adjacent points.public Point3DWithAdjacentPoints(Point3DWithAdjacentPoints object)
object - Object to copy.| Method Detail |
|---|
public java.util.Vector<Point3D> getAdjacentPoints()
public void setAdjacentPoints(java.util.Vector<Point3D> adjacentPoints)
adjacentPoints - New vector of adjacent points.public boolean addAdjacentPoint(Point3D adjacentPoint)
adjacentPoint - Point to add.
public void addAdjacentPoints(java.util.Vector<Point3D> adjacentPoints)
adjacentPoints - Vector of points to add.public boolean hasAdjacentPoints()
public java.util.Vector<Point3D> adjacentPointsInCommon(Point3DWithAdjacentPoints adjacentPoint)
throws java.lang.IllegalArgumentException
adjacentPoint - Point to test for common adjacent points with this point.
java.lang.IllegalArgumentException - Thrown if adjacentPoint is null.public FloatingPointVector anglesBetweenThisPointAndAdjacentPoints(boolean degrees)
degrees - Specified whether the returned angles are in degree or radians; default is DEGREES.
public int numberAdjacentPoints()
public Point3D centroidOfThisPointAndAdjacentPoints()
public Point3D centroidOfAdjacentPoints()
public int adjacentPointIndex(Point3D adjacentPoint)
adjacentPoint - Adjacent point.
public double distanceToAdjacentPoint(int adjacentPointIndex,
boolean distanceSquared)
throws java.lang.IllegalArgumentException
adjacentPointIndex - Adjacent point index.distanceSquared - Specifies whether or not the returned distance is to be squared (saving a sqrt() call) or actual distance; default is false.
java.lang.IllegalArgumentException - Thrown if adjacentPoint is invalid.
public double distanceToAdjacentPoint(Point3D adjacentPoint,
boolean distanceSquared)
throws java.lang.IllegalArgumentException
adjacentPoint - Adjacent point.distanceSquared - Specifies whether or not the returned distance is to be squared (saving a sqrt() call) or actual distance; default is false.
java.lang.IllegalArgumentException - Thrown if adjacentPoint is invalid.public double distanceSumToAdjacentPoints(boolean distanceSquared)
distanceSquared - Specifies whether or not the returned distance is to be squared (saving a sqrt() call) or actual distance; default is false.
public boolean sameSense(Point3DWithAdjacentPoints originalPoint,
double tolerance)
throws java.lang.IllegalArgumentException
originalPoint - Original point and adjacent points to compare against this point.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if originalPoint has a different number of adjacent points to this point.public boolean isAdjacentPoint(Point3D adjacentPoint)
adjacentPoint - Adjacent point to test.
public boolean isAdjacentPointIndex(int adjacentPoint)
adjacentPoint - Adjacent point index.
public void setToCentroidOfAdjacentPoints()
public java.lang.String toString()
toString in class Point3Dpublic java.util.Vector<ModelObject> childModelObjects()
childModelObjects in interface ModelObjectchildModelObjects in class Point3Dpublic int[] adjacentPointIDs()
public java.sql.PreparedStatement databaseInsertStatement(java.sql.Connection connection,
int modelID)
throws java.sql.SQLException
databaseInsertStatement in interface ModelObjectdatabaseInsertStatement in class Point3Dconnection - Database connection.modelID - Model ID.
java.sql.SQLException - Thrown if an SQL exception occurs.
public java.sql.PreparedStatement databaseUpdateStatement(java.sql.Connection connection,
int modelID)
throws java.sql.SQLException
databaseUpdateStatement in interface ModelObjectdatabaseUpdateStatement in class Point3Dconnection - Database connection.modelID - Model ID.
java.sql.SQLException - Thrown if an SQL exception occurs.
public ModelObject fromDatabase(java.sql.Connection connection,
Model model,
int modelID,
int objectID)
throws java.sql.SQLException
fromDatabase in interface ModelObjectfromDatabase in class Point3Dconnection - Database connection.modelID - Model ID.objectID - Object ID in associated ModelObjects table.model - Model built from database.
java.sql.SQLException - Thrown if an SQL exception occurs.
public org.w3c.dom.Element toXMLNode(org.w3c.dom.Document document,
org.w3c.dom.Element documentRootNode)
throws InvalidObjectException
toXMLNode in interface ModelObjecttoXMLNode in class Point3Ddocument - XML document.documentRootNode - Document root node.
InvalidObjectException - Thrown if this object's ID is equal to the default ID of -1.
public ModelObject fromXMLNode(org.w3c.dom.Document document,
org.w3c.dom.Node documentRootNode,
org.w3c.dom.Node node,
Model model)
throws InvalidObjectException
fromXMLNode in interface ModelObjectfromXMLNode in class Point3Ddocument - XML document.documentRootNode - Document root node; ie Model node.node - XML node.model - The model to which the returned object is associated.
InvalidObjectException - Thrown if an error occurred building the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||