Exemplo n.º 1
0
        private void AddJBQXItemToFigure(JDStruc jdstruc, List <SymbolItemStruc> syDrawingCol)
        {
            double adjacentVerZbdifference     = 10;
            double lastVerZBHor                = 0;
            double lastverZBVerHeigh           = 0;
            double lastadjacentVerZbdifference = 0;

            for (int i = 0; i < syDrawingCol.Count; i++)
            {
                SymbolItemStruc symbldrawing     = syDrawingCol[i];
                LJJSPoint       sybltopZuoBiaoPt = ZuoBiaoOper.GetJSZuoBiaoPt(jdstruc.JDPtStart, symbldrawing.depthtop, jdstruc.JDtop, FrameDesign.ValueCoordinate);
                adjacentVerZbdifference = lastadjacentVerZbdifference + Math.Abs(lastverZBVerHeigh - sybltopZuoBiaoPt.YValue);

                if (adjacentVerZbdifference < 4)
                {
                    lastVerZBHor = lastVerZBHor + jbqx_SymbolWidth;
                    lastadjacentVerZbdifference = lastadjacentVerZbdifference + Math.Abs(lastverZBVerHeigh - sybltopZuoBiaoPt.YValue);
                }
                else
                {
                    lastVerZBHor = 0;
                    lastadjacentVerZbdifference = 0;
                }
                LJJSPoint syblpos = new LJJSPoint(sybltopZuoBiaoPt.XValue + lastVerZBHor, sybltopZuoBiaoPt.YValue);
                SymbolAdd.InsertBlock("JBQX", 1, 1, syblpos);

                int sybolcodecount = symbldrawing.sybolcodelist.Count;

                if (sybolcodecount == 3)
                {
                    string yxcode = symbldrawing.sybolcodelist[0].Trim();
                    if (yxcode != "n" && yxcode != "N" && yxcode != "")
                    {
                        SymbolCodeClass sybloper = (SymbolCodeClass)HashUtil.FindObjByKey(yxcode, FillSymbolCode.SymbolCodeClassHt);
                        if (null != sybloper)
                        {
                            // SymbolCodeClass sybloper = (SymbolCodeClass)FillSymbolCode.SymbolCodeClassHt[yxcode];
                            AddJBQXYXSymbolToFigure(syblpos, sybloper);
                        }
                    }
                    string czcode = symbldrawing.sybolcodelist[1].Trim();
                    if (czcode != "n" && czcode != "N" && czcode != "")
                    {
                        SymbolCodeClass sybloper = (SymbolCodeClass)HashUtil.FindObjByKey(czcode, FillSymbolCode.SymbolCodeClassHt);
                        //  SymbolCodeClass sybloper = (SymbolCodeClass)FillSymbolCode.SymbolCodeClassHt[czcode];
                        if (null != sybloper)
                        {
                            AddJBQXCZSymbolToFigure(syblpos, sybloper);
                        }
                    }
                    string yscode = symbldrawing.sybolcodelist[2].Trim();
                    LJJSCAD.Drawing.Text.LJJSText.AddHorCommonTextByLayer(yscode, new LJJSPoint(syblpos.XValue + jbqx_yshoroffset, syblpos.YValue), AttachmentPoint.MiddleLeft, jbqx_ysCodeTxt_Height, jbqx_bzFont);
                    // ArxCSHelper.AddMText(yscode, 1.2, new LJJSPoint(syblpos.XValue + jbqx_yshoroffset, syblpos.YValue), AttachmentPoint.MiddleLeft, bztxtstyleid);
                }
                lastverZBVerHeigh = syblpos.YValue;
            }
        }
        private void AddStandardSymbolItemToFigure(JDStruc jdstruc, List <SymbolItemStruc> syDrawingCol)
        {
            for (int i = 0; i < syDrawingCol.Count; i++)
            {
                SymbolItemStruc symbldrawing        = syDrawingCol[i];
                LJJSPoint       sybltopZuoBiaoPt    = ZuoBiaoOper.GetJSZuoBiaoPt(jdstruc.JDPtStart, symbldrawing.depthtop, jdstruc.JDtop, FrameDesign.ValueCoordinate);
                LJJSPoint       syblbottomZuoBiaoPt = ZuoBiaoOper.GetJSZuoBiaoPt(jdstruc.JDPtStart, symbldrawing.depthbottom, jdstruc.JDtop, FrameDesign.ValueCoordinate);
                LJJSPoint       syblpos             = ZuoBiaoOper.GetMidPtBetweenTwoPt(sybltopZuoBiaoPt, syblbottomZuoBiaoPt);

                for (int j = 0; j < symbldrawing.sybolcodelist.Count; j++)
                {
                    double xscale   = 1;
                    double yscale   = 1;
                    string syblcode = symbldrawing.sybolcodelist[j].Trim();
                    if (syblcode != "n" && syblcode != "")
                    {
                        SymbolCodeClass sybloper = (SymbolCodeClass)HashUtil.FindObjByKey(syblcode, FillSymbolCode.SymbolCodeClassHt);
                        if (null == sybloper)
                        {
                            continue;
                        }

                        if (Math.Abs(sybloper.symbolHeigh) > 0.01 && sybloper.ifZXEnlarge)
                        {
                            yscale = Math.Abs(sybltopZuoBiaoPt.YValue - syblbottomZuoBiaoPt.YValue) / sybloper.symbolHeigh;
                        }

                        if ((Math.Abs(sybloper.symbolWidth) > 0.01) && symItemDesignStruc.SyblIfHorFill)
                        {
                            xscale = this.lineRoadEnvironment.LineRoadWidth / sybloper.symbolWidth;
                        }
                        if (symItemDesignStruc.SymbolFramePro == SymbolFrame.DoubleParallel)
                        {
                            Line.BuildCommonHorLineByLayer(sybltopZuoBiaoPt, lineRoadEnvironment.LineRoadWidth, 0, DrawCommonData.DirectionRight);
                            //.AddContinusHorLine(sybltopZuoBiaoPt, lineRoadEnvironment.LineRoadWidth, 0);
                            Line.BuildCommonHorLineByLayer(syblbottomZuoBiaoPt, lineRoadEnvironment.LineRoadWidth, 0, DrawCommonData.DirectionRight);
                        }
                        //    AddJoinAdjustItemObjId(CommonDrawing.InsertSymbolItem(sybloper.symbolcode, xscale, yscale, syblpos));
                        SymbolAdd.InsertBlock(sybloper.symbolcode, xscale, yscale, syblpos);
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void AddYXPouMianToFigure(JDStruc jdstruc, List <SymbolItemStruc> yxpmStrucLst)
        {
            for (int i = 0; i < yxpmStrucLst.Count; i++)
            {
                SymbolItemStruc symbldrawing        = yxpmStrucLst[i];
                LJJSPoint       sybltopZuoBiaoPt    = ZuoBiaoOper.GetJSZuoBiaoPt(jdstruc.JDPtStart, symbldrawing.depthtop, jdstruc.JDtop, FrameDesign.ValueCoordinate);
                LJJSPoint       syblbottomZuoBiaoPt = ZuoBiaoOper.GetJSZuoBiaoPt(jdstruc.JDPtStart, symbldrawing.depthbottom, jdstruc.JDtop, FrameDesign.ValueCoordinate);
                LJJSPoint       syblpos             = ZuoBiaoOper.GetMidPtBetweenTwoPt(sybltopZuoBiaoPt, syblbottomZuoBiaoPt);

                for (int j = 0; j < symbldrawing.sybolcodelist.Count; j++)
                {
                    double xscale   = 1;
                    double yscale   = 1;
                    string syblcode = symbldrawing.sybolcodelist[j].Trim();
                    if (syblcode != "n" && syblcode != "")
                    {
                        SymbolCodeClass sybloper = (SymbolCodeClass)FillSymbolCode.SymbolCodeClassHt[syblcode];
                        if (null == sybloper)
                        {
                            continue;
                        }
                        if (sybloper.ifZXEnlarge)
                        {
                            yscale = Math.Abs(sybltopZuoBiaoPt.YValue - syblbottomZuoBiaoPt.YValue);
                        }
                        else if (sybloper.ifFill)
                        {
                            xscale = sybloper.symbolWidth;
                            yscale = Math.Abs(sybltopZuoBiaoPt.YValue - syblbottomZuoBiaoPt.YValue);
                        }
                        if (sybloper.symbolWidth > 0)
                        {
                            Rect.AddBlackRect(syblbottomZuoBiaoPt, Math.Abs(syblbottomZuoBiaoPt.YValue - sybltopZuoBiaoPt.YValue), sybloper.symbolWidth, 0, new DrawDirection(1, 1));
                        }

                        SymbolAdd.InsertBlock(sybloper.symbolcode, xscale, yscale, syblpos);
                    }
                }
            }
        }