Class NativeDrawableImage
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.DrawableImage
org.jzy3d.plot3d.primitives.textured.NativeDrawableImage
- All Implemented Interfaces:
IGLRenderer
,ISortableDraw
,ITranslucent
- Direct Known Subclasses:
AWTNativeDrawableImage
,PickableTexture
A
NativeDrawableImage
can only mount its texture while the GL2 thread is current, so the
best is to let draw() automount texture file the first time the resource is required. When a
texture is loaded for the first time, it updates the current view bounds since the texture bounds
where up to now unknown and fixed to origin with no width.
A NativeDrawableImage
requires a color filter (default is white), and a set of
coordinates defining the polygon on which the texture should be drawn.
This texture implementation impose the texture to be perpendicular to a PlaneAxis
. It is
thus defined with 2d Coordinates in the plane defined by the {PlaneAxis
, axisValue}- Author:
- Martin
-
Field Summary
Modifier and TypeFieldDescriptionprotected float
protected float
protected Color
protected PlaneAxis
protected Coord2d
protected SharedTexture
protected float[]
protected Transform
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
Constructor Summary
ConstructorDescriptionNativeDrawableImage
(SharedTexture resource) NativeDrawableImage
(SharedTexture resource, PlaneAxis orientation) NativeDrawableImage
(SharedTexture resource, PlaneAxis orientation, float axisValue) NativeDrawableImage
(SharedTexture resource, PlaneAxis orientation, float axisValue, List<Coord2d> coords) NativeDrawableImage
(SharedTexture resource, PlaneAxis orientation, float axisValue, List<Coord2d> coords, Color filter) NativeDrawableImage
(SharedTexture resource, PlaneAxis orientation, float axisValue, Color filter) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
applyGeometryTransform
(Transform transform) protected void
void
void
Call OpenGL2 routines for rendering the object.Return the BoundingBox of this object.getManualTextureMapping
(float width, float height) getManualTextureMapping
(float width, float height, float xoffset, float yoffset) Must supply the expected size of texture in 3d coordinates.protected void
protected void
void
setAlphaFactor
(float a) void
setColorFilter
(Color filter) void
setPlanePosition
(Coord2d planePosition) void
setResource
(SharedTexture resource) void
setTextureScale
(Transform textureScale) void
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString
-
Field Details
-
resource
-
orientation
-
texMatMix
protected float[] texMatMix -
filter
-
axisValue
protected float axisValue -
mapping
-
alpha
protected float alpha -
planePosition
-
textureScale
-
-
Constructor Details
-
Method Details
-
getColorFilter
-
setColorFilter
-
setAlphaFactor
public void setAlphaFactor(float a) - Specified by:
setAlphaFactor
in interfaceITranslucent
-
initBoundsWithMapping
protected void initBoundsWithMapping() -
initBoundsWithResources
protected void initBoundsWithResources() -
getDefaultTextureMapping
-
getManualTextureMapping
public static List<Coord2d> getManualTextureMapping(float width, float height, float xoffset, float yoffset) Must supply the expected size of texture in 3d coordinates.- Returns:
-
getManualTextureMapping
-
debugMapping
public void debugMapping() -
getBounds
Description copied from class:Drawable
Return the BoundingBox of this object. -
getPlanePosition
-
setPlanePosition
-
getTextureScale
-
setTextureScale
-
draw
Description copied from class:Drawable
Call OpenGL2 routines for rendering the object.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
before
-
after
-
getResource
-
applyGeometryTransform
- Specified by:
applyGeometryTransform
in classDrawable
-
updateBounds
public void updateBounds()- Specified by:
updateBounds
in classDrawable
-