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 AddPerLegendNoFrame(LJJSPoint ptbase, SymbolCodeClass symoper)
        {
            if (symoper == null)
            {
                return;
            }
            double legwidth = symoper.legendWidth;

            Rect.AddBlackRect(ptbase, -_legendunitheigh, legwidth, 0, new DrawDirection(1, 1));
            symoper.InserLegendSymbol(new LJJSPoint(ptbase.XValue, ptbase.YValue - _legendunitheigh * 0.5), legwidth, _legendunitheigh);
            LJJSText.AddHorCommonText(symoper.symbolChineseName, new LJJSPoint(ptbase.XValue + legwidth + noframetxtvslegspace, ptbase.YValue - _legendunitheigh * 0.5), DrawCommonData.BlackColorRGB, AttachmentPoint.MiddleLeft, legendtxtheigh, legendCNtxtstyle);
            //(symoper.symbolChineseName, legendtxtheigh, new LJJSPoint(ptbase.XValue+ legwidth + noframetxtvslegspace, ptbase.YValue - _legendunitheigh * 0.5), AttachmentPoint.MiddleLeft, legendCNtxtstyle);
        }
        private Hashtable GetSymbolOperHt(List <string> symbolCodeList)
        {
            Hashtable ht = new Hashtable();

            foreach (string symcodestr in symbolCodeList)
            {
                SymbolCodeClass symboloper = (SymbolCodeClass)FillSymbolCode.SymbolCodeClassHt[symcodestr];
                if (!ht.Contains(symboloper.legendSequence) && symboloper != null)
                {
                    ht.Add(symboloper.legendSequence, symboloper);
                }
            }
            return(ht);
        }
        private double GetLegendMaxWidth(Hashtable syoperHt)
        {
            double maxwidth = 0;

            foreach (DictionaryEntry de in syoperHt)
            {
                SymbolCodeClass symoper = (SymbolCodeClass)de.Value;
                if (symoper.legendWidth > maxwidth)
                {
                    maxwidth = symoper.legendWidth;
                }
            }
            return(maxwidth);
        }
        private void AddNoFrameLegend(ArrayList al)
        {
            List <LJJSPoint> ptbasecol = GetNoFramePtbaseCol();

            for (int i = 0; i < al.Count; i++)
            {
                int             keyvalue = (int)al[i];
                SymbolCodeClass symoper  = (SymbolCodeClass)symbolOperHt[keyvalue];
                if (i < ptbasecol.Count)
                {
                    AddPerLegendNoFrame(ptbasecol[i], symoper);
                }
            }
        }
        private void AddJBQXYXSymbolToFigure(LJJSPoint insertPos, SymbolCodeClass sybloper)
        {
            LJJSPoint insertpt = new LJJSPoint(insertPos.XValue + jbqx_yxhoroffset, insertPos.YValue + 1);

            double enlargefactor = 1;
            string tmpsymbol     = sybloper.symbolcode.Trim();
            int    yenlarge      = 1;

            if (sybloper.symbolWidth > 0)
            {
                if (sybloper.symbolWidth > 8)
                {
                    enlargefactor = 8 / sybloper.symbolWidth;
                }
            }
            SymbolAdd.InsertBlock(sybloper.symbolcode, enlargefactor, yenlarge, insertpt);
            //  ArxCSHelper.InsertBlock(sybloper.symbolcode, enlargefactor, yenlarge, insertpt);
        }
        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);
                    }
                }
            }
        }
        private void AddHaveFrameLegend(ArrayList al)
        {
            if (legendunitwidth < 0.01)
            {
                return;
            }
            List <LJJSPoint> ptbasecol = AddLegendFrameToFigure();

            for (int i = 0; i < al.Count; i++)
            {
                int             keyvalue = (int)al[i];
                SymbolCodeClass symoper  = (SymbolCodeClass)symbolOperHt[keyvalue];
                if (null != symoper)
                {
                    if (i < ptbasecol.Count)
                    {
                        AddLegendHaveLeftTopBaseAndWH(ptbasecol[i], symoper);
                    }
                }
            }
        }
Exemple #9
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);
                    }
                }
            }
        }
        private void AddJBQXCZSymbolToFigure(LJJSPoint insertPos, SymbolCodeClass sybloper)
        {
            LJJSPoint insertpt  = new LJJSPoint(insertPos.XValue + jbqx_czhoroffset, insertPos.YValue - 1);
            string    tmpsymbol = sybloper.symbolcode.Trim();
            int       yenlarge  = 2;

            if (tmpsymbol.Equals("yj") || tmpsymbol.Equals("yb") || tmpsymbol.Equals("yg"))
            {
                yenlarge = 1;
            }

            double enlargefactor = 1;

            if (sybloper.symbolWidth > 0)
            {
                if (sybloper.symbolWidth > 8)
                {
                    enlargefactor = 8 / sybloper.symbolWidth;
                }
            }
            SymbolAdd.InsertBlock(sybloper.symbolcode, enlargefactor, yenlarge, insertpt);
        }
Exemple #11
0
        public static void SetSymbolCodeClassHt()
        {
            _symbolcodeclassht.Clear();

            DbDataReader dr = SymbolCodeDAL.GetAllSymbolCode();

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    SymbolCodeClass sycc = new SymbolCodeClass();
                    sycc.symbolcode     = dr["SymbolCode"].ToString().Trim();
                    sycc.symbolHeigh    = StrUtil.StrToDouble(dr["SymbolHeigh"].ToString(), 0, "符号高度的数据为非数值型");
                    sycc.ifFill         = BoolUtil.GetBoolByBindID(dr["IfFill"].ToString(), false);
                    sycc.ifZXEnlarge    = BoolUtil.GetBoolByBindID(dr["IfZXEnlarge"].ToString(), false);
                    sycc.symbolWidth    = StrUtil.StrToDouble(dr["SymbolWidth"].ToString(), 0, "符号宽度的数据为非数值型");
                    sycc.legendSequence = StrUtil.StrToInt(dr["xh"].ToString(), sycc.symbolcode + "图例缺少图例序号", sycc.symbolcode + "图例序号为非数值型");
                    sycc.legendstyle    = LegendOper.GetLegendTypeByStr(dr["LegendType"].ToString());
                    if (sycc.legendstyle == LegendStyle.errStyle)
                    {
                        sycc.legendstyle = LegendStyle.YSTxtStyle;
                        MessageBox.Show(sycc.symbolcode + "图例类型表述错误,请检查符号设置表,系统默认为颜色文本类型符号");
                    }
                    sycc.symbolChineseName = dr["ysmc"].ToString().Trim();
                    sycc.legendWidth       = StrUtil.StrToDouble(dr["LegendlWidth"].ToString(), 20, sycc.symbolcode + "图例框宽度为非数值型");
                    try
                    {
                        _symbolcodeclassht.Add(sycc.symbolcode, sycc);
                    }
                    catch
                    {
                        continue;
                    }
                }
            }
            dr.Close();
        }
 /// <summary>
 /// 根据左基点和符号内容,添加符号或颜色文本;
 /// </summary>
 private void AddLegendHaveLeftTopBaseAndWH(LJJSPoint ptBase, SymbolCodeClass symboloper)
 {
     symboloper.InserLegendSymbol(new LJJSPoint(ptBase.XValue, ptBase.YValue - _legendunitheigh * 0.5), legendunitwidth, _legendunitheigh);
     LJJSText.AddHorCommonText(symboloper.symbolChineseName, new LJJSPoint(ptBase.XValue + legendunitwidth * 0.5, ptBase.YValue - _legendunitheigh * 1.6), DrawCommonData.BlackColorRGB, AttachmentPoint.MiddleCenter, legendtxtheigh, legendCNtxtstyle);
 }