IsInside() public method

Check if the specified range is inside of the range.
public IsInside ( Range range ) : bool
range Range Range to check.
return bool
Esempio n. 1
0
 public bool IsOverlapping(Range range)
 {
     if (!IsInside(range.min) && !IsInside(range.max) && !range.IsInside(min))
     {
         return(range.IsInside(max));
     }
     return(true);
 }
Esempio n. 2
0
        /// <summary>
        /// Update Y range.
        /// </summary>
        private void UpdateYRange()
        {
            float minY = float.MaxValue;
            float maxY = float.MinValue;

            // walk through all data series
            foreach (KeyValuePair <string, DataSeries> kvp in seriesTable)
            {
                DataSeries series = kvp.Value;
                // get data of the series
                double[,] data = series.data;

                if ((series.updateYRange) && (data != null))
                {
                    for (int i = 0, n = data.GetLength(0); i < n; i++)
                    {
                        if (rangeX.IsInside((float)data[i, 0]))
                        {
                            float v = (float)data[i, 1];

                            // check for max
                            if (v > maxY)
                            {
                                maxY = v;
                            }
                            // check for min
                            if (v < minY)
                            {
                                minY = v;
                            }
                        }
                    }
                }
            }

            // update Y range, if there are any data
            if ((minY != double.MaxValue) || (maxY != double.MinValue))
            {
                rangeY = new Range(minY, maxY);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Check if the specified range overlaps with the range.
 /// </summary>
 ///
 /// <param name="range">Range to check for overlapping.</param>
 ///
 /// <returns><b>True</b> if the specified range overlaps with the range or
 /// <b>false</b> otherwise.</returns>
 ///
 public bool IsOverlapping(Range range)
 {
     return((IsInside(range.min)) || (IsInside(range.max)) ||
            (range.IsInside(min)) || (range.IsInside(max)));
 }
Esempio n. 4
0
 /// <summary>
 /// Check if the specified range overlaps with the range.
 /// </summary>
 /// 
 /// <param name="range">Range to check for overlapping.</param>
 /// 
 /// <returns><b>True</b> if the specified range overlaps with the range or
 /// <b>false</b> otherwise.</returns>
 /// 
 public bool IsOverlapping( Range range )
 {
     return ( ( IsInside( range.min ) ) || ( IsInside( range.max ) ) ||
              ( range.IsInside( min ) ) || ( range.IsInside( max ) ) );
 }