|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.Exhibit vmm.fractals.RepeatedSegmentFractal
public abstract class RepeatedSegmentFractal
A fractal curve in which a level (N+1) approximation of the fractal is computed
from a level N approximation by replacing each line segement with a scaled and
transformed copy of the entire curve. Examples include Koch
and Hilbert
.
Nested Class Summary | |
---|---|
class |
RepeatedSegmentFractal.RSFView
Defines the default View of an exhibit of type RepeatedSegmentFractal. |
Field Summary | |
---|---|
protected int |
colorRepeatFactor
Used in coloring the curve. |
protected int |
fastDrawRecursionLevel
Used during "fast drawing", such as when the curve is being dragged. |
protected RealParamAnimateable |
fractality
This parameter determines the fractal dimension of the curve. |
protected IntegerParam |
recursionLevel
Determines the number of "levels" that are computed. |
Fields inherited from class vmm.core.Exhibit |
---|
decorations, exhibitNeedsRedraw, isMorphing, morphingView, parameters, previousTransform |
Constructor Summary | |
---|---|
RepeatedSegmentFractal()
Constructor sets a default color of BLACK and a default window of (-1,1,-1,1). |
Method Summary | |
---|---|
protected void |
computeDrawData(View view,
boolean exhibitNeedsRedraw,
Transform previousTransform,
Transform newTransform)
Computes the data for the curve. |
protected abstract Complex[] |
computeNextLevel(Complex[] curvePoints,
int computedLevel)
This abstract method computes one approximation level from the previous one, which has already been computed. |
protected void |
doDraw(java.awt.Graphics2D g,
View view,
Transform transform)
Draws the curve in continuous rainbow colors. |
Animation |
getCreateAnimation(View view)
Returns a create animation that shows the curve at each approximation level from 1 up to the currently selected level of recursion. |
View |
getDefaultView()
Returns a default view of type RSFView, where RSFView is a nested class inside this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int colorRepeatFactor
protected int fastDrawRecursionLevel
protected RealParamAnimateable fractality
protected IntegerParam recursionLevel
Constructor Detail |
---|
public RepeatedSegmentFractal()
Method Detail |
---|
protected abstract Complex[] computeNextLevel(Complex[] curvePoints, int computedLevel)
curvePoints
- This array stores the points that have been computed for the current approximation level.
This array can be null, if the computedLevel is zero.computedLevel
- This is the approximation level that has been comptuted to get the points in
curvePoints. A zero value for this paramter means that the first, or base level, approximation should
be computed.
protected void computeDrawData(View view, boolean exhibitNeedsRedraw, Transform previousTransform, Transform newTransform)
computeDrawData
in class Exhibit
view
- The View that is drawing the Exhibit.exhibitNeedsRedraw
- This parameter is set to "true" if the Exhibit's forceRedraw()
method has been called since the last redraw. If it is true, then presumably the appearance of the Exhibit has
changed, so any cached data should be recomputed.previousTransform
- The Transform object that was used the last time the Exhibit was
drawn. This can be null if the Exhibit is being drawn for the first time.newTransform
- The Transform object that is being used for this drawing of the Exhibit.
Transform objects contain data about the window in the xy-plane where the Exhibit is
being drawn and about the pixel coordinates on the drawing area.
The two Transform objects are provided in case any cached data depends on the xy-window
or on the pixel coordinates. Note that the Transform might have changed even if exhibitNeedsRedraw is false.Exhibit.render(Graphics2D, View, Transform, ArrayList)
,
Exhibit.forceRedraw()
,
Exhibit.doDraw(Graphics2D, View, Transform)
protected void doDraw(java.awt.Graphics2D g, View view, Transform transform)
doDraw
in class Exhibit
g
- The graphics context where the Exhibit is being drawn. It has already been cleared
to the background color (assuming that drawing is being done in the usual way, as defined in the
top-level View class).view
- The View that is drawing the Exhibit; this object contains other
information that might be of use, such as the Display, if any, associated with
the View.transform
- Contains information about the rectangular area in the
xy-plane that is being drawn and about the rectangle of pixels in the graphics
context where it is drawn. Note that at least for the top-level View class,
transform.getX() and transform.getY() can be assumed to be zero.Exhibit.render(Graphics2D, View, Transform, ArrayList)
,
Exhibit.computeDrawData(View, boolean, Transform, Transform)
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 Exhibit
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |