Class EnlightableSphere
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.Wireframeable
org.jzy3d.plot3d.primitives.enlightables.AbstractEnlightable
org.jzy3d.plot3d.primitives.enlightables.EnlightableSphere
- All Implemented Interfaces:
ISingleColorable
,IGLRenderer
,ISortableDraw
A Sphere allows rendering a sphere.
The position and shape of a Sphere3d is defined through its
method. Moreover, a
Sphere3d is Wireframeable3d and support only one color that is defined trough its
method.
The position and shape of a Sphere3d is defined through its
invalid @link
setData()
invalid @link
setColor()
- Author:
- Martin Pernollet
-
Field Summary
Fields inherited from class org.jzy3d.plot3d.primitives.enlightables.AbstractEnlightable
materialAmbiantReflection, materialDiffuseReflection, materialEmission, materialShininess, materialSpecularReflection
Fields inherited from class org.jzy3d.plot3d.primitives.Wireframeable
depthFunctionChangeForWireframe, faceDisplayed, NO_OVERLAP_DEPTH_RATIO, polygonOffsetFactor, polygonOffsetFillEnable, polygonOffsetUnit, polygonWireframeDepthTrick, reflectLight, wireframeColor, wireframeColorFromPolygonPoints, wireframeDisplayed, wireframeWidth, wireframeWithLineLoop
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
Constructor Summary
ConstructorDescriptionInitialize a black sphere at the origin with a radius of 10, and slicing of 15.EnlightableSphere
(Coord3d position, float radius, int slicing, Color color) Initialize a sphere with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyGeometryTransform
(Transform transform) void
Call OpenGL2 routines for rendering the object.getColor()
Get the color.void
Set the color.void
Set the sphere data.void
setPosition
(Coord3d position) Set the position of the Sphere and the dimensions of its boundingbox.void
setSlicing
(int verticalWires, int horizontalWires) Set the sphere slicing parameters, i.e. the subtlety of the circle estimation.void
setVolume
(float radius) Set the radius of the sphere, and the dimensions of its boundingbox.toString
(int depth) void
Methods inherited from class org.jzy3d.plot3d.primitives.enlightables.AbstractEnlightable
applyMaterial, getMaterialAmbiantReflection, getMaterialDiffuseReflection, getMaterialEmission, getMaterialShininess, getMaterialSpecularReflection, setMaterialAmbiantReflection, setMaterialDiffuseReflection, setMaterialEmission, setMaterialShininess, setMaterialSpecularReflection
Methods inherited from class org.jzy3d.plot3d.primitives.Wireframeable
applyDepthRangeDefault, applyDepthRangeForOverlying, applyDepthRangeForUnderlying, doDrawBoundsIfDisplayed, getPolygonOffsetFactor, getPolygonOffsetUnit, getWireframeColor, getWireframeWidth, isFaceDisplayed, isPolygonOffsetFillEnable, isPolygonWireframeDepthTrick, isReflectLight, isWireframeColorFromPolygonPoints, isWireframeDisplayed, polygonOffsetFillDisable, polygonOffsetFillEnable, polygonOffsetLineDisable, polygonOffsetLineEnable, setFaceDisplayed, setPolygonOffsetFactor, setPolygonOffsetFillEnable, setPolygonOffsetUnit, setPolygonWireframeDepthTrick, setReflectLight, setWireframeColor, setWireframeColorFromPolygonPoints, setWireframeDisplayed, setWireframeWidth
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString
-
Constructor Details
-
EnlightableSphere
public EnlightableSphere()Initialize a black sphere at the origin with a radius of 10, and slicing of 15. -
EnlightableSphere
Initialize a sphere with the given parameters.
-
-
Method Details
-
draw
Description copied from class:Drawable
Call OpenGL2 routines for rendering the object.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
applyGeometryTransform
- Specified by:
applyGeometryTransform
in classDrawable
-
setData
Set the sphere data.- Parameters:
position
- sphere position (may be handled differently in future version)radius
- radius of the sphereslices
- number of vertical slices (i.e. wireframes)stacks
- number of horizontal stacks (i.e. wireframes)
-
setPosition
Set the position of the Sphere and the dimensions of its boundingbox. Note that this position will be use to translate the object before drawing it (meaning a glTranslate(position) is performed right after the Translate.execute).- Parameters:
position
-
-
updateBounds
public void updateBounds()- Specified by:
updateBounds
in classDrawable
-
setVolume
public void setVolume(float radius) Set the radius of the sphere, and the dimensions of its boundingbox.- Parameters:
radius
- sphere radius
-
setSlicing
public void setSlicing(int verticalWires, int horizontalWires) Set the sphere slicing parameters, i.e. the subtlety of the circle estimation.- Parameters:
verticalWires
- number of vertical sliceshorizontalWires
- number of horizontal slices
-
setColor
Description copied from interface:ISingleColorable
Set the color.- Specified by:
setColor
in interfaceISingleColorable
- Parameters:
color
- the color
-
getColor
Description copied from interface:ISingleColorable
Get the color.- Specified by:
getColor
in interfaceISingleColorable
- Returns:
- color the color.
-
toString
-