public void UpdateSVG(XmlTextWriter doc, SVGContext context) { doc.WriteStartElement("path"); doc.WriteAttributeString("d", this.GetPath2(context)); doc.WriteAttributeString("fill", "none"); context.PrintLine(doc); if (context.isClip & !String.IsNullOrEmpty(context.CurrClipID)) //if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0)) { doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")"); } doc.WriteFullEndElement(); }
public void UpdateSVG(XmlTextWriter doc, SVGContext context) { try { PointDbl dbl6 = new PointDbl(context.fxy(this.center)); PointDbl p = dbl6; dbl6 = new PointDbl(context.fxy(this.cd1)); PointDbl dbl2 = dbl6; dbl6 = new PointDbl(context.fxy(this.cd2)); PointDbl dbl3 = dbl6; dbl6 = new PointDbl(this.context_fxy2(this.v1, context)); PointDbl dbl4 = dbl6; dbl6 = new PointDbl(this.context_fxy2(this.v2, context)); PointDbl dbl5 = dbl6; SVGEllipseArc arc = CGM2SVGMath.FindSVGArc(p, dbl2, dbl3, dbl4, dbl5); string dAttribute = arc.dAttribute; string transformAttribute = arc.transformAttribute; switch (this.closingType) { case 0: dAttribute = dAttribute + string.Format(" L{0},{1} L{2},{3} Z", new object[] { arc.CenterP.X, arc.CenterP.Y, arc.StartP.X, arc.StartP.Y }); break; case 1: dAttribute = dAttribute + string.Format(" L{0},{1} Z", arc.StartP.X, arc.StartP.Y); break; } doc.WriteStartElement("path"); doc.WriteAttributeString("d", dAttribute); if (!String.IsNullOrEmpty(transformAttribute)) //if (StringType.StrCmp(transformAttribute, "", false) != 0) { doc.WriteAttributeString("transform", transformAttribute); } if (this.closingType >= 0) { context.PrintEdgeArc(doc); doc.WriteAttributeString("fill", context.fill); } else { context.PrintLine(doc); doc.WriteAttributeString("fill", "none"); } } finally { if (context.isClip & !String.IsNullOrEmpty(context.CurrClipID)) //if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0)) { doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")"); } doc.WriteFullEndElement(); } }
public void UpdateSVG(XmlTextWriter doc, SVGContext context) { string str = "none"; if ((context.interiorstyle == 3) & context.fingureOn) { context.getHatch(doc); str = "url(#" + context.HatchIndex.ToString() + ")"; } doc.WriteStartElement("path"); doc.WriteAttributeString("d", this.GetPath(context)); doc.WriteAttributeString("fill", str); context.PrintLine(doc); if (context.isClip & !String.IsNullOrEmpty(context.CurrClipID))//if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0)) { doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")"); } doc.WriteEndElement(); }
public void UpdateSVG(XmlTextWriter doc, SVGContext context) { string str = String.Empty; string[] strArray = new string[points.Length];//Array.CreateInstance(typeof(string), this.points.Length); int num4 = strArray.Length - 1; for (int i = 0; i <= num4; i++) { strArray[i] = context.fx(Convert.ToDouble(this.points[i].X)).ToString() + "," + context.fy(Convert.ToDouble(this.points[i].Y)).ToString(); } int num3 = strArray.Length; for (int j = 1; j <= num3; j += 2) { str = str + "M" + strArray[j - 1] + " L" + strArray[j] + " "; } doc.WriteStartElement("path"); doc.WriteAttributeString("d", str); doc.WriteAttributeString("fill", "none"); context.PrintLine(doc); doc.WriteEndElement(); }