示例#1
0
        internal static CircleModel Polyline2DModel(Polyline2d line, AttributeModel atModel)
        {
            CircleModel dbModel = new CircleModel();


            double length = line.Length;

            dbModel.pointList = MethodCommand.GetArcPoints(line, length);

            dbModel.Color = line.ColorIndex == 256 ? MethodCommand.GetLayerColorByID(line.LayerId) : System.Drawing.ColorTranslator.ToHtml(line.Color.ColorValue);
            foreach (AttributeItemModel item in atModel.attributeItems)
            {
                string attValue = "";

                switch (item.AtItemType)
                {
                case AttributeItemType.Area:
                    attValue = line.Area.ToString();
                    break;

                case AttributeItemType.TxtHeight:

                    break;

                case AttributeItemType.Color:
                    attValue = dbModel.Color;
                    break;

                case AttributeItemType.Content:

                    break;

                case AttributeItemType.LayerName:
                    attValue = line.Layer;
                    break;

                case AttributeItemType.LineScale:
                    attValue = line.LinetypeScale.ToString();
                    break;

                case AttributeItemType.LineType:
                    attValue = GetLayerLineTypeByID(line);
                    break;

                case AttributeItemType.Overallwidth:
                    attValue = line.ConstantWidth.ToString();
                    break;

                case AttributeItemType.TotalArea:

                    break;
                }
                if (!string.IsNullOrEmpty(attValue))
                {
                    item.AtValue = attValue;
                    dbModel.attItemList.Add(item);
                }
            }
            return(dbModel);
        }
示例#2
0
        internal static CircleModel Polyline2DModel(Polyline2d line)
        {
            CircleModel dbModel = new CircleModel();


            double length = line.Length;

            dbModel.pointList = MethodCommand.GetArcPoints(line, length);
            dbModel.isDashed  = GetLayerLineTypeByIDEx(line);

            dbModel.Color = line.ColorIndex == 256 ? MethodCommand.GetLayerColorByID(line.LayerId) : System.Drawing.ColorTranslator.ToHtml(line.Color.ColorValue);
            return(dbModel);
        }
示例#3
0
        public static CircleModel Circle2Model(Circle line)
        {
            CircleModel dbModel = new CircleModel();

            dbModel.Center  = Point3d2Pointf(line.Center);
            dbModel.Radius  = line.Radius;
            dbModel.GeoType = "Circle";
            MyPoint spt    = new MyPoint(line.StartPoint.X, line.StartPoint.Y);
            MyPoint ept    = new MyPoint(line.EndPoint.X, line.EndPoint.Y);
            MyPoint center = new MyPoint(dbModel.Center.X, dbModel.Center.Y);

            dbModel.pointList = MethodCommand.GetArcPoints(line, line.Circumference);
            dbModel.Color     = line.ColorIndex == 256 ? MethodCommand.GetLayerColorByID(line.LayerId) : System.Drawing.ColorTranslator.ToHtml(line.Color.ColorValue);
            dbModel.isDashed  = GetLayerLineTypeByIDEx(line);
            return(dbModel);
        }
示例#4
0
        public static EllipseModel Ellipse2Model(Ellipse line)
        {
            EllipseModel dbModel = new EllipseModel();

            dbModel.Center    = Point3d2Pointf(line.Center);
            dbModel.MajorAxis = line.MajorRadius;
            dbModel.MinorAxis = line.MinorRadius;
            dbModel.GeoType   = "Ellipse";
            MyPoint spt    = new MyPoint(line.StartPoint.X, line.StartPoint.Y);
            MyPoint ept    = new MyPoint(line.EndPoint.X, line.EndPoint.Y);
            MyPoint center = new MyPoint(dbModel.Center.X, dbModel.Center.Y);

            double length = line.RadiusRatio * (line.MinorRadius + line.MajorRadius);

            dbModel.pointList = MethodCommand.GetArcPoints(line, length);
            dbModel.isDashed  = GetLayerLineTypeByIDEx(line);

            dbModel.Color = line.ColorIndex == 256 ? MethodCommand.GetLayerColorByID(line.LayerId) : System.Drawing.ColorTranslator.ToHtml(line.Color.ColorValue);
            return(dbModel);
        }
示例#5
0
        internal static ArcModel Arc2Model(Arc line)
        {
            ArcModel dbModel = new ArcModel();

            dbModel.Center     = Point3d2Pointf(line.Center);
            dbModel.EndAngel   = line.EndAngle;
            dbModel.EndPoint   = MethodCommand.Point3d2Pointf(line.EndPoint);
            dbModel.Startangel = line.StartAngle;
            dbModel.StartPoint = MethodCommand.Point3d2Pointf(line.StartPoint);
            dbModel.GeoType    = "Arc";
            //dbModel.MajorAxis= line.MajorRadius;
            //dbModel.MinorAxis = line.MinorRadius;
            MyPoint spt    = new MyPoint(line.StartPoint.X, line.StartPoint.Y);
            MyPoint ept    = new MyPoint(line.EndPoint.X, line.EndPoint.Y);
            MyPoint center = new MyPoint(dbModel.Center.X, dbModel.Center.Y);

            double length = line.Length;

            dbModel.pointList = MethodCommand.GetArcPoints(line, length);
            dbModel.isDashed  = GetLayerLineTypeByIDEx(line);
            dbModel.Color     = line.ColorIndex == 256 ? MethodCommand.GetLayerColorByID(line.LayerId) : System.Drawing.ColorTranslator.ToHtml(line.Color.ColorValue);
            return(dbModel);
        }
示例#6
0
        public static CircleModel Ellipse2Model(Ellipse line, AttributeModel atModel)
        {
            CircleModel dbModel = new CircleModel();

            dbModel.Center = Point3d2Pointf(line.Center);
            //dbModel.MajorAxis= line.MajorRadius;
            //dbModel.MinorAxis = line.MinorRadius;
            MyPoint spt    = new MyPoint(line.StartPoint.X, line.StartPoint.Y);
            MyPoint ept    = new MyPoint(line.EndPoint.X, line.EndPoint.Y);
            MyPoint center = new MyPoint(dbModel.Center.X, dbModel.Center.Y);

            double length = line.RadiusRatio * (line.MinorRadius + line.MajorRadius);

            dbModel.pointList = MethodCommand.GetArcPoints(line, length);

            dbModel.Color = line.ColorIndex == 256 ? MethodCommand.GetLayerColorByID(line.LayerId) : System.Drawing.ColorTranslator.ToHtml(line.Color.ColorValue);
            foreach (AttributeItemModel item in atModel.attributeItems)
            {
                string attValue = "";

                switch (item.AtItemType)
                {
                case AttributeItemType.Area:
                    attValue = line.Area.ToString();
                    break;

                case AttributeItemType.TxtHeight:

                    break;

                case AttributeItemType.Color:
                    attValue = dbModel.Color;
                    break;

                case AttributeItemType.Content:

                    break;

                case AttributeItemType.LayerName:
                    attValue = line.Layer;
                    break;

                case AttributeItemType.LineScale:
                    attValue = line.LinetypeScale.ToString();
                    break;

                case AttributeItemType.LineType:
                    attValue = GetLayerLineTypeByID(line);
                    break;

                case AttributeItemType.Overallwidth:
                    break;

                case AttributeItemType.TotalArea:

                    break;
                }
                if (!string.IsNullOrEmpty(attValue))
                {
                    item.AtValue = attValue;
                    dbModel.attItemList.Add(item);
                }
            }
            return(dbModel);
        }