Esempio n. 1
0
        public override void Delete()
        {
            var wirePoints = WirePoint.FindAllByWireId(WireId);

            foreach (var p in wirePoints)
            {
                p.Delete();
            }
            base.Delete();
        }
Esempio n. 2
0
        public override void Delete()
        {
            var wire = Wire.FindOneByTunnelId(TunnelId);

            if (wire != null)
            {
                WirePoint.DeleteAll(WirePoint.FindAllByWireId(wire.WireId).Select(u => u.WirePointId));
                wire.Delete();
            }
            if (WorkingFace != null)
            {
                DayReportJj.DeleteByWorkingFaceId(WorkingFace.WorkingFaceId);
                DayReportHc.DeleteByWorkingFaceId(WorkingFace.WorkingFaceId);
            }
            MineData.DeleteByTunnelId <CoalExistence>(TunnelId);
            MineData.DeleteByTunnelId <GasData>(TunnelId);
            MineData.DeleteByTunnelId <GeologicStructure>(TunnelId);
            MineData.DeleteByTunnelId <Ventilation>(TunnelId);
            MineData.DeleteByTunnelId <Management>(TunnelId);
            base.Delete();
        }
Esempio n. 3
0
        /// <summary>
        ///     根据导线点计算巷道左右帮的点
        ///     前后两个导线点坐标一样的情况未处理,传入的导线点数据需要保证不重复.
        /// </summary>
        /// <param name="wirePts">导线点实体</param>
        /// <param name="verticesLeftBtmRet">out,根据导线点计算出的巷道左帮所有点</param>
        /// <param name="verticesRightBtmRet">out,根据导线点计算出的巷道右帮所有点</param>
        /// <returns></returns>
        public bool CalcLeftAndRightVertics(WirePoint[] wirePts, ref Vector3_DW[] verticesLeftBtmRet,
                                            ref Vector3_DW[] verticesRightBtmRet)
        {
            if (wirePts == null)
            {
                return(false);
            }

            int nTraversePtCnt = wirePts.Length;

            if (nTraversePtCnt < 1)
            {
                return(false);
            }

            #region 仅含两个导线点

            if (nTraversePtCnt == 2)
            {
                bool bRet = CalcLeftAndRightVerticsWith2TraverPoints(wirePts, ref verticesLeftBtmRet,
                                                                     ref verticesRightBtmRet);
                if (bRet == false)
                {
                    return(false);
                }
            }
            #endregion
            #region 大于等于三个点

            else
            {
                var lstLeftBtmVertices  = new List <Vector3_DW>();
                var lstRightBtmVertices = new List <Vector3_DW>();

                #region For loop

                for (int i = 0; i < nTraversePtCnt - 2; i++)
                {
                    var lwDatasPreTmp = new WirePoint[2]
                    {
                        new WirePoint(wirePts[i]),
                        new WirePoint(wirePts[i + 1])
                    };

                    var lwDatasNextTmp = new WirePoint[2]
                    {
                        new WirePoint(wirePts[i + 1]),
                        new WirePoint(wirePts[i + 2])
                    };

                    Vector3_DW[] verticesLeftPreTmp  = null;
                    Vector3_DW[] verticesRightPreTmp = null;
                    if (false ==
                        CalcLeftAndRightVerticsWith2TraverPoints(lwDatasPreTmp, ref verticesLeftPreTmp,
                                                                 ref verticesRightPreTmp))
                    {
                        return(false);
                    }
                    Vector3_DW[] verticesLeftNextTmp  = null;
                    Vector3_DW[] verticesRightNextTmp = null;
                    if (false ==
                        CalcLeftAndRightVerticsWith2TraverPoints(lwDatasNextTmp, ref verticesLeftNextTmp,
                                                                 ref verticesRightNextTmp))
                    {
                        return(false);
                    }
                    var vertexMid2d    = new Vector2_DW();
                    var vertexLeftMid  = new Vector3_DW();
                    var vertexRightMid = new Vector3_DW();
                    //左邦中间的点
                    LineIntersectType lit =
                        ToolsMath_DW.LineXLine(new Vector2_DW(verticesLeftPreTmp[0].X, verticesLeftPreTmp[0].Y),
                                               new Vector2_DW(verticesLeftPreTmp[1].X, verticesLeftPreTmp[1].Y),
                                               new Vector2_DW(verticesLeftNextTmp[0].X, verticesLeftNextTmp[0].Y),
                                               new Vector2_DW(verticesLeftNextTmp[1].X, verticesLeftNextTmp[1].Y), ref vertexMid2d);
                    if (lit == LineIntersectType.None) //有重复点,可能是这种情况eg:p0(0, 0), p1(2, 0),p2(1, 0), p3(4, 0)
                    {
                        vertexLeftMid.X = verticesLeftPreTmp[1].X;
                        vertexLeftMid.Y = verticesLeftPreTmp[1].Y;
                        vertexLeftMid.Z = lwDatasPreTmp[1].CoordinateZ;
                    }
                    else
                    {
                        vertexLeftMid.X = vertexMid2d.X;
                        vertexLeftMid.Y = vertexMid2d.Y;
                        vertexLeftMid.Z = lwDatasPreTmp[1].CoordinateZ;
                    }
                    //右邦中间的点
                    lit = ToolsMath_DW.LineXLine(new Vector2_DW(verticesRightPreTmp[0].X, verticesRightPreTmp[0].Y),
                                                 new Vector2_DW(verticesRightPreTmp[1].X, verticesRightPreTmp[1].Y),
                                                 new Vector2_DW(verticesRightNextTmp[0].X, verticesRightNextTmp[0].Y),
                                                 new Vector2_DW(verticesRightNextTmp[1].X, verticesRightNextTmp[1].Y), ref vertexMid2d);
                    if (lit == LineIntersectType.None) //有重复点,可能是这种情况eg:p0(0, 0), p1(2, 0),p2(1, 0), p3(4, 0)
                    {
                        vertexRightMid.X = verticesRightPreTmp[1].X;
                        vertexRightMid.Y = verticesRightPreTmp[1].Y;
                        vertexRightMid.Z = lwDatasPreTmp[1].CoordinateZ;
                    }
                    else
                    {
                        vertexRightMid.X = vertexMid2d.X;
                        vertexRightMid.Y = vertexMid2d.Y;
                        vertexRightMid.Z = lwDatasPreTmp[1].CoordinateZ;
                    }
                    //保存计算出来的点
                    //第一个顶点
                    if (i == 0)
                    {
                        lstLeftBtmVertices.Add(verticesLeftPreTmp[0]);
                        lstRightBtmVertices.Add(verticesRightPreTmp[0]);
                    }
                    //中间的顶点
                    lstLeftBtmVertices.Add(vertexLeftMid);
                    lstRightBtmVertices.Add(vertexRightMid);
                    //最后一个顶点
                    if (i == nTraversePtCnt - 3)
                    {
                        lstLeftBtmVertices.Add(verticesLeftNextTmp[1]);
                        lstRightBtmVertices.Add(verticesRightNextTmp[1]);
                    }
                } //end for

                #endregion

                verticesLeftBtmRet  = lstLeftBtmVertices.ToArray();
                verticesRightBtmRet = lstRightBtmVertices.ToArray();
            }

            #endregion

            return(true);
        }