org.jzy3d.plot3d.primitives
Class Tube
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.AbstractDrawable
-
- org.jzy3d.plot3d.primitives.AbstractWireframeable
-
- org.jzy3d.plot3d.primitives.Tube
-
- All Implemented Interfaces:
- ISingleColorable, IGLRenderer, ISortableDraw
public class Tube extends AbstractWireframeable implements ISingleColorable
-
-
Constructor Summary
Constructors Constructor and Description Tube()Initialize a Cylinder at the origin.Tube(Coord3d position, float radius, float height, int hslicing, int vslicing, Color color)Initialize a cylinder with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyGeometryTransform(Transform transform)voiddraw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Call OpenGL2 routines for rendering the object.ColorgetColor()Get the color.voidsetColor(Color color)Set the color.voidsetData(Coord3d position, float radiusBottom, float radiusTop, float height, int slices, int stacks)Set theTubedata.voidsetPosition(Coord3d position)Set the position of the Cylinder and the dimensions of its boundingbox.voidsetSlicing(int verticalWires, int horizontalWires)Set the cylinder slicing parameters, i.e.voidsetVolume(float radiusBottom, float radiusTop, float height)Set the top and bottom radius of the cylinder, its height, and the dimensions of its boundingbox.voidupdateBounds()-
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractWireframeable
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidth, setFaceDisplayed, setWireframeColor, setWireframeDisplayed, setWireframeWidth
-
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, dispose, doTransform, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString
-
-
-
-
Method Detail
-
draw
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Description copied from class:AbstractDrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classAbstractDrawable- Parameters:
gl- GL2 contextglu- GLU contextcam- a reference to a shooting Camera.
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransformin classAbstractDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classAbstractDrawable
-
setData
public void setData(Coord3d position, float radiusBottom, float radiusTop, float height, int slices, int stacks)
Set theTubedata.- Parameters:
position- cylinder position (may be handled diffrently in future version)radiusBottom- radius of the bottom circleradiusTop- radius of the top circleheight- height of the cylinderslices- number of vertical slices (i.e. wireframes)stacks- number of horizontal stacks (i.e. wireframes)
-
setPosition
public void setPosition(Coord3d position)
Set the position of the Cylinder 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-
-
setVolume
public void setVolume(float radiusBottom, float radiusTop, float height)Set the top and bottom radius of the cylinder, its height, and the dimensions of its boundingbox.- Parameters:
radiusBottom-radiusTop-height-
-
setSlicing
public void setSlicing(int verticalWires, int horizontalWires)Set the cylinder slicing parameters, i.e. the subtlety of the circle estimation.- Parameters:
verticalWires- number of vertical sliceshorizontalWires- number of horizontal slices
-
setColor
public void setColor(Color color)
Description copied from interface:ISingleColorableSet the color.- Specified by:
setColorin interfaceISingleColorable- Parameters:
color- the color
-
getColor
public Color getColor()
Description copied from interface:ISingleColorableGet the color.- Specified by:
getColorin interfaceISingleColorable- Returns:
- color the color.
-
-
DMelt 3.0 © DataMelt by jWork.ORG