|
|||||||||
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.implicit.SurfaceImplicit
public abstract class SurfaceImplicit
Represents a surface in three-space defined as the level set of a real-valued function of x,y,z.
Nested Class Summary | |
---|---|
class |
SurfaceImplicit.ImplicitSurfaceView
|
class |
SurfaceImplicit.Line3D
A line in R^3: decribed by its direction (Vector3D direction;), a unit vector, and its intercept, (Vector3D intercept;), which is where the line intersects the plane through the origin normal to direction (this is also the point on the line that is nearest to the origin. |
Field Summary | |
---|---|
protected RealParamAnimateable |
level
The level of the heightFunction that define the surface. |
protected SurfaceImplicit.Line3D[] |
ListOfRandomLines
This creates a fixed list of lines in R^3 that is random with respect to the kinematic measure on the subset of the space of all lines that meet the ball of radius searchRadius centered at the origin. |
protected Vector3D[] |
pointCloud
A cloud of random points on the implicit surface. |
protected IntegerParam |
pointCloudCount
The desired number of points in the cloud of random points that will show the implicit surface in Point Cloud Render Mode. |
protected IntegerParam |
randomLineCount
The number of lines in the ListOfRandomLines used to form a point cloud by intersecting the implicit surface with these lines. |
protected RealParam |
rayTraceResolution
Raytracing Resolution. |
protected double |
resolution
This is the minimum spacing for testing along a line the sign of the height function prior to using regula falsi Default is 0.05, but certain surfaces (notably the Steiner Roman Surface) need a smaller value so as not to miss roots. |
protected RealParamAnimateable |
searchRadius
Radius of the sphere centered at origin inside of which we search for points on the surface. |
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 | |
---|---|
SurfaceImplicit()
|
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. |
void |
cubicSolve(SurfaceImplicit.Line3D theLine,
double[] theRoots)
|
protected void |
doDraw3D(java.awt.Graphics2D g,
View3D view,
Transform3D transform)
Draws this Exhibit in a 3D view. |
double |
FindNextRoot(SurfaceImplicit.Line3D theLine,
double leftEnd,
double rightEnd,
double tolerance)
This finds an approximate root of theFunction, on the interval [leftEnd,rightEnd] assuming that the sign of theFunction is not the same at both ends. |
View |
getDefaultView()
Returns the default View of this Exhibit. |
BasicAnimator |
getMorphingAnimation(View view,
int looping)
This method is meant to produce a "morph" animation for this Exhibit, by animating any applicable animateable parameters. |
protected double |
heightAlongLine(double t,
SurfaceImplicit.Line3D line)
The heightFunction as a function of the signed distance t along line. |
abstract double |
heightFunction(double x,
double y,
double z)
The implicit surface is defined as solutions of heightFuncton(x,y,z) = level . |
double |
heightFunction(Vector3D thePoint)
|
void |
MakeListOfRandomLines()
|
Vector3D |
normalToSurfaceAt(Vector3D P)
Given a point P in R^3 and letting level = heightFunction(P), this gets the unit normal vector to the surface heightFunction = level at the point P by normalizing the gradient of the heightFunction at P. |
void |
quadraticSolve(SurfaceImplicit.Line3D theLine,
double[] theRoots)
This calculates the real roots (if any) of theEquation when it is a quadratic polynomial and stores them in theRoots |
void |
quarticSolve(SurfaceImplicit.Line3D theLine,
double[] theRoots)
|
void |
removeView(View view)
Overridden to shut down the task manager that is used for parallelization, when there are no more views of the exhibit. |
double |
theFunction(double t,
SurfaceImplicit.Line3D theLine)
This is the function whose vanishing gives a parameter value t such that a point of the line with that parameter value lies on the implicit 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 RealParamAnimateable level
protected IntegerParam pointCloudCount
protected IntegerParam randomLineCount
protected RealParamAnimateable searchRadius
protected RealParam rayTraceResolution
protected Vector3D[] pointCloud
protected SurfaceImplicit.Line3D[] ListOfRandomLines
protected double resolution
Constructor Detail |
---|
public SurfaceImplicit()
Method Detail |
---|
public abstract double heightFunction(double x, double y, double z)
public double heightFunction(Vector3D thePoint)
public Vector3D normalToSurfaceAt(Vector3D P)
public void removeView(View view)
removeView
in class Exhibit
view
- The view that is no longer displaying this exhibit.public void MakeListOfRandomLines()
protected double heightAlongLine(double t, SurfaceImplicit.Line3D line)
public double theFunction(double t, SurfaceImplicit.Line3D theLine)
public void quadraticSolve(SurfaceImplicit.Line3D theLine, double[] theRoots)
public void cubicSolve(SurfaceImplicit.Line3D theLine, double[] theRoots)
public void quarticSolve(SurfaceImplicit.Line3D theLine, double[] theRoots)
public double FindNextRoot(SurfaceImplicit.Line3D theLine, double leftEnd, double rightEnd, double tolerance)
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 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.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.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.public View getDefaultView()
Exhibit3D
View3D
.
getDefaultView
in class Exhibit3D
public BasicAnimator getMorphingAnimation(View view, int looping)
Exhibit
UserExhibit
from the function
parameters of the user exhibit. If
there are no Animateable parameters, the return value is null. Otherwise,
the return value is a BasicAnimator
to which all of the Exhibit's Animateable
parameters have been added. The number
of frames in the animation returned by this method is the value of the "framesForMorphing"
property. Subclasses might want to override this method to provide
more complex morphing animations, but they should follow the same pattern. In particular,
any parmeter values that are changed during the animation should be restored to their
original values when the animation ends.
getMorphingAnimation
in class Exhibit
view
- The view that the animation will be shown in, if any. If the value is
null, then the animation will not be associated with any particular view. In that
case, the Morphing animation will animate the Exhibit in all Views in which it appears, since
it operates by changing parameters of the exhibit. If the View is non-null, then only the
specified View will receive changeEvents from the Exhibit while the morph is in progress.looping
- This must be one of the values BasicAnimator.ONCE
, BasicAnimator.LOOP
,
or BasicAnimator.OSCILLATE
. The value is passed, without any error checking, to
the animation's setLooping
method.TimerAnimation.setLooping(int)
,
Exhibit.setFramesForMorphing(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |