public class Tube extends AbstractWireframeable implements ISingleColorable
Tube may be used to render cylinders or pyramids, according to its
input parameters. Tube is defined through its setData() method. Moreover, a Tube is Wireframeable3d and support
only one color that is defined trough its setColor() method.facestatus, wfcolor, wfstatus, wfwidthbbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore| 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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyGeometryTransform(Transform transform) |
void |
draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
Call OpenGL2 routines for rendering the object.
|
Color |
getColor()
Get the color.
|
void |
setColor(Color color)
Set the color.
|
void |
setData(Coord3d position,
float radiusBottom,
float radiusTop,
float height,
int slices,
int stacks)
Set the
Tube data. |
void |
setPosition(Coord3d position)
Set the position of the Cylinder and the dimensions of its boundingbox.
|
void |
setSlicing(int verticalWires,
int horizontalWires)
Set the cylinder slicing parameters, i.e. the subtlety of the circle
estimation.
|
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.
|
void |
updateBounds() |
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidth, setFaceDisplayed, setWireframeColor, setWireframeDisplayed, setWireframeWidthaddDrawableListener, call, call, callWithAlphaFactor, colorGL2, colorGLES2, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString, vertexGL2, vertexGLES2public void draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
AbstractDrawabledraw in interface IGLRendererdraw in class AbstractDrawablegl - GL2 contextglu - GLU contextcam - a reference to a shooting Camera.public void applyGeometryTransform(Transform transform)
applyGeometryTransform in class AbstractDrawablepublic void updateBounds()
updateBounds in class AbstractDrawablepublic void setData(Coord3d position, float radiusBottom, float radiusTop, float height, int slices, int stacks)
Tube data.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)public void setPosition(Coord3d position)
position - public void setVolume(float radiusBottom,
float radiusTop,
float height)
radiusBottom - radiusTop - height - public void setSlicing(int verticalWires,
int horizontalWires)
verticalWires - number of vertical sliceshorizontalWires - number of horizontal slicespublic void setColor(Color color)
ISingleColorablesetColor in interface ISingleColorablecolor - the colorpublic Color getColor()
ISingleColorablegetColor in interface ISingleColorableCopyright © 2016. All rights reserved.