org.jzy3d.plot3d.primitives
Class AbstractGeometry

java.lang.Object
  extended by org.jzy3d.plot3d.primitives.AbstractDrawable
      extended by org.jzy3d.plot3d.primitives.AbstractWireframeable
          extended by org.jzy3d.plot3d.primitives.AbstractGeometry
All Implemented Interfaces:
IMultiColorable, ISingleColorable, IGLRenderer, ISortableDraw
Direct Known Subclasses:
Polygon

public abstract class AbstractGeometry
extends AbstractWireframeable
implements ISingleColorable, IMultiColorable


Nested Class Summary
static class AbstractGeometry.PolygonMode
           
 
Field Summary
protected  Coord3d center
           
protected  Color color
           
protected  ColorMapper mapper
           
protected  List<Point> points
           
protected  AbstractGeometry.PolygonMode polygonMode
           
protected  boolean polygonOffsetFillEnable
           
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractWireframeable
facestatus, wfcolor, wfstatus, wfwidth
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, transform, transformBefore
 
Constructor Summary
AbstractGeometry()
          Initializes an empty AbstractGeometry with face status defaulting to true, and wireframe status defaulting to false.
 
Method Summary
 void add(Point point)
           
 void add(Point point, boolean updateBounds)
          Add a point to the polygon.
 void applyGeometryTransform(Transform transform)
           
protected  void applyPolygonModeFill(javax.media.opengl.GL gl)
           
protected  void applyPolygonModeLine(javax.media.opengl.GL gl)
           
protected abstract  void begin(javax.media.opengl.GL gl)
           
protected  void callPointForWireframe(javax.media.opengl.GL gl)
           
protected  void callPointsForFace(javax.media.opengl.GL gl)
           
 void draw(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, Camera cam)
          Call OpenGL2 routines for rendering the object.
protected  void end(javax.media.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(javax.media.opengl.GL gl)
           
protected  void polygonOffsetFillDisable(javax.media.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 AbstractGeometrys.
 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()
           
 
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, call, call, callWithAlphaFactor, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBoundingBoxColor, getBounds, getLegend, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setTransform, setTransformBefore, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

polygonMode

protected AbstractGeometry.PolygonMode polygonMode

polygonOffsetFillEnable

protected boolean polygonOffsetFillEnable

mapper

protected ColorMapper mapper

points

protected List<Point> points

color

protected Color color

center

protected Coord3d center
Constructor Detail

AbstractGeometry

public AbstractGeometry()
Initializes an empty AbstractGeometry with face status defaulting to true, and wireframe status defaulting to false.

Method Detail

draw

public void draw(javax.media.opengl.GL gl,
                 javax.media.opengl.glu.GLU glu,
                 Camera cam)
Description copied from class: AbstractDrawable
Call OpenGL2 routines for rendering the object.

Specified by:
draw in interface IGLRenderer
Specified by:
draw in class AbstractDrawable
Parameters:
gl - GL2 context
glu - GLU context
cam - a reference to a shooting Camera.

callPointForWireframe

protected void callPointForWireframe(javax.media.opengl.GL gl)

callPointsForFace

protected void callPointsForFace(javax.media.opengl.GL gl)

begin

protected abstract void begin(javax.media.opengl.GL gl)

end

protected void end(javax.media.opengl.GL gl)

applyPolygonModeLine

protected void applyPolygonModeLine(javax.media.opengl.GL gl)

applyPolygonModeFill

protected void applyPolygonModeFill(javax.media.opengl.GL gl)

polygonOffseFillEnable

protected void polygonOffseFillEnable(javax.media.opengl.GL gl)

polygonOffsetFillDisable

protected void polygonOffsetFillDisable(javax.media.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:
applyGeometryTransform in class AbstractDrawable

updateBounds

public void updateBounds()
Specified by:
updateBounds in class AbstractDrawable

getBarycentre

public Coord3d getBarycentre()
Description copied from class: AbstractDrawable
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 is Coord3d.INVALID

Overrides:
getBarycentre in class AbstractDrawable
Returns:
the center of the bounding box, or Coord3d.INVALID.

get

public Point get(int p)

getPoints

public List<Point> getPoints()

size

public int size()

getDistance

public double getDistance(Camera camera)
Description copied from class: AbstractDrawable
Return the distance of the object center to the Camera's eye.

Specified by:
getDistance in interface ISortableDraw
Overrides:
getDistance in class AbstractDrawable

getShortestDistance

public double getShortestDistance(Camera camera)
Specified by:
getShortestDistance in interface ISortableDraw
Overrides:
getShortestDistance in class AbstractDrawable

getLongestDistance

public double getLongestDistance(Camera camera)
Specified by:
getLongestDistance in interface ISortableDraw
Overrides:
getLongestDistance in class AbstractDrawable

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 a AbstractComposite containing AbstractGeometrys.

Parameters:
composite -
polygonOffsetFillEnable - status

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 interface IMultiColorable

getColorMapper

public ColorMapper getColorMapper()
Description copied from interface: IMultiColorable
Get the colormapper.

Specified by:
getColorMapper in interface IMultiColorable

setColor

public void setColor(Color color)
Description copied from interface: ISingleColorable
Set the color.

Specified by:
setColor in interface ISingleColorable
Parameters:
color - the color

getColor

public Color getColor()
Description copied from interface: ISingleColorable
Get the color.

Specified by:
getColor in interface ISingleColorable
Returns:
color the color.

toString

public String toString(int depth)
Overrides:
toString in class AbstractDrawable


Copyright © 2013. All rights reserved.