Esempio n. 1
0
        public ViewNetworkElement(NetworkElement element)
        {
            sourceObject = element;
            ID           = element.ID + "-ViewObject";
            NameInView   = element.ID;
            logicalLine  = new Line2d(element.LogicalStartPoint, element.LogicalEndPoint);

            if (element.From != null)
            {
                Point fromPoint = element.From.LogicalCenter;
                if (fromPoint != Point.Empty && !fromPoint.Equals(element.LogicalStartPoint))
                {
                    fromConnector = new Line2d(element.LogicalStartPoint, fromPoint);
                }
            }
            if (element.To != null)
            {
                Point toPoint = element.To.LogicalCenter;
                if (toPoint != Point.Empty && !toPoint.Equals(element.LogicalStartPoint))
                {
                    toConnector = new Line2d(element.LogicalEndPoint, toPoint);
                }
            }
        }
Esempio n. 2
0
 internal Line2d LogicalLineToScreen(Line2d logicalLine)
 {
     return(new Line2d(LogicalXToScreenX(logicalLine.BeginX), LogicalYToScreenY(logicalLine.BeginY),
                       LogicalXToScreenX(logicalLine.EndX), LogicalYToScreenY(logicalLine.EndY)));
 }