예제 #1
0
 /// <summary>
 /// redoes the editing
 /// </summary>
 public override void Redo()
 {
     insertedSite = new Site(PrevSite, InsertionPoint, PrevSite.Next);
     insertedSite.BezierSegmentFitCoefficient = this.siteK;
     GeometryGraphEditor.DragEdgeWithSite(new Point(0, 0), editedEdge,
                                          (EdgeRestoreData)GetRestoreData(editedEdge), insertedSite, insertedSite.Point);
 }
예제 #2
0
 /// <summary>
 /// redoes the editing
 /// </summary>
 public override void Redo()
 {
     insertedSite = new Site(PrevSite, InsertionPoint, PrevSite.Next);
     insertedSite.NextBezierSegmentFitCoefficient     = this.SiteKNext;
     insertedSite.PreviousBezierSegmentFitCoefficient = this.SiteKPrevious;
     GeometryGraphEditor.DragEdgeWithSite(new Point(0, 0), editedEdge, insertedSite);
 }
예제 #3
0
        /// <summary>
        /// undoes the editing
        /// </summary>
        public override void Undo()
        {
            Site prev = InsertedSite.Previous;
            Site next = InsertedSite.Next;

            prev.Next     = next;
            next.Previous = prev;
            GeometryGraphEditor.DragEdgeWithSite(new Point(0, 0), editedEdge, prev);
        }
예제 #4
0
        /// <summary>
        /// redoes the editing
        /// </summary>
        public override void Redo()
        {
            Site prev = RemovedSite.Previous;
            Site next = RemovedSite.Next;

            prev.Next     = next;
            next.Previous = prev;
            GeometryGraphEditor.DragEdgeWithSite(new Point(0, 0), editedEdge, (EdgeRestoreData)GetRestoreData(editedEdge), prev, prev.Point);
        }
 /// <summary>
 /// redoes the editing
 /// </summary>
 public override void Redo()
 {
     base.Redo();
     foreach (GeometryObject geomObj in movedObjects)
     {
         GeomNode node = geomObj as GeomNode;
         if (node != null)
         {
             GeometryGraphEditor.DragNode(node, Delta, GetRestoreData(node) as NodeRestoreData);
             foreach (GeomEdge edge in node.OutEdges)
             {
                 GeometryGraphEditor.DragEdgeWithSource(Delta, edge, GetRestoreData(edge) as EdgeRestoreData);
             }
             foreach (GeomEdge edge in node.InEdges)
             {
                 GeometryGraphEditor.DragEdgeWithTarget(Delta, edge, GetRestoreData(edge) as EdgeRestoreData);
             }
             foreach (GeomEdge edge in node.SelfEdges)
             {
                 GeometryGraphEditor.DragEdge(Delta, edge, GetRestoreData(edge) as EdgeRestoreData, movedObjects);
             }
         }
         else
         {
             GeomEdge edge = geomObj as GeomEdge;
             if (edge != null)
             {
                 GeometryGraphEditor.DragEdge(Delta, edge, GetRestoreData(edge) as EdgeRestoreData, movedObjects);
             }
             else
             {
                 GeomLabel label = geomObj as GeomLabel;
                 if (label != null)
                 {
                     GeometryGraphEditor.DragLabel(label, Delta, (GetRestoreData(label) as LabelRestoreData).Center);
                 }
                 else
                 {
                     throw new System.NotImplementedException();
                 }
             }
         }
     }
 }
        /// <summary>
        /// Undoes the editing
        /// </summary>
        public override void Undo()
        {
            base.Undo();
            Point point = new Point();

            foreach (GeometryObject geomObj in movedObjects)
            {
                GeomNode node = geomObj as GeomNode;
                if (node != null)
                {
                    GeometryGraphEditor.DragNode(node, point, GetRestoreData(node) as NodeRestoreData);
                    foreach (GeomEdge edge in node.Edges)
                    {
                        RestoreEdge(edge);
                    }
                }
                else
                {
                    GeomEdge edge = geomObj as GeomEdge;
                    if (edge != null)
                    {
                        GeometryGraphEditor.DragEdge(point, edge, GetRestoreData(edge) as EdgeRestoreData, movedObjects);
                    }
                    else
                    {
                        GeomLabel label = geomObj as GeomLabel;
                        if (label != null)
                        {
                            GeometryGraphEditor.DragLabel(label, point, (GetRestoreData(label) as LabelRestoreData).Center);
                        }
                        else
                        {
                            throw new System.NotImplementedException();
                        }
                    }
                }
            }
        }
예제 #7
0
        public Couple <Site, PolylineCornerType> AnalyzeInsertOrDeletePolylineCorner(Point point, double tolerance)
        {
            if (this.SelectedEdge == null)
            {
                return(null);
            }

            tolerance += this.SelectedEdge.Edge.Attr.LineWidth;

            Site corner = GeometryGraphEditor.GetPreviousSite(SelectedEdge.Edge.Attr.GeometryEdge, point);

            if (corner != null)
            {
                return(new Couple <Site, PolylineCornerType>(corner, PolylineCornerType.PreviousCornerForInsertion));
            }

            corner = GeometryGraphEditor.FindCornerForEdit(this.SelectedEdge.Edge.Attr.GeometryEdge.UnderlyingPolyline, point, tolerance);
            if (corner != null)
            {
                return(new Couple <Site, PolylineCornerType>(corner, PolylineCornerType.CornerToDelete));
            }

            return(null);
        }
        /// <summary>
        /// redoes the editing
        /// </summary>
        public override void Redo()
        {
            EdgeRestoreData erd = (EdgeRestoreData)GetRestoreData(editedEdge);

            GeometryGraphEditor.DragEdgeWithSite(Delta, editedEdge, erd, erd.Site, erd.InitialSitePosition);
        }
        /// <summary>
        /// undoes the editing
        /// </summary>
        public override void Undo()
        {
            EdgeRestoreData erd = (EdgeRestoreData)GetRestoreData(editedEdge);

            GeometryGraphEditor.DragEdgeWithSite(new Point(0, 0), editedEdge, erd, erd.Site, erd.InitialSitePosition);
        }