lixiaojun
2024-08-05 0d59c0b8d03e8485f7938c95ab6d7303d4b1a329
WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/Map/Map.Draw.cs
@@ -1,4 +1,4 @@
using DevExpress.XtraPrinting.Native;

@@ -130,7 +130,7 @@
        void DrawBackGroud(Graphics bufferG, Settings template)
        {
            if (template == null) return;
            var _Nodes = _network.Nodes.ViewNodes;
            var _Links = _network.Links.ViewLinks;
@@ -372,7 +372,7 @@
                            float radius = 5 * r;
                            float diameter = radius * 2;
                            #region 圆形拆分
                            List<PointF> p = new List<PointF>();
                            Cpoints.ForEach(cp => p.Add(GraphHelper.getRotatePoint(c.X + cp.X * radius - radius, c.Y + cp.Y * radius, c, p1, p2)));
@@ -382,7 +382,7 @@
                            bufferG.FillPolygon(link.Selected ? pen_valveChoosed.Brush : pen.Brush, p.ToArray());
                            // 绘制连接线
@@ -511,7 +511,7 @@
                        break;
                    }
                    if (zoomAtMin >= zoom) continue;
                    if (node == _OperaNode)
                    {
                        //bufferG.DrawEllipse(junction.Choosed ? penChoosed : pen, rectangle);
@@ -547,7 +547,7 @@
                        p2 = new PointF(p1.X + 6 * pr, p1.Y - 6 * pr);
                        bufferG.DrawLine(node.Selected ? penChoosed : pen, p1, p2);
                    }
                    else if (node is TankViewModel)
                    {
@@ -803,8 +803,8 @@
        // 根据旋转角度计算旋转后的坐标
        private PointF Get平面旋转Point(PointF p, PointF MapC)
        {
            PointF center = MapC ;
            PointF center = MapC;
            double radian = Rotation * Math.PI / 180;  // 角度转弧度
            float x = (float)(Math.Cos(radian) * (p.X - center.X) - Math.Sin(radian) * (p.Y - center.Y) + center.X);
            float y = (float)(Math.Sin(radian) * (p.X - center.X) + Math.Cos(radian) * (p.Y - center.Y) + center.Y);
@@ -991,7 +991,7 @@
        /// <returns></returns>
        public PointF MapPointToWorldPoint(PointF point, float z = 0)
        {
            var pointT = Get俯视角还原Point(point, z,MapCenter);
            var pointT = Get俯视角还原Point(point, z, MapCenter);
            pointT = Get平面还原Point(pointT, MapCenter);
            //var n=new PointF((float)pointR.X - Z(z).X, (float)(pointR.Y - Z(z).Y));
@@ -1011,7 +1011,7 @@
        #endregion
        #region 计算三维相机
        public PointF3D GetCameraPosition( float distance=1)
        public PointF3D GetCameraPosition(float distance = 1)
        {
            // 将角度转换为弧度
            float rotationRadians = (float)Rotation * (float)Math.PI / 180;
@@ -1035,7 +1035,7 @@
            {
                case "左":
                    //Rotation为0~180时显示
                    if (RotationF<=90-delta && Rotation >= 0 + delta && Rotation <= 180 - delta)
                    if (RotationF <= 90 - delta && Rotation >= 0 + delta && Rotation <= 180 - delta)
                        flag = true;
                    break;
                case "前":
@@ -1050,7 +1050,7 @@
                    break;
                case "后":
                    //Rotation为0~180时显示
                    if (RotationF <= 90 - delta && ((Rotation >= 90 + delta && Rotation<=180)||( Rotation>=-180 && Rotation <= -90 - delta)))
                    if (RotationF <= 90 - delta && ((Rotation >= 90 + delta && Rotation <= 180) || (Rotation >= -180 && Rotation <= -90 - delta)))
                        flag = true;
                    break;
                case "上":
@@ -1083,10 +1083,10 @@
            // 判断面是否朝向相机
            bool isFacingCamera = dotProduct > 0;
            return isFacingCamera;
            return isFacingCamera;
        }
        #endregion
        #region 判断可见性