ISurfaceBox.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. using SmartCoalApplication.Annotation.Enum;
  2. using SmartCoalApplication.Base.SettingModel;
  3. using System.Collections.Generic;
  4. using System.Drawing;
  5. using System.Drawing.Drawing2D;
  6. using System.Windows.Forms;
  7. using static SmartCoalApplication.Base.SettingModel.LabelStyleModel;
  8. using static System.Windows.Forms.Control;
  9. namespace SmartCoalApplication.Annotation
  10. {
  11. /// <summary>
  12. /// 用来给标注、测量、视场以及其它工具使用的接口
  13. /// </summary>
  14. public interface ISurfaceBox
  15. {
  16. /// <summary>
  17. /// 获取缩放比例
  18. /// </summary>
  19. double ScaleRatio { get; }
  20. /// <summary>
  21. ///
  22. /// </summary>
  23. bool Capture { get; set; }
  24. /// <summary>
  25. /// 绘制鼠标划选的标记
  26. /// </summary>
  27. bool DrawRectangleFlag { get; set; }
  28. Rectangle DrawRectangle { get; set; }
  29. /// <summary>
  30. /// 激活的工具
  31. /// </summary>
  32. DrawToolType ActiveTool { get; set; }
  33. DrawAnalysisModel AnalysisStyleModel { get; set; }
  34. /// <summary>
  35. /// 鼠标形状
  36. /// </summary>
  37. Cursor Cursor { get; set; }
  38. RectangleF GetVisibleDocumentRectangleF();
  39. SizeF GetDocumentSize();
  40. /// <summary>
  41. /// 获取controls
  42. /// </summary>
  43. ControlCollection Controls { get; }
  44. /// <summary>
  45. /// 添加到历史记录,用于撤销
  46. /// </summary>
  47. /// <param name="c"></param>
  48. void AddCommandToHistory(Command.Command c);
  49. /// <summary>
  50. /// 刷新界面
  51. /// </summary>
  52. void Refresh();
  53. /// <summary>
  54. /// 设置标记
  55. /// </summary>
  56. void SetDirty();
  57. /// <summary>
  58. /// 获取未缩放的坐标点
  59. /// </summary>
  60. /// <param name="location"></param>
  61. /// <returns></returns>
  62. Point GetScalePoint(PointF location);
  63. /// <summary>
  64. /// 获取缩放的原点
  65. /// </summary>
  66. /// <returns></returns>
  67. Point GetCalcOriginPoint();
  68. Rectangle RectangleToScreen(Rectangle rectangle);
  69. /// <summary>
  70. /// 获取未缩放的值
  71. /// </summary>
  72. /// <param name="deltaX"></param>
  73. /// <returns></returns>
  74. int UnscaleScalar(int deltaX);
  75. PointF GetDocumentScrollPositionF();
  76. void SetDocumentScrollPositionF(PointF newScrollPos);
  77. void Update();
  78. PointF DocumentToClient(PointF pointF);
  79. /// <summary>
  80. /// 获取系统当前选中单位及每单位像素值
  81. /// </summary>
  82. /// <returns>3位字符串数组,
  83. /// 0:系统选中单位枚举字符串
  84. /// 1:系统选中单位名称字符串
  85. /// 2:系统选中单位符号字符串
  86. /// 3:系统选中单位每单位像素长度</returns>
  87. string[] GetPxPerUnit();
  88. /// <summary>
  89. /// 单位的文字
  90. /// </summary>
  91. /// <returns></returns>
  92. Dictionary<int, string> GetUnitsDictionary();
  93. /// <summary>
  94. /// 单位的缩写
  95. /// </summary>
  96. /// <returns></returns>
  97. Dictionary<int, string> GetUnitSymbolsDictionary();
  98. /// <summary>
  99. /// 获取当前DocumentWorkspace的视场行为
  100. /// </summary>
  101. /// <returns></returns>
  102. CombineMode GetCombineMode();
  103. /// <summary>
  104. /// 设置当前鼠标的状态
  105. /// </summary>
  106. /// <param name="status"></param>
  107. void SetMouseStatus(bool status);
  108. /// <summary>
  109. /// 获取当前鼠标的状态
  110. /// </summary>
  111. /// <returns></returns>
  112. bool GetMouseStatus();
  113. #region 标注、测量
  114. /// <summary>
  115. /// 测量的连续绘制标记
  116. /// </summary>
  117. /// <returns></returns>
  118. bool ContinuousDrawingMeasure();
  119. /// <summary>
  120. /// 视场的连续绘制标记
  121. /// </summary>
  122. /// <returns></returns>
  123. bool ContinuousDrawingView();
  124. void SetContinuousDrawingMeasure(bool v);
  125. /// <summary>
  126. /// 标注、测量、视场等的集合
  127. /// </summary>
  128. GraphicsList GraphicsList { get; }
  129. /// <summary>
  130. /// 重置标注、测量的管理类
  131. /// </summary>
  132. void ResetUndoManager();
  133. /// <summary>
  134. /// 获取标注的样式信息
  135. /// </summary>
  136. /// <returns></returns>
  137. LabelStyleModel GetLabelStyleModel();
  138. /// <summary>
  139. /// 获取测量的样式信息
  140. /// </summary>
  141. /// <returns></returns>
  142. MeasureStyleModel GetMeasureStyleModel();
  143. /// <summary>
  144. /// 获取测量单位对应的换算字典
  145. /// </summary>
  146. /// <returns></returns>
  147. Dictionary<MeasurementUnit, double> getMeasureInfo();
  148. /// <summary>
  149. /// 更新命名的延续数字
  150. /// </summary>
  151. void UpdateContinueNum();
  152. #endregion
  153. bool ViewMoveOnMouseLeftDoubleClickEnable { get; set; }
  154. PointF GetRulerPointInPanel(PointF point);
  155. PointF ScalePointToRulerPoint(PointF point);
  156. int ToolNumber { set; }
  157. /// <summary>
  158. /// 删除视场
  159. /// </summary>
  160. /// <returns></returns>
  161. bool DeleteFieldOfView();
  162. /// <summary>
  163. /// 获取测量的样式信息
  164. /// </summary>
  165. /// <returns></returns>
  166. MeasureAreaModel GetMeasureAreaModel();
  167. double getUnitNum();
  168. string getAliasName();
  169. int getDecimalPlaces();
  170. }
  171. }