Exemplo n.º 1
0
        private void SetCurrentSlopeUI(SlopeLine spl)
        {
            var xdata = spl.XData;
            var s     = SlopeData.Combine(xdata.Slopes, xdata.Platforms, true);

            SetDGVDataSource(spl, s);
        }
Exemplo n.º 2
0
 /// <summary> 提取指定边坡集合中的所有的防护形式(挂网喷锚_6 与 挂网喷锚_9 并不会合并) </summary>
 public static string[] GetProtectionTypes(IEnumerable <SlopeData> slopeDatas)
 {
     return(slopeDatas
            .SelectMany(r => SlopeData.Combine(r.Slopes, r.Platforms, false))
            .Select(r => r.ProtectionMethod)
            .Where(r => !string.IsNullOrEmpty(r))
            .Distinct()
            .ToArray());
 }
Exemplo n.º 3
0
        private void ChangeSelectedSlopeProtection(ISlopeSeg baseSeg)
        {
            var changedSlp      = dgv.Tag as SlopeLine;
            var changedXdata    = changedSlp.XData;
            var seperateFillCut = checkBox_SeperateFillCut.Checked; // 在统一修改时区分填方与挖方

            //
            foreach (SlopeLine slp in listBox_slopes.SelectedItems)
            {
                var xdata = slp.XData;
                if (!seperateFillCut || changedXdata.FillCut == xdata.FillCut)
                {
                    var slopes = SlopeData.Combine(slp.XData.Slopes, slp.XData.Platforms, false);
                    foreach (var s in slopes)
                    {
                        if (s.Type == baseSeg.Type && s.Index == baseSeg.Index)
                        {
                            s.ProtectionMethod = baseSeg.ProtectionMethod;
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        /// <summary> 从边坡线所绑定的防护方式的文字对象来设置防护 </summary>
        public ExternalCmdResult FlushProtection(DocumentModifier docMdf, SelectionSet impliedSelection)
        {
            _docMdf = docMdf;
            SQUtils.SubgradeEnvironmentConfiguration(docMdf);
            // var allSections = ProtectionUtils.GetAllSections(docMdf);
            var slopeLines = SQUtils.SelecteExistingSlopeLines(docMdf, left: null, sort: true);

            // 从文字中提取边坡防护方式的数据
            foreach (var slp in slopeLines)
            {
                var xdata   = slp.XData;
                var slpSegs = SlopeData.Combine(xdata.Slopes, xdata.Platforms, sort: false);
                foreach (var s in slpSegs)
                {
                    SlopeLine.ExtractProtectionFromText(s, _docMdf.acDataBase);
                }
                // 将数据保存下来
                slp.Pline.UpgradeOpen();
                slp.FlushXData();
                slp.Pline.DowngradeOpen();
            }
            return(ExternalCmdResult.Commit);
        }
Exemplo n.º 5
0
        /// <summary> 根据前后边坡对象构造二维边坡系统 </summary>
        private void ConstructSlopeSystem()
        {
            double backBaseHeight = Math.Abs(_backSlope.RetainingWallHeight);

            // 后方边坡
            double innerLength  = backBaseHeight; // 斜坡长度
            double outterLength = innerLength;    // 斜坡长度

            var backSign = _backSlope.FillCut ? -1 : 1;

            _backSlopePoints = new Dictionary <double, Point2d[]>();
            var segs = SlopeData.Combine(_backSlope.Slopes, _backSlope.Platforms, true);

            foreach (var bs in segs)
            {
                if (bs.Type == SlopeSegType.边坡)
                {
                    outterLength = innerLength + bs.Length;
                    _backSlopePoints.Add(bs.Index,
                                         new Point2d[]
                                         { new Point2d(_backStation, backSign * innerLength), new Point2d(_backStation, backSign * outterLength) });
                    innerLength = outterLength;
                }
                else
                {
                    // Point2d[] 数组中两个值是相同的
                    _backSlopePoints.Add(-bs.Index,
                                         new Point2d[]
                                         { new Point2d(_backStation, backSign * innerLength), new Point2d(_backStation, backSign * innerLength) });
                }
            }
            //_maxBackSlopeIndex = _backSlope.Slopes.Count > 0 ? _backSlope.Slopes.Last().Index : 0;
            // _backEdge = _maxBackSlopeIndex > 0 ? _backSlopePoints[_maxBackSlopeIndex][1] : new Point2d(_backStation, 0);
            _backEdge = new Point2d(_backStation, backSign * outterLength);

            // 前方边坡
            var    frontSign       = _frontSlope.FillCut ? -1 : 1;
            double frontBaseHeight = Math.Abs(_frontSlope.RetainingWallHeight);

            innerLength       = frontBaseHeight;
            outterLength      = innerLength;
            _frontSlopePoints = new Dictionary <double, Point2d[]>();

            segs = SlopeData.Combine(_frontSlope.Slopes, _frontSlope.Platforms, true);
            foreach (var bs in segs)
            {
                if (bs.Type == SlopeSegType.边坡)
                {
                    outterLength = innerLength + bs.Length;
                    _frontSlopePoints.Add(bs.Index,
                                          new Point2d[]
                    {
                        new Point2d(_frontStation, frontSign * innerLength), new Point2d(_frontStation, frontSign * outterLength)
                    });
                    innerLength = outterLength;
                }
                else
                {
                    // Point2d[] 数组中两个值是相同的
                    _frontSlopePoints.Add(-bs.Index,
                                          new Point2d[]
                                          { new Point2d(_frontStation, frontSign * innerLength), new Point2d(_frontStation, frontSign * innerLength) });
                }
            }
            //_maxFrontSlopeIndex = _frontSlope.Slopes.Count > 0 ? _frontSlope.Slopes.Last().Index : 0;

            // _frontEdge = _maxFrontSlopeIndex > 0 ? _frontSlopePoints[_maxFrontSlopeIndex][1] : new Point2d(_frontStation, 0);
            _frontEdge = new Point2d(_frontStation, frontSign * outterLength);


            // 开口线
            _开口线 = new Line2d(_backEdge, _frontEdge);
        }