Beispiel #1
0
 public PathSegmentData(Point startPoint, System.Windows.Media.PathSegment pathSegment)
 {
     PathSegment = pathSegment;
     StartPoint  = startPoint;
 }
Beispiel #2
0
 public System.Windows.Media.Geometry get_clip(double nx, double ny)
 {
     System.Windows.Media.Geometry v = null;
     if (vp is eq.gui.vg.VgPathRectangle)
     {
         double aw = vp.get_w(), ah = vp.get_h();
         if (aw > 0 && ah > 0)
         {
             var rect = new System.Windows.Media.RectangleGeometry();
             rect.Rect = new System.Windows.Rect(x + vp.get_x() - nx, y + vp.get_y() - ny, aw, ah);
             v         = rect;
         }
     }
     else if (vp is eq.gui.vg.VgPathRoundedRectangle)
     {
         var    vpr = vp as eq.gui.vg.VgPathRoundedRectangle;
         double aw = vpr.get_w(), ah = vpr.get_h(), rd = vpr.get_radius();
         if (aw > 0 && ah > 0 && rd > 0)
         {
             var rrect = new System.Windows.Media.RectangleGeometry();
             rrect.Rect    = new System.Windows.Rect(x + vp.get_x() - nx, y + vp.get_y() - ny, aw, ah);
             rrect.RadiusX = rd;
             rrect.RadiusY = rd;
             v             = rrect;
         }
     }
     else if (vp is eq.gui.vg.VgPathCircle)
     {
         var    vpc = vp as eq.gui.vg.VgPathCircle;
         double rd  = vpc.get_radius();
         if (rd > 0)
         {
             var circle = new System.Windows.Media.EllipseGeometry();
             circle.Center  = new System.Windows.Point(x + vpc.get_xc() - nx, y + vpc.get_yc() - ny);
             circle.RadiusX = rd;
             circle.RadiusY = rd;
             v = circle;
         }
     }
     else if (vp is eq.gui.vg.VgPathCustom)
     {
         var cp     = vp as eq.gui.vg.VgPathCustom;
         var itr    = cp.iterate();
         var pg     = new System.Windows.Media.PathGeometry();
         var figure = new System.Windows.Media.PathFigure()
         {
             StartPoint = new System.Windows.Point(x + cp.get_start_x() - nx, y + cp.get_start_y() - ny)
         };
         while (itr != null)
         {
             var vpe = itr.next() as eq.gui.vg.VgPathElement;
             if (vpe == null)
             {
                 break;
             }
             System.Windows.Media.PathSegment segment = null;
             if (vpe.get_operation() == eq.gui.vg.VgPathElement.OP_LINE)
             {
                 segment = new System.Windows.Media.LineSegment()
                 {
                     Point = new System.Windows.Point(x + vpe.get_x1() - nx, y + vpe.get_y1() - ny)
                 };
             }
             else if (vpe.get_operation() == eq.gui.vg.VgPathElement.OP_CURVE)
             {
                 segment = new System.Windows.Media.BezierSegment()
                 {
                     Point1 = new System.Windows.Point(x + vpe.get_x1() - nx, y + vpe.get_y1() - ny),
                     Point2 = new System.Windows.Point(x + vpe.get_x2() - nx, y + vpe.get_y2() - ny),
                     Point3 = new System.Windows.Point(x + vpe.get_x3() - ny, y + vpe.get_y3() - ny)
                 };
             }
             else if (vpe.get_operation() == eq.gui.vg.VgPathElement.OP_ARC)
             {
             }
             else
             {
                 eq.api.Log.eq_api_Log_error((eq.api.Object)eq.api.StringStatic.eq_api_StringStatic_for_strptr("Unknown path element encountered."), null, null);
             }
             if (segment != null)
             {
                 figure.Segments.Add(segment);
             }
         }
         pg.Figures.Add(figure);
         v = pg;
     }
     if (vt != null)
     {
         double scx = vt.get_scale_x(), scy = vt.get_scale_y();
         double rot = vt.get_rotate_angle();
         var    tg  = new System.Windows.Media.TransformGroup();
         if (scx != 1.0 || scy != 1.0)
         {
             var st = new System.Windows.Media.ScaleTransform()
             {
                 ScaleX = scx, ScaleY = scy
             };
             st.CenterX = v.Bounds.Width / 2;
             st.CenterY = v.Bounds.Height / 2;
             tg.Children.Add(st);
         }
         if (rot != 0.0)
         {
             var rt = new System.Windows.Media.RotateTransform()
             {
                 Angle = rot
             };
             rt.CenterX = v.Bounds.Width / 2;
             rt.CenterY = v.Bounds.Height / 2;
             tg.Children.Add(rt);
         }
         if (vt.get_flip_horizontal())
         {
             var fht = new System.Windows.Media.ScaleTransform()
             {
                 ScaleX = -1.0, ScaleY = scy
             };
             fht.CenterX = v.Bounds.Width / 2;
             tg.Children.Add(fht);
         }
         v.Transform = tg;
     }
     return(v);
 }
Beispiel #3
0
 { public virtual void Add(System.Windows.Media.PathSegment param0)
   {
       throw new System.NotImplementedException();
   }