org.jzy3d.plot3d.primitives.selectable
Class SelectableScatter

java.lang.Object
  extended by org.jzy3d.plot3d.primitives.AbstractDrawable
      extended by org.jzy3d.plot3d.primitives.Scatter
          extended by org.jzy3d.plot3d.primitives.selectable.SelectableScatter
All Implemented Interfaces:
ISingleColorable, IGLRenderer, ISortableDraw, Selectable

public class SelectableScatter
extends Scatter
implements ISingleColorable, Selectable

A Scatter that supports an "highlighted status" to change selected point color

Author:
Martin Pernollet

Field Summary
protected  Color highlightColor
           
protected  boolean[] isHighlighted
           
protected  Coord3d[] projection
           
 
Fields inherited from class org.jzy3d.plot3d.primitives.Scatter
colors, coordinates, rgb, width
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
bbox, displayed, hasListeners, legend, legendDisplayed, listeners, transform
 
Constructor Summary
SelectableScatter(Coord3d[] coordinates, Color[] colors)
           
 
Method Summary
 void draw(javax.media.opengl.GL2 gl, javax.media.opengl.glu.GLU glu, Camera cam)
          Call OpenGL2 routines for rendering the object.
 Coord3d[] getData()
           
 Color getHighlightColor()
           
 boolean getHighlighted(int id)
           
 Polygon getHull2d()
           
 List<Coord3d> getLastProjection()
           
 Coord3d[] getProjection()
           
 void project(javax.media.opengl.GL2 gl, javax.media.opengl.glu.GLU glu, Camera cam)
           
 void resetHighlighting()
           
 void setData(Coord3d[] coordinates)
          Set the coordinates of the point.
 void setHighlightColor(Color highlightColor)
           
 void setHighlighted(int id, boolean value)
           
 
Methods inherited from class org.jzy3d.plot3d.primitives.Scatter
clear, getColor, setColor, setColors, setWidth
 
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, call, call, callWithAlphaFactor, dispose, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getTransform, hasLegend, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setDisplayed, setLegend, setLegendDisplayed, setTransform, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jzy3d.colors.ISingleColorable
getColor, setColor
 

Field Detail

isHighlighted

protected boolean[] isHighlighted

highlightColor

protected Color highlightColor

projection

protected Coord3d[] projection
Constructor Detail

SelectableScatter

public SelectableScatter(Coord3d[] coordinates,
                         Color[] colors)
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 Scatter
Parameters:
gl - GL2 context
glu - GLU context
cam - a reference to a shooting Camera.

project

public void project(javax.media.opengl.GL2 gl,
                    javax.media.opengl.glu.GLU glu,
                    Camera cam)
Specified by:
project in interface Selectable

getProjection

public Coord3d[] getProjection()

getHighlightColor

public Color getHighlightColor()

setHighlightColor

public void setHighlightColor(Color highlightColor)

setHighlighted

public void setHighlighted(int id,
                           boolean value)

getHighlighted

public boolean getHighlighted(int id)

resetHighlighting

public void resetHighlighting()

setData

public void setData(Coord3d[] coordinates)
Set the coordinates of the point.

Overrides:
setData in class Scatter
Parameters:
xyz - point's coordinates

getData

public Coord3d[] getData()
Overrides:
getData in class Scatter

getHull2d

public Polygon getHull2d()
Specified by:
getHull2d in interface Selectable

getLastProjection

public List<Coord3d> getLastProjection()
Specified by:
getLastProjection in interface Selectable