Ejemplo n.º 1
0
 public void Render(CircuitDiagram.Render.IRenderContext dc, bool absolute = true)
 {
     foreach (RenderDescription renderDescription in Description.RenderDescriptions)
     {
         if (renderDescription.Conditions.IsMet(this))
         {
             renderDescription.Render(this, dc, absolute);
         }
     }
 }
Ejemplo n.º 2
0
 public void Render(Component component, CircuitDiagram.Render.IRenderContext dc, bool absolute)
 {
     if (absolute)
     {
         dc.DrawEllipse(Point.Add(Centre.Resolve(component), component.Location), RadiusX, RadiusY, Thickness, Fill);
     }
     else
     {
         dc.DrawEllipse(Centre.Resolve(component), RadiusX, RadiusY, Thickness, Fill);
     }
 }
Ejemplo n.º 3
0
 public void Render(Component component, CircuitDiagram.Render.IRenderContext dc, bool absolute)
 {
     if (absolute)
     {
         dc.DrawLine(Point.Add(Start.Resolve(component), component.Location), Point.Add(End.Resolve(component), component.Location), Thickness);
     }
     else
     {
         dc.DrawLine(Start.Resolve(component), End.Resolve(component), Thickness);
     }
 }
Ejemplo n.º 4
0
        public void Render(Component component, CircuitDiagram.Render.IRenderContext dc, bool absolute)
        {
            IList <IPathCommand> commands = Commands;

            if (component.IsFlipped == true)
            {
                commands = new List <IPathCommand>(Commands.Count);
                foreach (IPathCommand command in Commands)
                {
                    commands.Add(command.Flip(component.Orientation == Orientation.Horizontal));
                }
            }
            if (absolute)
            {
                dc.DrawPath(Point.Add(Start.Resolve(component), component.Location), commands, Thickness, Fill);
            }
            else
            {
                dc.DrawPath(Start.Resolve(component), commands, Thickness, Fill);
            }
        }
Ejemplo n.º 5
0
        public void Render(Component component, CircuitDiagram.Render.IRenderContext dc, bool absolute)
        {
            Rect drawRect = new System.Windows.Rect(Location.Resolve(component), new Size(Width, Height));

            if (component.IsFlipped == true && component.Orientation == Orientation.Horizontal)
            {
                drawRect = new Rect(drawRect.X - Width, drawRect.Y, Width, Height);
            }
            else if (component.IsFlipped == true && component.Orientation == Orientation.Vertical)
            {
                drawRect = new Rect(drawRect.X, drawRect.Y - Height, Width, Height);
            }

            if (absolute)
            {
                dc.DrawRectangle(Point.Add(drawRect.TopLeft, component.Location), drawRect.Size, StrokeThickness, Fill);
            }
            else
            {
                dc.DrawRectangle(drawRect.TopLeft, drawRect.Size, StrokeThickness, Fill);
            }
        }