|
||||||||||
| 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.twod.IndexObject2D
com.hedgehog.geo.twod.IndexPointObject2D
com.hedgehog.geo.twod.points.IndexPoint2DSet
public class IndexPoint2DSet
Title: IndexPoint2DSet - a set of index points.
Description: Models a collection of 2D index-points. Internally stores the points as a vector of integer indices.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software.
| Field Summary | |
|---|---|
protected IntegerVector |
mPointIndices
Point set point indices vector. |
| Fields inherited from class com.hedgehog.geo.twod.IndexPointObject2D |
|---|
mPoints |
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
IndexPoint2DSet()
Default constructor. |
|
IndexPoint2DSet(ID id)
Constructor. |
|
IndexPoint2DSet(IndexPoint2DSet object)
Copy constructor. |
|
IndexPoint2DSet(Point2DSet pset)
Constructor. |
|
IndexPoint2DSet(Point2DSet pset,
IntegerVector pointIndices)
Constructor. |
|
IndexPoint2DSet(java.lang.String name)
Constructor. |
|
IndexPoint2DSet(java.lang.String name,
ID id)
Constructor. |
|
IndexPoint2DSet(java.util.Vector<Point2D> points)
Constructor. |
|
IndexPoint2DSet(java.util.Vector<Point2D> points,
int pointIndex)
Constructor. |
|
IndexPoint2DSet(java.util.Vector<Point2D> points,
IntegerVector pointIndices)
Constructor. |
|
IndexPoint2DSet(java.util.Vector<Point2D> points,
java.util.Vector<IndexPoint2D> indexPoints)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
add(int pointIndex,
boolean performCheck)
Adds the specified point index to this set. |
AxisAlignedBox2D |
boundingBox()
Returns the axis aligned bounding box of this point set. |
java.util.Vector<ModelObject> |
childModelObjects()
Returns a vector of this object's child ModelObject objects. |
void |
clear()
Clears the mPointIndices vector, thus emptying this set. |
ConvexStraightEdgePolygon2D |
convexHull(ConvexHullMethod hullMethod)
Returns the convex hull of this index-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. |
Point2D |
getPoint(int pointIndex)
Returns the actual point with the specified index. |
int |
getPointIndex(int i)
Returns the point index at the specified index in the mPointIndices vector. |
IntegerVector |
getPointIndices()
Returns the set's vector of point indices. |
boolean |
isEmpty()
Tests whether ro not this set is empty. |
boolean |
isMember(int pointIndex)
Tests whether or not the specified point index is a member of this set. |
int |
nearestPoint(IndexPoint2D p)
Returns the set point nearest to the specified index-point, which can be any point and is assumed not to be a point of this set. |
int |
nearestPoint(Point2D 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. |
int |
nearestPointToSetPoint(int pointIndex)
Returns the set point index neareat to the set point having the specified index, other than this point itself. |
int |
numberPoints()
Returns the number of points in this set. |
boolean |
remove(int pointIndex)
Remoces the specified point index from this set. |
boolean |
replacePointIndex(int oldPointIndex,
int newPointIndex)
Replaces the point index oldPointIndex with newPointIndex. |
void |
setPointIndices(IntegerVector pointIndices)
Sets the vector of point indices. |
Point2DSet |
toPoint2DSet()
Returns a Point2DSet equivalent of this object. |
java.lang.String |
toString()
Returns a String representation of a IndexPoint2DSet object. |
X3DNode |
toX3DNode(X3DObject x3dObject)
X3D support. |
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.twod.IndexPointObject2D |
|---|
getPoints, getPointsVector, isCurve, isGrid, isMesh, isPoint, isPointSet, isShape, isSurface, isValid, isValidIndex, maxPointIndex, minPointIndex, setPoints, threeNonCollinearPoints |
| Methods inherited from class com.hedgehog.geo.twod.IndexObject2D |
|---|
is2D, is3D |
| 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 IntegerVector mPointIndices
| Constructor Detail |
|---|
public IndexPoint2DSet()
public IndexPoint2DSet(Point2DSet pset)
throws java.lang.IllegalArgumentException
pset - Underlying Point2DSet object of points.
java.lang.IllegalArgumentException - Thrown if points is null.
public IndexPoint2DSet(Point2DSet pset,
IntegerVector pointIndices)
throws java.lang.IllegalArgumentException
pset - Underlying Point2DSet object of points.pointIndices - Vector of point indices.
java.lang.IllegalArgumentException - Thrown if pset is null, pointIndices is null or any point index is out of range.
public IndexPoint2DSet(java.util.Vector<Point2D> points)
throws java.lang.IllegalArgumentException
points - Vector of points.
java.lang.IllegalArgumentException - Thrown if points is null.
public IndexPoint2DSet(java.util.Vector<Point2D> points,
IntegerVector pointIndices)
throws java.lang.IllegalArgumentException
points - Vector of points.pointIndices - Vector of point indices.
java.lang.IllegalArgumentException - Thrown if points is null, pointIndices is null or any point index is out of range.
public IndexPoint2DSet(java.util.Vector<Point2D> points,
java.util.Vector<IndexPoint2D> indexPoints)
points - The points vector.indexPoints - Vector of IndexPoint2D objects.
public IndexPoint2DSet(java.util.Vector<Point2D> points,
int pointIndex)
points - Points vector.pointIndex - Index of point used to initialise this point set.public IndexPoint2DSet(java.lang.String name)
name - Point set name.public IndexPoint2DSet(ID id)
id - Point set ID.
public IndexPoint2DSet(java.lang.String name,
ID id)
name - Point set name.id - Point set ID.public IndexPoint2DSet(IndexPoint2DSet object)
object - Object to copy.| Method Detail |
|---|
public boolean add(int pointIndex,
boolean performCheck)
pointIndex - Point index.performCheck - Specifies whether or not tp perform checks when adding the point-index.
public AxisAlignedBox2D boundingBox()
public void clear()
public ConvexStraightEdgePolygon2D convexHull(ConvexHullMethod hullMethod)
throws java.lang.IllegalArgumentException
hullMethod - Method used to generate the hull.
java.lang.IllegalArgumentException - Thrown if hullMethod is invalid.public boolean isMember(int pointIndex)
pointIndex - Point index to test.
public int numberPoints()
numberPoints in class IndexPointObject2Dpublic boolean isEmpty()
public IntegerVector getPointIndices()
public int getPointIndex(int i)
i - Index into mPointIndices vector.
public void setPointIndices(IntegerVector pointIndices)
throws java.lang.IllegalArgumentException
pointIndices - New vector of point indices.
java.lang.IllegalArgumentException - Thrown if any of the specified point indices are out of range.public int nearestPoint(IndexPoint2D p)
p - Index point.
public int nearestPoint(Point2D p)
p - Point.
public int nearestPointToSetPoint(int pointIndex)
throws java.lang.IllegalArgumentException
pointIndex - Set point index.
java.lang.IllegalArgumentException - Thrown if p is not a member of this set.
public boolean replacePointIndex(int oldPointIndex,
int newPointIndex)
oldPointIndex - Old point index.newPointIndex - New point index.
public boolean remove(int pointIndex)
pointIndex - Point index to remove.
public Point2D getPoint(int pointIndex)
throws java.lang.IllegalArgumentException
pointIndex - Point index.
java.lang.IllegalArgumentException - Thrown if the specified point index is not an index of this set.public java.lang.String toString()
toString in class java.lang.Objectpublic Point2DSet toPoint2DSet()
public 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 documentRootNode)
throws InvalidObjectException
toXMLNode in interface ModelObjectdocument - 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 ModelObjectdocument - 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.
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 | |||||||||