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, numberOfTilesFields inherited from class org.opensourcephysics.display3d.simple3d.Element
targetPosition, targetSizeFields inherited from interface org.opensourcephysics.display3d.core.Element
TARGET_POSITION, TARGET_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis will be used by subclasses whenever there is a need to recompute the actual values of the corners before drawing.static XML.ObjectLoaderReturns an XML.ObjectLoader to save and load object data.doubleGets the truncation height for this tetrahedron.booleanWhether the tetrahedron is closed at its bottom.booleanWhether the tetrahedron is closed at its top.voidsetClosedBottom(boolean close) Whether the tetrahedron should be closed at its bottom.voidsetClosedTop(boolean close) Whether an incomplete tetrahedron element should be closed at its top.voidsetTruncationHeight(double height) Sets the truncation height for this tetrahedron.Methods inherited from class org.opensourcephysics.display3d.simple3d.AbstractTile
getTargetHit, projectPoints, setColorBelowWhenEqual, setColorOriginAndDirection, setColorRegions, setCorners, setDrawQuickInteriorMethods 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, toSpaceFrameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, toSpaceFrameMethods 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:ElementTetrahedronSets 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:
setTruncationHeightin interfaceElementTetrahedron- Parameters:
height- double
-
getTruncationHeight
public double getTruncationHeight()Description copied from interface:ElementTetrahedronGets the truncation height for this tetrahedron.- Specified by:
getTruncationHeightin 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:ElementTetrahedronWhether the tetrahedron should be closed at its bottom.- Specified by:
setClosedBottomin interfaceElementTetrahedron- Parameters:
close- the desired value
-
isClosedBottom
public boolean isClosedBottom()Description copied from interface:ElementTetrahedronWhether the tetrahedron is closed at its bottom.- Specified by:
isClosedBottomin interfaceElementTetrahedron- Returns:
- the value
-
setClosedTop
public void setClosedTop(boolean close) Description copied from interface:ElementTetrahedronWhether an incomplete tetrahedron element should be closed at its top.- Specified by:
setClosedTopin interfaceElementTetrahedron
-
isClosedTop
public boolean isClosedTop()Description copied from interface:ElementTetrahedronWhether the tetrahedron is closed at its top.- Specified by:
isClosedTopin interfaceElementTetrahedron- Returns:
- the value
-
computeCorners
protected void computeCorners()Description copied from class:AbstractTileThis 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:
computeCornersin classAbstractTile
-
getLoader
Returns an XML.ObjectLoader to save and load object data.- Returns:
- the XML.ObjectLoader
-