A class used to calculate axis range.
Exemplo n.º 1
0
        /// <summary>
        /// Returns the value margin, coordinate, and overlap triples that have the largest left and right overlap.
        /// </summary>
        /// <param name="valueMargins">The list of value margin, coordinate, and
        /// overlap triples.</param>
        /// <param name="maxLeftOverlapValueMargin">The value margin,
        /// coordinate, and overlap triple that has the largest left overlap.
        /// </param>
        /// <param name="maxRightOverlapValueMargin">The value margin,
        /// coordinate, and overlap triple that has the largest right overlap.
        /// </param>
        internal static void GetMaxLeftAndRightOverlap(IList <ValueMarginCoordinateAndOverlap> valueMargins, out ValueMarginCoordinateAndOverlap maxLeftOverlapValueMargin, out ValueMarginCoordinateAndOverlap maxRightOverlapValueMargin)
        {
            maxLeftOverlapValueMargin  = new ValueMarginCoordinateAndOverlap();
            maxRightOverlapValueMargin = new ValueMarginCoordinateAndOverlap();
            double maxLeftOverlap    = double.MinValue;
            double maxRightOverlap   = double.MinValue;
            int    valueMarginsCount = valueMargins.Count;

            for (int cnt = 0; cnt < valueMarginsCount; cnt++)
            {
                ValueMarginCoordinateAndOverlap valueMargin = valueMargins[cnt];
                double leftOverlap = valueMargin.LeftOverlap;
                if (leftOverlap > maxLeftOverlap)
                {
                    maxLeftOverlap            = leftOverlap;
                    maxLeftOverlapValueMargin = valueMargin;
                }
                double rightOverlap = valueMargin.RightOverlap;
                if (rightOverlap > maxRightOverlap)
                {
                    maxRightOverlap            = rightOverlap;
                    maxRightOverlapValueMargin = valueMargin;
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the value margin, coordinate, and overlap triples that have the largest left and right overlap.
 /// </summary>
 /// <param name="valueMargins">The list of value margin, coordinate, and 
 /// overlap triples.</param>
 /// <param name="maxLeftOverlapValueMargin">The value margin, 
 /// coordinate, and overlap triple that has the largest left overlap.
 /// </param>
 /// <param name="maxRightOverlapValueMargin">The value margin, 
 /// coordinate, and overlap triple that has the largest right overlap.
 /// </param>
 internal static void GetMaxLeftAndRightOverlap(IList<ValueMarginCoordinateAndOverlap> valueMargins, out ValueMarginCoordinateAndOverlap maxLeftOverlapValueMargin, out ValueMarginCoordinateAndOverlap maxRightOverlapValueMargin)
 {
     maxLeftOverlapValueMargin = new ValueMarginCoordinateAndOverlap();
     maxRightOverlapValueMargin = new ValueMarginCoordinateAndOverlap();
     double maxLeftOverlap = double.MinValue;
     double maxRightOverlap = double.MinValue;
     int valueMarginsCount = valueMargins.Count;
     for (int cnt = 0; cnt < valueMarginsCount; cnt++)
     {
         ValueMarginCoordinateAndOverlap valueMargin = valueMargins[cnt];
         double leftOverlap = valueMargin.LeftOverlap;
         if (leftOverlap > maxLeftOverlap)
         {
             maxLeftOverlap = leftOverlap;
             maxLeftOverlapValueMargin = valueMargin;
         }
         double rightOverlap = valueMargin.RightOverlap;
         if (rightOverlap > maxRightOverlap)
         {
             maxRightOverlap = rightOverlap;
             maxRightOverlapValueMargin = valueMargin;
         }
     }
 }