vmm.spacecurve.parametric
Class Viviani.DotCloudCylinder

java.lang.Object
  extended by vmm.core.Decoration
      extended by vmm.core3D.DotCloudSurface
          extended by vmm.spacecurve.parametric.Viviani.DotCloudCylinder
Enclosing class:
Viviani

protected class Viviani.DotCloudCylinder
extends DotCloudSurface


Field Summary
 
Fields inherited from class vmm.core.Decoration
decorationNeedsRedraw
 
Constructor Summary
protected Viviani.DotCloudCylinder()
           
 
Method Summary
 void computeDrawData(View view, boolean exhibitNeedsRedraw, Transform previousTransform, Transform newTransform)
          This method is called by the render method in the Exhibit class before it calls this Decoration's doDraw method, in order to give the Decoration a chance to recalculate any cached data that it needs in order to draw itself.
protected  Vector3D makeRandomPixel(java.util.Random randomNumberGenerator)
           
 
Methods inherited from class vmm.core3D.DotCloudSurface
doDraw, getColor, getDotCount, setColor, setDotCount
 
Methods inherited from class vmm.core.Decoration
addChangeListener, addExtraXML, fireDecorationChangeEvent, forceRedraw, getLayer, readExtraXML, removeChangeListener, setLayer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Viviani.DotCloudCylinder

protected Viviani.DotCloudCylinder()
Method Detail

makeRandomPixel

protected Vector3D makeRandomPixel(java.util.Random randomNumberGenerator)
Specified by:
makeRandomPixel in class DotCloudSurface

computeDrawData

public void computeDrawData(View view,
                            boolean exhibitNeedsRedraw,
                            Transform previousTransform,
                            Transform newTransform)
Description copied from class: Decoration
This method is called by the render method in the Exhibit class before it calls this Decoration's doDraw method, in order to give the Decoration a chance to recalculate any cached data that it needs in order to draw itself. (Note that subclasses of the View and Exhibit class are not necessarily required to follow this pattern.) Not all Decorations will need to "cache" computed data in this way. Decorations that do not cache data do not have to override this method. The method in this top-level exhibit class does nothing.

In general, a Decoration should check its decorationNeedsRedraw variable and also check the exhibitNeedsRedraw parameter. It should recompute cached data if either of these is true. A decoration might also need to compute data if the Transform has changed, if it has cached any data that depends on the Transform.

Overrides:
computeDrawData in class DotCloudSurface
Parameters:
view - The View that is drawing the Exhibit; this object contains other information that might be of use, such as the Display where the Exhibit is drawn and the the Exhibit that is being drawn.
exhibitNeedsRedraw - This parameter is set to "true" when the Exhibit changes. If it is true, then presumably the appearance of the Exhibit has changed, so any cached data for this decoration should probably 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 just in case any cached data depends on the xy-window or on the pixel coordinates.
See Also:
Exhibit.render(Graphics2D, View, Transform, ArrayList), Decoration.doDraw(Graphics2D, View, Transform)