vmm.surface.parametric
Class SurfaceParametric

java.lang.Object
  extended by vmm.core.Exhibit
      extended by vmm.core3D.Exhibit3D
          extended by vmm.surface.Surface
              extended by vmm.surface.parametric.SurfaceParametric
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
Direct Known Subclasses:
Astroidale, BianchiPinkall, BoyBryantKusner, Catalan, Catenoid_Helicoid, Conoid, ConstCurvFamilyOfRevolution, ConstCurvOneHelicoids, CrossCap, Cyclide, DiniSurface, DiracBelt, DoublyHopfFiberedTori, Enneper_Cartesian, Enneper_Polar, Henneberg, HyperbolicParaboloid, Hyperboloid1, Hyperboloid2, InvertedBoys, KleinBottle, KuenSurface, Kusner_Dihedral_Symmetric, LissajousSurface, MoebiusStrip, MonkeySaddle, nSolitons, Paraboloid, ParametricBreather, RightConoid, Scherk, SievertEnneper, SnailShell, Solitons, SteinerSurface, Torus, UserSurfaceParametric, WeierstrassMinimalSurface, WhitneyUmbrella

public abstract class SurfaceParametric
extends Surface

Defines a suface by a set of parametric equations defined on a rectangular domain in the uv-plane.


Field Summary
static int COLOR_GAUSS_CURVATURE
           
static int COLOR_MEAN_CURVATURE
           
static int COLOR_TWO_SIDED_DEFAULT
           
static int COLOR_TWO_SIDED_USER
           
static int COLOR_USER
           
static int COLOR_USER_FUNCTION_HSB
           
static int COLOR_USER_FUNCTION_RGB
           
static int COLOR_WHITE
          One of the types of surface coloration, for use in the setColoration method.
protected  RealParamAnimateable umax
          The upper limit of u values for the domain of the parametric functions that define this surface.
protected  RealParamAnimateable umin
          The lower limit of u values for the domain of the parametric functions that define this surface.
protected  RealParamAnimateable vmax
          The upper limit of v values for the domain of the parametric functions that define this surface.
protected  RealParamAnimateable vmin
          The lower limit of v values for the domain of the parametric functions that define this surface.
 
Fields inherited from class vmm.surface.Surface
data, uPatchCount, vPatchCount
 
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
SurfaceParametric()
          Adds umin, umax, vmin, and vmax as parameters of the exhibit.
 
Method Summary
 void addExtraXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element viewElement)
          This method is called when an XML representation of this exhibit is being constructed by the SaveAndRestore class to give the exhibit a chance to write any extra infomation that is not saved by default.
protected  void createData()
          Computes the data for the surface using equally spaced values of u and v in the ranges defined by umin, umax, vmin, and vmax.
 Vector3D deriv_u(double u, double v)
          Returns an approximation for the partial derivative in the direction u at a specified (u,v) point.
 Vector3D deriv_v(double u, double v)
          Returns an approximation for the partial derivative in the direction v at a specified (u,v) point.
 Vector3D gaussMap(double u, double v)
           
 ActionList getActionsForView(View view)
          This method returns a list of ActionItem that can be applied to a View that contains this Exhibit.
 void readExtraXML(org.w3c.dom.Element viewInfo)
          This method is called when this exhibit is being reconstructed from an XML representation by the SaveAndRestore class.
 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.
 Vector3D surfaceNormal(double u, double v)
          Returns the Surface Normal, by default from numerical differentiation.
abstract  Vector3D surfacePoint(double u, double v)
          The parametric equations that define the surface, given as a function from the uv-plane into R3.
 
Methods inherited from class vmm.surface.Surface
computeDrawData3D, doDraw3D, getBuildAnimation, getDefaultOrientation, getDefaultView, setDefaultOrientation
 
Methods inherited from class vmm.core3D.Exhibit3D
computeDrawDataHook, doDrawHook, getDefaultTransform, getDefaultViewpoint, getDefaultViewUp, setDefaultViewpoint, setDefaultViewUp
 
Methods inherited from class vmm.core.Exhibit
addChangeListener, addDecoration, addParameter, addView, clearDecorations, computeDrawData, doDraw, fireExhibitChangeEvent, forceRedraw, getAdditionalAnimationsForView, getAlternativeViews, getCreateAnimation, getDecorations, getDefaultBackground, getDefaultForeground, getDefaultWindow, getFramesForMorphing, getMorphingAnimation, getName, getParameterByName, getParameters, getSettingsCommandsForView, getTitle, getUseFilmstripForMorphing, getViews, parameterChanged, removeChangeListener, removeDecoration, removeParameter, render, setDefaultBackground, setDefaultForeground, setDefaultWindow, setDefaultWindow, setFramesForMorphing, setName, setUseFilmstripForMorphing, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLOR_WHITE

public static final int COLOR_WHITE
One of the types of surface coloration, for use in the setColoration method.

See Also:
Constant Field Values

COLOR_USER

public static final int COLOR_USER
See Also:
Constant Field Values

COLOR_TWO_SIDED_DEFAULT

public static final int COLOR_TWO_SIDED_DEFAULT
See Also:
Constant Field Values

COLOR_TWO_SIDED_USER

public static final int COLOR_TWO_SIDED_USER
See Also:
Constant Field Values

COLOR_GAUSS_CURVATURE

public static final int COLOR_GAUSS_CURVATURE
See Also:
Constant Field Values

COLOR_MEAN_CURVATURE

public static final int COLOR_MEAN_CURVATURE
See Also:
Constant Field Values

COLOR_USER_FUNCTION_HSB

public static final int COLOR_USER_FUNCTION_HSB
See Also:
Constant Field Values

COLOR_USER_FUNCTION_RGB

public static final int COLOR_USER_FUNCTION_RGB
See Also:
Constant Field Values

umin

protected RealParamAnimateable umin
The lower limit of u values for the domain of the parametric functions that define this surface. Default value is -5.


umax

protected RealParamAnimateable umax
The upper limit of u values for the domain of the parametric functions that define this surface. Default value is 5.


vmin

protected RealParamAnimateable vmin
The lower limit of v values for the domain of the parametric functions that define this surface. Default value is -5.


vmax

protected RealParamAnimateable vmax
The upper limit of v values for the domain of the parametric functions that define this surface. Default value is 5.

Constructor Detail

SurfaceParametric

public SurfaceParametric()
Adds umin, umax, vmin, and vmax as parameters of the exhibit.

Method Detail

surfacePoint

public abstract Vector3D surfacePoint(double u,
                                      double v)
The parametric equations that define the surface, given as a function from the uv-plane into R3. The return value of this function can be null, indicating that the function is undefined for the given u and v.


deriv_u

public Vector3D deriv_u(double u,
                        double v)
Returns an approximation for the partial derivative in the direction u at a specified (u,v) point.


deriv_v

public Vector3D deriv_v(double u,
                        double v)
Returns an approximation for the partial derivative in the direction v at a specified (u,v) point.


surfaceNormal

public Vector3D surfaceNormal(double u,
                              double v)
Returns the Surface Normal, by default from numerical differentiation. For Weierstrass surfaces the known Gauss map allows to override the numerical differentiation.


removeView

public 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.

Overrides:
removeView in class Exhibit
Parameters:
view - The view that is no longer displaying this exhibit.

createData

protected void createData()
Computes the data for the surface using equally spaced values of u and v in the ranges defined by umin, umax, vmin, and vmax.

Specified by:
createData in class Surface

getActionsForView

public ActionList getActionsForView(View view)
Description copied from class: Exhibit
This method returns a list of ActionItem that can be applied to a View that contains this Exhibit. If the view parameter is null, it should return actions that are appropriate in any View. View is presumably one that is displaying this Exhibit.

The items in the returned list must implement the ActionItem interface and generally belong to one of the classes AbstractActionVMM, ToggleAction, ActionRadioGroup, or ActionList. Null items represent separators.

In this top-level Exhibit class, the return value is a list that contains one object of type AbstractActionVMM. The action represents the "Create" command, which is meant to run the "create animation" of the Exhibit.

In general, when overriding this method, subclasses should call "super.getActionsForView()" to obtain a list of actions from the superclass. It can then add additional actions or remove or disable actions that are in the list from the superclass.

Overrides:
getActionsForView in class Exhibit

addExtraXML

public void addExtraXML(org.w3c.dom.Document containingDocument,
                        org.w3c.dom.Element viewElement)
Description copied from class: Exhibit
This method is called when an XML representation of this exhibit is being constructed by the SaveAndRestore class to give the exhibit a chance to write any extra infomation that is not saved by default. Any Parameters associated with the exhibit are saved automatically. Note that Decorations associated with the exhibit are NOT saved automatically UNLESS the decoration class is marked with a VMMSave annotation. Property variables will also be saved automatically IF they are marked with VMMSave annotations.

The method in this top level class does nothing.

When a subclass overrides this method, it should ordinarily start by calling super.addExtraXML(containingDocument,exhibitElement) to make sure that information from the superclass is saved.

Overrides:
addExtraXML in class Exhibit
Parameters:
containingDocument - The overall XML document that contains the exhibit Element that is being created. This parameter is necessary because it is needed to create any nested subelements that are to be added to the exhibit element.
viewElement - The XML element that is being constructed. This element already exists; the purpose of this method to add any extra information that would be needed to reconstruct this exhibit object from the XML represenation.
See Also:
Exhibit.readExtraXML(Element)

readExtraXML

public void readExtraXML(org.w3c.dom.Element viewInfo)
                  throws java.io.IOException
Description copied from class: Exhibit
This method is called when this exhibit is being reconstructed from an XML representation by the SaveAndRestore class. The Exhibit object has already been created, and default information (parameters and decorations) have been retrieved. This method is responsible for retrieving any data that was written by Exhibit.addExtraXML(Document, Element), except that properties written with SaveAndRestore.addProperty(Object, String, Document, Element) are retrieved automatically, and decorations saved with SaveAndRestore.addDecorationElement(Document, Element, Decoration) are retrieved automatically. The method in this top-level Exhibit class does nothing.

In general, when a subclass overrides this method, it should be sure to call super.readExtraXML(exhibitInfo).

Overrides:
readExtraXML in class Exhibit
Parameters:
viewInfo - The <exhibit> element from the XML file that contains the information about this exhibit. Some methods from the SaveAndRestore class might be useful for getting the data.
Throws:
java.io.IOException - If an error is found, an exception of type IOException should be thrown. This will abort the whole processing of the XML file.
See Also:
Exhibit.addExtraXML(Document, Element)

gaussMap

public Vector3D gaussMap(double u,
                         double v)