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
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!!!!!
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensourcephysics.display3d.core.Element
Element.Loader
-
Field Summary
FieldsFields inherited from class org.opensourcephysics.display3d.simple3d.Element
targetPosition, targetSize
Fields inherited from interface org.opensourcephysics.display3d.core.Element
TARGET_POSITION, TARGET_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
This will be used by subclasses whenever there is a need to recompute the actual values of the corners before drawing.protected InteractionTarget
getTargetHit
(int x, int y) Gets the target that is under the (x,y) position of the screenprotected void
void
setColorBelowWhenEqual
(boolean belowWhenEqual) Whether a value equal to one of the thresholds should be drawn using the color below or abovevoid
setColorOriginAndDirection
(double[] origin, double[] direction) Sets the origin and direction of the color change.void
setColorRegions
(double[] thresholds, Color[] colors) Set the levels and color for regional color separationprotected void
setCorners
(double[][][] _data) void
setDrawQuickInterior
(boolean draw, int transparency) Draw a transparent interior when in quickDraw mode.Methods inherited from class org.opensourcephysics.display3d.simple3d.Element
addInteractionListener, getAxesMode, getDrawingPanel3D, getHotSpotBodyCoordinates, getInteractionTarget, getName, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, isReallyVisible, isVisible, loadUnmutableObjects, removeInteractionListener, setName, setSizeX, setSizeXYZ, setSizeXYZ, setSizeY, setSizeZ, setTransformation, setVisible, setX, setXYZ, setXYZ, setY, setZ, toBodyFrame, toSpaceFrame
-
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 desiredtransparency
- 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
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 separationcolors
- an array on n+1 colors, one for each of the regions
-
getTargetHit
Description copied from class:Element
Gets the target that is under the (x,y) position of the screen- Overrides:
getTargetHit
in classElement
- Parameters:
x
- inty
- 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()
-