Beispiel #1
0
 public BrushTool()
 {
     box                = new BoxDraggableState(this);
     box.BoxColour      = Color.Turquoise;
     box.FillColour     = Color.FromArgb(_selectionBoxBackgroundOpacity, Color.Green);
     box.State.Changed += BoxChanged;
     States.Add(box);
 }
Beispiel #2
0
        public SelectTool()
        {
            _selectionBox                = new SelectionBoxDraggableState(this);
            _selectionBox.BoxColour      = Color.Yellow;
            _selectionBox.FillColour     = Color.FromArgb(SelectionBoxBackgroundOpacity, Color.White);
            _selectionBox.Stippled       = SelectionBoxStippled;
            _selectionBox.State.Changed += SelectionBoxChanged;
            States.Add(_selectionBox);
            Children.AddRange(_selectionBox.Widgets);

            _emptyBox                = new BoxDraggableState(this);
            _emptyBox.BoxColour      = Color.Yellow;
            _emptyBox.FillColour     = Color.FromArgb(SelectionBoxBackgroundOpacity, Color.White);
            _emptyBox.Stippled       = SelectionBoxStippled;
            _emptyBox.State.Changed += EmptyBoxChanged;
            _emptyBox.DragEnded     += (sender, args) =>
            {
                if (AutoSelectBox)
                {
                    Confirm();
                }
            };
            States.Add(_emptyBox);

            Usage = ToolUsage.Both;

            Oy.Subscribe <String>("SelectTool:TransformationModeChanged", x =>
            {
                if (Enum.TryParse(x, out SelectionBoxDraggableState.TransformationMode mode))
                {
                    if (mode != _selectionBox.CurrentTransformationMode)
                    {
                        _selectionBox.SetTransformationMode(mode);
                    }
                }
            });
            Oy.Subscribe <string>("SelectTool:Show3DWidgetsChanged", x =>
            {
                Show3DWidgets             = x == "1";
                _selectionBox.ShowWidgets = Show3DWidgets;
                _selectionBox.Update();
            });
        }
Beispiel #3
0
        public VertexScaleTool()
        {
            _vertices = new Dictionary <VertexSolid, VertexList>();

            States.Add(new WrapperDraggableState(GetDraggables));

            _boxState              = new BoxDraggableState(this);
            _boxState.BoxColour    = Color.Orange;
            _boxState.FillColour   = Color.FromArgb(64, Color.DodgerBlue);
            _boxState.DragStarted += (sender, args) =>
            {
                if (!KeyboardState.Ctrl)
                {
                    DeselectAll();
                }
            };

            States.Add(_boxState);

            _origin = new ScaleOrigin(this);
        }
        public VertexPointTool()
        {
            _vertices = new ConcurrentDictionary <VertexSolid, VertexList>();

            States.Add(new WrapperDraggableState(GetDraggables));

            _boxState = new BoxDraggableState(this)
            {
                RenderBoxText = false,
                BoxColour     = Color.Orange,
                FillColour    = Color.FromArgb(64, Color.DodgerBlue)
            };
            _boxState.DragStarted += (sender, args) =>
            {
                if (!KeyboardState.Ctrl)
                {
                    DeselectAll();
                }
            };

            States.Add(_boxState);

            _showPoints = VisiblePoints.All;
        }
Beispiel #5
0
 public ResizeTransformHandle(BoxDraggableState state, ResizeHandle handle)
     : base(state, handle)
 {
 }
Beispiel #6
0
 public RotateTransformHandle(BoxDraggableState state, ResizeHandle handle, RotationOrigin origin) : base(state, handle)
 {
     _origin = origin;
 }