Class AbstractTile

java.lang.Object
org.opensourcephysics.display3d.simple3d.Element
org.opensourcephysics.display3d.simple3d.AbstractTile
All Implemented Interfaces:
Element, InteractionSource
Direct Known Subclasses:
ElementBox, ElementCone, ElementCylinder, ElementEllipsoid, ElementPlane, ElementSurface, ElementTessellation, ElementTetrahedron

public abstract class AbstractTile extends Element
This is the basic class for all Elements which consist of a sequence of 3D colored tiles: Ellipsoid, Cylinder, Box, ... A tile is basically a collection of rectangles. NOT YET FINISHED!!!!!
  • Field Details

    • numberOfTiles

      protected int numberOfTiles
    • corners

      protected double[][][] corners
  • Constructor Details

    • AbstractTile

      public AbstractTile()
  • Method Details

    • 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, 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
    • getTargetHit

      protected InteractionTarget getTargetHit(int x, int y)
      Description copied from class: Element
      Gets the target that is under the (x,y) position of the screen
      Overrides:
      getTargetHit in class Element
      Parameters:
      x - int
      y - int
      Returns:
      InteractionTarget
    • computeCorners

      protected abstract void computeCorners()
      This will be used by subclasses whenever there is a need to recompute the actual values of the corners before drawing. Synchronization is recomended.
    • setCorners

      protected void setCorners(double[][][] _data)
    • projectPoints

      protected void projectPoints()