Class EnlightablePolygon
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.Drawable
-
- org.jzy3d.plot3d.primitives.Wireframeable
-
- org.jzy3d.plot3d.primitives.enlightables.AbstractEnlightable
-
- org.jzy3d.plot3d.primitives.enlightables.EnlightablePolygon
-
- All Implemented Interfaces:
IGLRenderer
,ISortableDraw
public class EnlightablePolygon extends AbstractEnlightable
-
-
Field Summary
Fields Modifier and Type Field Description 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.Wireframeable
depthFunctionChangeForWireframe, faceDisplayed, NO_OVERLAP_DEPTH_RATIO, polygonOffsetFactor, polygonOffsetFillEnable, polygonOffsetUnit, polygonWireframeDepthTrick, reflectLight, wireframeColor, wireframeColorFromPolygonPoints, wireframeDisplayed, wireframeWidth, wireframeWithLineLoop
-
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
-
Constructor Summary
Constructors Constructor Description EnlightablePolygon()
Initializes an emptyPolygon
with face status defaulting to true, and wireframe status defaulting to false.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Point point)
Add a point to the polygon.void
applyGeometryTransform(Transform transform)
void
draw(IPainter painter)
Call OpenGL2 routines for rendering the object.Point
get(int p)
Retrieve a point from thePolygon
.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 thisPolygon
.String
toString(int depth)
void
updateBounds()
protected void
updateCenter()
-
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.Wireframeable
applyDepthRangeDefault, applyDepthRangeForOverlying, applyDepthRangeForUnderlying, doDrawBoundsIfDisplayed, getPolygonOffsetFactor, getPolygonOffsetUnit, getWireframeColor, getWireframeWidth, isFaceDisplayed, isPolygonOffsetFillEnable, isPolygonWireframeDepthTrick, isReflectLight, isWireframeColorFromPolygonPoints, isWireframeDisplayed, polygonOffsetFillDisable, polygonOffsetFillEnable, polygonOffsetLineDisable, polygonOffsetLineEnable, setFaceDisplayed, setPolygonOffsetFactor, setPolygonOffsetFillEnable, setPolygonOffsetUnit, setPolygonWireframeDepthTrick, setReflectLight, setWireframeColor, setWireframeColorFromPolygonPoints, setWireframeDisplayed, setWireframeWidth
-
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doTransform, fireDrawableChanged, fireDrawableChanged, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString
-
-
-
-
Field Detail
-
mapper
protected ColorMapper mapper
-
color
protected Color color
-
center
protected Coord3d center
-
-
Constructor Detail
-
EnlightablePolygon
public EnlightablePolygon()
Initializes an emptyPolygon
with face status defaulting to true, and wireframe status defaulting to false.
-
-
Method Detail
-
draw
public void draw(IPainter painter)
Description copied from class:Drawable
Call OpenGL2 routines for rendering the object.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransform
in classDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBounds
in classDrawable
-
updateCenter
protected void updateCenter()
-
add
public void add(Point point)
Add a point to the polygon.
-
hasAlpha
public boolean hasAlpha()
-
getBarycentre
public Coord3d getBarycentre()
Description copied from class:Drawable
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 isCoord3d.INVALID
- Overrides:
getBarycentre
in classDrawable
- Returns:
- the center of the bounding box, or
Coord3d.INVALID
.
-
size
public int size()
Indicates the number of points in thisPolygon
.- 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()
-
-