internal static void DrawWindow( Graphics graphics, Color ok, Color ng, ToolSettingBase positionAdjustSetting, ToolSettingBase targetToolSetting, ToolResultBase positionAdjustResult, ToolResultBase targetToolResult) { Color color = targetToolResult.Ok ? ok : ng; PositionAdjustToolResultBase posResult = positionAdjustResult as PositionAdjustToolResultBase; PositionAdjustToolSettingBase posSetting = positionAdjustSetting as PositionAdjustToolSettingBase; if (targetToolResult is PositionAdjustIncludeToolResult) { PositionAdjustIncludeToolResult includeToolResult = targetToolResult as PositionAdjustIncludeToolResult; if (includeToolResult.DrawInSettingPosition) { if (targetToolSetting.MultiToolWindow.Enabled) { ToolResultRender.DrawVector(graphics, color, targetToolSetting.MultiToolWindow); } else { ToolResultRender.DrawVector(graphics, color, targetToolSetting.ToolWindow); } } else if (targetToolSetting.MultiToolWindow.Enabled) { ToolResultRender.DrawPositionAdjustedVector(graphics, color, targetToolSetting.MultiToolWindow, includeToolResult.Description); } else { ToolResultRender.DrawPositionAdjustedVector(graphics, color, targetToolSetting.ToolWindow, includeToolResult.Description); } } else { PositionAdjustExcludeToolResult excludeToolResult = targetToolResult as PositionAdjustExcludeToolResult; if (excludeToolResult != null && (posSetting == null || posResult == null || excludeToolResult.IsDrawInSettingPosition(posSetting, posResult))) { ToolResultRender.DrawVector(graphics, color, targetToolSetting.ToolWindow); } else { ToolResultRender.DrawPositionUnadjustedVector(graphics, color, posSetting, posResult, targetToolSetting.ToolWindow); } } }
private static void DrawPositionAdjustedVector( Graphics graphics, Color color, WindowShape toolWindow, PositionControl description) { WindowShape toolWindow1 = (WindowShape)null; RectangleWindow rectangleWindow = toolWindow as RectangleWindow; if (rectangleWindow != null) { toolWindow1 = (WindowShape) new RectangleWindow(description.sPoint.nX, description.sPoint.nY, (ushort)rectangleWindow.Size.Width, (ushort)rectangleWindow.Size.Height, (short)((int)description.nAngle + toolWindow.Angle)); } CircleWindow circleWindow = toolWindow as CircleWindow; if (circleWindow != null) { toolWindow1 = (WindowShape) new CircleWindow(description.sPoint.nX, description.sPoint.nY, (ushort)circleWindow.Diameter); } ToolResultRender.DrawVector(graphics, color, toolWindow1); }
private static void DrawPositionUnadjustedVector( Graphics graphics, Color color, PositionAdjustToolSettingBase posSetting, PositionAdjustToolResultBase posResult, WindowShape toolWindow) { WindowShape toolWindow1 = (WindowShape)null; RectangleWindow rect = toolWindow as RectangleWindow; if (rect != null) { toolWindow1 = (WindowShape)ToolResultRender.PositionAdjustRectangle(posSetting, posResult, rect); } CircleWindow circle = toolWindow as CircleWindow; if (circle != null) { toolWindow1 = (WindowShape)ToolResultRender.PositionAdjustCircle(posSetting, posResult, circle); } ToolResultRender.DrawVector(graphics, color, toolWindow1); }
private static void DrawVector(Graphics graphics, Color color, MultiWindowShape toolWindows) { ToolResultRender.DrawVector(graphics, color, toolWindows.ToolWindow1); ToolResultRender.DrawVector(graphics, color, toolWindows.ToolWindow2); }