public abstract class AbstractGeometry extends AbstractWireframeable implements ISingleColorable, IMultiColorable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractGeometry.PolygonMode |
Modifier and Type | Field and Description |
---|---|
protected Coord3d |
center |
protected Color |
color |
protected ColorMapper |
mapper |
protected List<Point> |
points |
protected AbstractGeometry.PolygonMode |
polygonMode |
protected boolean |
polygonOffsetFillEnable |
facestatus, wfcolor, wfstatus, wfwidth
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
Constructor and Description |
---|
AbstractGeometry()
Initializes an empty
AbstractGeometry with face status defaulting
to true, and wireframe status defaulting to false. |
Modifier and Type | Method and Description |
---|---|
void |
add(Point point) |
void |
add(Point point,
boolean updateBounds)
Add a point to the polygon.
|
void |
applyGeometryTransform(Transform transform) |
protected void |
applyPolygonModeFill(com.jogamp.opengl.GL gl) |
void |
applyPolygonModeFillGL2(com.jogamp.opengl.GL gl) |
void |
applyPolygonModeFillGLES2() |
protected void |
applyPolygonModeLine(com.jogamp.opengl.GL gl) |
protected void |
applyPolygonModeLineGL2(com.jogamp.opengl.GL gl) |
protected void |
applyPolygonModeLineGLES2() |
protected abstract void |
begin(com.jogamp.opengl.GL gl) |
protected void |
callPointForWireframe(com.jogamp.opengl.GL gl)
Drawing the point list in wireframe mode if GL2 profile is available
|
protected void |
callPointsForFace(com.jogamp.opengl.GL gl)
Drawing the point list in face mode (polygon content)
|
void |
callPointsForFaceGL2(com.jogamp.opengl.GL gl)
Drawing the point list in face mode (polygon content) with GL2 profile
|
void |
callPointsForFaceGLES2(com.jogamp.opengl.GL gl)
Drawing the point list in face mode (polygon content) with GLES2 profile
|
void |
callPointsForFaceGLES2(com.jogamp.opengl.GL gl,
List<Point> points)
Drawing the point list in face mode (polygon content) with GLES2 profile
|
void |
callPointsForWireframeGL2(com.jogamp.opengl.GL gl)
Drawing the point list in wireframe mode
|
void |
draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
Call OpenGL2 routines for rendering the object.
|
protected void |
end(com.jogamp.opengl.GL gl) |
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 the
Camera 's eye. |
double |
getLongestDistance(Camera camera) |
List<Point> |
getPoints() |
AbstractGeometry.PolygonMode |
getPolygonMode() |
double |
getShortestDistance(Camera camera) |
boolean |
isPolygonOffsetFillEnable() |
protected void |
polygonOffseFillEnable(com.jogamp.opengl.GL gl) |
protected void |
polygonOffsetFillDisable(com.jogamp.opengl.GL gl) |
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(AbstractGeometry.PolygonMode polygonMode)
A null polygonMode imply no any call to gl.glPolygonMode(...) at
rendering
|
static void |
setPolygonOffsetFillEnable(AbstractComposite composite,
boolean polygonOffsetFillEnable)
A utility to change polygon offset fill status of a
AbstractComposite containing AbstractGeometry s. |
void |
setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable)
Enable offset fill, which let a polygon with a wireframe render cleanly
without weird depth incertainty between face and border.
|
int |
size() |
String |
toString(int depth) |
void |
updateBounds() |
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidth, setFaceDisplayed, setWireframeColor, setWireframeDisplayed, setWireframeWidth
addDrawableListener, call, call, callWithAlphaFactor, colorGL2, colorGLES2, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBoundingBoxColor, getBounds, getLegend, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, vertexGL2, vertexGLES2
protected AbstractGeometry.PolygonMode polygonMode
protected boolean polygonOffsetFillEnable
protected ColorMapper mapper
protected Color color
protected Coord3d center
public AbstractGeometry()
AbstractGeometry
with face status defaulting
to true, and wireframe status defaulting to false.public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)
AbstractDrawable
draw
in interface IGLRenderer
draw
in class AbstractDrawable
gl
- GL2 contextglu
- GLU contextcam
- a reference to a shooting Camera.protected void callPointForWireframe(com.jogamp.opengl.GL gl)
public void callPointsForWireframeGL2(com.jogamp.opengl.GL gl)
protected void callPointsForFace(com.jogamp.opengl.GL gl)
public void callPointsForFaceGLES2(com.jogamp.opengl.GL gl)
public void callPointsForFaceGLES2(com.jogamp.opengl.GL gl, List<Point> points)
public void callPointsForFaceGL2(com.jogamp.opengl.GL gl)
protected abstract void begin(com.jogamp.opengl.GL gl)
protected void end(com.jogamp.opengl.GL gl)
protected void applyPolygonModeLine(com.jogamp.opengl.GL gl)
protected void applyPolygonModeLineGLES2()
protected void applyPolygonModeLineGL2(com.jogamp.opengl.GL gl)
protected void applyPolygonModeFill(com.jogamp.opengl.GL gl)
public void applyPolygonModeFillGLES2()
public void applyPolygonModeFillGL2(com.jogamp.opengl.GL gl)
protected void polygonOffseFillEnable(com.jogamp.opengl.GL gl)
protected void polygonOffsetFillDisable(com.jogamp.opengl.GL gl)
public void add(Point point)
public void add(Point point, boolean updateBounds)
public void applyGeometryTransform(Transform transform)
applyGeometryTransform
in class AbstractDrawable
public void updateBounds()
updateBounds
in class AbstractDrawable
public Coord3d getBarycentre()
AbstractDrawable
Coord3d.INVALID
getBarycentre
in class AbstractDrawable
Coord3d.INVALID
.public Point get(int p)
public int size()
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 AbstractGeometry.PolygonMode getPolygonMode()
public void setPolygonMode(AbstractGeometry.PolygonMode polygonMode)
public boolean isPolygonOffsetFillEnable()
public void setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable)
public static void setPolygonOffsetFillEnable(AbstractComposite composite, boolean polygonOffsetFillEnable)
AbstractComposite
containing AbstractGeometry
s.composite
- polygonOffsetFillEnable
- statuspublic 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 String toString(int depth)
toString
in class AbstractDrawable
Copyright © 2016. All rights reserved.