|
||||||||||
| 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.shapes.Shape3D
com.hedgehog.geo.threed.shapes.PlanarCircle3D
public class PlanarCircle3D
Title: PlanarCircle3D - models a circle lying within a 3D plane.
Description: Models a circle lying in a 3D plane.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software
| Field Summary | |
|---|---|
protected Point3D |
mCentre
Circle centre. |
protected Plane3D |
mPlane
Circle plane. |
protected double |
mRadius
Circle radius. |
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
PlanarCircle3D()
Default constructor. |
|
PlanarCircle3D(ID id)
Constructor. |
|
PlanarCircle3D(PlanarCircle3D object)
Copy constructor. |
|
PlanarCircle3D(Point3D centre,
double radius,
Plane3D plane)
Constructor. |
|
PlanarCircle3D(Point3D centre,
double radius,
Plane3D plane,
java.lang.String name,
ID id)
Constructor. |
|
PlanarCircle3D(Point3D p1,
Point3D p2,
Point3D p3,
double tolerance)
Constructor. |
|
PlanarCircle3D(java.lang.String name)
Constructor. |
|
PlanarCircle3D(java.lang.String name,
ID id)
Constructor. |
|
PlanarCircle3D(Vector3D n,
double d,
Point3D centre,
double radius)
Constructor. |
|
| Method Summary | |
|---|---|
double |
area()
Returns the surface area of this circle; ie pir^2. |
AxisAlignedBox3D |
boundingBox()
Returns the axis-aligned bounding of this planar circle. |
Point3D |
centroid()
Returns the centroid of this circle; ie the centre. |
java.util.Vector<ModelObject> |
childModelObjects()
Returns a vector of this object's child ModelObject objects. |
double |
circumference()
Returns the circumference; ie 2pir. |
PolyStraightLine3D |
circumferencePolyStraightLine3D(int numberPoints,
Point3D p,
double tolerance)
Returns a poly-straight-line representation of a circle. |
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 |
getCentre()
Returns the circle centre. |
Plane3D |
getPlane()
Returns the circle plane. |
double |
getRadius()
Returns the circle radius. |
java.util.Vector<Point3D> |
intersection(InfiniteStraightLine3D line,
double tolerance)
Tests for intersection points between this plane circle and the specified infinite straight line. |
java.util.Vector<Point3D> |
intersection(PlanarCircle3D circle,
double tolerance)
Returns the intersection point(s), if any, between two planar circles. |
java.util.Vector<Point3D> |
intersection(Ray3D ray,
double tolerance)
Tests for intersection points between this plane circle and the specified ray. |
java.util.Vector<Point3D> |
intersection(StraightLine3D line,
double tolerance)
Returns the point/s of intersection between a planar circle and a straight line. |
boolean |
isSamePlane(PlanarCircle3D circle,
double tolerance)
Tests whether or not the specified planar circle has the same plane as this circle. |
boolean |
localAxes(Vector3D lx,
Vector3D ly,
Vector3D lz,
boolean normalise)
Returns a set of local axes for this planar circle. |
double |
perimeter()
Returns the perimeter; ie the circumference. |
Vector3D |
planeNormal(boolean unitNormal)
Returns this circle's plane normal. |
boolean |
pointInside(Point3D p,
double tolerance)
Tests whether or not the specified point is inside (not including the circumference) this circle. |
Point3D |
pointOnCircle(double theta,
boolean degrees,
double tolerance,
Vector3D Ip,
Vector3D Jq)
Returns the point on a circle corresponding to the angle theta (0<=theta<=2pi radians) measured from the local Ip and Jq axes. |
boolean |
pointOnCirclePlane(Point3D p,
double tolerance)
Tests whether or not the specified point lies on this circle's plane. |
boolean |
pointOnCircumference(Point3D p,
double tolerance)
Tests whether or not the specified point is on the circumference of this circle. |
boolean |
pointOnSurface(Point3D p,
double tolerance)
Tests whether or not the specified point is on the surface of this circle; ie on the same plane and either inside or on the crcumference. |
java.util.Vector<Point3D> |
pointsOnCircle(int numberPoints,
Point3D p,
double tolerance)
Returns a vector of evenly spaced points on this circle. |
Point3D |
randomPointOnCircumference(double tolerance)
Returns a random point on this circle's circumference. |
java.util.Vector<Point3D> |
randomPointsOnCircumference(int numberPoints,
double tolerance)
Returns a vector of random points on this circle's circumference. |
Shape3D |
rotate(double theta,
double beta,
double gamma,
Point3D fixedPoint,
boolean degrees)
Rotates this shape by the specified angles. |
Shape3D |
scale(double s,
Point3D fixedPoint)
Scales this circle about the specified fixed poiint or global origin. |
void |
setCentre(Point3D centre)
Sets the circle centre. |
void |
setPlane(Plane3D plane)
Sets the circle plane. |
void |
setRadius(double radius)
Sets the circle radius. |
Circle2D |
toCircle2D()
Returns a 2D equivalent of this Circle3D object. |
java.lang.String |
toString()
Returns a String representation of an Circle2D 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. |
Shape3D |
translate(double tx,
double ty,
double tz)
Translates this shape by the specified vector (tx,ty,tz). |
double |
volume()
Returns the volume of this shape. |
| Methods inherited from class com.hedgehog.geo.threed.shapes.Shape3D |
|---|
is2D, is3D, isCurve, isGrid, isMesh, isPoint, isPointSet, isShape, isSurface, pointInsideOrOnSurface, pointOutside |
| 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 Point3D mCentre
protected double mRadius
protected Plane3D mPlane
| Constructor Detail |
|---|
public PlanarCircle3D()
public PlanarCircle3D(java.lang.String name)
name - Object name.public PlanarCircle3D(ID id)
id - Object ID.
public PlanarCircle3D(java.lang.String name,
ID id)
name - Object name.id - Object ID.
public PlanarCircle3D(Point3D centre,
double radius,
Plane3D plane)
centre - Circle centre.radius - Circle radius.plane - Circle plane.
public PlanarCircle3D(Point3D centre,
double radius,
Plane3D plane,
java.lang.String name,
ID id)
centre - Circle centre.radius - Circle radius.plane - Circle plane.name - Object name.id - Objetc ID.
public PlanarCircle3D(Vector3D n,
double d,
Point3D centre,
double radius)
n - Plane normal.d - Plane distance to oriign.centre - Circle centre.radius - Circle radius.
public PlanarCircle3D(Point3D p1,
Point3D p2,
Point3D p3,
double tolerance)
throws java.lang.IllegalArgumentException
p1 - Point 1.p2 - Point 2.p3 - Point 3.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if the three points are collinear/coincident.public PlanarCircle3D(PlanarCircle3D object)
object - Object to copy.| Method Detail |
|---|
public Point3D getCentre()
public double getRadius()
public Plane3D getPlane()
public void setCentre(Point3D centre)
throws java.lang.IllegalArgumentException
centre - New circle centre.
java.lang.IllegalArgumentException - Thrown if centre is null.
public void setRadius(double radius)
throws java.lang.IllegalArgumentException
radius - New circle radius.
java.lang.IllegalArgumentException - Thrown if radius<0.0.
public void setPlane(Plane3D plane)
throws java.lang.IllegalArgumentException
plane - New circle plane.
java.lang.IllegalArgumentException - Thrown if plane is null.public Vector3D planeNormal(boolean unitNormal)
unitNormal - Specifies whether or not the returned vector is to be normalised.
public boolean pointOnCirclePlane(Point3D p,
double tolerance)
p - point to test.tolerance - Required tolerance.
public boolean isSamePlane(PlanarCircle3D circle,
double tolerance)
circle - Circle to compare.tolerance - Required tolerance.
public Point3D pointOnCircle(double theta,
boolean degrees,
double tolerance,
Vector3D Ip,
Vector3D Jq)
throws java.lang.IllegalArgumentException
theta - Angle or rotation in radians measured in counterclockwise direction from Ip.degrees - Specifies whether or not theta is in radians or degrees.tolerance - Required tolerance.Ip - Local x-axis.Jq - Local y-axis.
java.lang.IllegalArgumentException - Thrown if theta is out of range [0:2pi] or if either Ip or Jq are not within the base circle plane.
public boolean localAxes(Vector3D lx,
Vector3D ly,
Vector3D lz,
boolean normalise)
lx - Set to the local x'-axis.ly - Set to the local y'-axis.lz - Set to the local z'-axis.normalise - Specifies whether or not the returned axes are normalised.
public java.util.Vector<Point3D> intersection(Ray3D ray,
double tolerance)
throws java.lang.IllegalArgumentException
ray - Ray to test for intersections.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if ray is null.
public java.util.Vector<Point3D> intersection(InfiniteStraightLine3D line,
double tolerance)
throws java.lang.IllegalArgumentException
line - Infinite straight line to test for intersections.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if line is null.
public java.util.Vector<Point3D> intersection(StraightLine3D line,
double tolerance)
throws java.lang.IllegalArgumentException
line - Straight line to test for intersection with this planar circle.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if line is null.
public java.util.Vector<Point3D> intersection(PlanarCircle3D circle,
double tolerance)
throws java.lang.IllegalArgumentException
circle - Other circle to test for intersection.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if circle is null.
public Point3D randomPointOnCircumference(double tolerance)
throws InvalidObjectException
tolerance - Required tolerance.
InvalidObjectException - Thrown if internal problem generating local x'-axis in circle plane.
public java.util.Vector<Point3D> randomPointsOnCircumference(int numberPoints,
double tolerance)
throws java.lang.IllegalArgumentException
numberPoints - Number of points.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if numberPoints<=0.
public java.util.Vector<Point3D> pointsOnCircle(int numberPoints,
Point3D p,
double tolerance)
throws java.lang.IllegalArgumentException
numberPoints - Number of points.p - Start point from which other points are generated. If null then a random point on the circumference is selected.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if numberPoints<=0 or p (if not null) does not lies on this circle's circumference.public Circle2D toCircle2D()
public java.lang.String toString()
toString in class java.lang.Object
public PolyStraightLine3D circumferencePolyStraightLine3D(int numberPoints,
Point3D p,
double tolerance)
throws java.lang.IllegalArgumentException
numberPoints - The number of points on the polyline.p - Start point. Must be on the circle circumference.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if p is not on the circle circumference.
public boolean pointOnCircumference(Point3D p,
double tolerance)
p - Point to test.tolerance - Required tolerance.
public double perimeter()
public double circumference()
public double area()
area in class Shape3Dpublic AxisAlignedBox3D boundingBox()
boundingBox in class Shape3Dpublic Point3D centroid()
centroid in class Shape3D
public boolean pointInside(Point3D p,
double tolerance)
pointInside in class Shape3Dp - Point to test.tolerance - Required tolerance.
public boolean pointOnSurface(Point3D p,
double tolerance)
pointOnSurface in class Shape3Dp - Point to test.tolerance - Required tolerance.
public Shape3D rotate(double theta,
double beta,
double gamma,
Point3D fixedPoint,
boolean degrees)
throws java.lang.IllegalArgumentException
rotate in class Shape3Dtheta - Angle about x-axis; in range [0:360] degrees or [0:2pi] radians.beta - Angle about y-axis; in range [0:360] degrees or [0:2pi] radians.gamma - Angle about z-axis; in range [0:360] degrees or [0:2pi] radians.fixedPoint - Rotationa fixed point or global origin is null.degrees - Specifies whether or not the anhles are in degrees or radians.
java.lang.IllegalArgumentException - Thrown if angles are out of range.
public Shape3D scale(double s,
Point3D fixedPoint)
scale in class Shape3Ds - Scalaing factor.fixedPoint - Scaling fixed point or global origin if null.
public Shape3D translate(double tx,
double ty,
double tz)
translate in class Shape3Dtx - Translation in x-direction.ty - Translation in y-direction.tz - Translation in z-direction.
public double volume()
volume in class Shape3Dpublic 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 - Douument 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 node 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 | |||||||||