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 Coord3d
center
protected Color
color
protected ColorMapper
mapper
protected List<Point>
points
protected PolygonMode
polygonMode
-
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 void
add(float x, float y, float z)
void
add(Coord3d coord)
void
add(Point point)
void
add(Point point, boolean updateBounds)
Add a point to the polygon.void
applyGeometryTransform(Transform transform)
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
...protected void
callPointForWireframe(IPainter painter)
Drawing the point list in wireframe modeprotected void
callPointsForFace(IPainter painter)
Drawing the point list in face mode (polygon content)void
draw(IPainter painter)
Call OpenGL2 routines for rendering the object.protected void
drawFace(IPainter painter)
protected void
drawWireframe(IPainter painter)
Point
get(int p)
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 theCamera
's eye.double
getLongestDistance(Camera camera)
List<Point>
getPoints()
PolygonMode
getPolygonMode()
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.void
setPolygonMode(PolygonMode polygonMode)
A null polygonMode imply no any call to gl.glPolygonMode(...) at renderingint
size()
String
toString(int depth)
void
updateBounds()
-
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 emptyGeometry
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
-
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:
applyGeometryTransform
in classDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBounds
in classDrawable
-
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
.
-
get
public Point get(int p)
-
size
public int size()
-
getDistance
public double getDistance(Camera camera)
Description copied from class:Drawable
Return the distance of the object center to theCamera
's eye.- Specified by:
getDistance
in interfaceISortableDraw
- Overrides:
getDistance
in classDrawable
-
getShortestDistance
public double getShortestDistance(Camera camera)
- Specified by:
getShortestDistance
in interfaceISortableDraw
- Overrides:
getShortestDistance
in classDrawable
-
getLongestDistance
public double getLongestDistance(Camera camera)
- Specified by:
getLongestDistance
in interfaceISortableDraw
- Overrides:
getLongestDistance
in 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:IMultiColorable
Set the colormapper that will be used by the Drawable, instead of using precomputed colors.- Specified by:
setColorMapper
in interfaceIMultiColorable
-
getColorMapper
public ColorMapper getColorMapper()
Description copied from interface:IMultiColorable
Get the colormapper.- Specified by:
getColorMapper
in interfaceIMultiColorable
-
setColor
public void setColor(Color color)
Description copied from interface:ISingleColorable
Set the color.- Specified by:
setColor
in interfaceISingleColorable
- Parameters:
color
- the color
-
getColor
public Color getColor()
Description copied from interface:ISingleColorable
Get the color.- Specified by:
getColor
in interfaceISingleColorable
- Returns:
- color the color.
-
-