Esempio n. 1
0
 public void SwitchTool(HotkeyTool tool)
 {
     if (ToolManager.ActiveTool != null && ToolManager.ActiveTool.GetHotkeyToolType() == tool)
     {
         tool = HotkeyTool.Selection;
     }
     ToolManager.Activate(tool);
 }
        public void Perform(Document document)
        {
            ToolManager.Deactivate(true);

            document.Selection.SwitchToFaceSelection();

            ToolManager.Activate(_toolType, true);

            Mediator.Publish(EditorMediator.DocumentTreeSelectedFacesChanged, document.Selection.GetSelectedFaces());
            Mediator.Publish(EditorMediator.SelectionChanged);
        }
        public void Perform(Document document)
        {
            ToolManager.Deactivate(true);

            document.Selection.SwitchToObjectSelection();

            ToolManager.Activate(HotkeyTool.Selection, true);

            Mediator.Publish(EditorMediator.DocumentTreeSelectedFacesChanged, _selection);
            Mediator.Publish(EditorMediator.SelectionChanged);
        }
        public void Reverse(Document document)
        {
            ToolManager.Deactivate(true);

            document.Selection.SwitchToObjectSelection();
            document.Selection.Clear();

            var sel = _selection.Select(x => document.Map.WorldSpawn.FindByID(x)).Where(x => x != null && x.BoundingBox != null).ToList();

            document.Selection.Select(sel);

            ToolManager.Activate(HotkeyTool.Selection, true);

            Mediator.Publish(EditorMediator.DocumentTreeSelectedObjectsChanged, sel.Union(document.Selection.GetSelectedObjects()));
            Mediator.Publish(EditorMediator.SelectionChanged);
        }
        public void Reverse(Document document)
        {
            ToolManager.Deactivate(true);

            document.Selection.SwitchToFaceSelection();
            var seln = document.Selection.GetSelectedFaces();

            document.Selection.Clear();

            var sel = _selection.Select(x => FindFace(document, x.Key, x.Value)).Where(x => x != null).ToList();

            document.Selection.Select(sel);

            ToolManager.Activate(_toolType, true);

            Mediator.Publish(EditorMediator.DocumentTreeSelectedFacesChanged, sel.Union(seln));
            Mediator.Publish(EditorMediator.SelectionChanged);
        }
Esempio n. 6
0
        public void SetActive()
        {
            if (!Sledge.Settings.View.KeepSelectedTool)
            {
                ToolManager.Activate(_memory.SelectedTool);
            }
            if (!Sledge.Settings.View.KeepCameraPositions)
            {
                _memory.RestoreViewports(ViewportManager.Viewports);
            }

            ViewportManager.AddContext3D(new WidgetLinesRenderable());
            Renderer.Register(ViewportManager.Viewports);
            ViewportManager.AddContextAll(new ToolRenderable());
            ViewportManager.AddContextAll(new HelperRenderable(this));

            _subscriptions.Subscribe();

            RenderAll();
        }
Esempio n. 7
0
        public void Notify(string message, object data)
        {
            HotkeysMediator val;

            if (ToolManager.ActiveTool != null && Enum.TryParse(message, true, out val))
            {
                var result = ToolManager.ActiveTool.InterceptHotkey(val, data);
                if (result == HotkeyInterceptResult.Abort)
                {
                    return;
                }
                if (result == HotkeyInterceptResult.SwitchToSelectTool)
                {
                    ToolManager.Activate(typeof(SelectTool));
                }
            }
            if (!Mediator.ExecuteDefault(this, message, data))
            {
                throw new Exception("Invalid document message: " + message + ", with data: " + data);
            }
        }
Esempio n. 8
0
 public void SelectTool(BaseTool t)
 {
     ToolManager.Activate(t);
 }