Esempio n. 1
0
        /// <summary>
        ///     Insert a Edge into the graph
        /// </summary>
        /// <param name="e">the Edge</param>
        /// <returns>status</returns>
        private bool AddEdge(Edge e)
        {
            if (GetModel.ContainsEdges(e.Id))
            {
                return(false);
            }
            GetModel.AddEdge(e);

            GetModel.GetVertex(e.FromId).EdgesId.Add(e.Id);
            GetModel.GetVertex(e.ToId).EdgesId.Add(e.Id);

            AddedEdge?.Invoke(e);
            return(true);
        }
Esempio n. 2
0
        public void ChangePosition(Point p)
        {
            SelectedElements.ForEach(v =>
            {
                if (!GetModel.ContainsVerticies(v))
                {
                    return;
                }
                var vc = GetModel.GetVertex(v);

                vc.PositionX = p.X;
                vc.PositionY = p.Y;
            });
            Changed = true;
        }