org.opensourcephysics.drawing3d.simple3d
Class SimpleAbstractTile

java.lang.Object
  extended by org.opensourcephysics.drawing3d.simple3d.SimpleElement
      extended by org.opensourcephysics.drawing3d.simple3d.SimpleAbstractTile
All Implemented Interfaces:
ImplementingObject
Direct Known Subclasses:
SimpleElementBox, SimpleElementCone, SimpleElementCylinder, SimpleElementDisk, SimpleElementEllipsoid, SimpleElementObject, SimpleElementPlane, SimpleElementSurface, SimpleElementTessellation, SimpleElementTetrahedron

public abstract class SimpleAbstractTile
extends SimpleElement

Title: SimpleAbstractTile

Description: Painter's algorithm implementation of a Tile

A tile is the basic abstract superclass for all Elements which consist of a sequence of 3D colored planar polygons (tiles). Such as: Box, Ellipsoid, Cylinder, ...

Version:
August 2009
Author:
Francisco Esquembre

Field Summary
 
Fields inherited from class org.opensourcephysics.drawing3d.simple3d.SimpleElement
FORCE_RECOMPUTE
 
Constructor Summary
SimpleAbstractTile(Element _element)
           
 
Method Summary
 void draw(java.awt.Graphics2D _g2, int _index)
          Draws a given Object3D (indicated by its index).
 void drawQuickly(java.awt.Graphics2D _g2)
          Sketches the drawable
 void processChanges(int _change, int _cummulativeChange)
          Process changes of the element
 void setColorBelowWhenEqual(boolean belowWhenEqual)
          Whether a value equal to one of the thresholds should be drawn using the color below or above
 void setColorOriginAndDirection(double[] origin, double[] direction)
          Sets the origin and direction of the color change.
 void setColorRegions(double[] thresholds, java.awt.Color[] colors)
          Set the levels and color for regional color separation
 void setDrawQuickInterior(boolean draw, int transparency)
          Draw a transparent interior when in quickDraw mode.
 
Methods inherited from class org.opensourcephysics.drawing3d.simple3d.SimpleElement
addToScene, getObjects3D, removeFromScene, styleChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleAbstractTile

public SimpleAbstractTile(Element _element)
Method Detail

processChanges

public void processChanges(int _change,
                           int _cummulativeChange)
Description copied from interface: ImplementingObject
Process changes of the element

Specified by:
processChanges in interface ImplementingObject
Specified by:
processChanges in class SimpleElement
Parameters:
_change - int the changes of this element
_cummulativeChange - int the cumulative changes, i.e. the changes of the element and those inherited from parent groups

draw

public void draw(java.awt.Graphics2D _g2,
                 int _index)
Description copied from class: SimpleElement
Draws a given Object3D (indicated by its index).


drawQuickly

public void drawQuickly(java.awt.Graphics2D _g2)
Description copied from class: SimpleElement
Sketches the drawable


setDrawQuickInterior

public void setDrawQuickInterior(boolean draw,
                                 int transparency)
Draw a transparent interior when in quickDraw mode. Default is false

Parameters:
draw - the value desired
transparency - the desired level of transparency (from 0=fully transparent to 255=opaque)

setColorBelowWhenEqual

public void setColorBelowWhenEqual(boolean belowWhenEqual)
Whether a value equal to one of the thresholds should be drawn using the color below or above

Parameters:
belowWhenEqual - true to use the color below, false to use teh color above

setColorOriginAndDirection

public void setColorOriginAndDirection(double[] origin,
                                       double[] direction)
Sets the origin and direction of the color change. Default is (0,0,0) and (0,0,1), giving z-coded regions

Parameters:
origin - double[]
direction - double[]

setColorRegions

public void setColorRegions(double[] thresholds,
                            java.awt.Color[] colors)
Set the levels and color for regional color separation

Parameters:
thresholds - an array on n doubles that separate the n+1 regions. null for no region separation
colors - an array on n+1 colors, one for each of the regions