org.opensourcephysics.display3d.simple3d
Class ElementTetrahedron

java.lang.Object
  extended by org.opensourcephysics.display3d.simple3d.Element
      extended by org.opensourcephysics.display3d.simple3d.AbstractTile
          extended by org.opensourcephysics.display3d.simple3d.ElementTetrahedron
All Implemented Interfaces:
Element, ElementTetrahedron, InteractionSource

public class ElementTetrahedron
extends AbstractTile
implements ElementTetrahedron

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
ElementTetrahedron()
           
 
Method Summary
protected  void computeCorners()
          This will be used by subclasses whenever there is a need to recompute the actual values of the corners before drawing.
static XML.ObjectLoader getLoader()
          Returns an XML.ObjectLoader to save and load object data.
 double getTruncationHeight()
          Gets the truncation height for this tetrahedron.
 boolean isClosedBottom()
          Whether the tetrahedron is closed at its bottom.
 boolean isClosedTop()
          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 Detail

ElementTetrahedron

public ElementTetrahedron()
Method Detail

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 interface ElementTetrahedron
Parameters:
height - double

getTruncationHeight

public double getTruncationHeight()
Description copied from interface: ElementTetrahedron
Gets the truncation height for this tetrahedron.

Specified by:
getTruncationHeight in interface ElementTetrahedron
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 interface ElementTetrahedron
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 interface ElementTetrahedron
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 interface ElementTetrahedron

isClosedTop

public boolean isClosedTop()
Description copied from interface: ElementTetrahedron
Whether the tetrahedron is closed at its top.

Specified by:
isClosedTop in interface ElementTetrahedron
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 class AbstractTile

getLoader

public static XML.ObjectLoader getLoader()
Returns an XML.ObjectLoader to save and load object data.

Returns:
the XML.ObjectLoader