Hybrid/vtkCubeAxesActor.cxx
int vtkCubeAxesActor::Digits(double min, double max )
{
  double  range = max - min;
  double  pow10   = log10(range);
  int    ipow10  = static_cast<int>(floor(pow10));
  int    digitsPastDecimal = -ipow10;

  if (digitsPastDecimal < 0)
    {
    //
    // The range is more than 10, but not so big we need scientific
    // notation, we don't need to worry about decimals.
    //
    digitsPastDecimal = 0;
    }
  else
    {
    //
    // We want one more than the range since there is more than one
    // tick per decade.
    //
    digitsPastDecimal++;

    //
    // Anything more than 5 is just noise.  (and probably 5 is noise with
    // doubleing point if the part before the decimal is big).
    //
    if (digitsPastDecimal > 5)
      {
      digitsPastDecimal = 5;
      }
    }

  return digitsPastDecimal;
}
// ****************************************************************************
//  Method: Digits
//
//  Purpose:
//      Determines the appropriate number of digits for a given range.
//
//  Arguments:
//      min    The minimum value in the range.
//      max    The maximum value in the range.
//
//  Returns:   The appropriate number of digits.
//
//  Programmer: Hank Childs
//  Creation:   July 11, 2000
//
//  Modifications:
//
//    Hank Childs, Tue Sep 18 11:58:33 PDT 2001
//    Cast ipow10 to get rid of compiler warning.
//
//    Kathleen Bonnell, Wed Oct 31 07:57:49 PST 2001
//    Moved from VisWinAxes3D.
//
//    Kathleen Bonnell, Thu Aug  1 13:44:02 PDT 2002
//    Added lastPow argument, it specifies whether or not scientific notation
//    is being used on the labels.
//
//    Kathleen Bonnell, Wed Aug  6 13:59:15 PDT 2003
//    Removed lastPow argment, as the adjustment necessary is now taking
//    place in AdjustRange.
//
// ****************************************************************************
Digits
Purpose:
Determines the appropriate number of digits for a given range.

min    The minimum value in the range.
max    The maximum value in the range.

The appropriate number of digits.

Hank Childs
Creation:   July 11, 2000



Hank Childs, Tue Sep 18 11:58:33 PDT 2001
Cast ipow10 to get rid of compiler warning.

Kathleen Bonnell, Wed Oct 31 07:57:49 PST 2001
Moved from VisWinAxes3D.

Kathleen Bonnell, Thu Aug  1 13:44:02 PDT 2002
Added lastPow argument, it specifies whether or not scientific notation
is being used on the labels.

Kathleen Bonnell, Wed Aug  6 13:59:15 PDT 2003
Removed lastPow argment, as the adjustment necessary is now taking
place in AdjustRange.
Digits Purpose : Determines the appropriate number of digits for a given range . min The minimum value in the range . max The maximum value in the range . The appropriate number of digits . Hank Childs Creation : July 11 2000 Hank Childs Tue Sep 18 11 : 58 : 33 PDT 2001 Cast ipow10 to get rid of compiler warning . Kathleen Bonnell Wed Oct 31 07 : 57 : 49 PST 2001 Moved from VisWinAxes3D . Kathleen Bonnell Thu Aug 1 13 : 44 : 02 PDT 2002 Added lastPow argument it specifies whether or not scientific notation is being used on the labels . Kathleen Bonnell Wed Aug 6 13 : 59 : 15 PDT 2003 Removed lastPow argment as the adjustment necessary is now taking place in AdjustRange .
int vtkCubeAxesActor::Digits(double min, double max )
{
  double  range = max - min;
  double  pow10   = log10(range);
  int    ipow10  = static_cast<int>(floor(pow10));
  int    digitsPastDecimal = -ipow10;
  if (digitsPastDecimal < 0)
    {
     The range is more than 10, but not so big we need scientific
     notation, we don't need to worry about decimals.
    digitsPastDecimal = 0;
    }
  else
    {
     We want one more than the range since there is more than one
     tick per decade.
    digitsPastDecimal++;
     Anything more than 5 is just noise.  (and probably 5 is noise with
     doubleing point if the part before the decimal is big).
    if (digitsPastDecimal > 5)
      {
      digitsPastDecimal = 5;
      }
    }
  return digitsPastDecimal;
}
int vtkCubeAxesActor :: Digits ( double min , double max ) { double range = max - min ; double pow10 = log10 ( range ) ; int ipow10 = static_cast < int > ( floor ( pow10 ) ) ; int digitsPastDecimal = - ipow10 ; if ( digitsPastDecimal < 0 ) { digitsPastDecimal = 0 ; } else { digitsPastDecimal ++ ; if ( digitsPastDecimal > 5 ) { digitsPastDecimal = 5 ; } } return digitsPastDecimal ; }
Method: Digits
Purpose:
Determines the appropriate number of digits for a given range.
Method : Digits Purpose : Determines the appropriate number of digits for a given range .
// // The range is more than 10, but not so big we need scientific // notation, we don't need to worry about decimals. // // // We want one more than the range since there is more than one // tick per decade. // // // Anything more than 5 is just noise.  (and probably 5 is noise with // doubleing point if the part before the decimal is big). //