Class MeshComponent
- All Implemented Interfaces:
- Component,- Transformable,- Showable
- Direct Known Subclasses:
- ScintillatorMesh
- Author:
- gavalian
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the component's id number.doubleReturns the length of this component.getLineX()getLineY()getLineZ()Returns the midpoint of this component.intReturns the number of edges between the points that define thevolume.intReturns 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'svolumeas a list of lines in the xy-plane.getVolumeEdge(int e) Returns the edge on thevolumewith the specified index.booleangetVolumeIntersection(Line3D line, Point3D inIntersect, Point3D outIntersect) Returns true if the given line segment intersect thevolume-shapetwice (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 thevolumewith the specified index.Returns the volume of the component.voidvoidrotateX(double angle) Rotates this object clockwise around the x axis.voidrotateY(double angle) Rotates this object clockwise around the y axis.voidrotateZ(double angle) Rotates this object clockwise around the z axis.voidshow()InvokesSystem.out.println(this).voidtranslateXYZ(double dx, double dy, double dz) Translates this object linearly by the amounts specified.
- 
Constructor Details- 
MeshComponentpublic MeshComponent(int id) 
 
- 
- 
Method Details- 
getComponentIdpublic int getComponentId()Description copied from interface:ComponentReturns the component's id number.- Specified by:
- getComponentIdin interface- Component
- Returns:
- the id
 
- 
getNumVolumePointspublic int getNumVolumePoints()Description copied from interface:ComponentReturns the number of points that define thevolume.- Specified by:
- getNumVolumePointsin interface- Component
- Returns:
- the number of volume points
 
- 
getVolumePointDescription copied from interface:ComponentReturns the point on thevolumewith the specified index.- Specified by:
- getVolumePointin interface- Component
- Parameters:
- p- the index of the point
- Returns:
- the point on the volume
 
- 
getNumVolumeEdgespublic int getNumVolumeEdges()Description copied from interface:ComponentReturns the number of edges between the points that define thevolume.- Specified by:
- getNumVolumeEdgesin interface- Component
- Returns:
- the number of volume edges
 
- 
getVolumeEdgeDescription copied from interface:ComponentReturns the edge on thevolumewith the specified index.Though edges are returned as Line3Dobjects 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 returnedLine3Dis 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:
- getVolumeEdgein interface- Component
- Parameters:
- e- the index of the edge
- Returns:
- the edge on the volume
 
- 
getVolumeShapeDescription copied from interface:ComponentReturns the volume of the component.A volume is represented by a Shape3Dobject which contains a list of triangularFace3Dobjects. This these triangles bound a closed closed volume.- Specified by:
- getVolumeShapein interface- Component
- Returns:
- the volume
 
- 
getVolumeCrossSectionDescription copied from interface:ComponentReturns the cross section of a plane through the the component'svolumeas a list of lines in the xy-plane.This method takes a Transformation3D object as an argument, then constructs a new Plane3Dobject 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:
- getVolumeCrossSectionin interface- Component
- Parameters:
- transformation- the transformation to apply to the plane
- Returns:
- a list of lines in the xy-plane representing the cross section
 
- 
getVolumeIntersectionDescription copied from interface:ComponentReturns true if the given line segment intersect thevolume-shapetwice (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:
- getVolumeIntersectionin interface- Component
- Parameters:
- line- the line segment
- inIntersect- the incoming intersection
- outIntersect- the outgoing intersection
- Returns:
- true if two intersections are found
 
- 
getMidpointDescription copied from interface:ComponentReturns 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:
- getMidpointin interface- Component
- Returns:
- the midpoint
 
- 
getLengthpublic double getLength()Description copied from interface:ComponentReturns the length of this component.
- 
getLineX
- 
getLineY
- 
getLineZ
- 
getTypeDescription copied from interface:ComponentReturns a string that identifies the specific subtype of this component.
- 
showpublic void show()Description copied from interface:ComponentInvokesSystem.out.println(this).
- 
translateXYZpublic void translateXYZ(double dx, double dy, double dz) Description copied from interface:TransformableTranslates this object linearly by the amounts specified.- Specified by:
- translateXYZin interface- Transformable
- Parameters:
- dx- amount to translate along the x axis
- dy- amount to translate along the y axis
- dz- amount to translate along the z axis
 
- 
rotateXpublic void rotateX(double angle) Description copied from interface:TransformableRotates this object clockwise around the x axis.- Specified by:
- rotateXin interface- Transformable
- Parameters:
- angle- rotation angle in radians
 
- 
rotateYpublic void rotateY(double angle) Description copied from interface:TransformableRotates this object clockwise around the y axis.- Specified by:
- rotateYin interface- Transformable
- Parameters:
- angle- rotation angle in radians
 
- 
rotateZpublic void rotateZ(double angle) Description copied from interface:TransformableRotates this object clockwise around the z axis.- Specified by:
- rotateZin interface- Transformable
- Parameters:
- angle- rotation angle in radians
 
- 
getVolumeMesh
- 
init
 
-