|
||||||||||
| 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.points.Point3DSet
public class Point3DSet
Title: Point3DSet - models a set of 3D points.
Description: Models a collection of 3D points. Internally stores the points as a vector.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software.
| Field Summary | |
|---|---|
protected java.util.Vector<Point3D> |
mPoints
Point set. |
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
Point3DSet()
Default constructor. |
|
Point3DSet(java.util.ArrayList<Point3D> points)
Constructor. |
|
Point3DSet(ID id)
Constructor. |
|
Point3DSet(Point3D point)
Constructor. |
|
Point3DSet(Point3D[] points)
Constructor. |
|
Point3DSet(Point3DSet object)
Copy constructor. |
|
Point3DSet(java.lang.String name)
Constructor. |
|
Point3DSet(java.lang.String name,
ID id)
Constructor. |
|
Point3DSet(java.util.Vector<Point3D> points)
Constructor. |
|
Point3DSet(VectorOpt<Point3D> points)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
add(Point3D p,
boolean performCheck,
double tolerance)
Adds the specified point to this point set. |
AxisAlignedBox3D |
boundingBox()
Returns the axis aligned bounding box of this point set. |
Sphere3D |
boundingBoxEnclosingSphere()
Returns the circle that encloses the bounding box of this point set. |
Sphere3D |
boundingCentroidSphere()
Returns the bounding sphere centred at the point set centroid and radius sufficient to enclose all points. |
Point3D |
centroid()
Returns the centroid of this point set. |
java.util.Vector<ModelObject> |
childModelObjects()
Returns a vector of this object's child ModelObject objects. |
void |
clear()
Clears this point by emptying the vector of points. |
boolean |
contains(Point3D p,
double tolerance)
Tests whether or not the specified point (within the specified tolerance) is contained within this point set. |
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. |
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. |
Point3D |
getPoint(int index)
Returns the point having the specified index. |
java.util.Vector<Point3D> |
getPoints()
Returns the point set points vector. |
boolean |
is2D()
Tests whether or not this object is a 2D obect; ie false. |
boolean |
is3D()
Tests whether or not this object is a 3D obect; ie true. |
boolean |
isCurve()
Tests whether or not this object is a curve; ie false. |
boolean |
isEmpty()
Tests whether or not this point set is empty. |
boolean |
isGrid()
Tests whether or not this object is a grid; ie false. |
boolean |
isMember(Point3D p,
double tolerance)
Tests whether or not the specified point is a member of this set. |
boolean |
isMesh()
Tests whether or not this object is a mesh; ie false. |
boolean |
isParallelToCoordinatePlane(int plane,
double tolerance)
Tests whether or not a point set is parallel or lies in one of the three coordinate planes. |
boolean |
isPoint()
Tests whether or not this object is a point; ie false. |
boolean |
isPointIndex(int index)
Tests whether or not the specified index is a valid index of the underlying vector. |
boolean |
isPointSet()
Tests whether or not this object is a point set; ie true. |
boolean |
isShape()
Tests whether or not this object is a shape; ie false. |
boolean |
isSurface()
Tests whether or not this object is a surface; ie false. |
PairPQ<Point3D,HDouble> |
minEnclosingSphere(double tolerance)
Returns the minimum area circle containing this point set. |
Point3D |
nearestPoint(Point3D p)
Returns the set point nearest to the specified point, which can be any point and is assumed not to be a point of this set. |
Point3D |
nearestPointToSetPoint(Point3D p,
double tolerance)
Returns the set point nearest to the specified point, other than p itself. |
int |
numberPoints()
Returns the number of points in this set. |
int[] |
pointIDs()
Returns an array of this object's point IDs. |
boolean |
remove(int index)
Removes from this point set the point with the specified index. |
boolean |
remove(Point3D p)
Removes the specified point from this point set. |
boolean |
samePointSet(Point3DSet pset,
double tolerance)
Tests if two point sets are equivalent; ie both sets are of the same size and all points of one set exist in the other. |
void |
setPoint(Point3D p,
int index)
Sets the point at the specified index to the new point p. |
void |
setPoints(java.util.Vector<Point3D> points)
Sets the points vector. |
int |
size()
Returns the number of points in this set. |
java.lang.String |
toString()
Returns a String representation of a Point3DSet object. |
X3DNode |
toX3DNode(X3DObject x3dObject)
X3D support. |
org.w3c.dom.Element |
toXMLNode(org.w3c.dom.Document document,
org.w3c.dom.Element doucmentRootNode)
Returns the xml node of this object. |
| Methods inherited from class com.hedgehog.geo.GeometricObject |
|---|
objectDimension |
| Methods inherited from class com.hedgehog.HObject |
|---|
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Vector<Point3D> mPoints
| Constructor Detail |
|---|
public Point3DSet()
public Point3DSet(java.util.Vector<Point3D> points)
points - Vector of points.public Point3DSet(java.util.ArrayList<Point3D> points)
points - Vector of points.public Point3DSet(VectorOpt<Point3D> points)
points - Vector of points.public Point3DSet(Point3D[] points)
points - Vector of points.public Point3DSet(Point3D point)
point - Point to intialise a point set.public Point3DSet(java.lang.String name)
name - Point set name.public Point3DSet(ID id)
id - Point set ID.
public Point3DSet(java.lang.String name,
ID id)
name - Point set name.id - Point set ID.public Point3DSet(Point3DSet object)
object - Object to copy.| Method Detail |
|---|
public boolean add(Point3D p,
boolean performCheck,
double tolerance)
p - Point to add.performCheck - Specifies whether or not to check that p is not already a member of this set.tolerance - Required tolerance.
public AxisAlignedBox3D boundingBox()
public Sphere3D boundingBoxEnclosingSphere()
public Sphere3D boundingCentroidSphere()
public Point3D centroid()
public void clear()
public boolean contains(Point3D p,
double tolerance)
p - Point to test.tolerance - Required tolerance.
public Point3D getPoint(int index)
throws java.lang.IllegalArgumentException
index - Index into this point set vector.
java.lang.IllegalArgumentException - Thrown if index if out of range.public java.util.Vector<Point3D> getPoints()
public void setPoints(java.util.Vector<Point3D> points)
points - New points vector.public boolean isPointIndex(int index)
index - Index to test.
public boolean remove(int index)
index - point index.
public boolean remove(Point3D p)
p - Point to remove.
public void setPoint(Point3D p,
int index)
throws java.lang.IllegalArgumentException
p - New point p.index - Set index.
java.lang.IllegalArgumentException - Thrown if index is out of range.
public boolean samePointSet(Point3DSet pset,
double tolerance)
pset - Point set to compare against this point set.tolerance - Required tolerance.
public int numberPoints()
public int size()
public boolean isEmpty()
public boolean isMember(Point3D p,
double tolerance)
p - Point to test.tolerance - Required tolerance.
public PairPQ<Point3D,HDouble> minEnclosingSphere(double tolerance)
tolerance - Required tolerance.
MinSphere3Dpublic Point3D nearestPoint(Point3D p)
p - Point.
PointBackgroundGrid3D,
KDTreePoint3D
public Point3D nearestPointToSetPoint(Point3D p,
double tolerance)
throws java.lang.IllegalArgumentException
p - Set point.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if p is not a member of this set.public int[] pointIDs()
public boolean isParallelToCoordinatePlane(int plane,
double tolerance)
throws java.lang.IllegalArgumentException
plane - Indicates the type of coordinate plane: CoordinatePlaneType.XY_PLANE, CoordinatePlaneType.YZ or CoordinatePlaneType.XZ.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if the specified plane is not CoordinatePlaneType.XY_PLANE, CoordinatePlaneType.YZ or CoordinatePlaneType.XZ.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean is2D()
is2D in class GeometricObjectpublic boolean is3D()
is3D in class GeometricObjectpublic boolean isPoint()
isPoint in class GeometricObjectpublic boolean isPointSet()
isPointSet in class GeometricObjectpublic boolean isCurve()
isCurve in class GeometricObjectpublic boolean isGrid()
isGrid in class GeometricObjectpublic boolean isMesh()
isMesh in class GeometricObjectpublic boolean isSurface()
isSurface in class GeometricObjectpublic boolean isShape()
isShape in class GeometricObjectpublic java.util.Vector<ModelObject> childModelObjects()
childModelObjects in interface ModelObject
public java.sql.PreparedStatement databaseInsertStatement(java.sql.Connection connection,
int modelID)
throws java.sql.SQLException
databaseInsertStatement in interface ModelObjectconnection - 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 ModelObjectconnection - Database connection.modelID - Model ID.
java.sql.SQLException - Thrown if an SQL exception occurs.
public org.w3c.dom.Element toXMLNode(org.w3c.dom.Document document,
org.w3c.dom.Element doucmentRootNode)
throws InvalidObjectException
toXMLNode in interface ModelObjectdocument - XML document.doucmentRootNode - 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 ModelObjectdocument - XML document.documentRootNode - Document root node; ie Model node.node - XML node.model - Model to which the object is added.
InvalidObjectException - Thrown if an error occurred building the object.
public ModelObject fromDatabase(java.sql.Connection connection,
Model model,
int modelID,
int objectID)
throws java.sql.SQLException
fromDatabase in interface ModelObjectconnection - 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 X3DNode toX3DNode(X3DObject x3dObject)
throws InvalidObjectException
toX3DNode in interface ModelObjectx3dObject - X3D object.
InvalidObjectException - Thrown if this object is invalid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||