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
FieldsModifier and TypeFieldDescriptionprotected floatprotected floatprotected Colorprotected PlaneAxisprotected Coord2dprotected SharedTextureprotected float[]protected TransformFields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore -
Constructor Summary
ConstructorsConstructorDescriptionNativeDrawableImage(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 voidvoidapplyGeometryTransform(Transform transform) protected voidvoidvoidCall 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 voidprotected voidvoidsetAlphaFactor(float a) voidsetColorFilter(Color filter) voidsetPlanePosition(Coord2d planePosition) voidsetResource(SharedTexture resource) voidsetTextureScale(Transform textureScale) voidMethods 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:
setAlphaFactorin 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:DrawableReturn the BoundingBox of this object. -
getPlanePosition
-
setPlanePosition
-
getTextureScale
-
setTextureScale
-
draw
Description copied from class:DrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classDrawable
-
before
-
after
-
getResource
-
applyGeometryTransform
- Specified by:
applyGeometryTransformin classDrawable
-
updateBounds
public void updateBounds()- Specified by:
updateBoundsin classDrawable
-