Пример #1
0
        public void SwitchToFaceSelection()
        {
            if (InFaceSelection)
            {
                return;
            }
            foreach (var face in SelectedFaces)
            {
                face.IsSelected = false;
            }
            SelectedFaces.Clear();

            SelectedFaces.UnionWith(GetSelectedObjects()
                                    .OfType <Solid>()
                                    .SelectMany(x => {
                var disps = x.Faces.Where(y => y is Displacement);
                return(disps.Any() ? disps : x.Faces);
            }));

            foreach (var face in SelectedFaces)
            {
                face.IsSelected = true;
            }

            foreach (var obj in SelectedObjects)
            {
                obj.IsSelected = false;
            }
            SelectedObjects.Clear();

            InFaceSelection = true;

            Mediator.Publish(EditorMediator.SelectionTypeChanged, Document);
            Mediator.Publish(EditorMediator.SelectionChanged, Document);
        }
Пример #2
0
        public void Select(IEnumerable <Face> faces)
        {
            var list = faces.ToList();

            foreach (var face in list)
            {
                face.IsSelected = true;
            }
            SelectedFaces.UnionWith(list);
        }