Exemple #1
0
        public void CompoundCurve()
        {
            hCompoundCurve crv   = new hCompoundCurve();
            hShape         shape = new hShape("p" + Index);
            hPath          path  = new hPath();

            GroupCheck(Shapes);

            foreach (wShape Shape in Shapes.Shapes)
            {
                hCubicBezierSpline spline = AddSpline((wBezierSpline)Shape.Curve);

                crv.AddCurve(spline);
            }

            shape.SetShape(crv);

            shape.AddAttribute(new hBoolean(hBoolean.FillRule.evenodd).Value);

            shape = SetGraphics(shape, Shapes.Graphics);

            if (Shapes.Effects.HasEffect)
            {
                hFilter filter = SetEffects(Shapes.Effects, Index);
                PathSet[Shapes.Group].Append(filter.Value);
                shape.AddAttribute(filter.ApplyFilter());
            }

            path = new hPath(shape);

            PathSet[Shapes.Group].Append(path.svgPath);
        }
Exemple #2
0
        public void AddShape()
        {
            hShape shape = new hShape("p" + Index);
            hPath  path  = new hPath();

            GroupCheck(Shapes);

            switch (Shapes.Type)
            {
            case "Arc":
                AddArc((wArc)Shapes.Shapes[0].Curve);
                break;

            case "Circle":
                shape.SetShape(AddCircle((wCircle)Shapes.Shapes[0].Curve));
                break;

            case "Ellipse":
                wEllipse tempEllipse = (wEllipse)Shapes.Shapes[0].Curve;
                shape.SetShape(AddEllipse(tempEllipse));
                shape.AddAttribute(new hTransform(new hRotate(tempEllipse.Center, tempEllipse.Rotation).Transformation).Transformation);
                break;

            case "Line":
                shape.SetShape(AddLine((wLine)Shapes.Shapes[0].Curve));
                break;

            case "Polyline":
                shape.SetShape(AddPolyline((wPolyline)Shapes.Shapes[0].Curve));
                break;

            case "BezierSpline":
                shape.SetShape(AddSpline((wBezierSpline)Shapes.Shapes[0].Curve));
                break;

            default:
                break;
            }

            shape = SetGraphics(shape, Shapes.Graphics);

            if (Shapes.Effects.HasEffect)
            {
                hFilter filter = SetEffects(Shapes.Effects, Index);
                PathSet[Shapes.Group].Append(filter.Value);
                shape.AddAttribute(filter.ApplyFilter());
            }

            path = new hPath(shape);

            PathSet[Shapes.Group].Append(path.svgPath);
        }