/// <summary> /// Method to expand this <see cref="OctagonalEnvelope"/> to include the provided <paramref name="oct"/> OctogonalEnvelope. /// </summary> /// <param name="oct">The OctogonalEnvelope</param> /// <returns>A reference to <c>this</c> octagonal envelope, expanded by <paramref name="oct"/></returns> public OctagonalEnvelope ExpandToInclude(OctagonalEnvelope oct) { if (oct.IsNull) { return(this); } if (IsNull) { _minX = oct._minX; _maxX = oct._maxX; _minY = oct._minY; _maxY = oct._maxY; _minA = oct._minA; _maxA = oct._maxA; _minB = oct._minB; _maxB = oct._maxB; return(this); } if (oct._minX < _minX) { _minX = oct._minX; } if (oct._maxX > _maxX) { _maxX = oct._maxX; } if (oct._minY < _minY) { _minY = oct._minY; } if (oct._maxY > _maxY) { _maxY = oct._maxY; } if (oct._minA < _minA) { _minA = oct._minA; } if (oct._maxA > _maxA) { _maxA = oct._maxA; } if (oct._minB < _minB) { _minB = oct._minB; } if (oct._maxB > _maxB) { _maxB = oct._maxB; } return(this); }
/// <summary> /// Function to test if <c>this</c> octagonal envelope contains <paramref name="other"/> octagonal envelope. /// </summary> /// <param name="other">An octagonal envelope</param> /// <returns><c>true</c> if <c>this</c> octagonal envelope contains <paramref name="other"/> octagonal envelope.</returns> public Boolean Contains(OctagonalEnvelope other) { if (IsNull || other.IsNull) { return(false); } return(other._minX >= _minX && other._maxX <= _maxX && other._minY >= _minY && other._maxY <= _maxY && other._minA >= _minA && other._maxA <= _maxA && other._minB >= _minB && other._maxB <= _maxB); }
/// <summary> /// Function to test if <c>this</c> octagonal envelope intersects <paramref name="other"/> octagonal envelope . /// </summary> /// <param name="other">An octagonal envelope </param> /// <returns><c>true</c> if <c>this</c> octagonal envelope intersects <paramref name="other"/> octagonal envelope .</returns> public Boolean Intersects(OctagonalEnvelope other) { if (IsNull || other.IsNull) { return(false); } if (_minX > other._maxX) { return(false); } if (_maxX < other._minX) { return(false); } if (_minY > other._maxY) { return(false); } if (_maxY < other._minY) { return(false); } if (_minA > other._maxA) { return(false); } if (_maxA < other._minA) { return(false); } if (_minB > other._maxB) { return(false); } if (_maxB < other._minB) { return(false); } return(true); }
/// <summary> /// Creates a new null bounding octagon bounding an <see cref="OctagonalEnvelope" /> /// (the copy constructor). /// </summary> public OctagonalEnvelope(OctagonalEnvelope oct) { ExpandToInclude(oct); }
public BoundingOctagonComponentFilter(OctagonalEnvelope octagonalEnvelope) { _octogonalEnvelope = octagonalEnvelope; }