NAME
        ContourNaN

   DESCRIPTION
        This module generates contour geometry for a 2-D lattice.  It can create
        the basic contour lines over a particular data range like the Contour
        module, but it also adds many other options.  ContourNaN provides
        tube contours as well as real filled contour bands with optional face or
        vertex normals.  ContourNaN can remove special values by the grid
        point or by the whole lattice cell.  ContourNaN also includes all the
        options found in NCSA's Contour2 module.  These include optionally
        showing the zero contour, dimming the colors of negative contours,
        setting the contour range to be data dependent or fixed, and specifying
        the contours by a number of levels or an exact interval.  A final
        significant feature is the ability to create unevenly spaced contours
        with a configuration string (typically from the ColorBands module).

   INPUTS

      Input -- Lattice
         (2-D, 1-vector, float, perimeter..curvilinear).
         This is the lattice used for contouring.

      Transform -- Lattice (Opt.)
         (2-D, 1-vector, float).
         This is an optional 4x4 transformation matrix (typically from
         TransformGen) that allows rotation and translation operations to be
         applied to the resulting geometry.

      Colormap -- Lattice (Opt.)
         (1-D, 4-vector, float, uniform).
         This is an optional lattice used to color the contour values.

      Configuration In -- Parameter (Opt.)
         This is an optional configuration string (typically created by the
         ColorBands module) that can be used to create unevenly spaced
         contours with particular colors.  If valid configuration data is present
         then it will override and disable the settings of the widgets that deal
         with specifying the contour values ("Range Type", "Contour Method",
         "Range Start", "Range End", "# Levels", and "Interval").  It will also
         override any connected colormap lattice.

   WIDGETS

      Contour Type -- Option Menu
         This determines the style used to draw the contours.
         
            Filled - Draws solid bands between the contour levels.  The color of
               a band is determined from the middle data value between the levels.
            Line - Draws regular line contours.
            Tube - Draws line contours but using tubes instead of plain line
               segments.
            Capped Tube - Draws the contours as tubes with spheres at the ends
               of the tubes in order to give them a smoother appearance.

      Dimension -- Radio Box
         This selects how the contour geometry is to be drawn based on the
         setting of "Contour Type".  It can be represented as points, lines, or
         shaded polygons.  Lowering the dimension will speed up rendering for
         better interactive manipulation.  However, it will not increase the
         dimension beyond what "Contour Type" specifies.

      Use Normals? -- Option Menu
         This selects whether normals will be added to the geometry.  The
         default is no normals, but if the geometry looks oddly colored (i.e.
         containing erroneous dark patches) in Render then using this option
         will fix the problem at the expense of some extra memory and
         processing time.  Normals can be applied on a per-face or per-vertex
         basis.  Using face normals may result in the geometry having a faceted
         appearance since for each triangle the lighting is the same at all of
         its vertices (and consequently over the entire triangle).  Using vertex
         normals allows each of the vertices of a triangle to have different
         lighting resulting in smooth shading between triangles that share
         vertices.  There is no difference between using face normals or vertex
         normals when the geometry is completely flat.

      Line Width -- Slider
         This sets the width of the contours when they are drawn as line
         segments by either setting the "Contour Type" to "Line" or setting the
         "Dimension" to "1-D".

      Tube Scale -- Dial
         This is the scaling factor to be applied to the radius of the tube and
         capped tube contours.

      Complexity -- Slider
         This is the complexity to be applied to the geometry when contours are
         drawn as tubes or capped tubes.  The larger the complexity, the more
         polygons are used to create these objects.  The range is from 0.0 to 1.0.
         A value of .5 generates about 200 polygons for a sphere.  Larger
         complexity values can SIGNIFICANTLY reduce rendering speed when
         there are many objects.

      Range Type -- Option Menu
         This determines how the contour range specified by the "Range Start"
         and "Range End" widgets is used.  It can be data dependent (the
         default), whereby the starting and ending range values are always set to
         the minimum and maximum data values of the input lattice.  The range
         can also be fixed so that any starting and ending value is possible.

      Range Start -- Dial
         This is the lower bound of the contour range.

      Range End -- Dial
         This is the upper bound of the contour range.

      Special Value -- Text
         This is data value that should be treated as "special" according to the
         setting of the "Special Value Type" widget.

      Special Value Type -- Radio Box
         This determines how special values will be treated.  The default is to
         keep them and include them as part of the geometry.  Special values
         can also be removed by eliminating their grid points or the entire
         lattice cells that they are a part of.  Choosing "Remove special value
         grid points" results in a smoother appearance since it tries to preserve
         as much of the lattice cells as possible while removing the points
         without interpolating around them.  Choosing "Remove special value
         cells" not only removes the special value grid points, but also all
         adjacent ones resulting in a course appearance that reveals the size of
         the lattice cells in the grid.

      Contour Method -- Option Menu
         This determines how the contour values are chosen.  If "# Levels" is
         selected (the default) then the specified number of levels will be
         generated over the the entire contour range using an appropriate
         increment.  If "Interval" is selected then the specified value will be
         used to increment from the "Range Start" to the "Range End".  Both
         methods will create evenly spaced contours.  The "Configuration In"
         port in conjunction with the ColorBands module can be used to create
         unevenly spaced contours.

      # Levels -- Slider
         This is the number of evenly space contour levels covering the entire
         contour range.  It is directly used when the "Contour Method" is set to
         "# Levels".

      Interval -- Dial
         This is the data increment for calculating evenly spaced contour levels
         beginning at the "Range Start" value.  It is directly used when the
         "Contour Method" is set to "Interval".  The interval does not have to
         divide evenly into the contour range; it will just fall short of the
         "Range End" if it doesn't.

      Show Zero Contour? -- Option Menu
         This determines whether contours with a value of 0 are shown.

      Dim Negatives? -- Option Menu
         Setting this option draws negative contours with 50% intensity of
         their original color.

      Lighting Model -- Option Menu
         This is the method used to light all the contour geometry.  The default
         is Phong lighting, but flat lighting can also be set, which is especially
         useful for flat planes of filled contours so that they will be colored
         exactly as specified and not modified by the scene's lighting.  The
         lighting model is meaningless for plain pixel-width line contours.

   OUTPUTS

      Output -- Geometry
         This is the contour geometry.

      Configuration Out -- Parameter
         This is a string containing information about the contour levels and
         colors created by ContourNaN when the "Contour Type" is set to
         "Filled".  It can be connected to the "Configuration In" port of the
         ColorBands module in order to generate a color key that is actually
         representative of ContourNaN's geometry in the filled case.  It is only
         necessary with filled contours since they use the middle value between
         two contour levels for coloring rather than the values at the contour
         levels.

   KNOWN PROBLEMS
      ContourNaN is a good deal slower than the Contour module when there
      are many contour levels or when the input lattice is reasonably large.
      Hopefully, the next version will be faster.  Also, the geometry could
      probably be optimized further to reduce its size.  There are no known
      bugs.

   SEE ALSO
      ColorBands, Contour, Contour2, LatToGeomNaN
       
      -
            
      Hans Vahlenkamp (Hans.Vahlenkamp@noaa.gov)
      Geophysical Fluid Dynamics Laboratory / NOAA
      Princeton University Forrestal Campus
      http://www.gfdl.noaa.gov