org.jzy3d.plot3d.primitives.enlightables
Class EnlightablePolygon

java.lang.Object
  extended by org.jzy3d.plot3d.primitives.AbstractDrawable
      extended by org.jzy3d.plot3d.primitives.AbstractWireframeable
          extended by org.jzy3d.plot3d.primitives.enlightables.AbstractEnlightable
              extended by org.jzy3d.plot3d.primitives.enlightables.EnlightablePolygon
All Implemented Interfaces:
IGLRenderer, ISortableDraw

public class EnlightablePolygon
extends AbstractEnlightable


Field Summary
protected  Coord3d center
           
protected  Color color
           
protected  ColorMapper mapper
           
protected  List<Point> points
           
 
Fields inherited from class org.jzy3d.plot3d.primitives.enlightables.AbstractEnlightable
materialAmbiantReflection, materialDiffuseReflection, materialEmission, materialShininess, materialSpecularReflection
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractWireframeable
facestatus, wfcolor, wfstatus, wfwidth
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
bbox, displayed, hasListeners, legend, legendDisplayed, listeners, transform
 
Constructor Summary
EnlightablePolygon()
          Initializes an empty Polygon with face status defaulting to true, and wireframe status defaulting to false.
 
Method Summary
 void add(Point point)
          Add a point to the polygon.
 void draw(javax.media.opengl.GL2 gl, javax.media.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)
           
 
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.AbstractWireframeable
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidth, setFaceDisplayed, setWireframeColor, setWireframeDisplayed, setWireframeWidth
 
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, call, call, callWithAlphaFactor, dispose, fireDrawableChanged, fireDrawableChanged, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getTransform, hasLegend, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setDisplayed, setLegend, setLegendDisplayed, setTransform, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mapper

protected ColorMapper mapper

points

protected List<Point> points

color

protected Color color

center

protected Coord3d center
Constructor Detail

EnlightablePolygon

public EnlightablePolygon()
Initializes an empty Polygon with face status defaulting to true, and wireframe status defaulting to false.

Method Detail

draw

public void draw(javax.media.opengl.GL2 gl,
                 javax.media.opengl.glu.GLU glu,
                 Camera cam)
Description copied from class: AbstractDrawable
Call OpenGL2 routines for rendering the object.

Specified by:
draw in interface IGLRenderer
Specified by:
draw in class AbstractDrawable
Parameters:
gl - GL2 context
glu - GLU context
cam - a reference to a shooting Camera.

add

public void add(Point point)
Add a point to the polygon.


hasAlpha

public boolean hasAlpha()

getBarycentre

public Coord3d getBarycentre()
Description copied from class: AbstractDrawable
Return the barycentre of this object, which is computed as the center of its bounding box. If the bounding box is not available, the returned value is Coord3d.INVALID

Overrides:
getBarycentre in class AbstractDrawable
Returns:
the center of the bounding box, or Coord3d.INVALID.

get

public Point get(int p)
Retrieve a point from the Polygon.

Returns:
a Point3d.

size

public int size()
Indicates the number of points in this Polygon.

Returns:
the number of points

setColorMapper

public void setColorMapper(ColorMapper mapper)

getColorMapper

public ColorMapper getColorMapper()

setColor

public void setColor(Color color)

getColor

public Color getColor()

toString

public String toString(int depth)
Overrides:
toString in class AbstractDrawable