Package org.jzy3d.plot3d.primitives
Class Geometry
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.Drawable
-
- org.jzy3d.plot3d.primitives.Wireframeable
-
- org.jzy3d.plot3d.primitives.Geometry
-
- All Implemented Interfaces:
IMultiColorable,ISingleColorable,IGLRenderer,ISortableDraw
public abstract class Geometry extends Wireframeable implements ISingleColorable, IMultiColorable
-
-
Field Summary
Fields Modifier and Type Field Description protected Coord3dcenterprotected Colorcolorprotected ColorMappermapperprotected List<Point>pointsprotected PolygonModepolygonMode-
Fields inherited from class org.jzy3d.plot3d.primitives.Wireframeable
faceDisplayed, polygonOffsetFactor, polygonOffsetFillEnable, polygonOffsetUnit, polygonWireframeDepthTrick, wireframeColor, wireframeColorFromPolygonPoints, wireframeDisplayed, wireframeWidth
-
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(float x, float y, float z)voidadd(Coord3d coord)voidadd(Point point)voidadd(Point point, boolean updateBounds)Add a point to the polygon.voidapplyGeometryTransform(Transform transform)protected abstract voidbegin(IPainter painter)Invoke GL begin with the actual geometry typeGL#GL_POINTS,GL#GL_LINES,GL#GL_TRIANGLES,GL2#GL_POLYGON...protected voidcallPointForWireframe(IPainter painter)Drawing the point list in wireframe modeprotected voidcallPointsForFace(IPainter painter)Drawing the point list in face mode (polygon content)voiddraw(IPainter painter)Call OpenGL2 routines for rendering the object.protected voiddrawFace(IPainter painter)protected voiddrawWireframe(IPainter painter)Pointget(int p)Coord3dgetBarycentre()Return the barycentre of this object, which is computed as the center of its bounding box.ColorgetColor()Get the color.ColorMappergetColorMapper()Get the colormapper.doublegetDistance(Camera camera)Return the distance of the object center to theCamera's eye.doublegetLongestDistance(Camera camera)List<Point>getPoints()PolygonModegetPolygonMode()doublegetShortestDistance(Camera camera)voidsetColor(Color color)Set the color.voidsetColorMapper(ColorMapper mapper)Set the colormapper that will be used by the Drawable, instead of using precomputed colors.voidsetPolygonMode(PolygonMode polygonMode)A null polygonMode imply no any call to gl.glPolygonMode(...) at renderingintsize()StringtoString(int depth)voidupdateBounds()-
Methods inherited from class org.jzy3d.plot3d.primitives.Wireframeable
applyDepthRangeForOverlying, applyDepthRangeForUnderlying, getFaceDisplayed, getPolygonOffsetFactor, getPolygonOffsetUnit, getWireframeColor, getWireframeDisplayed, getWireframeWidth, isPolygonOffsetFillEnable, isPolygonWireframeDepthTrick, isWireframeColorFromPolygonPoints, polygonOffseFillEnable, polygonOffsetFillDisable, polygonOffsetLineDisable, polygonOffsetLineEnable, setFaceDisplayed, setPolygonOffsetFactor, setPolygonOffsetFillEnable, setPolygonOffsetUnit, setPolygonWireframeDepthTrick, setWireframeColor, setWireframeColorFromPolygonPoints, setWireframeDisplayed, setWireframeWidth
-
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBoundingBoxColor, getBounds, getLegend, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString
-
-
-
-
Field Detail
-
polygonMode
protected PolygonMode polygonMode
-
mapper
protected ColorMapper mapper
-
color
protected Color color
-
center
protected Coord3d center
-
-
Constructor Detail
-
Geometry
public Geometry()
Initializes an emptyGeometrywith face status defaulting to true, and wireframe status defaulting to false.
-
-
Method Detail
-
draw
public void draw(IPainter painter)
Description copied from class:DrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classDrawable
-
drawFace
protected void drawFace(IPainter painter)
-
drawWireframe
protected void drawWireframe(IPainter painter)
-
callPointForWireframe
protected void callPointForWireframe(IPainter painter)
Drawing the point list in wireframe mode
-
callPointsForFace
protected void callPointsForFace(IPainter painter)
Drawing the point list in face mode (polygon content)
-
begin
protected abstract void begin(IPainter painter)
Invoke GL begin with the actual geometry typeGL#GL_POINTS,GL#GL_LINES,GL#GL_TRIANGLES,GL2#GL_POLYGON...
-
add
public void add(float x, float y, float z)
-
add
public void add(Coord3d coord)
-
add
public void add(Point point)
-
add
public void add(Point point, boolean updateBounds)
Add a point to the polygon.
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransformin classDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classDrawable
-
getBarycentre
public Coord3d getBarycentre()
Description copied from class:DrawableReturn 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:
getBarycentrein classDrawable- Returns:
- the center of the bounding box, or
Coord3d.INVALID.
-
get
public Point get(int p)
-
size
public int size()
-
getDistance
public double getDistance(Camera camera)
Description copied from class:DrawableReturn the distance of the object center to theCamera's eye.- Specified by:
getDistancein interfaceISortableDraw- Overrides:
getDistancein classDrawable
-
getShortestDistance
public double getShortestDistance(Camera camera)
- Specified by:
getShortestDistancein interfaceISortableDraw- Overrides:
getShortestDistancein classDrawable
-
getLongestDistance
public double getLongestDistance(Camera camera)
- Specified by:
getLongestDistancein interfaceISortableDraw- Overrides:
getLongestDistancein classDrawable
-
getPolygonMode
public PolygonMode getPolygonMode()
-
setPolygonMode
public void setPolygonMode(PolygonMode polygonMode)
A null polygonMode imply no any call to gl.glPolygonMode(...) at rendering
-
setColorMapper
public void setColorMapper(ColorMapper mapper)
Description copied from interface:IMultiColorableSet the colormapper that will be used by the Drawable, instead of using precomputed colors.- Specified by:
setColorMapperin interfaceIMultiColorable
-
getColorMapper
public ColorMapper getColorMapper()
Description copied from interface:IMultiColorableGet the colormapper.- Specified by:
getColorMapperin interfaceIMultiColorable
-
setColor
public void setColor(Color color)
Description copied from interface:ISingleColorableSet the color.- Specified by:
setColorin interfaceISingleColorable- Parameters:
color- the color
-
getColor
public Color getColor()
Description copied from interface:ISingleColorableGet the color.- Specified by:
getColorin interfaceISingleColorable- Returns:
- color the color.
-
-