示例#1
0
        UndoPosition DispatchRedoHorizontalMerge(UndoTaskHorizontalMerge task)
        {
            if (task.LeftEventIsUserSource)
            {
                Events.MergeHorizontallyLow(task.EventLeft, task.EventRight, true, null, RemovePolygon, RenderEvent, new UndoPosition(true));
            }
            else
            {
                Events.MergeHorizontallyLow(task.EventRight, task.EventLeft, true, null, RemovePolygon, RenderEvent, new UndoPosition(true));
            }

            task.EventLeft.FixtureClass  = task.FixtureClassLeftNew;
            task.EventRight.FixtureClass = task.FixtureClassRightNew;
            task.EventLeft.ClassifiedUsingFixtureList  = task.ClassifiedUsingFixtureListLeftNew;
            task.EventRight.ClassifiedUsingFixtureList = task.ClassifiedUsingFixtureListRightNew;

            return(task.Position);
        }
示例#2
0
        UndoPosition DispatchUndoHorizontalMerge(UndoTaskHorizontalMerge task)
        {
            if (task.LeftEventIsUserSource)
            {
                task.EventLeft = Events.SplitHorizontally(task.EventRight, SlightlyInThePast(task.SplitTime), null, RemovePolygon, RenderEvent, false, new UndoPosition(true), true);
            }
            else
            {
                task.EventRight = Events.SplitHorizontally(task.EventLeft, SlightlyInThePast(task.SplitTime), null, RemovePolygon, RenderEvent, false, new UndoPosition(true), false);
            }

            task.EventLeft.FixtureClass  = task.FixtureClassLeftOld;
            task.EventRight.FixtureClass = task.FixtureClassRightOld;
            task.EventLeft.ClassifiedUsingFixtureList  = task.ClassifiedUsingFixtureListLeftOld;
            task.EventRight.ClassifiedUsingFixtureList = task.ClassifiedUsingFixtureListRightOld;

            return(task.Position);
        }
示例#3
0
        static public UndoTaskHorizontalMerge CreateUndoTask(Event eventTarget, Event eventSource, FixtureClass fixtureClassTargetOld, FixtureClass fixtureClassSourceOld, bool classifiedUsingFixtureListTargetOld, bool classifiedUsingFixtureListSourceOld)
        {
            var task = new UndoTaskHorizontalMerge();

            task.LeftEventIsUserSource = (eventSource.StartTime == eventTarget.StartTime);

            if (task.LeftEventIsUserSource)
            {
                task.EventLeft           = eventSource;
                task.FixtureClassLeftOld = fixtureClassSourceOld;
                task.FixtureClassLeftNew = eventSource.FixtureClass;
                task.ClassifiedUsingFixtureListLeftOld = classifiedUsingFixtureListSourceOld;
                task.ClassifiedUsingFixtureListLeftNew = eventSource.ClassifiedUsingFixtureList;

                task.EventRight           = eventTarget;
                task.FixtureClassRightOld = fixtureClassTargetOld;
                task.FixtureClassRightNew = eventTarget.FixtureClass;
                task.ClassifiedUsingFixtureListRightOld = classifiedUsingFixtureListTargetOld;
                task.ClassifiedUsingFixtureListRightNew = eventTarget.ClassifiedUsingFixtureList;

                task.SplitTime = task.EventLeft.EndTime;
            }
            else
            {
                task.EventLeft           = eventTarget;
                task.FixtureClassLeftOld = fixtureClassTargetOld;
                task.FixtureClassLeftNew = eventTarget.FixtureClass;
                task.ClassifiedUsingFixtureListLeftOld = classifiedUsingFixtureListTargetOld;
                task.ClassifiedUsingFixtureListLeftNew = eventTarget.ClassifiedUsingFixtureList;

                task.EventRight           = eventSource;
                task.FixtureClassRightOld = fixtureClassSourceOld;
                task.FixtureClassRightNew = eventSource.FixtureClass;
                task.ClassifiedUsingFixtureListRightOld = classifiedUsingFixtureListSourceOld;
                task.ClassifiedUsingFixtureListRightNew = eventSource.ClassifiedUsingFixtureList;

                task.SplitTime = task.EventRight.StartTime;
            }

            return(task);
        }