Class Sphere
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.Wireframeable
org.jzy3d.plot3d.primitives.Sphere
- All Implemented Interfaces:
ISingleColorable, IGLRenderer, ISortableDraw
- Direct Known Subclasses:
PickableSphere, SelectableSphere
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.
invalid reference
setData()
invalid reference
setColor()
- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected Coord3dprotected floatprotected intprotected intFields inherited from class Wireframeable
depthFunctionChangeForWireframe, faceDisplayed, materialAmbiantReflection, materialDiffuseReflection, materialEmission, materialShininess, materialSpecularReflection, NO_OVERLAP_DEPTH_RATIO, polygonOffsetFactor, polygonOffsetFillEnable, polygonOffsetUnit, polygonWireframeDepthTrick, reflectLight, wireframeColor, wireframeColorFromPolygonPoints, wireframeDisplayed, wireframeWidth, wireframeWithLineLoopFields inherited from class Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyGeometryTransform(Transform transform) protected voiddoDrawSphere(IPainter painter) voidCall OpenGL2 routines for rendering the object.getColor()Get the color.voidSet the color.voidSet the sphere data.voidsetPosition(Coord3d position) Set the position of the Sphere and the dimensions of its boundingbox.voidsetSlicing(int verticalWires, int horizontalWires) Set the sphere slicing parameters, i.e.voidsetVolume(float radius) Set the radius of the sphere, and the dimensions of its boundingbox.toString(int depth) voidMethods inherited from class Wireframeable
applyDepthRangeDefault, applyDepthRangeForOverlying, applyDepthRangeForUnderlying, applyMaterial, doDrawBoundsIfDisplayed, getMaterialAmbiantReflection, getMaterialDiffuseReflection, getMaterialEmission, getMaterialShininess, getMaterialSpecularReflection, getPolygonOffsetFactor, getPolygonOffsetUnit, getWireframeColor, getWireframeWidth, isFaceDisplayed, isPolygonOffsetFillEnable, isPolygonWireframeDepthTrick, isReflectLight, isWireframeColorFromPolygonPoints, isWireframeDisplayed, polygonOffsetFillDisable, polygonOffsetFillEnable, polygonOffsetLineDisable, polygonOffsetLineEnable, setFaceDisplayed, setMaterialAmbiantReflection, setMaterialDiffuseReflection, setMaterialEmission, setMaterialShininess, setMaterialSpecularReflection, setPolygonOffsetFactor, setPolygonOffsetFillEnable, setPolygonOffsetUnit, setPolygonWireframeDepthTrick, setReflectLight, setWireframeColor, setWireframeColorFromPolygonPoints, setWireframeDisplayed, setWireframeWidthMethods inherited from class 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
-
Field Details
-
position
-
radius
protected float radius -
slices
protected int slices -
stacks
protected int stacks -
color
-
-
Constructor Details
-
Sphere
public Sphere()Initialize a black sphere at the origin with a radius of 10, and slicing of 15. -
Sphere
-
-
Method Details
-
draw
-
doDrawSphere
-
applyGeometryTransform
- Specified by:
applyGeometryTransformin 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-
-
getPosition
-
updateBounds
public void updateBounds()- Specified by:
updateBoundsin 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:ISingleColorableSet the color.- Specified by:
setColorin interfaceISingleColorable- Parameters:
color- the color
-
getColor
Description copied from interface:ISingleColorableGet the color.- Specified by:
getColorin interfaceISingleColorable- Returns:
- color the color.
-
toString
-