/// <summary>
        /// 添加普通类型的棒线,是与对数类型相区别;
        /// </summary>
        /// <param name="jdstruc">绘制棒线的井段范围</param>
        /// <param name="drawht">绘制棒线的数据,hashtable的key为y值也就是井深,X为棒线的横向取值</param>
        private void AddNormalStickLineToFigure(JDStruc jdstruc, Hashtable drawht)
        {
            bool        ifinkdc  = false;
            double      jdtop    = jdstruc.JDtop;
            double      jdbottom = jdstruc.JDBottom;
            KeDuChiItem drawkdc;
            LJJSPoint   lrptstart;
            int         kdccount = m_KDCList.Count;

            foreach (DictionaryEntry de in drawht)
            {
                ifinkdc = false;
                double xval = (double)de.Value;
                for (int i = 0; i < m_KDCList.Count; i++)
                {
                    drawkdc = m_KDCList[i];
                    if (ZuoBiaoOper.IfInKeDuChi(xval, drawkdc))//假如棒线横向坐标值在刻度尺范围内则绘制棒线;
                    {
                        Layer.Layer_SetToCurrent(drawkdc.KName);
                        lrptstart = ZuoBiaoOper.UpdateLRStartPt(drawkdc.KDir, jdstruc.JDPtStart, lineRoadEnvironment.LineRoadWidth);
                        DrawStickLine(lrptstart, drawkdc, xval, (double)de.Key, jdtop);
                        ifinkdc = true;
                        break;
                    }
                }
                if (ifinkdc == false)//棒线横向坐标不再刻度吃范围内,添加超界标注;
                {
                    lrptstart = ZuoBiaoOper.UpdateLRStartPt(m_KDCList[kdccount - 1].KDir, jdstruc.JDPtStart, lineRoadEnvironment.LineRoadWidth);
                    if (lineItemStruct.LineItemChaoJie == CJQXChaoJie.BiaoZhu)//添加标注信息;
                    {
                        AddChaoJieBZ(xval, jdstruc.JDPtStart, (double)de.Key, jdstruc.JDtop, FrameDesign.ValueCoordinate, m_KDCList[kdccount - 1], lineRoadEnvironment.LineRoadWidth);
                    }
                }
            }
        }
        //understand
        private LJJSPoint GetPtZBByKDC(KeDuChiItem drawkdc, LJJSPoint jdptstart, double xval, double yval, double jdtop)
        {
            ZuoBiaoOper zbopp     = new ZuoBiaoOper(FrameDesign.ValueCoordinate);
            LJJSPoint   lrptstart = ZuoBiaoOper.UpdateLRStartPt(drawkdc.KDir, jdptstart, LineRoadEnvironment.LineRoadWidth);

            return(zbopp.GetDrawingZuoBiaoPt(lrptstart, drawkdc, xval, yval, jdtop, LineRoadEnvironment.LineRoadWidth));
        }
Exemplo n.º 3
0
 public CurveHatch(JDStruc jdstruc, KeDuChiItem keDuChiItem, double lineRoadWidth)
 {
     this._jdstruc       = jdstruc;
     this._keDuChiItem   = keDuChiItem;
     this._jdptstart     = ZuoBiaoOper.UpdateLRStartPt(keDuChiItem.KDir, jdstruc.JDPtStart, lineRoadWidth);//根据刻度尺方向获得起点;
     this._lineRoadWidth = lineRoadWidth;
 }
        private void AddDuiShuStickLineToFigure(KeDuChiItem duiShuKDC, JDStruc jdstruc, Hashtable drawht)
        {
            LJJSPoint lrptstart = ZuoBiaoOper.UpdateLRStartPt(duiShuKDC.KDir, jdstruc.JDPtStart, LineRoadEnvironment.LineRoadWidth);

            foreach (DictionaryEntry de in drawht)
            {
                double xval = (double)de.Value;

                DrawDuiShuStickLine(lrptstart, duiShuKDC, xval, (double)de.Key, jdstruc.JDtop);
            }
        }
        private void AddDuiShuContinuousToFigure(KeDuChiItem duiShuKDC, ArrayList al, JDStruc jdstruc, Hashtable drawht, Color penColor)
        {
            List <LJJSPoint> drawptcol = new List <LJJSPoint>();
            double           yval      = 0;
            LJJSPoint        lrptstart = ZuoBiaoOper.UpdateLRStartPt(duiShuKDC.KDir, jdstruc.JDPtStart, LineRoadEnvironment.LineRoadWidth);//根据刻度尺方向获得起点;

            for (int i = 0; i < al.Count; i++)
            {
                yval = (double)al[i];
                drawptcol.Add(GetDuiShuPointZB(duiShuKDC, yval, drawht, jdstruc, lrptstart));
            }
            DrawContinuousLine(drawptcol, duiShuKDC.KName, duiShuKDC.kLineWidth, penColor);//绘制上一段曲线;
        }
        private List <HatchRectDrawStrut> GetPerJDDrawStructLst(JDStruc jdStruc)
        {
            LJJSPoint lrptstart = ZuoBiaoOper.UpdateLRStartPt(drawkdc.KDir, jdStruc.JDPtStart, lineRoadEnvironment.LineRoadWidth);
            double    jdTop     = jdStruc.JDtop;
            double    jdBottom  = jdStruc.JDBottom;


            List <HatchRectDrawStrut> hrdsLst = new List <HatchRectDrawStrut>();

            if (null == itemDataTable || itemDataTable.Rows.Count < 1)
            {
                return(hrdsLst);
            }
            string sql = GetItemSqlTxt(jdTop.ToString(), jdBottom.ToString());

            DataRow[] drs = itemDataTable.Select(sql, itemDesignStruc.Y_TopField + " ASC");
            if (itemDesignStruc.hrItemSubStyle.Equals(HatchRectItemSubStyle.ColorField))
            {
                foreach (DataRow dr in drs)
                {
                    List <LJJSPoint> areaLst = GetFillAreaPtLst(lrptstart, jdTop, jdBottom, dr);
                    string           color   = dr[itemDesignStruc.Color_FromFiled].ToString();
                    if (colorDic.ContainsKey(color))
                    {
                        string             colorvalue = colorDic[color];
                        LJJSHatch          ljjsHatch  = new LJJSHatch(colorvalue, bool.FalseString);
                        HatchRectDrawStrut hrds       = new HatchRectDrawStrut(areaLst, ljjsHatch);
                        hrdsLst.Add(hrds);
                    }
                }
            }
            else
            {
                foreach (DataRow dr in drs)
                {
                    List <LJJSPoint> areaLst = GetFillAreaPtLst(lrptstart, jdTop, jdBottom, dr);

                    LJJSHatch          ljjsHatch = itemDesignStruc.ItemHatch;
                    HatchRectDrawStrut hrds      = new HatchRectDrawStrut(areaLst, ljjsHatch);
                    hrdsLst.Add(hrds);
                }
            }
            return(hrdsLst);
        }
        private void AddNormalContinuousToFigure(ArrayList al, JDStruc jdstruc, Hashtable drawht, Color penColor, int index)
        {
            double           jdtop       = jdstruc.JDtop;
            string           prekdcname  = "No";
            double           preyval     = 0;
            double           prexvalue   = 0;
            string           currkdcname = "";
            LJJSPoint        lrptstart;
            LJJSPoint        currpt     = new LJJSPoint(0, 0);
            List <LJJSPoint> drawptcol  = new List <LJJSPoint>();
            List <LJJSPoint> outdrawcol = new List <LJJSPoint>();

            List <List <LJJSPoint> > outdrawcollist = new List <List <LJJSPoint> >();

            double      jdbottom = jdstruc.JDBottom;
            ZuoBiaoOper zbopp    = new ZuoBiaoOper(FrameDesign.ValueCoordinate);
            LJJSPoint   prept    = new LJJSPoint(0, 0);
            KeDuChiItem drawkdc  = null;
            LJJSPoint   chajieinterpt;//超界交点
            KeDuChiItem outdrawkdc = m_KDCList[m_KDCList.Count - 1];
            double      lastxvalue = 0;


            #region
            for (int i = 0; i < al.Count; i++)
            {
                double yval   = (double)al[i];
                double xvalue = (double)drawht[yval]; //获取 每个点x,y的值

                drawkdc = PointIfChaoJie(yval, drawht);

                if (drawkdc != null)//该点未超界;
                {
                    outdrawkdc = drawkdc;
                    lrptstart  = ZuoBiaoOper.UpdateLRStartPt(drawkdc.KDir, jdstruc.JDPtStart, LineRoadEnvironment.LineRoadWidth);

                    this.lrptstart     = lrptstart;
                    this.lrptstartName = lineItemStruct.LiSubClass;
                    //MessageBox.Show(string.Format("lrptstart:({0},{1})", lrptstart.XValue.ToString(), lrptstart.YValue.ToString()));

                    currkdcname = drawkdc.KName;
                    currpt      = GetPtZBByKDC(drawkdc, jdstruc.JDPtStart, (double)drawht[yval], yval, jdstruc.JDtop);
                    prept       = currpt;
                    if (StrUtil.IfTwoStrEqul(prekdcname, currkdcname))
                    {
                        drawptcol.Add(currpt);//和上一点为同一刻度尺;则加入绘图集合;
                    }
                    else//开始下一段曲线的操作;分为从超界曲线向非超界的跳变,也有可能是非超界之间的跳变;
                    {
                        if (prekdcname.Equals(""))//从超界曲线向非超界的跳变
                        {
                            if (lastxvalue < drawkdc.KMin)
                            {
                                chajieinterpt = ZuoBiaoOper.GetTiaoBianIntersectionPoint(currpt, prept, lrptstart.XValue);
                            }
                            else
                            {
                                chajieinterpt = ZuoBiaoOper.GetTiaoBianIntersectionPoint(currpt, prept, lrptstart.XValue + outdrawkdc.KDir * LineRoadEnvironment.LineRoadWidth);
                            }


                            outdrawcol.Add(chajieinterpt);
                            drawptcol.Clear();
                            drawptcol.Add(chajieinterpt);

                            if (outdrawcol.Count > 0)
                            {
                                outdrawcollist.Add(outdrawcol);
                            }
                        }
                        else//非超界之间的跳变;
                        {
                            if (drawptcol.Count > 1)
                            {
                                this.DrawContinuousLine(drawptcol, prekdcname, drawkdc.kLineWidth, penColor);//绘制上一段曲线;
                            }

                            drawptcol.Clear();
                        }
                        drawptcol.Add(currpt);
                    }
                    prekdcname = currkdcname;
                    prexvalue  = (double)drawht[yval];
                    preyval    = yval;
                }
                else//该点已超界  drawkdc == null
                {
                    if (m_KDCList.Count > 0)
                    {
                        currpt      = GetPtZBByKDC(outdrawkdc, jdstruc.JDPtStart, (double)drawht[yval], yval, jdstruc.JDtop);
                        currkdcname = "";
                        if (lineItemStruct.LineItemChaoJie == CJQXChaoJie.BiaoZhu) //添加标注信息;
                        {
                            if (!StrUtil.IfTwoStrEqul(prekdcname, currkdcname))    //跳变点
                            {
                                lrptstart          = ZuoBiaoOper.UpdateLRStartPt(outdrawkdc.KDir, jdstruc.JDPtStart, lineRoadEnvironment.LineRoadWidth);
                                this.lrptstart     = lrptstart;
                                this.lrptstartName = lineItemStruct.LiSubClass;
                                if (xvalue < outdrawkdc.KMin)
                                {
                                    chajieinterpt = ZuoBiaoOper.GetTiaoBianIntersectionPoint(currpt, prept, lrptstart.XValue);
                                }
                                else
                                {
                                    chajieinterpt = ZuoBiaoOper.GetTiaoBianIntersectionPoint(currpt, prept, lrptstart.XValue + outdrawkdc.KDir * lineRoadEnvironment.LineRoadWidth);
                                }
                                drawptcol.Add(chajieinterpt);
                                if (drawptcol.Count > 0)
                                {
                                    this.DrawContinuousLine(drawptcol, prekdcname, outdrawkdc.kLineWidth, penColor);//绘制上一段非超界曲线;


                                    drawptcol.Clear();
                                }
                            }
                            prept      = currpt;
                            prekdcname = currkdcname;
                            prexvalue  = (double)drawht[yval];
                            preyval    = yval;

                            continue;
                        }


                        if (StrUtil.IfTwoStrEqul(prekdcname, currkdcname))
                        {
                            outdrawcol.Add(currpt);//和上一点为同一刻度尺;则加入绘图集合;
                        }
                        else//此时为从非超界向超界跳变;上一段非超界曲线结束;
                        {
                            outdrawcol         = new List <LJJSPoint>();
                            lrptstart          = ZuoBiaoOper.UpdateLRStartPt(outdrawkdc.KDir, jdstruc.JDPtStart, lineRoadEnvironment.LineRoadWidth);
                            this.lrptstart     = lrptstart;
                            this.lrptstartName = lineItemStruct.LiSubClass;
                            if (xvalue < outdrawkdc.KMin)
                            {
                                chajieinterpt = ZuoBiaoOper.GetTiaoBianIntersectionPoint(currpt, prept, lrptstart.XValue);
                            }
                            else
                            {
                                chajieinterpt = ZuoBiaoOper.GetTiaoBianIntersectionPoint(currpt, prept, lrptstart.XValue + outdrawkdc.KDir * lineRoadEnvironment.LineRoadWidth);
                            }

                            drawptcol.Add(chajieinterpt);
                            if (drawptcol.Count > 1)
                            {
                                this.DrawContinuousLine(drawptcol, prekdcname, outdrawkdc.kLineWidth, penColor);//绘制上一段非超界曲线;

                                drawptcol.Clear();
                            }
                            if (outdrawcol.Count > 0)
                            {
                                outdrawcollist.Add(outdrawcol);
                            }
                            outdrawcol.Clear();
                            if (i != 0)
                            {
                                outdrawcol.Add(chajieinterpt);
                            }


                            outdrawcol.Add(currpt);
                            prekdcname = currkdcname;
                            prexvalue  = (double)drawht[yval];
                            preyval    = yval;
                        }
                    }
                }
                prept      = currpt;
                lastxvalue = xvalue;
            }//遍历完所有的点;
            #endregion
            lrptstart = ZuoBiaoOper.UpdateLRStartPt(outdrawkdc.KDir, jdstruc.JDPtStart, lineRoadEnvironment.LineRoadWidth);


            this.set_start_point_dele = SuiZuanForm.set_startpoint; //这两行代码用于随钻界面画图后界面的放大,如果是绘图可无视
            this.set_start_point_dele(lrptstart);                   //这两行代码用于随钻界面画图后界面的放大,如果是绘图可无视
            this.lrptstart     = lrptstart;
            this.lrptstartName = lineItemStruct.LiSubClass;
            if ((currkdcname == "") && (outdrawcol.Count > 1))
            {
                outdrawcollist.Add(outdrawcol);


                //add here?
            }



            if (drawptcol.Count > 1 && drawkdc != null)
            {
                //在循环进行完毕,将drawptcol ,即画的线上的所有点的集合保存在一个静态类中
                if (lineItemStruct.LiSubClass == "msev" && DrawPointContainer.list[index].msevList == null)
                {
                    DrawPointContainer.list[index].msevList = drawptcol;
                    //MsehAndMsevContainer.msevList = drawptcol;
                }
                if (lineItemStruct.LiSubClass == "mseh" && DrawPointContainer.list[index].msehList == null)
                {
                    DrawPointContainer.list[index].msehList = drawptcol;
                }

                if (lineItemStruct.LiSubClass == "wxcs" && DrawPointContainer.list[index].wxcsList == null)
                {
                    DrawPointContainer.list[index].wxcsList = drawptcol;
                }

                if (lineItemStruct.LiSubClass == "wxcs2" && DrawPointContainer.list[index].WXCSJiaoHuiList == null)
                {
                    DrawPointContainer.list[index].WXCSJiaoHuiList = drawptcol;
                }

                if (lineItemStruct.LiSubClass == "jgl" && DrawPointContainer.list[index].JinGeiLiangList == null)
                {
                    DrawPointContainer.list[index].JinGeiLiangList = drawptcol;
                }


                this.DrawContinuousLine(drawptcol, currkdcname, drawkdc.kLineWidth, penColor);//绘制上一段非超界曲线;在此画线
            }

            if (outdrawcollist.Count > 0)
            {
                AddChaoJieLine(outdrawcollist, lrptstart.XValue + outdrawkdc.KDir * lineRoadEnvironment.LineRoadWidth, outdrawkdc.KDir, outdrawkdc.KName, outdrawkdc.kLineWidth, penColor);
            }
        }