public override bool Stop(IMouseInformation mouseInformation) { if (!Enabled) { return(false); } if (_graphicBuilder != null && _graphicBuilder.Stop(mouseInformation)) { _primitiveGraphic.Draw(); return(true); } return(false); }
public override bool Stop(IMouseInformation mouseInformation) { if (_graphicBuilder == null) { return(false); } if (_graphicBuilder.Stop(mouseInformation)) { return(true); } _graphicBuilder = null; _undoableCommand = null; return(false); }
public override bool Stop(IMouseInformation mouseInformation) { if (!Enabled) { return(false); } if (_graphicBuilder != null && _graphicBuilder.Stop(mouseInformation)) { _primitiveGraphic.Draw(); return(true); } if (_graphicBuilder == null && _primitiveGraphic != null) { bool boundingBoxTooSmall = false; _primitiveGraphic.CoordinateSystem = CoordinateSystem.Destination; if (_primitiveGraphic.BoundingBox.Width < 50 || _primitiveGraphic.BoundingBox.Height < 50) { boundingBoxTooSmall = true; } _primitiveGraphic.ResetCoordinateSystem(); if (boundingBoxTooSmall) { RemoveDrawShutterGraphic(); base.SelectedPresentationImage.Draw(); } else { GeometricShutter shutter = ConvertToGeometricShutter(); GeometricShuttersGraphic shuttersGraphic = GetGeometricShuttersGraphic((IDicomPresentationImage)base.SelectedPresentationImage); DrawableUndoableCommand command = new DrawableUndoableCommand(shuttersGraphic); command.Name = SR.CommandDrawShutter; command.Enqueue(new AddGeometricShutterUndoableCommand(shuttersGraphic, shutter)); command.Execute(); base.ImageViewer.CommandHistory.AddCommand(command); } } return(false); }