Class ElementTetrahedron
java.lang.Object
org.opensourcephysics.display3d.simple3d.Element
org.opensourcephysics.display3d.simple3d.AbstractTile
org.opensourcephysics.display3d.simple3d.ElementTetrahedron
- All Implemented Interfaces:
Element
,ElementTetrahedron
,InteractionSource
Title: ElementTetrahedron
Description: A Tetrahedron using the painter's algorithm
- Version:
- December 2008
- Author:
- Carlos Jara Bravo and Francisco Esquembre
-
Field Summary
Fields inherited from class org.opensourcephysics.display3d.simple3d.AbstractTile
corners, numberOfTiles
Fields inherited from class org.opensourcephysics.display3d.simple3d.Element
targetPosition, targetSize
Fields inherited from interface org.opensourcephysics.display3d.core.Element
TARGET_POSITION, TARGET_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
This will be used by subclasses whenever there is a need to recompute the actual values of the corners before drawing.static XML.ObjectLoader
Returns an XML.ObjectLoader to save and load object data.double
Gets the truncation height for this tetrahedron.boolean
Whether the tetrahedron is closed at its bottom.boolean
Whether the tetrahedron is closed at its top.void
setClosedBottom
(boolean close) Whether the tetrahedron should be closed at its bottom.void
setClosedTop
(boolean close) Whether an incomplete tetrahedron element should be closed at its top.void
setTruncationHeight
(double height) Sets the truncation height for this tetrahedron.Methods inherited from class org.opensourcephysics.display3d.simple3d.AbstractTile
getTargetHit, projectPoints, setColorBelowWhenEqual, setColorOriginAndDirection, setColorRegions, setCorners, setDrawQuickInterior
Methods inherited from class org.opensourcephysics.display3d.simple3d.Element
addInteractionListener, getAxesMode, getDrawingPanel3D, getHotSpotBodyCoordinates, getInteractionTarget, getName, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, isReallyVisible, isVisible, loadUnmutableObjects, removeInteractionListener, setName, setSizeX, setSizeXYZ, setSizeXYZ, setSizeY, setSizeZ, setTransformation, setVisible, setX, setXYZ, setXYZ, setY, setZ, toBodyFrame, toSpaceFrame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display3d.core.Element
getDrawingPanel3D, getName, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, isVisible, loadUnmutableObjects, setName, setSizeX, setSizeXYZ, setSizeXYZ, setSizeY, setSizeZ, setTransformation, setVisible, setX, setXYZ, setXYZ, setY, setZ, toBodyFrame, toSpaceFrame
Methods inherited from interface org.opensourcephysics.display3d.core.interaction.InteractionSource
addInteractionListener, getInteractionTarget, removeInteractionListener
-
Constructor Details
-
ElementTetrahedron
public ElementTetrahedron()
-
-
Method Details
-
setTruncationHeight
public void setTruncationHeight(double height) Description copied from interface:ElementTetrahedron
Sets the truncation height for this tetrahedron. The standard height of a tetrahedron is set using setSizeZ(). This method helps create truncated tetrahedrons by setting the truncation height at a value smaller than the Z size. Negative, zero, or Double.NaN values set the tetrahedron to a standard (complete) one. Values greater than the Z size are ignored.- Specified by:
setTruncationHeight
in interfaceElementTetrahedron
- Parameters:
height
- double
-
getTruncationHeight
public double getTruncationHeight()Description copied from interface:ElementTetrahedron
Gets the truncation height for this tetrahedron.- Specified by:
getTruncationHeight
in interfaceElementTetrahedron
- Returns:
- double The truncation height (Double.NaN if the tetrahedron is complete.)
- See Also:
-
#setTruncationHeight()
-
setClosedBottom
public void setClosedBottom(boolean close) Description copied from interface:ElementTetrahedron
Whether the tetrahedron should be closed at its bottom.- Specified by:
setClosedBottom
in interfaceElementTetrahedron
- Parameters:
close
- the desired value
-
isClosedBottom
public boolean isClosedBottom()Description copied from interface:ElementTetrahedron
Whether the tetrahedron is closed at its bottom.- Specified by:
isClosedBottom
in interfaceElementTetrahedron
- Returns:
- the value
-
setClosedTop
public void setClosedTop(boolean close) Description copied from interface:ElementTetrahedron
Whether an incomplete tetrahedron element should be closed at its top.- Specified by:
setClosedTop
in interfaceElementTetrahedron
-
isClosedTop
public boolean isClosedTop()Description copied from interface:ElementTetrahedron
Whether the tetrahedron is closed at its top.- Specified by:
isClosedTop
in interfaceElementTetrahedron
- Returns:
- the value
-
computeCorners
protected void computeCorners()Description copied from class:AbstractTile
This will be used by subclasses whenever there is a need to recompute the actual values of the corners before drawing. Synchronization is recomended.- Specified by:
computeCorners
in classAbstractTile
-
getLoader
Returns an XML.ObjectLoader to save and load object data.- Returns:
- the XML.ObjectLoader
-