Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- addFace(Face3D)
- face(int)
- size()
- center()
- translateXYZ(double, double, double)
- rotateX(double)
- rotateY(double)
- rotateZ(double)
- moveTo(Point3D)
- moveTo(double, double, double)
- intersection(Line3D, List)
- intersection_with_faces(Line3D, List, List)
- intersectionRay(Line3D, List)
- intersectionSegment(Line3D, List)
- hasIntersection(Line3D)
- hasIntersectionRay(Line3D)
- hasIntersectionSegment(Line3D)
- show()
- toString()
- box(double, double, double)
- getMeshFXML()
Class Shape3D
java.lang.Object
org.jlab.geom.prim.Shape3D
- All Implemented Interfaces:
Transformable
,Showable
A collection of
Face3D
objects.
Faces can be added and retrieved via
addFace(org.jlab.geom.prim.Face3D)
and face(int)
.
The center of the shape can be calculated via center()
, which
returns the geometric mean of all of the points of all the faces contained
in this shape.
The moveTo(org.jlab.geom.prim.Point3D)
method translates this
shape so that its center is at the given point.
- Author:
- gavalian
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given face to this shape.static Shape3D
box
(double xd, double yd, double zd) center()
Constructs a point center of the shape.face
(int index) Returns the face corresponding to the given index.boolean
hasIntersection
(Line3D line) Returns true if the infinite line intersects this shape.boolean
hasIntersectionRay
(Line3D line) Returns true if the ray intersects this shape.boolean
hasIntersectionSegment
(Line3D line) Returns true if the line segment intersects this shape.int
intersection
(Line3D line, List<Point3D> intersections) Finds intersections of the given infinite line with this shape.int
Finds intersections of the given infinite line with this shape.int
intersectionRay
(Line3D line, List<Point3D> intersections) Finds intersections of the given ray with this shape.int
intersectionSegment
(Line3D line, List<Point3D> intersections) Finds intersections of the given line segment with this shape.void
moveTo
(double x, double y, double z) Translates this shape so that it's geometric center coincides with the given point at the given coordinates.void
Translates this shape so that it's geometric center coincides with the given point.void
rotateX
(double angle) Rotates this object clockwise around the x axis.void
rotateY
(double angle) Rotates this object clockwise around the y axis.void
rotateZ
(double angle) Rotates this object clockwise around the z axis.void
show()
InvokesSystem.out.println(this)
.int
size()
Returns the number of faces in this shape.toString()
void
translateXYZ
(double x, double y, double z) Translates this object linearly by the amounts specified.
-
Constructor Details
-
Method Details
-
addFace
Adds the given face to this shape. If the face is subsequently modified, this shape will also be modified.- Parameters:
face
- the face to add
-
face
Returns the face corresponding to the given index.- Parameters:
index
- the index of the face to get- Returns:
- the face at the corresponding index or null if there is no such face
-
size
public int size()Returns the number of faces in this shape.- Returns:
- the number of faces in this shape
-
center
Constructs a point center of the shape. This point is at the geometric mean of every point in every face of the shape.- Returns:
- a point at the geometric center of the shape, or a point at the origin if the shape has no faces
-
translateXYZ
public void translateXYZ(double x, double y, double z) Description copied from interface:Transformable
Translates this object linearly by the amounts specified.- Specified by:
translateXYZ
in interfaceTransformable
- Parameters:
x
- amount to translate along the x axisy
- amount to translate along the y axisz
- amount to translate along the z axis
-
rotateX
public void rotateX(double angle) Description copied from interface:Transformable
Rotates this object clockwise around the x axis.- Specified by:
rotateX
in interfaceTransformable
- Parameters:
angle
- rotation angle in radians
-
rotateY
public void rotateY(double angle) Description copied from interface:Transformable
Rotates this object clockwise around the y axis.- Specified by:
rotateY
in interfaceTransformable
- Parameters:
angle
- rotation angle in radians
-
rotateZ
public void rotateZ(double angle) Description copied from interface:Transformable
Rotates this object clockwise around the z axis.- Specified by:
rotateZ
in interfaceTransformable
- Parameters:
angle
- rotation angle in radians
-
moveTo
Translates this shape so that it's geometric center coincides with the given point.- Parameters:
point
- the new position of the shape's center
-
moveTo
public void moveTo(double x, double y, double z) Translates this shape so that it's geometric center coincides with the given point at the given coordinates.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinate
-
intersection
Finds intersections of the given infinite line with this shape. Intersection points will be appended to the given list.- Parameters:
line
- the infinite lineintersections
- the list of intersections- Returns:
- the number of intersections that were found
-
intersection_with_faces
Finds intersections of the given infinite line with this shape. Intersection points will be appended to the given list.- Parameters:
line
- the infinite lineintersections
- the list of intersections- Returns:
- the number of intersections that were found
-
intersectionRay
Finds intersections of the given ray with this shape. Intersection points will be appended to the given list.- Parameters:
line
- the rayintersections
- the list of intersections- Returns:
- the number of intersections that were found
-
intersectionSegment
Finds intersections of the given line segment with this shape. Intersection points will be appended to the given list.- Parameters:
line
- the line segmentintersections
- the list of intersections- Returns:
- the number of intersections that were found
-
hasIntersection
Returns true if the infinite line intersects this shape.- Parameters:
line
- the infinite line- Returns:
- true if the line intersects the shape
-
hasIntersectionRay
Returns true if the ray intersects this shape.- Parameters:
line
- the ray- Returns:
- true if the line intersects the shape
-
hasIntersectionSegment
Returns true if the line segment intersects this shape.- Parameters:
line
- the line segment- Returns:
- true if the line intersects the shape
-
show
-
toString
-
box
-
getMeshFXML
-