public class EnlightablePolygon extends AbstractEnlightable
Modifier and Type | Field and Description |
---|---|
protected Coord3d |
center |
protected Color |
color |
protected ColorMapper |
mapper |
protected List<Point> |
points |
materialAmbiantReflection, materialDiffuseReflection, materialEmission, materialShininess, materialSpecularReflection
facestatus, wfcolor, wfstatus, wfwidth
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
Constructor and Description |
---|
EnlightablePolygon()
Initializes an empty
Polygon with face status defaulting to true,
and wireframe status defaulting to false. |
Modifier and Type | Method and Description |
---|---|
void |
add(Point point)
Add a point to the polygon.
|
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.
|
Point |
get(int p)
Retrieve a point from the
Polygon . |
Coord3d |
getBarycentre()
Return the barycentre of this object, which is computed as the center of
its bounding box.
|
Color |
getColor() |
ColorMapper |
getColorMapper() |
boolean |
hasAlpha() |
void |
setColor(Color color) |
void |
setColorMapper(ColorMapper mapper) |
int |
size()
Indicates the number of points in this
Polygon . |
String |
toString(int depth) |
void |
updateBounds() |
protected void |
updateCenter() |
applyMaterial, getMaterialAmbiantReflection, getMaterialDiffuseReflection, getMaterialEmission, getMaterialShininess, getMaterialSpecularReflection, setMaterialAmbiantReflection, setMaterialDiffuseReflection, setMaterialEmission, setMaterialShininess, setMaterialSpecularReflection
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidth, setFaceDisplayed, setWireframeColor, setWireframeDisplayed, setWireframeWidth
addDrawableListener, call, call, callWithAlphaFactor, colorGL2, colorGLES2, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, vertexGL2, vertexGLES2
protected ColorMapper mapper
protected Color color
protected Coord3d center
public EnlightablePolygon()
Polygon
with face status defaulting to true,
and wireframe status defaulting to false.public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)
AbstractDrawable
draw
in interface IGLRenderer
draw
in class AbstractDrawable
gl
- GL2 contextglu
- GLU contextcam
- a reference to a shooting Camera.public void applyGeometryTransform(Transform transform)
applyGeometryTransform
in class AbstractDrawable
public void updateBounds()
updateBounds
in class AbstractDrawable
protected void updateCenter()
public void add(Point point)
public boolean hasAlpha()
public Coord3d getBarycentre()
AbstractDrawable
Coord3d.INVALID
getBarycentre
in class AbstractDrawable
Coord3d.INVALID
.public int size()
Polygon
.public void setColorMapper(ColorMapper mapper)
public ColorMapper getColorMapper()
public void setColor(Color color)
public Color getColor()
public String toString(int depth)
toString
in class AbstractDrawable
Copyright © 2016. All rights reserved.