示例#1
0
        //--------------------------------------------------------------------------------------------------

        public void FinishSegmentCreation(Dictionary <int, Pnt2d> points, int[] mergePointIndices, IEnumerable <SketchSegment> segments, IEnumerable <SketchConstraint> constraints, int continueWithPoint = -1)
        {
            var(pointMap, segmentMap, _) = Sketch.AddElements(points, mergePointIndices, segments.ToIndexedDictionary(), constraints);
            InteractiveContext.Current.UndoHandler.Commit();
            WorkspaceController.UpdateSelection();

            if (_ContinuesSegmentCreation && continueWithPoint >= 0 && pointMap.ContainsKey(continueWithPoint))
            {
                (CurrentTool as ISketchSegmentCreator)?.Continue(pointMap[continueWithPoint]);
            }
            else
            {
                StopTool();
                Elements.DeselectAll();
                Elements.Select(null, segmentMap.Values);
                _UpdateSelections();
            }
        }