public SVGGradientElement(SVGParser xmlImp, Node node)
        {
            _attrList = node.attributes;
            _xmlImp = xmlImp;
            _stopList = new List<SVGStopElement>();
            _id = _attrList.GetValue("id");
            _gradientUnits = SVGGradientUnit.ObjectBoundingBox;
            if (_attrList.GetValue("gradiantUnits") == "userSpaceOnUse")
            {
                _gradientUnits = SVGGradientUnit.UserSpaceOnUse;
            }

            _gradientTransform = new SVGTransformList(_attrList.GetValue("gradientTransform"));

            //------
            // TODO: It's probably a bug that the value is not innoculated for CaSe
            // VaRiAtIoN in GetValue, below:
            _spreadMethod = SVGSpreadMethod.Pad;
            if (_attrList.GetValue("spreadMethod") == "reflect")
            {
                _spreadMethod = SVGSpreadMethod.Reflect;
            } else if (_attrList.GetValue("spreadMethod") == "repeat")
            {
                _spreadMethod = SVGSpreadMethod.Repeat;
            }

            if(node is BlockOpenNode)
            {
                GetElementList();
            }
        }
        public SVGGradientElement(SVGParser xmlImp, Node node)
        {
            _attrList      = node.attributes;
            _xmlImp        = xmlImp;
            _stopList      = new List <SVGStopElement>();
            _id            = _attrList.GetValue("id");
            _gradientUnits = SVGGradientUnit.ObjectBoundingBox;
            if (_attrList.GetValue("gradiantUnits") == "userSpaceOnUse")
            {
                _gradientUnits = SVGGradientUnit.UserSpaceOnUse;
            }

            _gradientTransform = new SVGTransformList(_attrList.GetValue("gradientTransform"));

            //------
            // TODO: It's probably a bug that the value is not innoculated for CaSe
            // VaRiAtIoN in GetValue, below:
            _spreadMethod = SVGSpreadMethod.Pad;
            if (_attrList.GetValue("spreadMethod") == "reflect")
            {
                _spreadMethod = SVGSpreadMethod.Reflect;
            }
            else if (_attrList.GetValue("spreadMethod") == "repeat")
            {
                _spreadMethod = SVGSpreadMethod.Repeat;
            }

            if (node is BlockOpenNode)
            {
                GetElementList();
            }
        }
 public SVGPolygonElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
 {
     this._attrList = node.attributes;
     this._paintable = new SVGPaintable(inheritPaintable, node);
     this._listPoints = ExtractPoints(this._attrList.GetValue("points"));
     this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));
     
     Rect viewport = _paintable.viewport;
     this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
     paintable.SetViewport(viewport);
 }
        public SVGPathElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            _attrList = node.attributes;
            _paintable = new SVGPaintable(inheritPaintable, node);
            currentTransformList = new SVGTransformList(_attrList.GetValue("transform"));
            Rect viewport = _paintable.viewport;
            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
            paintable.SetViewport(viewport);

            Initial();
        }
Beispiel #5
0
        public SVGPathElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            _attrList            = node.attributes;
            _paintable           = new SVGPaintable(inheritPaintable, node);
            currentTransformList = new SVGTransformList(_attrList.GetValue("transform"));
            Rect viewport = _paintable.viewport;

            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
            paintable.SetViewport(viewport);
            Initial();
        }
Beispiel #6
0
        public SVGPolygonElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            this._attrList            = node.attributes;
            this._paintable           = new SVGPaintable(inheritPaintable, node);
            this._listPoints          = ExtractPoints(this._attrList.GetValue("points"));
            this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));

            Rect viewport = _paintable.viewport;

            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
            paintable.SetViewport(viewport);
        }
Beispiel #7
0
 public void BeforeRender(SVGTransformList transformList)
 {
     inheritTransformList = transformList;
     for (int i = 0; i < _segList.Count; i++)
     {
         ISVGDrawable temp = _segList.GetItem(i) as ISVGDrawable;
         if (temp != null)
         {
             temp.BeforeRender(summaryTransformList);
         }
     }
 }
        public SVGCircleElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            this._attrList = node.attributes;
            this._paintable = new SVGPaintable(inheritPaintable, node);
            this._cx = new SVGLength(attrList.GetValue("cx"));
            this._cy = new SVGLength(attrList.GetValue("cy"));
            this._r = new SVGLength(attrList.GetValue("r"));
            this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));

            Rect viewport = _paintable.viewport;
            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(this._attrList, ref viewport, false)));
            paintable.SetViewport(viewport);
        }
 public SVGLineElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
 {
     this._attrList = node.attributes;
     this._paintable = new SVGPaintable(inheritPaintable, node);
     this._x1 = new SVGLength(attrList.GetValue("x1"));
     this._y1 = new SVGLength(attrList.GetValue("y1"));
     this._x2 = new SVGLength(attrList.GetValue("x2"));
     this._y2 = new SVGLength(attrList.GetValue("y2"));
     this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));
     
     Rect viewport = _paintable.viewport;
     this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
     paintable.SetViewport(viewport);
 }
Beispiel #10
0
        public SVGCircleElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            this._attrList            = node.attributes;
            this._paintable           = new SVGPaintable(inheritPaintable, node);
            this._cx                  = new SVGLength(attrList.GetValue("cx"));
            this._cy                  = new SVGLength(attrList.GetValue("cy"));
            this._r                   = new SVGLength(attrList.GetValue("r"));
            this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));

            Rect viewport = _paintable.viewport;

            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(this._attrList, ref viewport, false)));
            paintable.SetViewport(viewport);
        }
Beispiel #11
0
        public SVGLineElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            this._attrList            = node.attributes;
            this._paintable           = new SVGPaintable(inheritPaintable, node);
            this._x1                  = new SVGLength(attrList.GetValue("x1"));
            this._y1                  = new SVGLength(attrList.GetValue("y1"));
            this._x2                  = new SVGLength(attrList.GetValue("x2"));
            this._y2                  = new SVGLength(attrList.GetValue("y2"));
            this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));

            Rect viewport = _paintable.viewport;

            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
            paintable.SetViewport(viewport);
        }
Beispiel #12
0
        public SVGRectElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            this._attrList            = node.attributes;
            this._paintable           = new SVGPaintable(inheritPaintable, node);
            this._x                   = new SVGLength(attrList.GetValue("x"));
            this._y                   = new SVGLength(attrList.GetValue("y"));
            this._width               = new SVGLength(attrList.GetValue("width"));
            this._height              = new SVGLength(attrList.GetValue("height"));
            this._rx                  = new SVGLength(attrList.GetValue("rx"));
            this._ry                  = new SVGLength(attrList.GetValue("ry"));
            this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));

            Rect viewport = _paintable.viewport;

            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
            paintable.SetViewport(viewport);
        }
 public void BeforeRender(SVGTransformList transformList)
 {
     this.inheritTransformList = transformList;
 }
 public void AppendItemsAt(SVGTransformList newListItem, int index)
 {
     _listTransform.InsertRange(index, newListItem._listTransform);
     _totalMatrix = null;
 }
        //public SVGMesh mesh;

        public SVGParentable(SVGTransformList inheritTransformList) : base(inheritTransformList)
        {

        }
 public void AppendItemsAt(SVGTransformList newListItem, int index)
 {
     _listTransform.InsertRange(index, newListItem._listTransform);
     _totalMatrix = null;
 }
 public void AppendItems(SVGTransformList newListItem)
 {
     _listTransform.AddRange(newListItem._listTransform);
     _totalMatrix = null;
 }
Beispiel #18
0
        //public SVGMesh mesh;

        public SVGParentable(SVGTransformList inheritTransformList) : base(inheritTransformList)
        {
        }
 public void BeforeRender(SVGTransformList transformList)
 {
     inheritTransformList = transformList;
     for (int i = 0; i < _segList.Count; i++)
     {
         ISVGDrawable temp = _segList.GetItem(i) as ISVGDrawable;
         if (temp != null)
             temp.BeforeRender(summaryTransformList);
     }
 }
 public SVGTransformable(SVGTransformList transformList)
 {
     inheritTransformList = transformList;
 }
Beispiel #21
0
 public SVGGroupElement(SVGParser xmlImp,
                        SVGTransformList inheritTransformList,
                        SVGPaintable inheritPaintable) : base(xmlImp, inheritTransformList, inheritPaintable)
 {
     _name = attributeList.GetValue("id");
 }
        public SVGRectElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
        {
            this._attrList = node.attributes;
            this._paintable = new SVGPaintable(inheritPaintable, node);
            this._x = new SVGLength(attrList.GetValue("x"));
            this._y = new SVGLength(attrList.GetValue("y"));
            this._width = new SVGLength(attrList.GetValue("width"));
            this._height = new SVGLength(attrList.GetValue("height"));
            this._rx = new SVGLength(attrList.GetValue("rx"));
            this._ry = new SVGLength(attrList.GetValue("ry"));
            this.currentTransformList = new SVGTransformList(attrList.GetValue("transform"));

            Rect viewport = _paintable.viewport;
            this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
            paintable.SetViewport(viewport);
        }
Beispiel #23
0
 public void BeforeRender(SVGTransformList transformList)
 {
     this.inheritTransformList = transformList;
 }
Beispiel #24
0
        private List <List <Vector2> > GetClipPath(Node node, SVGMatrix svgMatrix)
        {
            SVGTransformList transformList = new SVGTransformList();

            transformList.AppendItem(new SVGTransform(svgMatrix));

            switch (node.name)
            {
            case SVGNodeName.Rect:
            {
                return(new SVGRectElement(node, transformList).GetClipPath());
            }

            case SVGNodeName.Line:
            {
                return(new SVGLineElement(node, transformList).GetClipPath());
            }

            case SVGNodeName.Circle:
            {
                return(new SVGCircleElement(node, transformList).GetClipPath());
            }

            case SVGNodeName.Ellipse:
            {
                return(new SVGEllipseElement(node, transformList).GetClipPath());
            }

            case SVGNodeName.PolyLine:
            {
                return(new SVGPolylineElement(node, transformList).GetClipPath());
            }

            case SVGNodeName.Polygon:
            {
                return(new SVGPolygonElement(node, transformList).GetClipPath());
            }

            case SVGNodeName.Path:
            {
                return(new SVGPathElement(node, transformList).GetClipPath());
            }

            case SVGNodeName.Use:
            {
                string xlink = node.attributes.GetValue("xlink:href");
                if (!string.IsNullOrEmpty(xlink))
                {
                    if (xlink [0] == '#')
                    {
                        xlink = xlink.Remove(0, 1);
                    }

                    if (SVGParser._defs.ContainsKey(xlink))
                    {
                        Node definitionNode = SVGParser._defs [xlink];
                        if (definitionNode != null && definitionNode != node)
                        {
                            return(GetClipPath(definitionNode, svgMatrix));
                        }
                    }
                }
                break;
            }
            }

            return(null);
        }
        private List<List<Vector2>> GetClipPath(Node node, SVGMatrix svgMatrix)
        {
            SVGTransformList transformList = new SVGTransformList();

            switch (node.name)
            {
                case SVGNodeName.Rect:
                {
                    return SVGRectElement.GetClipPath(svgMatrix, new SVGRectElement(node, transformList));
                }
                case SVGNodeName.Line:
                {
                    return SVGLineElement.GetClipPath(svgMatrix, new SVGLineElement(node, transformList));
                }
                case SVGNodeName.Circle:
                {
                    return SVGCircleElement.GetClipPath(svgMatrix, new SVGCircleElement(node, transformList));
                }
                case SVGNodeName.Ellipse:
                {
                    return SVGEllipseElement.GetClipPath(svgMatrix, new SVGEllipseElement(node, transformList));
                }
                case SVGNodeName.PolyLine:
                {
                    return SVGPolylineElement.GetClipPath(svgMatrix, new SVGPolylineElement(node, transformList));
                }
                case SVGNodeName.Polygon:
                {
                    return SVGPolygonElement.GetClipPath(svgMatrix, new SVGPolygonElement(node, transformList));
                }
                case SVGNodeName.Path:
                {
                    return SVGPathElement.GetClipPath(svgMatrix, new SVGPathElement(node, transformList));
                }
                case SVGNodeName.Use:
                {
                    string xlink = node.attributes.GetValue("xlink:href");
                    if (!string.IsNullOrEmpty(xlink))
                    {
                        if (xlink [0] == '#')
                            xlink = xlink.Remove(0, 1);

                        if (SVGParser._defs.ContainsKey(xlink))
                        {
                            Node definitionNode = SVGParser._defs [xlink];
                            if (definitionNode != null && definitionNode != node)
                            {
                                return GetClipPath(definitionNode, svgMatrix);
                            }
                        }
                    }
                    break;
                }
            }

            return null;
        }
 public void AppendItems(SVGTransformList newListItem)
 {
     _listTransform.AddRange(newListItem._listTransform);
     _totalMatrix = null;
 }
Beispiel #27
0
 public SVGTransformable(SVGTransformList transformList)
 {
     inheritTransformList = transformList;
 }
Beispiel #28
0
 public void AppendItems(SVGTransformList newListItem)
 {
     _listTransform.AddRange(newListItem._listTransform);
 }