You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeoSigmaViewer
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DrawToolEquilateral : DrawTool
|
|
|
|
|
|
{
|
|
|
|
|
|
private MouseMoveResult mmResult;
|
|
|
|
|
|
private bool isDrawing;
|
|
|
|
|
|
public DrawToolEquilateral()
|
|
|
|
|
|
{
|
|
|
|
|
|
ToolCursor = DrawCursors.Range;
|
|
|
|
|
|
ItemType = DrawItemType.ITEM_EQUILATERAL;
|
|
|
|
|
|
isDrawing = false;
|
|
|
|
|
|
mmResult = new MouseMoveResult();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
drawer.Cursor = DrawCursors.Range;
|
|
|
|
|
|
drawer.Geo.Arc_SetType(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void End()
|
|
|
|
|
|
{
|
|
|
|
|
|
drawer.Cursor = DrawCursors.Select;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnLButtonDown(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
isDrawing = !isDrawing;
|
|
|
|
|
|
//clockCount = clockCount % 3;
|
|
|
|
|
|
drawArea.Geo.OnLButtonDown(e.X, e.Y);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnMouseMove(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isDrawing)
|
|
|
|
|
|
{
|
|
|
|
|
|
Graphics g = drawArea.CreateGraphics();
|
|
|
|
|
|
drawArea.Geo.ItemMouseMove(g.GetHdc(), e.X, e.Y, ref mmResult);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnLButtonUp(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
drawArea.Geo.OnLButtonUp(e.X, e.Y);
|
|
|
|
|
|
drawArea.Geo.EnableRedraw(true);
|
|
|
|
|
|
drawArea.ReDraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|