Ejemplo n.º 1
0
        /// <summary>
        /// 添加点对象
        /// </summary>
        /// <param name="item"></param>
        /// <param name="item"></param>
        /// <param name="type"></param>
        /// <param name="point"></param>
        /// <returns></returns>
        /// <summary>
        /// 多线段
        /// </summary>
        /// <returns></returns>
        /// <summary>
        /// 圆弧
        /// </summary>
        /// <returns></returns>
        private PathElement LoadArc(RTSafe.DxfCore.Entities.Arc item, int type)
        {
            PathElement pathElement = new PathElement();

            pathElement.Tag        = item.Layer.Name;
            pathElement.Color      = GetBrush(item.Color, item.Layer, type);
            pathElement.StartAngle = item.StartAngle;
            pathElement.EndAngle   = item.EndAngle;
            var s = item.StartAngle;

            if (item.Center.X.Equals(269.001501586602d))
            {
                pathElement.IsLargeArc = true;
            }

            //pathElement.StartPoint = new EPoint(Math.Cos(s) * item.Radius + item.Center.X - MinX, MaxY - (Math.Sin(s) * item.Radius + item.Center.Y));
            pathElement.StartPoint = new EPoint(item.Center.X - MinX, MaxY - item.Center.Y);
            var c = item.EndAngle - item.StartAngle;

            ////若果结束角度小于开始角度,弧长为差值加2*pi
            if (c < 0)
            {
                c += 360;
            }

            if (c > 180)
            {
                pathElement.IsLargeArc = true;
            }
            pathElement.RotationAngle = c;
            pathElement.Radius        = item.Radius;
            return(pathElement);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加点对象
        /// </summary>
        /// <param name="item"></param>
        /// <param name="item"></param>
        /// <param name="type"></param>
        /// <param name="point"></param>
        /// <returns></returns>
        /// <summary>
        /// 多线段
        /// </summary>
        /// <returns></returns>
        /// <summary>
        /// 圆弧
        /// </summary>
        /// <returns></returns>
        private Element LoadArc(RTSafe.DxfCore.Entities.Arc item, int type)
        {
            var color = GetBrush(item.Color, item.Layer, type).Color;


            PathElement pathElement = new PathElement
            {
                Tag        = item.Layer.Name,
                R          = color.R,
                G          = color.G,
                B          = color.B,
                StartAngle = item.StartAngle,
                EndAngle   = item.EndAngle,
                LayerName  = item.Layer.Name
            };

            if (item.Center.X.Equals(269.001501586602d))
            {
                pathElement.IsLargeArc = true;
            }

            pathElement.X = item.Center.X - MinX;
            pathElement.Y = MaxY - item.Center.Y;
            var c = item.EndAngle - item.StartAngle;

            ////若果结束角度小于开始角度,弧长为差值加2*pi
            if (c < 0)
            {
                c += 360;
            }

            if (c > 180)
            {
                pathElement.IsLargeArc = true;
            }
            pathElement.RotationAngle = c;
            pathElement.Radius        = item.Radius;
            return(pathElement);
        }