|
|||||||||
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.ode.ODE_3D
public abstract class ODE_3D
Represents an ODE exhibit that will be displayed in three dimensions.
Nested Class Summary | |
---|---|
class |
ODE_3D.ODEView
Represents the default view for an ODEFirstOrder2D. |
Field Summary | |
---|---|
protected boolean |
addAnimateCheckBoxontrolPanel
If set to false in the constructor of a subclass, then the check box for turning animatino of orbit drawing will not be added to the control pandl (although the command will still be in the Action menu). |
protected boolean |
addLinesCheckBoxontrolPanel
If set to false in the constructor of a subclass, then the check box for controling whether orbits are drawn as solid lines will not be added to the control pandl (although the command will still be in the Action menu). |
protected boolean |
addOrbitTypesToControlPanel
If set to true in the constructor of a subclass, then the radio buttons for selecting RungeKutta/Euler/Both will be added to the control pandl. |
protected boolean |
anaglyphIsDefault
If this is set to true in a subclass's constructor, then the view will be put in anaglyph mode when it is created. |
protected boolean |
canShowVectorField
Tells whether it is possible to draw a vector field for the exhibit. |
protected double |
dtDefault
The value of this variable is used as the initial value of dt in the Control Panel of any view of this exhbit. |
protected double[] |
initialDataDefault
Contains the initial conditions that are placed in the control panel when the exhibit is first created. |
protected java.lang.String[] |
inputLabelNames
The names used for the input boxes where the user can type in the initial values for an integeral curves. |
protected boolean |
isAutonomous
Tells whether the ODE is autonomous (i.e. |
static int |
ORBIT_TYPE_BOTH
|
static int |
ORBIT_TYPE_EULER
|
static int |
ORBIT_TYPE_RUNGE_KUTTA
|
protected boolean |
showAxes
If this is set to true in a subclass's constructor, then the view will be set to show axes when it is created. |
protected double |
timeSpanDefault
The value of this variable is used as the initial value of Time Span in the Control Panel of any view of this exhbit. |
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 |
ODE_3D(boolean canShowVectorField,
boolean isAutonomous,
java.lang.String... inputLabelName)
Constructor sets the default background to be black, and sets the value of the final "isAutonomous" property and the lables to be used for the input boxes for initial conditions. |
Method Summary | |
---|---|
protected void |
doDraw(java.awt.Graphics2D g,
View view,
Transform transform)
Draws a direction field, but only for an exhbit in which the canShowVectorField
property is true and then only if the exhibit is being displayed in an ODEView whose
showDirectionField property is turned on (or in the unlikely event that it is being
displayed in some other type of View). |
protected Vector3D |
extractPointFromData(double[] pointData)
Extract from the data for a point on the integral curve the actual point that is to be displayed on the screen. |
TimerAnimation |
getCreateAnimation(View view)
For an ODE view, returns the animation that redraws the current orbit, if there is one, or draws the default orbit as defined by initialDataDefault , if the value of
that variable is non-null. |
View |
getDefaultView()
Returns a view of type ODE_3D.ODEView . |
protected MouseTask |
makeDefaultMouseTask(ODE_3D.ODEView view)
Should construct and return a mouse task appropriate for this exhibit, to be used in the specified view. |
protected abstract void |
nextEulerPoint(double[] pointData,
double dt)
Computes the next point on an integral curve, using Euler's method. |
protected abstract void |
nextRungeKuttaPoint(double[] pointData,
double dt)
Computes the next point on an integral curve, using the Runge-Kutta method. |
protected Vector3D |
screenPointTo3DPoint(View3D view,
int x,
int y)
Transform a point on the screen to a point in 3D space. |
protected double |
vectorField_x(double x,
double y,
double z,
double t)
Returns the x-component of the vector field at point (x,y,z) and time t. |
protected double |
vectorField_y(double x,
double y,
double z,
double t)
Returns the x-component of the vector field at point (x,y,z) and time t. |
Methods inherited from class vmm.core3D.Exhibit3D |
---|
computeDrawData3D, computeDrawDataHook, doDraw3D, 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 |
---|
public static final int ORBIT_TYPE_RUNGE_KUTTA
public static final int ORBIT_TYPE_BOTH
public static final int ORBIT_TYPE_EULER
protected final boolean isAutonomous
ODE_3D(boolean, boolean, String[])
, with the actual value
coming from the constructor of each subclass. Autonomous and non-autonomous
vector fields have different behaviors.
protected boolean showAxes
protected boolean anaglyphIsDefault
protected boolean addOrbitTypesToControlPanel
protected boolean addAnimateCheckBoxontrolPanel
protected boolean addLinesCheckBoxontrolPanel
protected final boolean canShowVectorField
ODE_3D(boolean, boolean, String[])
, with the actual value coming
from the contructor of each subclass. If the value is false, then the
methods vectorField_x(double, double, double, double)
and
vectorField_y(double, double, double,double)
are never called. If the
value is true, then these methods must be overridden to return the correct
values. For an autonomous ODE, the display of the vector field
is under control of the user. For a non-autonomous ODE, the vector field
is shown only when an integral curve is being constructed. (Actually,
a direction field rather than a vector field is drawn.)
protected final java.lang.String[] inputLabelNames
ODE_3D(boolean, boolean, String[])
. There
must be exactly as many strings as there are data items in the
pointData array that is passed to nextEulerPoint(double[], double)
,
nextRungeKuttaPoint(double[], double)
and extractPointFromData(double[])
.
protected double dtDefault
protected double timeSpanDefault
protected double[] initialDataDefault
nextEulerPoint(double[], double)
and
extractPointFromData(double[])
. In addition there can be up to
two additional items. The first additional item, if present and greater than
zero, specifies a dt for the initial orbit. The second additional item, if
present and greater than zero, specifies a timeSpan for the initial orbit.
If these values are not present or are less than or equal to zero, then
the default dt/TimeSpan of the exhbit is used.
Constructor Detail |
---|
protected ODE_3D(boolean canShowVectorField, boolean isAutonomous, java.lang.String... inputLabelName)
Method Detail |
---|
protected abstract void nextEulerPoint(double[] pointData, double dt)
protected abstract void nextRungeKuttaPoint(double[] pointData, double dt)
protected Vector3D extractPointFromData(double[] pointData)
protected double vectorField_x(double x, double y, double z, double t)
canShowVectorField
propery to true should
override this method to compute the correct value.
protected double vectorField_y(double x, double y, double z, double t)
canShowVectorField
propery to true should
override this method to compute the correct value.
protected MouseTask makeDefaultMouseTask(ODE_3D.ODEView view)
public TimerAnimation getCreateAnimation(View view)
initialDataDefault
, if the value of
that variable is non-null. Otherwise, the return value is null.
getCreateAnimation
in class Exhibit
view
- A View that is displaying this Exhibit. The animation, if any, that
is returned by this method will be installed in the View's display. If the view
is null, than a creation animation that can run independently of a view could
be returned.
protected Vector3D screenPointTo3DPoint(View3D view, int x, int y)
For cross-eye and stereograph view, where (x,y) might not lie in one of the view rects, the return value is null when (x,y) is outside the view rects.
protected void doDraw(java.awt.Graphics2D g, View view, Transform transform)
canShowVectorField
property is true and then only if the exhibit is being displayed in an ODEView whose
showDirectionField property is turned on (or in the unlikely event that it is being
displayed in some other type of View).
doDraw
in class Exhibit
g
- The graphics context where the Exhibit is being drawn. It has already been cleared
to the background color (assuming that drawing is being done in the usual way, as defined in the
top-level View class).view
- The View that is drawing the Exhibit; this object contains other
information that might be of use, such as the Display, if any, associated with
the View.transform
- Contains information about the rectangular area in the
xy-plane that is being drawn and about the rectangle of pixels in the graphics
context where it is drawn. Note that at least for the top-level View class,
transform.getX() and transform.getY() can be assumed to be zero.ODE_3D.ODEView.setShowDirectionField(boolean)
public View getDefaultView()
ODE_3D.ODEView
.
getDefaultView
in class Exhibit3D
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |