/// <summary> 将本桩号区间与其紧紧相连的下一个区间进行合并 </summary> /// <param name="frontRange">比此区间桩号更大的区间</param> /// <returns>true表示可以合并,false表示合并不了</returns> public virtual bool TryMerge(CrossSectionRange <T> frontRange) { // 桩号的包含 if ((frontRange.BackValue.EdgeStation - this.FrontValue.EdgeStation > SQConstants.RangeMergeTolerance) || (this.BackValue.EdgeStation - frontRange.FrontValue.EdgeStation > SQConstants.RangeMergeTolerance)) { return(false); } if (FrontValue.IsMergeable(frontRange.BackValue)) { // 说明这两段桩号区间在几何上是相接的 FrontValue.Merge(frontRange.BackValue); FrontValue.Merge(frontRange.FrontValue); // FrontValue.EdgeStation = frontRange.FrontValue.EdgeStation; Merged = true; return(true); } return(false); }
/// <summary> 用新的数据替换对象中的原数据 </summary> public void Override(CrossSectionRange <T> newSection) { StationInbetween = newSection.StationInbetween; BackValue = newSection.BackValue; FrontValue = newSection.FrontValue; }