|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeoSigmaViewer
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DrawToolSelect : DrawTool
|
|
|
|
|
|
{
|
|
|
|
|
|
private MouseMoveResult mmResult;
|
|
|
|
|
|
public DrawToolSelect()
|
|
|
|
|
|
{
|
|
|
|
|
|
ToolCursor=DrawCursors.Select;
|
|
|
|
|
|
ItemType =DrawItemType.ITEM_SELECT;
|
|
|
|
|
|
mmResult = new MouseMoveResult();
|
|
|
|
|
|
}
|
|
|
|
|
|
public override void OnMouseClick(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnMouseClick(drawArea, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnLButtonDown(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
drawArea.Geo.OnLButtonDown(e.X, e.Y);
|
|
|
|
|
|
//base.OnLButtonDown(drawArea, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnMouseMove(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//drawArea.Cursor=ToolCursor;
|
|
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
|
{
|
|
|
|
|
|
Graphics g = drawArea.CreateGraphics();
|
|
|
|
|
|
drawArea.Geo.ItemMouseMove(g.GetHdc(), e.X, e.Y, ref mmResult);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int type = drawArea.Geo.GetTrackerHandleCursorType(e.X, e.Y);
|
|
|
|
|
|
if (cursorType != type && e.Button != MouseButtons.Left)
|
|
|
|
|
|
{
|
|
|
|
|
|
cursorType = type;
|
|
|
|
|
|
SetCursor(drawArea, cursorType);
|
|
|
|
|
|
}
|
|
|
|
|
|
//Console.WriteLine("handleKind:"+ handleKind);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnLButtonUp(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
drawArea.Geo.OnLButtonUp(e.X, e.Y);
|
|
|
|
|
|
drawArea.Geo.EnableRedraw(true);
|
|
|
|
|
|
drawArea.ReDraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SetCursor(Drawer drawArea, int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
//0--左下箭头 1--垂直箭头 2--右下箭头 3--水平箭头
|
|
|
|
|
|
//4--旋转箭头 5--水平剪切箭头 6--垂直剪切箭头 7--平移箭头
|
|
|
|
|
|
//-1 出错
|
|
|
|
|
|
switch (type)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.LBArrow;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.VArrow;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.RBArrow;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.HArrow;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.RotationArrow;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 5:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.HShearArrow;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 6:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.VShearArrow;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 7:
|
|
|
|
|
|
drawArea.Cursor = DrawCursors.CurveMovePoint;
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
drawArea.Cursor = ToolCursor;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//DrawCursors
|
|
|
|
|
|
}
|
|
|
|
|
|
private int cursorType = -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|