public double getValue (double x, double y, double z)
   {
      assert (sourceModules[0] != null);
      assert (sourceModules[1] != null);
      assert (sourceModules[2] != null);

      double controlValue = sourceModules[2].getValue (x, y, z);
      double alpha;

      if (edgeFalloff > 0.0)
      {
         if (controlValue < (lowerBound - edgeFalloff))
            // The output value from the control module is below the selector
            // threshold; return the output value from the first source module.
            return sourceModules[0].getValue (x, y, z);
         else if (controlValue < (lowerBound + edgeFalloff))
         {
            // The output value from the control module is near the lower end of the
            // selector threshold and within the smooth curve. Interpolate between
            // the output values from the first and second source modules.
            double lowerCurve = (lowerBound - edgeFalloff);
            double upperCurve = (lowerBound + edgeFalloff);
            alpha = Interp.SCurve3 (
                  (controlValue - lowerCurve) / (upperCurve - lowerCurve));
            return Interp.linearInterp (sourceModules[0].getValue (x, y, z),
                  sourceModules[2].getValue (x, y, z),
                  alpha);
         }
         else if (controlValue < (upperBound - edgeFalloff))
            // The output value from the control module is within the selector
            // threshold; return the output value from the second source module.
            return sourceModules[1].getValue (x, y, z);
         else if (controlValue < (upperBound + edgeFalloff))
         {
            // The output value from the control module is near the upper end of the
            // selector threshold and within the smooth curve. Interpolate between
            // the output values from the first and second source modules.
            double lowerCurve = (upperBound - edgeFalloff);
            double upperCurve = (upperBound + edgeFalloff);
            alpha = Interp.SCurve3 (
                  (controlValue - lowerCurve) / (upperCurve - lowerCurve));
            return Interp.linearInterp (sourceModules[1].getValue (x, y, z),
                  sourceModules[0].getValue (x, y, z),
                  alpha);
         }
         else
            // Output value from the control module is above the selector threshold;
            // return the output value from the first source module.
            return sourceModules[0].getValue (x, y, z);         
      }
      else
      {
         if (controlValue < lowerBound || controlValue > upperBound)
            return sourceModules[0].getValue (x, y, z);
         else
            return sourceModules[1].getValue (x, y, z);
      }
   }