/// <summary> 纵向填挖交界 </summary> public void ExportFillCutInters() { // 求出所有的填挖交界点相关信息 if (_longitudinalSection.Intersects.NumberOfIntersectionPoints == 0) { _docMdf.WriteNow("没有填挖交界交点,整个路段都是填方或者挖方"); return; } ConstructIntersectRange(_longitudinalSection); return; // 进行更深入的信息处理 var allIntersectsSections = new SortedDictionary <double, CrossSectionRange <FillCutIntersects> >(); FillCutIntersects backValue; FillCutIntersects frontValue; // var allIntersects = _longitudinalSection.IntersPoints.Keys.ToArray(); var count = allIntersects.Length; double lastStation = allIntersects[0]; for (int i = 0; i < count - 1; i++) { var nextStation = (allIntersects[i] + allIntersects[i + 1]) / 2; backValue = new FillCutIntersects(); backValue.SetParentStation(allIntersects[i]); backValue.EdgeStation = lastStation; // frontValue = new FillCutIntersects(); frontValue.SetParentStation(allIntersects[i]); frontValue.EdgeStation = nextStation; // var s1 = new CrossSectionRange <FillCutIntersects>(allIntersects[i], backValue, frontValue); allIntersectsSections.Add(allIntersects[i], s1); lastStation = nextStation; } // 最后一个区间 backValue = new FillCutIntersects(); backValue.SetParentStation(allIntersects[count - 1]); backValue.EdgeStation = lastStation; // frontValue = new FillCutIntersects(); frontValue.SetParentStation(allIntersects[count - 1]); frontValue.EdgeStation = allIntersects[count - 1]; var s2 = new CrossSectionRange <FillCutIntersects>(allIntersects[count - 1], backValue, frontValue); allIntersectsSections.Add(allIntersects[count - 1], s2); }
/// <summary> 初始化所有断面所占据的几何区间 </summary> /// <typeparam name="T"></typeparam> /// <param name="allStations"></param> /// <returns></returns> public static SortedDictionary <double, CrossSectionRange <T> > InitializeGeometricRange <T>(double[] allStations) where T : HalfValue, new() { var allSections = new SortedDictionary <double, CrossSectionRange <T> >(); T backValue; T frontValue; var count = allStations.Length; double lastStation = allStations[0]; for (int i = 0; i < count - 1; i++) { var nextStation = (allStations[i] + allStations[i + 1]) / 2; backValue = new T(); backValue.SetParentStation(allStations[i]); backValue.EdgeStation = lastStation; // frontValue = new T(); frontValue.SetParentStation(allStations[i]); frontValue.EdgeStation = nextStation; // var s1 = new CrossSectionRange <T>(allStations[i], backValue, frontValue); allSections.Add(allStations[i], s1); lastStation = nextStation; } // 最后一个区间 backValue = new T(); backValue.SetParentStation(allStations[count - 1]); backValue.EdgeStation = lastStation; // frontValue = new T(); frontValue.SetParentStation(allStations[count - 1]); frontValue.EdgeStation = allStations[count - 1]; var s2 = new CrossSectionRange <T>(allStations[count - 1], backValue, frontValue); allSections.Add(allStations[count - 1], s2); // return(allSections); }