|
|||||||||
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.surface.Surface
public abstract class Surface
Represents a surface in three-space defined by a rectangular array of points.
Field Summary | |
---|---|
protected Grid3D |
data
The object that holds all the data for the surface. |
protected IntegerParam |
uPatchCount
The U resolution, that is, the number of patches in the u direction. |
protected IntegerParam |
vPatchCount
The U resolution, that is, the number of patches in the u direction. |
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 | |
---|---|
Surface()
Adds uPatchCount and vPatchCount as parameters of the surface, each with a range of possible input values from 1 to 40. |
Method Summary | |
---|---|
protected void |
computeDrawData3D(View3D view,
boolean exhibitNeedsRedraw,
Transform3D previousTransform,
Transform3D newTransform)
Recopmputes cached data, if necessary, for a 3D rendering of this exhibit. |
protected abstract void |
createData()
Creates the data needed to represent the surface. |
protected void |
doDraw3D(java.awt.Graphics2D g,
View3D view,
Transform3D transform)
Draws this Exhibit in a 3D view. |
Animation |
getBuildAnimation(View view)
Returns a surface build animation, which shows patches being drawn bit-by-bit in back to front order. |
int |
getDefaultOrientation()
Returns the default orientation setting for this surface. |
View |
getDefaultView()
Returns a default view of this exhibit, a View of type SurfaceView . |
void |
setDefaultOrientation(int defaultOrientation)
Set the default orientation setting for this surface. |
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 Grid3D data
createData()
method.
protected IntegerParam uPatchCount
protected IntegerParam vPatchCount
Constructor Detail |
---|
public Surface()
Exhibit.setFramesForMorphing(int)
to set the number of frames for morphing
to 12 and calls Exhibit.setUseFilmstripForMorphing(boolean)
to turn on the use of filmstrips for
the morphing animation.
Method Detail |
---|
protected abstract void createData()
data
. Note: the gridSpacing for the grid is
completely managed by the top-level surface class, so subclasses
do not have to concern themselves with which grid lines will be drawn. In general, subclasses only
need to compute the veritces and intrinsic colors for the grid. They could also compute normal vectors.
public int getDefaultOrientation()
setDefaultOrientation(int)
public void setDefaultOrientation(int defaultOrientation)
Note that the default orientation is used only when a View is created by the
getDefaultView()
method.
View3DLit.setOrientation(int)
public View getDefaultView()
SurfaceView
.
(Note: If a Surface is displayed in a plain View3D, it will always appear as a wireframe.)
getDefaultView
in class Exhibit3D
public Animation getBuildAnimation(View view)
getBuildAnimation
in class Exhibit
view
- The view into which the build animation will be installed.
protected void computeDrawData3D(View3D view, boolean exhibitNeedsRedraw, Transform3D previousTransform, Transform3D newTransform)
Exhibit3D
Exhibit.computeDrawData(View, boolean, Transform, Transform)
to say what should be drawn in a 2D view.
computeDrawData3D
in class Exhibit3D
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.previousTransform
- 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).newTransform
- 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.protected void doDraw3D(java.awt.Graphics2D g, View3D view, Transform3D transform)
Exhibit3D
Exhibit3D.computeDrawData3D(View3D, boolean, Transform3D, Transform3D)
has already been called, so that any cached data should be correct.
Note that this method is called only if the Exhibit is being drawn in a View3D. Exhibits that have
both two and three dimensional renderings should also override Exhibit.doDraw(Graphics2D, View, Transform)
.
When drawing a 3D exhibit, you are strongly advised to use the drawing routines supplied by the
View3D
and View3DLit
classes. These routines will automatically produce the correct results
in stereo views -- the same is not true about direct drawing to the graphics context.
doDraw3D
in class Exhibit3D
g
- the graphics context where the exhibit is being drawn.view
- The View3D in which the exhibit is being drawn. In general, it is advisable to use the view for
all drawing operations.transform
- The transform that is being used to draw the exhibit.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |