|
|||||||||
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.conformalmap.ConformalMap
public abstract class ConformalMap
This class represents a map from a region in the complex plane to the complex plane. (Note: For most of the subclasses of this map, the map is conformal, but that is not in fact true in every case.)
Note that a ConformalMap by default uses a mouse task that lets the user switch between a view of the domain and a view of the image by shift-right-clicking. Ordinarily, the image is shown. The domain is shown when the user shift-right-clicks until the mouse is released.
Nested Class Summary | |
---|---|
static class |
ConformalMap.ConformalMapView
A class that defines the default view for a ConformalMap. |
Field Summary | |
---|---|
protected Complex[][] |
argumentGrid
Stores all the points in the grid that covers the domain of the function. |
static int |
CARTESIAN
Code for using a cartesian grid on the domain of the function. |
static int |
FRACTIONAL
Code for the function (1-z)/(1+z) as one of the possible functions that can be precomposed or postcomposed with a map. |
protected ActionRadioGroup |
gridTypeSelect
|
static int |
IDENTITY
Code for the identity function as one of the possible functions that can be precomposed or postcomposed with a map. |
static int |
INVERSION
Code for the function 1/z as one of the possible functions that can be precomposed or postcomposed with a map. |
protected static int |
POINTS_PER_INTERVAL
The actual resolutions in the u- and v- directions are obtained by multiplying the nominal resolutions give by the ures and vres parameters by this value. |
protected int |
pointsOnCircleFigure
The number of points to be used for a ConformalMapFigure with a circle shape, when the user adds a circle to the exhibit. |
protected int |
pointsOnLineFigure
The number of points to be used for a ConformalMapFigure that is a line, when the user adds a line to the exhibit. |
protected int |
pointsOnLineSegmentFigure
The number of points to be used for a ConformalMapFigure that is a line segment, when the user adds a line to the exhibit. |
static int |
POLAR
Code for using a polar grid on the domain of the function. |
static int |
POLARCONFORMAL
Code for using a conformal polar grid on the domain of the function. |
static int |
SQRROOT
Code for the square root function as one of the possible functions that can be precomposed or postcomposed with a map. |
protected RealParamAnimateable |
umax
Maximum u-value for the domain of the function. |
protected RealParamAnimateable |
umin
Minimum u-value for the domain of the function. |
protected IntegerParam |
ures
Number of grid lines in the grid in the u direction. |
protected Complex[][] |
valueGrid
Stores the images of the points in the argumentGrid. |
protected RealParamAnimateable |
vmax
Maximum v-value for the domain of the function. |
protected RealParamAnimateable |
vmin
Minimum v-value for the domain of the function. |
protected IntegerParam |
vres
Number of grid lines in the grid in the v direction. |
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 | |
---|---|
ConformalMap()
|
Method Summary | |
---|---|
void |
addExtraXML(org.w3c.dom.Document containingDocument,
org.w3c.dom.Element exhibitElement)
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 Complex |
composedFunction(Complex z)
Computes the output value for a given input argument, taking into account the precomposed and postcomposed functions. |
protected void |
computeDrawData3D(View3D view,
boolean exhibitNeedsRedraw,
Transform3D previousTransform3D,
Transform3D newTransform3D)
Recopmputes cached data, if necessary, for a 3D rendering of this exhibit. |
protected void |
doDraw3D(java.awt.Graphics2D g,
View3D view,
Transform3D transform)
Draws this Exhibit in a 3D view. |
protected abstract Complex |
function(Complex argument)
The function that is to be graphed, to be supplied by any concrete subclass. |
ActionList |
getActionsForView(View view)
This method returns a list of ActionItem that can be applied to a View that
contains this Exhibit. |
Animation |
getCreateAnimation(View view)
Returns an animation that shows the domain grid for a short time, then switches to the image. |
View |
getDefaultView()
Overridden to return a view of type ConformalMapView, defined by a nested class in this class. |
double[] |
getDefaultWindow2D()
Returns an array of four numbers representing the default 2D window. |
int |
getGridType()
Gets the code number for the type of grid that is used on the domain of the function. |
int |
getPostCompFunction()
Gets the code number for the function that is postcomposed with the basic map. |
int |
getPreCompFunction()
Gets the code number for the function that is precomposed with the basic map. |
protected Complex |
gridMap(double u,
double v)
Finds the input grid point corresponding to (u,v). |
void |
readExtraXML(org.w3c.dom.Element exhibitInfo)
This method is called when this exhibit is being reconstructed from an XML representation by the SaveAndRestore class. |
protected void |
resetGridType(int gridType)
For use in a subclass where the gridType has to be modified without changing the values of umin, umax, vmin, vmax. |
void |
setDefaultWindow2D(double[] defaultWindow2D)
Sets the default 2D window for this exhibit. |
void |
setDefaultWindow2D(double xmin,
double xmax,
double ymin,
double ymax)
Sets the default 2D window for this exhibit. |
void |
setGridType(int gridType)
Sets the type of grid that is used on the domain of the map. |
void |
setPostCompFunction(int postCompFunction)
Sets the function that is postcomposed with the basic map. |
void |
setPreCompFunction(int preCompFunction)
Sets the function that is precomposed with the basic map. |
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 |
---|
public static final int IDENTITY
public static final int INVERSION
public static final int FRACTIONAL
public static final int SQRROOT
public static final int CARTESIAN
public static final int POLAR
public static final int POLARCONFORMAL
protected RealParamAnimateable umin
protected RealParamAnimateable umax
protected RealParamAnimateable vmin
protected RealParamAnimateable vmax
protected IntegerParam ures
protected IntegerParam vres
protected static final int POINTS_PER_INTERVAL
protected int pointsOnCircleFigure
protected int pointsOnLineFigure
protected int pointsOnLineSegmentFigure
protected Complex[][] argumentGrid
protected Complex[][] valueGrid
protected ActionRadioGroup gridTypeSelect
Constructor Detail |
---|
public ConformalMap()
Method Detail |
---|
protected abstract Complex function(Complex argument)
public int getPostCompFunction()
setPostCompFunction(int)
public void setPostCompFunction(int postCompFunction)
public int getPreCompFunction()
setPreCompFunction(int)
public void setPreCompFunction(int preCompFunction)
public int getGridType()
setGridType(int)
public void setGridType(int gridType)
protected void resetGridType(int gridType)
gridTypeSelect
to match the
new grid type.
(This was introduced specifically for use in UserConformalMap
.
protected Complex composedFunction(Complex z)
public double[] getDefaultWindow2D()
setDefaultWindow2D(double[])
public void setDefaultWindow2D(double[] defaultWindow2D)
defaultWindow2D
- an array containing the default window, xmin, xmax, ymin, and ymax.
If this parameter is null, nothing is done. If the array has fewer than four elements, an
IllegalArgumentException is thrown.public void setDefaultWindow2D(double xmin, double xmax, double ymin, double ymax)
setDefaultWindow2D(double[])
.
protected Complex gridMap(double u, double v)
protected void computeDrawData3D(View3D view, boolean exhibitNeedsRedraw, Transform3D previousTransform3D, Transform3D newTransform3D)
Exhibit3D
Exhibit.computeDrawData(View, boolean, Transform, Transform)
to say what should be drawn in a 2D view.
computeDrawData3D
in class Exhibit3D
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.previousTransform3D
- 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).newTransform3D
- 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)
Exhibit3D
Exhibit3D.computeDrawData3D(View3D, boolean, Transform3D, Transform3D)
has already been called, so that any cached data should be correct.
Note that this method is called only if the Exhibit is being drawn in a View3D. Exhibits that have
both two and three dimensional renderings should also override Exhibit.doDraw(Graphics2D, View, Transform)
.
When drawing a 3D exhibit, you are strongly advised to use the drawing routines supplied by the
View3D
and View3DLit
classes. These routines will automatically produce the correct results
in stereo views -- the same is not true about direct drawing to the graphics context.
doDraw3D
in class Exhibit3D
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.public Animation getCreateAnimation(View view)
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.
public View getDefaultView()
getDefaultView
in class Exhibit3D
public ActionList getActionsForView(View view)
Exhibit
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.
getActionsForView
in class Exhibit
public void addExtraXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element exhibitElement)
Exhibit
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.
addExtraXML
in class Exhibit
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.exhibitElement
- 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.Exhibit.readExtraXML(Element)
public void readExtraXML(org.w3c.dom.Element exhibitInfo) throws java.io.IOException
Exhibit
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).
readExtraXML
in class Exhibit
exhibitInfo
- 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.
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.Exhibit.addExtraXML(Document, Element)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |