org.jzy3d.colors
Class ColorMapper

java.lang.Object
  extended by org.jzy3d.colors.ColorMapper
All Implemented Interfaces:
IColorMappable
Direct Known Subclasses:
OrderingStrategyScoreColorMapper

public class ColorMapper
extends Object
implements IColorMappable

A ColorMapper uses a IColorMap to process a color for a given Coord3d. An optional global color factor let you filter the Color computed by the colormap: public Color getColor(Coord3d coord){ Color out = colormap.getColor(this, v); if(factor!=null) out.mul(factor); }

Author:
Martin Pernollet

Field Summary
protected  IColorMap colormap
           
protected  Color factor
           
protected  double max
           
protected  double min
           
 
Constructor Summary
ColorMapper()
           
ColorMapper(ColorMapper colormapper, Color factor)
           
ColorMapper(IColorMap colormap, Color factor)
           
ColorMapper(IColorMap colormap, double min, double max)
           
ColorMapper(IColorMap colormap, double min, double max, Color factor)
           
 
Method Summary
 Color getColor(Coord3d coord)
          call a colormap with a three dimensions coordinate
 Color getColor(double v)
          call a colormap with a single dimension coordinate
 IColorMap getColorMap()
           
 double getMax()
          Retrieve the upper value boundary for a IColorMap.
 double getMin()
          Retrieve the lower value boundary for a IColorMap.
 Range getRange()
           
 Scale getScale()
           
 void postDraw(Object o)
           
 void preDraw(Object o)
          A hook method to implement to prepare colormapper for the current draw call.
 void setMax(double value)
          Set the upper value boundary for a IColorMap.
 void setMin(double value)
          Set the lower value boundary for a IColorMap.
 void setRange(Range range)
           
 void setScale(Scale range)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

protected double min

max

protected double max

colormap

protected IColorMap colormap

factor

protected Color factor
Constructor Detail

ColorMapper

public ColorMapper()

ColorMapper

public ColorMapper(IColorMap colormap,
                   Color factor)

ColorMapper

public ColorMapper(IColorMap colormap,
                   double min,
                   double max)

ColorMapper

public ColorMapper(IColorMap colormap,
                   double min,
                   double max,
                   Color factor)

ColorMapper

public ColorMapper(ColorMapper colormapper,
                   Color factor)
Method Detail

getColor

public Color getColor(Coord3d coord)
call a colormap with a three dimensions coordinate


getColor

public Color getColor(double v)
call a colormap with a single dimension coordinate


preDraw

public void preDraw(Object o)
A hook method to implement to prepare colormapper for the current draw call. The input parameter o must be the object calling preDraw. Indeed, the mapper is supposed to be able to check wether preDraw is actually allowed for the caller.

See Also:
IColorMapperUpdatePolicy}

postDraw

public void postDraw(Object o)

getColorMap

public IColorMap getColorMap()

getMin

public double getMin()
Description copied from interface: IColorMappable
Retrieve the lower value boundary for a IColorMap.

Specified by:
getMin in interface IColorMappable
Returns:
the minimum Z value

getMax

public double getMax()
Description copied from interface: IColorMappable
Retrieve the upper value boundary for a IColorMap.

Specified by:
getMax in interface IColorMappable
Returns:
the maximum Z value

setMin

public void setMin(double value)
Description copied from interface: IColorMappable
Set the lower value boundary for a IColorMap.

Specified by:
setMin in interface IColorMappable
Parameters:
value - the minimum Z value

setMax

public void setMax(double value)
Description copied from interface: IColorMappable
Set the upper value boundary for a IColorMap.

Specified by:
setMax in interface IColorMappable
Parameters:
value - the maximum Z value

setRange

public void setRange(Range range)

getRange

public Range getRange()

setScale

public void setScale(Scale range)

getScale

public Scale getScale()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All rights reserved.