- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- getComponentId()
- getNumVolumePoints()
- getVolumePoint(int)
- getNumVolumeEdges()
- getVolumeEdge(int)
- getVolumeShape()
- getVolumeCrossSection(Transformation3D)
- getVolumeIntersection(Line3D, Point3D, Point3D)
- getMidpoint()
- getLength()
- getLineX()
- getLineY()
- getLineZ()
- getType()
- show()
- translateXYZ(double, double, double)
- rotateX(double)
- rotateY(double)
- rotateZ(double)
- getVolumeMesh()
- init(String, double...)
Class MeshComponent
- All Implemented Interfaces:
Component
,Transformable
,Showable
- Direct Known Subclasses:
ScintillatorMesh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the component's id number.double
Returns the length of this component.getLineX()
getLineY()
getLineZ()
Returns the midpoint of this component.int
Returns the number of edges between the points that define thevolume
.int
Returns the number of points that define thevolume
.getType()
Returns a string that identifies the specific subtype of this component.getVolumeCrossSection
(Transformation3D transformation) Returns the cross section of a plane through the the component'svolume
as a list of lines in the xy-plane.getVolumeEdge
(int e) Returns the edge on thevolume
with the specified index.boolean
getVolumeIntersection
(Line3D line, Point3D inIntersect, Point3D outIntersect) Returns true if the given line segment intersect thevolume-shape
twice (one incoming intersection and one out going) and stores the incoming and outgoing intersection points are stored in the first and second Point3D objects given as arguments respectively.getVolumePoint
(int p) Returns the point on thevolume
with the specified index.Returns the volume of the component.void
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)
.void
translateXYZ
(double dx, double dy, double dz) Translates this object linearly by the amounts specified.
-
Constructor Details
-
Method Details
-
getComponentId
public int getComponentId()Description copied from interface:Component
Returns the component's id number.- Specified by:
getComponentId
in interfaceComponent
- Returns:
- the id
-
getNumVolumePoints
public int getNumVolumePoints()Description copied from interface:Component
Returns the number of points that define thevolume
.- Specified by:
getNumVolumePoints
in interfaceComponent
- Returns:
- the number of volume points
-
getVolumePoint
Description copied from interface:Component
Returns the point on thevolume
with the specified index.- Specified by:
getVolumePoint
in interfaceComponent
- Parameters:
p
- the index of the point- Returns:
- the point on the volume
-
getNumVolumeEdges
public int getNumVolumeEdges()Description copied from interface:Component
Returns the number of edges between the points that define thevolume
.- Specified by:
getNumVolumeEdges
in interfaceComponent
- Returns:
- the number of volume edges
-
getVolumeEdge
Description copied from interface:Component
Returns the edge on thevolume
with the specified index.Though edges are returned as
Line3D
objects and a majority components have edges which are all straight line segments, edges are not required to be straight lines. The edge may, in reality, be curved, in which case the returnedLine3D
is merely storing the two points bounding a curved path segment. Thus, special care must be taken to ensure that the edge is in fact a straight line segment if one intends to use it as such.- Specified by:
getVolumeEdge
in interfaceComponent
- Parameters:
e
- the index of the edge- Returns:
- the edge on the volume
-
getVolumeShape
Description copied from interface:Component
Returns the volume of the component.A volume is represented by a
Shape3D
object which contains a list of triangularFace3D
objects. This these triangles bound a closed closed volume.- Specified by:
getVolumeShape
in interfaceComponent
- Returns:
- the volume
-
getVolumeCrossSection
Description copied from interface:Component
Returns the cross section of a plane through the the component'svolume
as a list of lines in the xy-plane.This method takes a Transformation3D object as an argument, then constructs a new
Plane3D
object in the xy-plane and applies the transformation to the plane. The intersection of the volume's shape with the transformed plane is then calculated and stored in a list of lines. The inverse of the transformation is then applied to each line in the list ensuring that each line in the returned list is in the xy-plane.- Specified by:
getVolumeCrossSection
in interfaceComponent
- Parameters:
transformation
- the transformation to apply to the plane- Returns:
- a list of lines in the xy-plane representing the cross section
-
getVolumeIntersection
Description copied from interface:Component
Returns true if the given line segment intersect thevolume-shape
twice (one incoming intersection and one out going) and stores the incoming and outgoing intersection points are stored in the first and second Point3D objects given as arguments respectively.The incoming intersection is defined such that the incoming intersection point is closer to the origin of the line than the outgoing intersection point.
- Specified by:
getVolumeIntersection
in interfaceComponent
- Parameters:
line
- the line segmentinIntersect
- the incoming intersectionoutIntersect
- the outgoing intersection- Returns:
- true if two intersections are found
-
getMidpoint
Description copied from interface:Component
Returns the midpoint of this component. By convention, the midpoint of a component is normally the geometric center of the component's volume but the definition of midpoint may vary by component type.- Specified by:
getMidpoint
in interfaceComponent
- Returns:
- the midpoint
-
getLength
-
getLineX
-
getLineY
-
getLineZ
-
getType
-
show
-
translateXYZ
public void translateXYZ(double dx, double dy, double dz) Description copied from interface:Transformable
Translates this object linearly by the amounts specified.- Specified by:
translateXYZ
in interfaceTransformable
- Parameters:
dx
- amount to translate along the x axisdy
- amount to translate along the y axisdz
- 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
-
getVolumeMesh
-
init
-