Exemplo n.º 1
0
        public static ConnectionViewModel Connect(SceneViewModel scene, ConnectionPointViewModel connectionPoint1, ConnectionPointViewModel connectionPoint2)
        {
            var connection = new ConnectionViewModel(scene, connectionPoint1, connectionPoint2);

            connectionPoint1.Connections.Add(connection);
            connectionPoint2.Connections.Add(connection);
            return(connection);
        }
Exemplo n.º 2
0
        public ConnectionPointViewModel AddConnectionPoint()
        {
            var ellipse         = new Ellipse(Body.TopLeft + new Vector2(4, 0), new Vector2(1, 1), 0);
            var connectionPoint = new ConnectionPointViewModel(this, ellipse);

            ConnectionPoints.Add(connectionPoint);
            Add(connectionPoint);
            return(connectionPoint);
        }
Exemplo n.º 3
0
 protected ConnectionViewModel(SceneViewModel scene, ConnectionPointViewModel connectionPoint1, ConnectionPointViewModel connectionPoint2) : base(new PolyLine(VertexArray.Create(new Vector2[]
 {
     connectionPoint1.Ellipse.BoundingCircle.Center,
     connectionPoint2.Ellipse.BoundingCircle.Center
 })))
 {
     Scene                     = scene;
     ConnectionPoint1          = connectionPoint1;
     ConnectionPoint2          = connectionPoint2;
     CollisionDetectionEnabled = false;
     Calculate();
 }