org.jzy3d.plot3d.primitives
Class AbstractGeometry
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.AbstractDrawable
-
- org.jzy3d.plot3d.primitives.AbstractWireframeable
-
- org.jzy3d.plot3d.primitives.AbstractGeometry
-
- All Implemented Interfaces:
- IMultiColorable, ISingleColorable, IGLRenderer, ISortableDraw
- Direct Known Subclasses:
- AxeTransformableAbstractGeometry, Polygon
public abstract class AbstractGeometry extends AbstractWireframeable implements ISingleColorable, IMultiColorable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classAbstractGeometry.PolygonMode
-
Constructor Summary
Constructors Constructor and Description AbstractGeometry()Initializes an emptyAbstractGeometrywith face status defaulting to true, and wireframe status defaulting to false.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(Point point)voidadd(Point point, boolean updateBounds)Add a point to the polygon.voidapplyGeometryTransform(Transform transform)voidapplyPolygonModeFillGL2(com.jogamp.opengl.GL gl)voidapplyPolygonModeFillGLES2()voidcallPointsForFaceGL2(com.jogamp.opengl.GL gl)Drawing the point list in face mode (polygon content) with GL2 profilevoidcallPointsForFaceGLES2(com.jogamp.opengl.GL gl)Drawing the point list in face mode (polygon content) with GLES2 profilevoidcallPointsForFaceGLES2(com.jogamp.opengl.GL gl, java.util.List<Point> points)Drawing the point list in face mode (polygon content) with GLES2 profilevoidcallPointsForWireframeGL2(com.jogamp.opengl.GL gl)Drawing the point list in wireframe modevoiddraw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Call OpenGL2 routines for rendering the object.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)java.util.List<Point>getPoints()AbstractGeometry.PolygonModegetPolygonMode()doublegetShortestDistance(Camera camera)booleanisPolygonOffsetFillEnable()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(AbstractGeometry.PolygonMode polygonMode)A null polygonMode imply no any call to gl.glPolygonMode(...) at renderingstatic voidsetPolygonOffsetFillEnable(AbstractComposite composite, boolean polygonOffsetFillEnable)A utility to change polygon offset fill status of aAbstractCompositecontainingAbstractGeometrys.voidsetPolygonOffsetFillEnable(boolean polygonOffsetFillEnable)Enable offset fill, which let a polygon with a wireframe render cleanly without weird depth incertainty between face and border.intsize()java.lang.StringtoString(int depth)voidupdateBounds()-
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, doTransform, getBoundingBoxColor, getBounds, getLegend, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString
-
-
-
-
Constructor Detail
-
AbstractGeometry
public AbstractGeometry()
Initializes an emptyAbstractGeometrywith face status defaulting to true, and wireframe status defaulting to false.
-
-
Method Detail
-
draw
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Description copied from class:AbstractDrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classAbstractDrawable- Parameters:
gl- GL2 contextglu- GLU contextcam- a reference to a shooting Camera.
-
callPointsForWireframeGL2
public void callPointsForWireframeGL2(com.jogamp.opengl.GL gl)
Drawing the point list in wireframe mode
-
callPointsForFaceGLES2
public void callPointsForFaceGLES2(com.jogamp.opengl.GL gl)
Drawing the point list in face mode (polygon content) with GLES2 profile
-
callPointsForFaceGLES2
public void callPointsForFaceGLES2(com.jogamp.opengl.GL gl, java.util.List<Point> points)Drawing the point list in face mode (polygon content) with GLES2 profile
-
callPointsForFaceGL2
public void callPointsForFaceGL2(com.jogamp.opengl.GL gl)
Drawing the point list in face mode (polygon content) with GL2 profile
-
applyPolygonModeFillGLES2
public void applyPolygonModeFillGLES2()
-
applyPolygonModeFillGL2
public void applyPolygonModeFillGL2(com.jogamp.opengl.GL gl)
-
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 classAbstractDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classAbstractDrawable
-
getBarycentre
public Coord3d getBarycentre()
Description copied from class:AbstractDrawableReturn 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 classAbstractDrawable- Returns:
- the center of the bounding box, or
Coord3d.INVALID.
-
get
public Point get(int p)
-
getPoints
public java.util.List<Point> getPoints()
-
size
public int size()
-
getDistance
public double getDistance(Camera camera)
Description copied from class:AbstractDrawableReturn the distance of the object center to theCamera's eye.- Specified by:
getDistancein interfaceISortableDraw- Overrides:
getDistancein classAbstractDrawable
-
getShortestDistance
public double getShortestDistance(Camera camera)
- Specified by:
getShortestDistancein interfaceISortableDraw- Overrides:
getShortestDistancein classAbstractDrawable
-
getLongestDistance
public double getLongestDistance(Camera camera)
- Specified by:
getLongestDistancein interfaceISortableDraw- Overrides:
getLongestDistancein classAbstractDrawable
-
getPolygonMode
public AbstractGeometry.PolygonMode getPolygonMode()
-
setPolygonMode
public void setPolygonMode(AbstractGeometry.PolygonMode polygonMode)
A null polygonMode imply no any call to gl.glPolygonMode(...) at rendering
-
isPolygonOffsetFillEnable
public boolean isPolygonOffsetFillEnable()
-
setPolygonOffsetFillEnable
public void setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable)
Enable offset fill, which let a polygon with a wireframe render cleanly without weird depth incertainty between face and border. Default value is true.
-
setPolygonOffsetFillEnable
public static void setPolygonOffsetFillEnable(AbstractComposite composite, boolean polygonOffsetFillEnable)
A utility to change polygon offset fill status of aAbstractCompositecontainingAbstractGeometrys.- Parameters:
composite-polygonOffsetFillEnable- status
-
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.
-
toString
public java.lang.String toString(int depth)
- Overrides:
toStringin classAbstractDrawable
-
-
DMelt 3.0 © DataMelt by jWork.ORG