|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvmm.core.Exhibit
vmm.core3D.Exhibit3D
vmm.spacecurve.SpaceCurve
vmm.spacecurve.parametric.SpaceCurveParametric
public abstract class SpaceCurveParametric
A space curve that is defined by parametric equations, giving points of the form (x(t),y(t),z(t)).
A parametric curve can be rendered as a "tube" that surrounds the curve; this tube has square cross section,
with the orientation of the square at a given point depending on the torsion of the curve at that point.
A SpaceCurveParametric renders itself as a tube if it is being drawn in a View3DLit
. In a plain
View3D
, it renders itself as a curve.
Nested Class Summary | |
---|---|
class |
SpaceCurveParametric.SpaceCurveParametricView
Defines the default View of a SpaceCurveParametric. |
static class |
SpaceCurveParametric.SpaceCurveParametricViewAsTube
Defines a tube view of a SpaceCurveParametric. |
Field Summary | |
---|---|
protected RealParam |
tmax
The maximum value of t for points on the curve. |
protected RealParam |
tmin
The minimum value of t for points on the curve. |
protected IntegerParam |
tResolution
The number of t-values for points on the curve. |
protected Grid3D |
tube
Represents the surface of the tube, when this exhibit is rendered as a tube. |
protected IntegerParam |
tubeSides
The number of sides around the tube, from 3 to 20. |
protected RealParam |
tubeSize
The length of one of the square cross sections of the tube, when this exhibit is rendered as a tube. |
protected double[] |
tVals
The t-values used to compute the points (x(t),y(t),z(t)) on the curve. |
Fields inherited from class vmm.spacecurve.SpaceCurve |
---|
points |
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 | |
---|---|
SpaceCurveParametric()
|
Method Summary | |
---|---|
protected void |
computeDrawData3D(View3D view,
boolean exhibitNeedsRedraw,
Transform3D previousTransform,
Transform3D newTransform)
Computes the data needed to render the exhibit. |
protected Vector3D |
deriv1(double t)
Finds the derivative (x'(t),y'(t),z'(t)) at a given point on the curve. |
protected Vector3D |
deriv2(double t)
Finds the second derivative (x''(t),y''(t),z''(t)) at a given point on the curve. |
protected void |
doDraw3D(java.awt.Graphics2D g,
View3D view,
Transform3D transform)
Draws either a tube view or a regular curve view of this exhibit, depending on the type of View in which the curve is being rendered. |
Vector3D |
geographicCoordinates(double theta,
double phi)
Computes spherical coordinates (x,y,z)(theta, phi). |
ActionList |
getActionsForView(View view)
Returns a list of actions that can be applied to this exhibit in the specified view. |
View[] |
getAlternativeViews()
Returns an array containing a single item, which is a View of type View3DLit . |
Animation |
getBuildAnimation(View view)
Returns a build animation of the tube view of the curve, that shows the tube being constructed from back to front. |
protected Vector3D |
getCenterOfPoints(Vector3D[] pointSet,
int numPoints)
Returns the center of the first numPoints of the array pointSet. |
Animation |
getCreateAnimation(View view)
Returns an animation that shows the curve being drawn bit-by-bit. |
View |
getDefaultView()
Returns a View of type SpaceCurveParametric.SpaceCurveParametricView as the default view of this curve. |
double |
getT(int index)
Returns the t-value used to calculate the i-th point (x(t),y(t),z(t)) on the curve. |
int |
getTResolution()
Returns the t-resolution, the number of subintervals into which the interval is divided. |
protected void |
makePoints()
Computes the array of points on the curve, using the value(double) function and the
values of the tmin, tmax, and tResolution parameters. |
Vector3D[] |
makeRepereMobile(double t)
Returns an array of four vectors representing the Repere Mobile to the curve at a specified t value. |
protected abstract Vector3D |
value(double t)
Returns a point (x(t), y(t), z(t)) on the curve, given a value of t. |
Methods inherited from class vmm.spacecurve.SpaceCurve |
---|
getPoint, getPointCount |
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 IntegerParam tResolution
tmin
and tmax
. This interval is divided into
tResolution sub-intervals, giving tResolution+1 points. The default value is 200.
protected RealParam tmin
protected RealParam tmax
protected double[] tVals
protected Grid3D tube
protected RealParam tubeSize
protected IntegerParam tubeSides
Constructor Detail |
---|
public SpaceCurveParametric()
Method Detail |
---|
protected void makePoints()
value(double)
function and the
values of the tmin, tmax, and tResolution parameters. Subclasses should not need to override this method.
makePoints
in class SpaceCurve
protected Vector3D getCenterOfPoints(Vector3D[] pointSet, int numPoints)
protected abstract Vector3D value(double t)
protected Vector3D deriv1(double t)
protected Vector3D deriv2(double t)
public Vector3D geographicCoordinates(double theta, double phi)
public double getT(int index)
public int getTResolution()
public Vector3D[] makeRepereMobile(double t)
public View getDefaultView()
SpaceCurveParametric.SpaceCurveParametricView
as the default view of this curve. In this view,
the curve appears as a curve.
getDefaultView
in class SpaceCurve
public View[] getAlternativeViews()
View3DLit
. This is an alternative
view of the curve in which the curve appears as a tube that surrounds the curve itself.
getAlternativeViews
in class Exhibit
public ActionList getActionsForView(View view)
getActionsForView
in class Exhibit
public Animation getCreateAnimation(View view)
getCreateAnimation
in class Exhibit
view
- The View where the creation animation will be shown. If this
is null or if it is not an instance of SpaceCurveParametric.SpaceCurveParametricView
, then the return
value is null. The create animation is not used for a tube view of the curve;
a build animation is used instead. A curce can be shown in a plaine View3D,
but in that case no creation or build animation is used.
getBuildAnimation(View)
public Animation getBuildAnimation(View view)
getBuildAnimation
in class Exhibit
view
- The view into which the build animation will be installed.
getCreateAnimation(View)
protected void computeDrawData3D(View3D view, boolean exhibitNeedsRedraw, Transform3D previousTransform, Transform3D newTransform)
computeDrawData3D
in class SpaceCurve
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)
doDraw3D
in class SpaceCurve
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 |