void scenePanel_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Diagnostics.Debug.Assert(mainFrm != null);
if (viewCmd != null)
{
GraphicView gv = GraphicViewManager.Instance.ActiveView;
bool windowSelectionOn = SelectionCommand.WindowSelectionOn;
viewCmd.ButtonUp(gv, e);
mainFrm.ScenePanel.Capture = false;
// Check if its time to end current ViewCommand
if (e.Button == System.Windows.Forms.MouseButtons.Right || e.Button == MouseButtons.Middle)
{
if ((viewCmd != SelectionCommand || gv.ModelRenderer.RenderOptions.ShowAnimated) && EndViewCommand != null)
EndViewCommand(this, new EndViewCommandArgs(viewCmd));
else if (!SelectionCommand.IsWorkingAsCommandService)
{
if (!windowSelectionOn)
Canguro.Model.Model.Instance.UnSelectAll();
}
viewCmd = SelectionCommand;
if (StartViewCommand != null)
StartViewCommand(this, EventArgs.Empty);
mainFrm.ScenePanel.Cursor = SelectionCommand.Cursor;
}
if (e.Button == MouseButtons.Middle && lastViewCmd != null)
{
if (lastViewCmd == Commands.View.Trackball3D.Instance)
Execute("rotate");
else if (lastViewCmd == Commands.View.Pan.Instance)
Execute("pan");
else if (lastViewCmd == Commands.View.ZoomInteractive.Instance)
Execute("zoom");
lastViewCmd = null;
}
if (viewCmd == SelectionCommand)
GraphicViewManager.Instance.UpdateView(gv);
}
}