Class SurfaceParametric
- java.lang.Object
-
- vmm3d.core.Exhibit
-
- vmm3d.core3D.Exhibit3D
-
- vmm3d.surface.Surface
-
- vmm3d.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 surface by a set of parametric equations defined on a rectangular domain in the uv-plane.
-
-
Field Summary
Fields Modifier and Type Field and Description static intCOLOR_GAUSS_CURVATUREstatic intCOLOR_MEAN_CURVATUREstatic intCOLOR_TWO_SIDED_DEFAULTstatic intCOLOR_TWO_SIDED_USERstatic intCOLOR_USERstatic intCOLOR_USER_FUNCTION_HSBstatic intCOLOR_USER_FUNCTION_RGBstatic intCOLOR_WHITEOne of the types of surface coloration, for use in the setColoration method.-
Fields inherited from class vmm3d.surface.Surface
uPatchCount, vPatchCount
-
-
Constructor Summary
Constructors Constructor and Description SurfaceParametric()Adds umin, umax, vmin, and vmax as parameters of the exhibit.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddExtraXML(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 theSaveAndRestoreclass to give the exhibit a chance to write any extra infomation that is not saved by default.Vector3Dderiv_u(double u, double v)Returns an approximation for the partial derivative in the direction u at a specified (u,v) point.Vector3Dderiv_v(double u, double v)Returns an approximation for the partial derivative in the direction v at a specified (u,v) point.Vector3DgaussMap(double u, double v)ActionListgetActionsForView(View view)This method returns a list ofActionItemthat can be applied to a View that contains this Exhibit.intgetPatchCountU()Get the current value of Nr of patches in UintgetPatchCountV()Get number of patches in VvoidreadExtraXML(org.w3c.dom.Element viewInfo)This method is called when this exhibit is being reconstructed from an XML representation by theSaveAndRestoreclass.voidremoveView(View view)Overridden to shut down the task manager that is used for parallelization, when there are no more views of the exhibit.voidsetEpsilon(double epsilon)Set precision for derivative of function.voidsetPatchCount(int unumber, int vnumber)Set number of divisions for U and V variablevoidsetU(double min, double max)Set minimum and maximum values for UvoidsetV(double min, double max)Set minimum and maximum values for VvoidsetViewpoint(double x, double y, double z)Set view point in X, Y, Z.Vector3DsurfaceNormal(double u, double v)Returns the Surface Normal, by default from numerical differentiation.abstract Vector3DsurfacePoint(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 vmm3d.surface.Surface
getBuildAnimation, getDefaultOrientation, getDefaultView, getGrid3D, setDefaultOrientation
-
Methods inherited from class vmm3d.core3D.Exhibit3D
getDefaultTransform, getDefaultViewpoint, getDefaultViewUp, setDefaultViewpoint, setDefaultViewUp
-
Methods inherited from class vmm3d.core.Exhibit
addChangeListener, addDecoration, addView, clearDecorations, forceRedraw, getAdditionalAnimationsForView, getAlternativeViews, getCreateAnimation, getDecorations, getDefaultBackground, getDefaultForeground, getDefaultWindow, getFramesForMorphing, getMorphingAnimation, getName, getParameterByName, getParameters, getSettingsCommandsForView, getTitle, getUseFilmstripForMorphing, getViews, parameterChanged, removeChangeListener, removeDecoration, render, setDefaultBackground, setDefaultForeground, setDefaultWindow, setDefaultWindow, setFramesForMorphing, setName, setUseFilmstripForMorphing, stateChanged
-
-
-
-
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
-
-
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.
-
setPatchCount
public void setPatchCount(int unumber, int vnumber)Set number of divisions for U and V variable- Parameters:
unumber- number of divisions for Uvnumber- number of divisions for V
-
getPatchCountU
public int getPatchCountU()
Get the current value of Nr of patches in U- Returns:
- number of patches in U
-
getPatchCountV
public int getPatchCountV()
Get number of patches in V- Returns:
- number of patches in V
-
setViewpoint
public void setViewpoint(double x, double y, double z)Set view point in X, Y, Z.- Parameters:
x- X pointy- Y pointz- Z point
-
setU
public void setU(double min, double max)Set minimum and maximum values for U- Parameters:
min- value for Uminmax- value for Umax
-
setV
public void setV(double min, double max)Set minimum and maximum values for V- Parameters:
min- value for Vminmax- value for Vmax
-
setEpsilon
public void setEpsilon(double epsilon)
Set precision for derivative of function.- Parameters:
epsilon- epsilon value (0.00005 is default).
-
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:
removeViewin classExhibit- Parameters:
view- The view that is no longer displaying this exhibit.
-
getActionsForView
public ActionList getActionsForView(View view)
Description copied from class:ExhibitThis method returns a list ofActionItemthat 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, orActionList. 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:
getActionsForViewin classExhibit
-
addExtraXML
public void addExtraXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element viewElement)Description copied from class:ExhibitThis method is called when an XML representation of this exhibit is being constructed by theSaveAndRestoreclass 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 aVMMSaveannotation. Property variables will also be saved automatically IF they are marked withVMMSaveannotations.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:
addExtraXMLin classExhibit- 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.IOExceptionDescription copied from class:ExhibitThis method is called when this exhibit is being reconstructed from an XML representation by theSaveAndRestoreclass. 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 byExhibit.addExtraXML(Document, Element), except that properties written withSaveAndRestore.addProperty(Object, String, Document, Element)are retrieved automatically, and decorations saved withSaveAndRestore.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:
readExtraXMLin classExhibit- Parameters:
viewInfo- The <exhibit> element from the XML file that contains the information about this exhibit. Some methods from theSaveAndRestoreclass 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)
-
-
DMelt 3.0 © DataMelt by jWork.ORG