|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jzy3d.plot3d.primitives.AbstractDrawable org.jzy3d.plot3d.primitives.AbstractWireframeable org.jzy3d.plot3d.primitives.Polygon
public class Polygon
A Polygon
holds a List of Point
s 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 Polygon
s (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 IGLRenderer
draw
in class AbstractDrawable
gl
- GL contextglu
- GLU contextcam
- a reference to a shooting Camera.public void add(Point point)
public Coord3d getBarycentre()
AbstractDrawable
Coord3d.INVALID
getBarycentre
in class AbstractDrawable
Coord3d.INVALID
.public Point get(int p)
Polygon
.
public java.util.List<Point> getAll()
public int size()
Polygon
.
public double getDistance(Camera camera)
AbstractDrawable
Camera
's eye.
getDistance
in interface ISortableDraw
getDistance
in class AbstractDrawable
public double getShortestDistance(Camera camera)
getShortestDistance
in interface ISortableDraw
getShortestDistance
in class AbstractDrawable
public double getLongestDistance(Camera camera)
getLongestDistance
in interface ISortableDraw
getLongestDistance
in class AbstractDrawable
public void setColorMapper(ColorMapper mapper)
IMultiColorable
setColorMapper
in interface IMultiColorable
public ColorMapper getColorMapper()
IMultiColorable
getColorMapper
in interface IMultiColorable
public void setColor(Color color)
ISingleColorable
setColor
in interface ISingleColorable
color
- the colorpublic Color getColor()
ISingleColorable
getColor
in interface ISingleColorable
public 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 |