org.jzy3d.plot3d.primitives
Class Quad

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

public class Quad
extends Polygon

A Quad extends a Polygon in order to provide a specific draw() method that relies on a dedicated GL2 call (GL_QUADS), and to ensure the number of points is never greater than 4.

Author:
Martin Pernollet
See Also:
Polygon}

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jzy3d.plot3d.primitives.Polygon
Polygon.PolygonMode
 
Field Summary
 
Fields inherited from class org.jzy3d.plot3d.primitives.Polygon
center, color, mapper, points, polygonMode, polygonOffsetFillEnable
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractWireframeable
facestatus, wfcolor, wfstatus, wfwidth
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
bbox, displayed, hasListeners, legend, legendDisplayed, listeners, transform
 
Constructor Summary
Quad()
          Initializes an empty Quad with face status defaulting to true, and wireframe status defaulting to false.
 
Method Summary
 void add(Point point)
          Add a point to the polygon.
 void draw(javax.media.opengl.GL2 gl, javax.media.opengl.glu.GLU glu, Camera cam)
          Call OpenGL2 routines for rendering the object.
 double getDistance(Camera camera)
          Return the distance of the object center to the Camera's eye.
 double getLongestDistance(Camera camera)
           
 double getShortestDistance(Camera camera)
           
 String toString(int depth)
           
 
Methods inherited from class org.jzy3d.plot3d.primitives.Polygon
applyPolygonModeFill, applyPolygonModeLine, get, getAll, getBarycentre, getColor, getColorMapper, getPolygonMode, isPolygonOffsetFillEnable, polygonOffseFillEnable, polygonOffsetFillDisable, setColor, setColorMapper, setPolygonMode, setPolygonOffsetFillEnable, setPolygonOffsetFillEnable, size
 
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, fireDrawableChanged, fireDrawableChanged, getBounds, getLegend, getTransform, hasLegend, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setDisplayed, setLegend, setLegendDisplayed, setTransform, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Quad

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

Method Detail

draw

public void draw(javax.media.opengl.GL2 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
Overrides:
draw in class Polygon
Parameters:
gl - GL2 context
glu - GLU context
cam - a reference to a shooting Camera.

add

public void add(Point point)
Add a point to the polygon.

Overrides:
add in class Polygon

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 Polygon

getShortestDistance

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

getLongestDistance

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

toString

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