예제 #1
0
        public override XmlElement CreateElement(string prefix, string localName, string ns)
        {
            XmlElement element1;
            if (this.firstload)
            {
            //				SvgElement element2 = null;
                if (this.preelement != null)
                {
                    //                    if (this.preelement.ParentNode == null)
                    //                    {
                    //                        if (this.groups.Count > 0)
                    //                        {
                    //                            element2 = (SvgElement) this.groups[this.groups.Count - 1];
                    //                            if ((element2 is ContainerElement) && ((ContainerElement) element2).IsValidChild(this.preelement))
                    //                            {
                    //                                ((ContainerElement) element2).ChildList.Add(this.preelement);
                    //                            }
                    //                        }
                    //                        this.groups.Add(this.preelement);
                    //                    }
                    //                    else if (this.groups.Count > 0)
                    //                    {
                    //						if(this.preelement.ParentNode is ContainerElement && ((ContainerElement) this.preelement.ParentNode).IsValidChild(this.preelement))
                    //						{
                    //							((ContainerElement)this.preelement.ParentNode).ChildList.Add(this.preelement);
                    //						}
                    //
                    //                    }
                }
            }
            switch (localName)
            {
                case "clipPath":
                {
                    element1 = new ClipPath(prefix, localName, ns, this);
                    break;
                }
                case "rect":
                {
                    element1 = new RectangleElement(prefix, localName, ns, this);
                    break;
                }
                case "path":
                {
                    element1 = new GraphPath(prefix, localName, ns, this);
                    break;
                }
                case "polyline":
                {
                    element1 = new Polyline(prefix, localName, ns, this);
                    break;
                }
                case "polygon":
                {
                    element1 = new Polygon(prefix, localName, ns, this);
                    break;
                }
                case "circle":
                {
                    element1 = new Circle(prefix, localName, ns, this);
                    break;
                }
                case "ellipse":
                {
                    element1 = new Ellips(prefix, localName, ns, this);
                    break;
                }
                case "script":
                {
                    element1 = new SvgScript(prefix, localName, ns, this);
                    break;
                }
                case "line":
                {
                    element1 = new Line(prefix, localName, ns, this);
                    break;
                }
                case "connectline":
                case "connect":
                {
                    element1 = new ConnectLine(prefix, localName, ns, this);
                    break;
                }
                case "g":
                {
                    element1 = new Group(prefix, localName, ns, this);
                    break;
                }
                case "svg":
                {
                    element1 = new SVG(prefix, localName, ns, this);
                    break;
                }
                case "text":
                {
                    element1 = new Text(prefix, localName, ns, this);
                    break;
                }
                case "tspan":
                {
                    element1 = new TSpan(prefix, localName, ns, this);
                    break;
                }
                case "tref":
                {
                    element1 = new TRef(prefix, localName, ns, this);
                    break;
                }
                case "linearGradient":
                {
                    element1 = new LinearGradient(prefix, localName, ns, this);
                    break;
                }
                case "radialGradient":
                {
                    element1 = new RadialGradients(prefix, localName, ns, this);
                    break;
                }
                case "stop":
                {
                    element1 = new GradientStop(prefix, localName, ns, this);
                    break;
                }
                case "symbol":
                {
                    element1 = new ItopVector.Core.Figure.Symbol(prefix, localName, ns, this);
                    break;
                }
                case "marker":
                {
                    element1 = new ItopVector.Core.Figure.Marker(prefix, localName, ns, this);
                    break;
                }
                case "defs":
                {
                    element1 = new ItopVector.Core.Figure.Defs(prefix, localName, ns, this);
                    break;
                }
                case "image":
                {
                    element1 = new ItopVector.Core.Figure.Image(prefix, localName, ns, this);
                    break;
                }
                case "a":
                {
                    element1 = new ItopVector.Core.Figure.Link(prefix, localName, ns, this);
                    break;
                }
                case "use":
                {
                    element1 = new ItopVector.Core.Figure.Use(prefix, localName, ns, this);
                    break;
                }
                case "animate":
                {
                    element1 = new ItopVector.Core.Animate.Animate(prefix, localName, ns, this);
                    break;
                }
                case "set":
                {
                    element1 = new SetAnimate(prefix, localName, ns, this);
                    break;
                }
                case "animateColor":
                {
                    element1 = new ColorAnimate(prefix, localName, ns, this);
                    break;
                }
                case "animateMotion":
                {
                    element1 = new MotionAnimate(prefix, localName, ns, this);
                    break;
                }
                case "animateTransform":
                {
                    element1 = new TransformAnimate(prefix, localName, ns, this);
                    break;
                }
                case "pattern":
                {
                    element1 = new Pattern(prefix, localName, ns, this);
                    break;
                }
                case "audio3d":
                case "audio":
                {
                    element1 = new AudioAnimate(prefix, localName, ns, this);
                    break;
                }
                case "state"://״̬
                {
                    element1 =new State(prefix, localName, ns, this);
                    break;
                }
                case "layer":
                {
                    element1 =new Layer(prefix, localName, ns, this);
                    break;
                }
                default:
                {
                    element1 = base.CreateElement(prefix, localName, ns);
                    break;
                }
            }
            if (element1 is SvgElement)
            {
                ((SvgElement) element1).ShowParticular = this.AutoShowAnim;
            }
            if ((element1 is SvgElement) && this.firstload)
            {
                this.preelement = (SvgElement) element1;
            }
            else
            {
                this.preelement = null;
            }
            if (this.xmlreader != null)
            {
                int num3 = this.xmlreader.LineNumber;
                int num4 = this.xmlreader.LinePosition;
            }
            //			if ((element1 is SVG) && (this.DocumentType == null))
            //			{
            //				XmlDocumentType type1 = this.CreateDocumentType("svg", "-/W3C/DTD SVG 1.1/EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", null);
            //				this.AppendChild(type1);
            //				this.AppendChild(this.CreateWhitespace("\r\n"));
            //			}

            return element1;
        }
예제 #2
0
        //返回某变电站最小覆盖原相交的地块
        private Dictionary<XmlElement, PointF> GetsubFhk(Circle cir,ArrayList _polylist)
        {
            Dictionary<XmlElement, PointF> fhkcollect = new Dictionary<XmlElement, PointF>();

                int k = 0;
                GraphicsPath gr1 = new GraphicsPath();
                gr1.AddPath(cir.GPath, true);
                gr1.CloseFigure();
                for (int m = 0; m < _polylist.Count; m++) {
                    XmlElement _x = (XmlElement)_polylist[m];
                    PointF _f = TLMath.polyCentriod(_x);
                    if (gr1.IsVisible(_f))    //外接圆包括那些负荷中心点
                    {
                        //k = k + 1;   //求和的过程
                        //string sid = _x.GetAttribute("id");
                        //glebeProperty pl = new glebeProperty();
                        //pl.EleID = sid;
                        //pl.SvgUID = tlVectorControl1.SVGDocument.SvgdataUid;
                        //pl = (glebeProperty)Services.BaseService.GetObject("SelectglebePropertyByEleID", pl);
                        //if (pl != null) {
                        //    sum = sum + pl.Burthen;
                        //}
                        fhkcollect.Add(_x, _f);//记录外包圆相交的负荷块
                    }
                }
                //clist.Add(sum + n, cir);
                //CtoFHlist.Add(sum + n, fhkcollect);
                //string aa = "";
                return fhkcollect;
        }
예제 #3
0
        //返回某变电站最小覆盖原相交的地块
        private Dictionary<XmlElement, PointF> GetsubFhk(Circle cir, ArrayList _polylist)
        {
            Dictionary<XmlElement, PointF> fhkcollect = new Dictionary<XmlElement, PointF>();

            int k = 0;
            GraphicsPath gr1 = new GraphicsPath();
            gr1.AddPath(cir.GPath, true);
            gr1.CloseFigure();
            List<fhdkandcirsort> dkcol = new List<fhdkandcirsort>();
            for (int m = 0; m < _polylist.Count; m++) {
                XmlElement _x = (XmlElement)_polylist[m];
                PointF _f = TLMath.polyCentriod(_x);
                if (gr1.IsVisible(_f))    //外接圆包括那些负荷中心点
                    {
                        double lenth = Math.Sqrt(Math.Pow(_f.X - cir.CX, 2) + Math.Pow(_f.Y - cir.CY, 2));
                        fhdkandcirsort ds = new fhdkandcirsort(_x, _f, lenth);
                        if (!string.IsNullOrEmpty(_x.GetAttribute("bdzandlenth")))
                        {
                            _x.SetAttribute("bdzandlenth", _x.GetAttribute("bdzandlenth") + cir.GetAttribute("subname") + "," + (lenth).ToString() + ";");
                        }
                        else
                        {
                            _x.SetAttribute("bdzandlenth", cir.GetAttribute("subname") + "," + (lenth).ToString() + ";");
                        }
                    //k = k + 1;   //求和的过程
                    //string sid = _x.GetAttribute("id");
                    //glebeProperty pl = new glebeProperty();
                    //pl.EleID = sid;
                    //pl.SvgUID = tlVectorControl1.SVGDocument.SvgdataUid;
                    //pl = (glebeProperty)Services.BaseService.GetObject("SelectglebePropertyByEleID", pl);
                    //if (pl != null) {
                    //    sum = sum + pl.Burthen;
                    //}
                        dkcol.Add(ds);
                    //fhkcollect.Add(_x, _f);//记录外包圆相交的负荷块
                }
            }
            //clist.Add(sum + n, cir);
            //CtoFHlist.Add(sum + n, fhkcollect);
            //string aa = "";
            dkcol.Sort();
            for (int m = 0; m < dkcol.Count;m++ )
            {
                fhkcollect.Add(dkcol[m].DK, dkcol[m].DKZX);
            }
            return fhkcollect;
        }