vmm.planecurve.parametric
Class OsculatingCircleAnimation

java.lang.Object
  extended by vmm.core.ThreadedAnimation
      extended by vmm.planecurve.parametric.OsculatingCircleAnimation
All Implemented Interfaces:
Animation

public class OsculatingCircleAnimation
extends ThreadedAnimation

Shows an osculating circle moving along a PlaneCurveParametric. The animation can, optionally, show the normal bundle; one normal vector is shown for each point on the curve, and the length of the nomral vector is equal to the radius of the osculating circle at that point. The animation can also, optionally, show the evolute curve being drawn as the osculating circle moves around the curve. A NormalBundleDecoration is used to do the actual work.


Nested Class Summary
 
Nested classes/interfaces inherited from class vmm.core.ThreadedAnimation
ThreadedAnimation.AnimationCanceledException
 
Constructor Summary
OsculatingCircleAnimation(Decorateable owner, PlaneCurveParametric curve)
          Create an animation that will show the animation on the specified curve.
OsculatingCircleAnimation(Decorateable owner, PlaneCurveParametric curve, boolean showNormals, boolean showEvolute)
          Create an animation that will show the animation on the specified curve, with the option of showing or not showing the evolute and the normal vectors.
OsculatingCircleAnimation(PlaneCurveParametric curve)
          Create an animation that will show the animation on the specified curve.
 
Method Summary
protected  void runAnimation()
          The animation consists of running this method.
 
Methods inherited from class vmm.core.ThreadedAnimation
addChangeListener, cancel, fireAnimationChangeEvent, getStatusText, getTimeDilation, isPaused, isRunning, pause, removeChangeListener, setPaused, setTimeDilation, start, wasCanceled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsculatingCircleAnimation

public OsculatingCircleAnimation(PlaneCurveParametric curve)
Create an animation that will show the animation on the specified curve. The curve should be non-null. The NormalBundleDecoration is added to the curve itself. Normals are shown but the evolute curve is not.


OsculatingCircleAnimation

public OsculatingCircleAnimation(Decorateable owner,
                                 PlaneCurveParametric curve)
Create an animation that will show the animation on the specified curve. The curve should be non-null. The NormalBundleDecoration is added to the specified Decorateable owner, which should be either the curve itself or a View containing the curve. Normals are shown but the evolute curve is not.

Parameters:
owner - The Decorateable object to which the NormalBundleDecoration is to be added. If the value is null, then the curve will be used as the owner.
curve - The curve to which parallel curves are to be drawn.

OsculatingCircleAnimation

public OsculatingCircleAnimation(Decorateable owner,
                                 PlaneCurveParametric curve,
                                 boolean showNormals,
                                 boolean showEvolute)
Create an animation that will show the animation on the specified curve, with the option of showing or not showing the evolute and the normal vectors. The curve should be non-null. The NormalBundleDecoration is added to the specified Decorateable owner, which should be either the curve itself or a View containing the curve.

Parameters:
owner - The Decorateable object to which the NormalBundleDecoration is to be added. If the value is null, then the curve will be used as the owner.
curve - The curve to which parallel curves are to be drawn.
showNormals - If set to true, the normal bundle is constructed and shown before the osculating circles are shown.
showEvolute - If set to true, the evolute curve is shown being drawn as the osculating circles move.
Method Detail

runAnimation

protected void runAnimation()
Description copied from class: ThreadedAnimation
The animation consists of running this method. To create an animation, it is generally only necessary to implement this method. This method should call pause regularly. The animation ends when this method returns or the first time pause is called after the cancel method has been called; the pause method generates an ThreadedAnimation.AnimationCanceledException in this case. If there is clean-up that must be done when the animation ends, it is advisable to do it in a finally clause in this method.

(Note that if some error other than an AnimationCanceledException occurs during the animation, it will also abort the animation. Since this is presumably a programming error, a stack trace for the exception is printed to standard output.)

Specified by:
runAnimation in class ThreadedAnimation
See Also:
ThreadedAnimation.pause(int), ThreadedAnimation.cancel()