|
||||||||||
| 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
A Polygon holds a List of Points that store a coordinate
and a color.
There is no setData function for a Polygon since it is built incrementaly
by calls to add(Point).
The effective color of the Polygon will be an interpolation between
all Polygon's point colors.
The final rendering will thus depend on the selected shading model
for Polygons (see Scene.init()).
A Polygon is not a AbstractComposite, because:
Point only, and no generic AbstractDrawable.
| 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. |
void |
draw(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
Camera cam)
Call OpenGL routines for rendering the object. |
Point |
get(int p)
Retrieve a point from the Polygon. |
java.util.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)
|
double |
getShortestDistance(Camera camera)
|
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. |
int |
size()
Indicates the number of points in this Polygon. |
java.lang.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, dispose, getBounds, getFace, getTransform, hasFace, isDisplayed, isFace2dDisplayed, removeDrawableListener, setDisplayed, setLegend, setLegendDisplayed, setTransform, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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.GL gl,
javax.media.opengl.glu.GLU glu,
Camera cam)
AbstractDrawable
draw in interface IGLRendererdraw in class AbstractDrawablegl - GL contextglu - GLU contextcam - a reference to a shooting Camera.public void add(Point point)
public Coord3d getBarycentre()
AbstractDrawableCoord3d.INVALID
getBarycentre in class AbstractDrawableCoord3d.INVALID.public Point get(int p)
Polygon.
public java.util.List<Point> getAll()
public int size()
Polygon.
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 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 java.lang.String toString(int depth)
toString in class AbstractDrawable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||