Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public void Clear()
        {
            foreach (var obj in SelectedObjects)
            {
                obj.IsSelected = false;
            }
            SelectedObjects.Clear();

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