Class ColorMap3D


public abstract class ColorMap3D extends ColorMap<MeshLambertMaterial>
Coloring3D is a wrapper class for different schemes to map data onto colors for 3D visualization using WebGL. Each inner class implements the ColorMap interface to provide an implementation agnostic manner to translate data into colors.

The following color mappings are currently available:

Index
Associates integer indices with colors.
Gradient1D
One dimensional color gradient spanning two or more colors.
Hue
Special case of Gradient1D where the gradient follows the color hue.
Gradient2D
Two dimensional gradient with each dimension represented by one color.
GradientND
Multi-dimensional gradient spanned by an identical number of colors

Important: the Parallax library provides access to WebGL technology directly from GWT. The following code is compliant with Parallax version 1.6. Unfortunately, colors are handled differently in the two frameworks. In particular, java.awt.Color and thothbot.parallax.core.shared.math.Color are incompatible. In the following any reference to Color refers to the WebGL version, while references to regular java Color's use the fully qualified name, java.awt.Color.

Author:
Christoph Hauert
See Also:
  • Field Details

    • BLACK

      public static final Color BLACK
      The color black.
    • UNDIRECTED

      public static final Color UNDIRECTED
      The color of undirected links.
    • DIRECTED

      public static final Color DIRECTED
      The baseline color of directed links.
    • DIRECTED_SRC

      public static final Color DIRECTED_SRC
      The color of directed links at the origin.
    • DIRECTED_DST

      public static final Color DIRECTED_DST
      The color of directed links at the destination.
    • FACTOR

      private static final double FACTOR
      Helper constant: the factor to derive darker shades of a color.
      See Also:
  • Constructor Details

    • ColorMap3D

      public ColorMap3D()
      Constructs a new color map.
  • Method Details

    • Color2Color

      public static Color Color2Color(Color color)
      Convert a java.awt.Color object to a Color object.
      Parameters:
      color - the java.awt.Color
      Returns:
      the corresponding thothbot.parallax.core.shared.math.Color
    • Color2Color

      public static Color Color2Color(double r, double g, double b)
      Convert red, green, blue to a WebGL Color object.
      Parameters:
      r - the red component of the color in [0.0, 1.0]
      g - the green component of the color in [0.0, 1.0]
      b - the blue component of the color in [0.0, 1.0]
      Returns:
      the corresponding thothbot.parallax.core.shared.math.Color object
    • Color2Material

      public static MeshLambertMaterial Color2Material(double r, double g, double b, double a)
      Convert red, green, blue and transparency values (RGBA) to a WebGL Material object.
      Parameters:
      r - the red component of the color in [0.0, 1.0]
      g - the green component of the color in [0.0, 1.0]
      b - the blue component of the color in [0.0, 1.0]
      a - the transparency (alpha) component of the color in [0.0, 1.0]
      Returns:
      the Material object for non-shiny surfaces representing the RGB value with transparency (if applicable)
      See Also:
    • Color2Material

      public static MeshLambertMaterial Color2Material(Color color)
      Convert a java.awt.Color to a WebGL Material object. In order to enhance 3D effects the ambient color is set to color.darker().
      Parameters:
      color - the java.awt.Color
      Returns:
      the Material object for non-shiny surfaces with color and transparency (if applicable)