|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jzy3d.plot3d.primitives.AbstractDrawable
org.jzy3d.plot3d.primitives.AbstractWireframeable
org.jzy3d.plot3d.primitives.Polygon
public class Polygon
Supports additional settings
| Nested Class Summary | |
|---|---|
static class |
Polygon.PolygonMode
|
| Field Summary | |
|---|---|
protected Coord3d |
center
|
protected Color |
color
|
protected ColorMapper |
mapper
|
protected List<Point> |
points
|
protected Polygon.PolygonMode |
polygonMode
|
protected boolean |
polygonOffsetFillEnable
|
| 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 | |
|---|---|
Polygon()
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. |
protected void |
applyPolygonModeFill(javax.media.opengl.GL2 gl)
|
protected void |
applyPolygonModeLine(javax.media.opengl.GL2 gl)
|
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)
|
List<Point> |
getAll()
|
Coord3d |
getBarycentre()
Return the barycentre of this object, which is computed as the center of its bounding box. |
Color |
getColor()
Get the color. |
ColorMapper |
getColorMapper()
Get the colormapper. |
double |
getDistance(Camera camera)
Return the distance of the object center to the Camera's eye. |
double |
getLongestDistance(Camera camera)
|
Polygon.PolygonMode |
getPolygonMode()
|
double |
getShortestDistance(Camera camera)
|
boolean |
isPolygonOffsetFillEnable()
|
protected void |
polygonOffseFillEnable(javax.media.opengl.GL2 gl)
|
protected void |
polygonOffsetFillDisable(javax.media.opengl.GL2 gl)
|
void |
setColor(Color color)
Set the color. |
void |
setColorMapper(ColorMapper mapper)
Set the colormapper that will be used by the Drawable, instead of using precomputed colors. |
void |
setPolygonMode(Polygon.PolygonMode polygonMode)
A null polygonMode imply no any call to gl.glPolygonMode(...) at rendering |
static void |
setPolygonOffsetFillEnable(AbstractComposite composite,
boolean polygonOffsetFillEnable)
A utility to change polygon offset fill status of a AbstractComposite
containing Polygons. |
void |
setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable)
Enable offset fill, which let a polygon with a wireframe render cleanly without weird depth incertainty between face and border. |
int |
size()
|
String |
toString(int depth)
|
| 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, getLegend, 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 |
|---|
protected Polygon.PolygonMode polygonMode
protected boolean polygonOffsetFillEnable
protected ColorMapper mapper
protected List<Point> points
protected Color color
protected Coord3d center
| Constructor Detail |
|---|
public Polygon()
Polygon with face status defaulting to true,
and wireframe status defaulting to false.
| Method Detail |
|---|
public void draw(javax.media.opengl.GL2 gl,
javax.media.opengl.glu.GLU glu,
Camera cam)
AbstractDrawable
draw in interface IGLRendererdraw in class AbstractDrawablegl - GL2 contextglu - GLU contextcam - a reference to a shooting Camera.protected void applyPolygonModeLine(javax.media.opengl.GL2 gl)
protected void applyPolygonModeFill(javax.media.opengl.GL2 gl)
protected void polygonOffseFillEnable(javax.media.opengl.GL2 gl)
protected void polygonOffsetFillDisable(javax.media.opengl.GL2 gl)
public void add(Point point)
public Coord3d getBarycentre()
AbstractDrawableCoord3d.INVALID
getBarycentre in class AbstractDrawableCoord3d.INVALID.public Point get(int p)
public List<Point> getAll()
public int size()
public double getDistance(Camera camera)
AbstractDrawableCamera's eye.
getDistance in interface ISortableDrawgetDistance in class AbstractDrawablepublic double getShortestDistance(Camera camera)
getShortestDistance in interface ISortableDrawgetShortestDistance in class AbstractDrawablepublic double getLongestDistance(Camera camera)
getLongestDistance in interface ISortableDrawgetLongestDistance in class AbstractDrawablepublic Polygon.PolygonMode getPolygonMode()
public void setPolygonMode(Polygon.PolygonMode polygonMode)
public boolean isPolygonOffsetFillEnable()
public void setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable)
public static void setPolygonOffsetFillEnable(AbstractComposite composite,
boolean polygonOffsetFillEnable)
AbstractComposite
containing Polygons.
composite - polygonOffsetFillEnable - statuspublic void setColorMapper(ColorMapper mapper)
IMultiColorable
setColorMapper in interface IMultiColorablepublic ColorMapper getColorMapper()
IMultiColorable
getColorMapper in interface IMultiColorablepublic void setColor(Color color)
ISingleColorable
setColor in interface ISingleColorablecolor - the colorpublic Color getColor()
ISingleColorable
getColor in interface ISingleColorablepublic String toString(int depth)
toString in class AbstractDrawable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||