|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.Exhibit vmm.core3D.Exhibit3D vmm.polyhedron.IFS vmm.polyhedron.RegularPolyhedron
public abstract class RegularPolyhedron
Represents a regular polyhedron, with a parameter that allows the corners to be "truncated" by various amounts. In fact, this class can also be used for many non-regular polyhedra. The main requirement is that the algorithm that is used for truncating the corners of the polyhedron makes the following assumption: For each vertex, the opposite endpoints of the set of edges that are incident on that vertex must be co-planar (otherwise, the facets that are produced when the corners are truncated will not be planar polygons). Also, the faces should not have any colinear vertices; that is, all the vertices of each face should be real corners of that face.
This class is abstract, even though it has no abstract methods, because this class does not define any data for any polyhedron. The data must be provided by any concrete subclass, probably in the constructor of the subclass, but in any case before the computeDrawData3D() method in this class is called.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class vmm.polyhedron.IFS |
---|
IFS.IFSView |
Field Summary | |
---|---|
protected int[][] |
polyhedronFaces
Data for the faces of the polyhedron. |
protected Vector3D[] |
polyhedronVertices
A list of the vertices of the polyhedron. |
protected double |
stellationHeight
|
protected double |
stellationScale
|
protected RealParamAnimateable |
truncation
|
protected ActionRadioGroup |
truncationSelect
A radio group that appears in the Action menu that allows the user to select one of the standard truncations. |
Fields inherited from class vmm.polyhedron.IFS |
---|
edgeDivisor, useBackFaceFudge |
Fields inherited from class vmm.core3D.Exhibit3D |
---|
defaultViewpoint, defaultViewUp, previousTransform3D |
Fields inherited from class vmm.core.Exhibit |
---|
decorations, exhibitNeedsRedraw, isMorphing, morphingView, parameters, previousTransform |
Constructor Summary | |
---|---|
protected |
RegularPolyhedron()
Sets up a RegularPolyhedron with default viewpoint (10,-10,10) and default xy-window (-2,2,-2,2), and adds the truncation parameter. |
Method Summary | |
---|---|
protected void |
computeDrawData3D(View3D view,
boolean exhibitNeedsRedraw,
Transform3D previousTransform3D,
Transform3D newTransform3D)
Recopmputes cached data, if necessary, for a 3D rendering of this exhibit. |
ActionList |
getActionsForView(View view)
Adds truncationSelect to the actions from the superclass. |
ActionList |
getAdditionalAnimationsForView(View view)
This method returns a list of ActionItem that will be added to
the Animation menu of the 3dxm applicaiton. |
boolean |
getStellationWanted()
|
void |
parameterChanged(Parameter param,
java.lang.Object oldValue,
java.lang.Object newValue)
This is overridden to keep the selected item in the action group truncationSelect in sync with the value of the parameter truncation . |
void |
setStellationWanted(boolean stellationWanted)
|
Methods inherited from class vmm.polyhedron.IFS |
---|
doDraw3D, getCreateAnimation, getDefaultView, setIFSData |
Methods inherited from class vmm.core3D.Exhibit3D |
---|
computeDrawDataHook, doDrawHook, getDefaultTransform, getDefaultViewpoint, getDefaultViewUp, setDefaultViewpoint, setDefaultViewUp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector3D[] polyhedronVertices
protected int[][] polyhedronFaces
protected double stellationScale
protected double stellationHeight
protected RealParamAnimateable truncation
protected ActionRadioGroup truncationSelect
Constructor Detail |
---|
protected RegularPolyhedron()
truncation
parameter.
Method Detail |
---|
public boolean getStellationWanted()
public void setStellationWanted(boolean stellationWanted)
protected void computeDrawData3D(View3D view, boolean exhibitNeedsRedraw, Transform3D previousTransform3D, Transform3D newTransform3D)
Exhibit3D
Exhibit.computeDrawData(View, boolean, Transform, Transform)
to say what should be drawn in a 2D view.
computeDrawData3D
in class IFS
view
- the 3D View where the Exhibit is about to be drawn.exhibitNeedsRedraw
- if true, then something about the Exhibit has changed that probably requires
recomputation of cached data. For example, this is set to true when one of the Parameters of the Exhibit
has changed since the previous redraw.previousTransform3D
- the Transform3D that was used the last time this exhibit was drawn. This can be null, if
this is the first time that the Exhibit is being drawn (in 3D).newTransform3D
- the transform that will be used to draw the Exhibit during the current drawing operation.
This parameter and the previousTransform3D parameter are provided so that the Exhbit can detect those rare
cases where cached data exists that depends on the transform. Most Exhibits will just ignore the
transform parameters.public ActionList getActionsForView(View view)
truncationSelect
to the actions from the superclass.
getActionsForView
in class IFS
public void parameterChanged(Parameter param, java.lang.Object oldValue, java.lang.Object newValue)
truncationSelect
in sync with the value of the parameter truncation
.
parameterChanged
in interface Parameterizable
parameterChanged
in class Exhibit
param
- The Parmeter whose value has been set.oldValue
- The previous value of the parameter.newValue
- The new, current value of the parameter. This is not
necessarily guaranteed to be different from the old value (although it
is for parameters definedin the VMM core).Exhibit.forceRedraw()
public ActionList getAdditionalAnimationsForView(View view)
Exhibit
ActionItem
that will be added to
the Animation menu of the 3dxm applicaiton. The values in the list should
ordinarily be commands (i.e. AbstractActionVMM
)
that run animations (although there is no way to enforce
this restriction). These animations commands are in addition to the standard "Morph"
and "Cyclic Morph" commands. Note that these commands are added to those returned
by View.getAdditionalAnimations()
.
In this top-level Exhibit class, the return value is a an empty list (but not null). In general, when overriding this method, subclasses should call "super.getAdditionalAnimationsForView()" to obtain a list of actions from the superclass. It can then add additional actions or remove or disable actions that are in the list from the superclass.
getAdditionalAnimationsForView
in class Exhibit
view
- The view in which the animations will be run.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |