public CurveLink(Curve curve, double ystart, double yend, int etag) { _curve = curve; _ytop = ystart; _ybot = yend; _etag = etag; if (_ytop < curve.GetYTop() || _ybot > curve.GetYBot()) { throw new SystemException("bad curvelink [" + _ytop + "=>" + _ybot + "] for " + curve); } }
public bool Absorb(Curve curve, double ystart, double yend, int etag) { if (_curve != curve || _etag != etag || _ybot < ystart || _ytop > yend) { return false; } if (ystart < curve.GetYTop() || yend > curve.GetYBot()) { throw new SystemException("bad curvelink [" + ystart + "=>" + yend + "] for " + curve); } _ytop = Math.Min(_ytop, ystart); _ybot = Math.Max(_ybot, yend); return true; }