@labelbee/lb-annotation 1.9.0-alpha.1 → 1.9.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +1 -0
  2. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +1 -0
  3. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -0
  4. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +1 -0
  5. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +2 -0
  6. package/dist/_virtual/filterBoxWorker.js +1 -0
  7. package/dist/_virtual/highlightWorker.js +1 -0
  8. package/dist/assets/attributeIcon/icon_canvasEdit0.svg.js +1 -0
  9. package/dist/assets/attributeIcon/icon_canvasEdit1.svg.js +1 -0
  10. package/dist/assets/attributeIcon/icon_canvasEdit2.svg.js +1 -0
  11. package/dist/assets/attributeIcon/icon_canvasEdit3.svg.js +1 -0
  12. package/dist/assets/attributeIcon/icon_canvasEdit4.svg.js +1 -0
  13. package/dist/assets/attributeIcon/icon_canvasEdit5.svg.js +1 -0
  14. package/dist/assets/attributeIcon/icon_canvasEdit6.svg.js +1 -0
  15. package/dist/assets/attributeIcon/icon_canvasEdit7.svg.js +1 -0
  16. package/dist/assets/attributeIcon/icon_canvasEdit8.svg.js +1 -0
  17. package/dist/assets/attributeIcon/icon_canvasEdit_miss.svg.js +1 -0
  18. package/dist/assets/attributeIcon/icon_editFEN.svg.js +1 -0
  19. package/dist/assets/attributeIcon/icon_editHUANG.svg.js +1 -0
  20. package/dist/assets/attributeIcon/icon_editLAN.svg.js +1 -0
  21. package/dist/assets/attributeIcon/icon_editLV.svg.js +1 -0
  22. package/dist/assets/attributeIcon/icon_editQING.svg.js +1 -0
  23. package/dist/constant/annotation.js +1 -0
  24. package/dist/constant/annotationTask.js +1 -0
  25. package/dist/constant/defaultConfig.js +1 -0
  26. package/dist/constant/keyCode.js +1 -0
  27. package/dist/constant/style.js +1 -0
  28. package/dist/constant/tool.js +1 -0
  29. package/dist/core/index.js +1 -0
  30. package/dist/core/pointCloud/OrbitControls.js +1 -0
  31. package/dist/core/pointCloud/PCDLoader.js +2 -0
  32. package/dist/core/pointCloud/annotation.js +1 -0
  33. package/dist/core/pointCloud/cache.js +1 -0
  34. package/dist/core/pointCloud/index.js +11 -0
  35. package/dist/core/scheduler.js +1 -0
  36. package/dist/core/toolOperation/LineToolOperation.js +1 -0
  37. package/dist/core/toolOperation/TextToolOperation.js +1 -0
  38. package/dist/core/toolOperation/ViewOperation.js +1 -0
  39. package/dist/core/toolOperation/basicToolOperation.js +1 -0
  40. package/dist/core/toolOperation/checkOperation.js +1 -0
  41. package/dist/core/toolOperation/eventListener.js +1 -0
  42. package/dist/core/toolOperation/measureOperation.js +1 -0
  43. package/dist/core/toolOperation/pointCloud2dOperation.js +1 -0
  44. package/dist/core/toolOperation/pointOperation.js +1 -0
  45. package/dist/core/toolOperation/polygonOperation.js +1 -0
  46. package/dist/core/toolOperation/rectOperation.js +1 -0
  47. package/dist/core/toolOperation/segmentByRect.js +1 -0
  48. package/dist/core/toolOperation/tagOperation.js +19 -0
  49. package/dist/core/toolOperation/textAttributeClass.js +37 -0
  50. package/dist/index.js +1 -107
  51. package/dist/locales/constants.js +1 -0
  52. package/dist/locales/en_US/message.js +1 -0
  53. package/dist/locales/index.js +1 -0
  54. package/dist/locales/zh_CN/message.js +1 -0
  55. package/dist/newCore/CanvasScheduler.js +1 -0
  56. package/dist/types/core/pointCloud/annotation.d.ts +27 -5
  57. package/dist/types/core/pointCloud/cache.d.ts +1 -1
  58. package/dist/types/core/pointCloud/filterBoxWorker.d.ts +1 -0
  59. package/dist/types/core/pointCloud/highlightWorker.d.ts +1 -0
  60. package/dist/types/core/pointCloud/index.d.ts +31 -15
  61. package/dist/types/core/toolOperation/basicToolOperation.d.ts +11 -0
  62. package/dist/types/core/toolOperation/pointCloud2dOperation.d.ts +16 -2
  63. package/dist/types/core/toolOperation/polygonOperation.d.ts +2 -1
  64. package/dist/types/utils/MathUtils.d.ts +2 -0
  65. package/dist/utils/ActionsHistory.js +1 -0
  66. package/dist/utils/ImgUtils.js +1 -0
  67. package/dist/utils/MathUtils.js +2 -0
  68. package/dist/utils/VectorUtils.js +1 -0
  69. package/dist/utils/tool/AttributeUtils.js +1 -0
  70. package/dist/utils/tool/AxisUtils.js +1 -0
  71. package/dist/utils/tool/CanvasUtils.js +1 -0
  72. package/dist/utils/tool/CommonToolUtils.js +1 -0
  73. package/dist/utils/tool/DblClickEventListener.js +1 -0
  74. package/dist/utils/tool/DrawUtils.js +3 -0
  75. package/dist/utils/tool/EnhanceCommonToolUtils.js +1 -0
  76. package/dist/utils/tool/ImgPosUtils.js +1 -0
  77. package/dist/utils/tool/LineToolUtils.js +1 -0
  78. package/dist/utils/tool/MarkerUtils.js +1 -0
  79. package/dist/utils/tool/PolygonUtils.js +1 -0
  80. package/dist/utils/tool/RectUtils.js +1 -0
  81. package/dist/utils/tool/RenderDomClass.js +20 -0
  82. package/dist/utils/tool/RenderDomUtils.js +16 -0
  83. package/dist/utils/tool/StyleUtils.js +1 -0
  84. package/dist/utils/tool/TagUtils.js +1 -0
  85. package/dist/utils/tool/UnitUtils.js +1 -0
  86. package/dist/utils/tool/ZoomUtils.js +1 -0
  87. package/dist/utils/tool/polygonTool.js +1 -0
  88. package/dist/utils/uuid.js +1 -0
  89. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +1 -0
  90. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +1 -0
  91. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -0
  92. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +1 -0
  93. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +2 -0
  94. package/es/_virtual/filterBoxWorker.js +1 -0
  95. package/es/_virtual/highlightWorker.js +1 -0
  96. package/es/_virtual/worker.js +6 -0
  97. package/es/assets/attributeIcon/icon_canvasEdit0.svg.js +1 -3
  98. package/es/assets/attributeIcon/icon_canvasEdit1.svg.js +1 -3
  99. package/es/assets/attributeIcon/icon_canvasEdit2.svg.js +1 -3
  100. package/es/assets/attributeIcon/icon_canvasEdit3.svg.js +1 -3
  101. package/es/assets/attributeIcon/icon_canvasEdit4.svg.js +1 -3
  102. package/es/assets/attributeIcon/icon_canvasEdit5.svg.js +1 -3
  103. package/es/assets/attributeIcon/icon_canvasEdit6.svg.js +1 -3
  104. package/es/assets/attributeIcon/icon_canvasEdit7.svg.js +1 -3
  105. package/es/assets/attributeIcon/icon_canvasEdit8.svg.js +1 -3
  106. package/es/assets/attributeIcon/icon_canvasEdit_miss.svg.js +1 -3
  107. package/es/assets/attributeIcon/icon_editFEN.svg.js +1 -3
  108. package/es/assets/attributeIcon/icon_editHUANG.svg.js +1 -3
  109. package/es/assets/attributeIcon/icon_editLAN.svg.js +1 -3
  110. package/es/assets/attributeIcon/icon_editLV.svg.js +1 -3
  111. package/es/assets/attributeIcon/icon_editQING.svg.js +1 -3
  112. package/es/constant/annotation.js +1 -68
  113. package/es/constant/annotationTask.js +1 -25
  114. package/es/constant/defaultConfig.js +1 -260
  115. package/es/constant/keyCode.js +1 -36
  116. package/es/constant/style.js +1 -67
  117. package/es/constant/tool.js +1 -183
  118. package/es/core/index.js +1 -138
  119. package/es/core/pointCloud/OrbitControls.js +1 -661
  120. package/es/core/pointCloud/PCDLoader.js +2 -238
  121. package/es/core/pointCloud/annotation.js +1 -87
  122. package/es/core/pointCloud/cache.js +1 -33
  123. package/es/core/pointCloud/index.js +5 -765
  124. package/es/core/scheduler.js +1 -173
  125. package/es/core/toolOperation/LineToolOperation.js +1 -1369
  126. package/es/core/toolOperation/TextToolOperation.js +1 -129
  127. package/es/core/toolOperation/ViewOperation.js +1 -410
  128. package/es/core/toolOperation/basicToolOperation.js +1 -808
  129. package/es/core/toolOperation/checkOperation.js +1 -206
  130. package/es/core/toolOperation/eventListener.js +1 -35
  131. package/es/core/toolOperation/measureOperation.js +1 -39
  132. package/es/core/toolOperation/pointCloud2dOperation.js +1 -137
  133. package/es/core/toolOperation/pointOperation.js +1 -603
  134. package/es/core/toolOperation/polygonOperation.js +1 -1160
  135. package/es/core/toolOperation/rectOperation.js +1 -1166
  136. package/es/core/toolOperation/segmentByRect.js +1 -169
  137. package/es/core/toolOperation/tagOperation.js +3 -199
  138. package/es/core/toolOperation/textAttributeClass.js +16 -180
  139. package/es/index.js +1 -107
  140. package/es/locales/constants.js +1 -21
  141. package/es/locales/en_US/message.js +1 -22
  142. package/es/locales/index.js +1 -17
  143. package/es/locales/zh_CN/message.js +1 -22
  144. package/es/newCore/CanvasScheduler.js +1 -31
  145. package/es/utils/ActionsHistory.js +1 -78
  146. package/es/utils/ImgUtils.js +1 -20
  147. package/es/utils/MathUtils.js +2 -271
  148. package/es/utils/VectorUtils.js +1 -23
  149. package/es/utils/tool/AttributeUtils.js +1 -196
  150. package/es/utils/tool/AxisUtils.js +1 -254
  151. package/es/utils/tool/CanvasUtils.js +1 -60
  152. package/es/utils/tool/CommonToolUtils.js +1 -186
  153. package/es/utils/tool/DblClickEventListener.js +1 -100
  154. package/es/utils/tool/DrawUtils.js +3 -424
  155. package/es/utils/tool/EnhanceCommonToolUtils.js +1 -0
  156. package/es/utils/tool/ImgPosUtils.js +1 -56
  157. package/es/utils/tool/LineToolUtils.js +1 -255
  158. package/es/utils/tool/MarkerUtils.js +1 -9
  159. package/es/utils/tool/PolygonUtils.js +1 -453
  160. package/es/utils/tool/RectUtils.js +1 -153
  161. package/es/utils/tool/RenderDomClass.js +7 -55
  162. package/es/utils/tool/RenderDomUtils.js +4 -17
  163. package/es/utils/tool/StyleUtils.js +1 -29
  164. package/es/utils/tool/TagUtils.js +1 -127
  165. package/es/utils/tool/UnitUtils.js +1 -10
  166. package/es/utils/tool/ZoomUtils.js +1 -70
  167. package/es/utils/tool/polygonTool.js +1 -126
  168. package/es/utils/uuid.js +1 -24
  169. package/package.json +6 -7
  170. package/dist/types/types/toolExport/index.d.ts +0 -5
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _rollupPluginWebWorkerLoader__helper__node__createBase64WorkerFactory=require("./_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js"),_rollupPluginWebWorkerLoader__helper__browser__createBase64WorkerFactory=require("./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js"),_rollupPluginWebWorkerLoader__helper__auto__isNodeJS=require("./_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js");function createBase64WorkerFactory(e,r,o){return _rollupPluginWebWorkerLoader__helper__auto__isNodeJS.isNodeJS()?_rollupPluginWebWorkerLoader__helper__node__createBase64WorkerFactory.createBase64WorkerFactory(e,r,o):_rollupPluginWebWorkerLoader__helper__browser__createBase64WorkerFactory.createBase64WorkerFactory(e,r,o)}exports.createBase64WorkerFactory=createBase64WorkerFactory;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var kIsNodeJS=Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]";function isNodeJS(){return kIsNodeJS}exports.isNodeJS=isNodeJS;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});function decodeBase64(o,n){var r=atob(o);if(n){for(var e=new Uint8Array(r.length),t=0,a=r.length;t<a;++t)e[t]=r.charCodeAt(t);return String.fromCharCode.apply(null,new Uint16Array(e.buffer))}return r}function createURL(o,n,r){var e=n===void 0?null:n,t=r===void 0?!1:r,a=decodeBase64(o,t),u=a.indexOf(`
2
+ `,10)+1,c=a.substring(u)+(e?"//# sourceMappingURL="+e:""),i=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(i)}function createBase64WorkerFactory(o,n,r){var e;return function(a){return e=e||createURL(o,n,r),new Worker(e,a)}}exports.createBase64WorkerFactory=createBase64WorkerFactory;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerClass=null;try{var WorkerThreads=typeof module!="undefined"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof require=="function"&&require("worker_threads");exports.WorkerClass=WorkerThreads.Worker}catch(e){}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _rollupPluginWebWorkerLoader__helper__node__WorkerClass=require("./_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js");function decodeBase64(r,e){return Buffer.from(r,"base64").toString(e?"utf16":"utf8")}function createBase64WorkerFactory(r,e,o){var t=e===void 0?null:e,n=o===void 0?!1:o,a=decodeBase64(r,n),u=a.indexOf(`
2
+ `,10)+1,s=a.substring(u)+(t?"//# sourceMappingURL="+t:"");return function(l){return new _rollupPluginWebWorkerLoader__helper__node__WorkerClass.WorkerClass(s,Object.assign({},l,{eval:!0}))}}exports.createBase64WorkerFactory=createBase64WorkerFactory;
@@ -0,0 +1 @@
1
+ "use strict";var _rollupPluginWebWorkerLoader__helper__auto__createBase64WorkerFactory=require("./_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js"),WorkerFactory=_rollupPluginWebWorkerLoader__helper__auto__createBase64WorkerFactory.createBase64WorkerFactory("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwp2YXIgd29ya2VyX2NvZGU9ZnVuY3Rpb24oZil7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIGMoaSxzLGw9MCl7bGV0IHg9MCx1LG8sdCxlO3M9Wy4uLnNdLGw9PT0xJiYocz1jcmVhdGVTbW9vdGhDdXJ2ZVBvaW50cyhzLnJlZHVjZSgoYSxuKT0+Wy4uLmEsbi54LG4ueV0sW10pLC41LCEwLFNFR01FTlRfTlVNQkVSKSksW3RdPXM7Y29uc3Qgcj1zLmxlbmd0aDtmb3IodT0xO3U8PXI7dSsrKWU9c1t1JXJdLGkueD5NYXRoLm1pbih0LngsZS54KSYmaS54PD1NYXRoLm1heCh0LngsZS54KSYmaS55PD1NYXRoLm1heCh0LnksZS55KSYmdC54IT09ZS54JiYobz0oaS54LXQueCkqKGUueS10LnkpLyhlLngtdC54KSt0LnksKHQueT09PWUueXx8aS55PD1vKSYmeCsrKSx0PWU7cmV0dXJuIHglMiE9MH1yZXR1cm4gb25tZXNzYWdlPWZ1bmN0aW9uKHMpe2NvbnN0e3pNaW46bCx6TWF4OngscG9seWdvblBvaW50TGlzdDp1LHBvc2l0aW9uOm8sY29sb3I6dH09cy5kYXRhLGU9W10scj1bXTtsZXQgYT0wO2ZvcihsZXQgbj0wO248by5sZW5ndGg7bis9Myl7Y29uc3QgaD1vW25dLE09b1tuKzFdLHk9b1tuKzJdO2Moe3g6aCx5Ok19LHUpJiZ5Pj1sJiZ5PD14JiYoZS5wdXNoKGgpLGUucHVzaChNKSxlLnB1c2goeSksci5wdXNoKHRbbl0pLHIucHVzaCh0W24rMV0pLHIucHVzaCh0W24rMl0pLGErKyl9dGhpcy5wb3N0TWVzc2FnZSh7cG9zaXRpb246ZSxjb2xvcjpyLG51bTphfSl9LGYuaXNJblBvbHlnb249YyxPYmplY3QuZGVmaW5lUHJvcGVydHkoZiwiX19lc01vZHVsZSIse3ZhbHVlOiEwfSksZn0oe30pOwoK",null,!1);module.exports=WorkerFactory;
@@ -0,0 +1 @@
1
+ "use strict";var _rollupPluginWebWorkerLoader__helper__auto__createBase64WorkerFactory=require("./_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js"),WorkerFactory=_rollupPluginWebWorkerLoader__helper__auto__createBase64WorkerFactory.createBase64WorkerFactory("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwp2YXIgd29ya2VyX2NvZGU9ZnVuY3Rpb24oeCl7InVzZSBzdHJpY3QiO2NsYXNzIEN7c3RhdGljIGdlbkNvbG9yQnlDb29yZChyLHUsbil7cmV0dXJuIG48PTA/WzEyOCwxMjgsMTI4XTpuPDU/WzI1NSwwLDBdOm48MTA/WzAsMjU1LDBdOlswLDAsMjU1XX1zdGF0aWMgZ2V0U3RhbmRhcmRDb2xvckJ5Q29vcmQocix1LG4pe3JldHVybiB0aGlzLmdlbkNvbG9yQnlDb29yZChyLHUsbikubWFwKGk9PmkvMjU1KX19ZnVuY3Rpb24geShzLHIsdT0wKXtsZXQgbj0wLGEsaSx0LG87cj1bLi4ucl0sdT09PTEmJihyPWNyZWF0ZVNtb290aEN1cnZlUG9pbnRzKHIucmVkdWNlKChmLGwpPT5bLi4uZixsLngsbC55XSxbXSksLjUsITAsU0VHTUVOVF9OVU1CRVIpKSxbdF09cjtjb25zdCBlPXIubGVuZ3RoO2ZvcihhPTE7YTw9ZTthKyspbz1yW2ElZV0scy54Pk1hdGgubWluKHQueCxvLngpJiZzLng8PU1hdGgubWF4KHQueCxvLngpJiZzLnk8PU1hdGgubWF4KHQueSxvLnkpJiZ0LnghPT1vLngmJihpPShzLngtdC54KSooby55LXQueSkvKG8ueC10LngpK3QueSwodC55PT09by55fHxzLnk8PWkpJiZuKyspLHQ9bztyZXR1cm4gbiUyIT0wfXJldHVybiBvbm1lc3NhZ2U9ZnVuY3Rpb24ocil7Y29uc3R7ek1pbjp1LHpNYXg6bixwb2x5Z29uUG9pbnRMaXN0OmEscG9zaXRpb246aSxjb2xvcjp0fT1yLmRhdGE7bGV0IG89MDtmb3IobGV0IGU9MDtlPGkubGVuZ3RoO2UrPTMpe2NvbnN0IGY9aVtlXSxsPWlbZSsxXSxkPWlbZSsyXTtpZih5KHt4OmYseTpsfSxhKSYmZD49dSYmZDw9bilvKyssdFtlXT0wLHRbZSsxXT0xLHRbZSsyXT0xO2Vsc2V7Y29uc3RbYyxnLE1dPUMuZ2V0U3RhbmRhcmRDb2xvckJ5Q29vcmQoZixsLGQpO3RbZV09Yyx0W2UrMV09Zyx0W2UrMl09TX19cG9zdE1lc3NhZ2Uoe3BvaW50czppLGNvbG9yOnQsbnVtOm99KX0seC5pc0luUG9seWdvbj15LE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh4LCJfX2VzTW9kdWxlIix7dmFsdWU6ITB9KSx4fSh7fSk7Cgo=",null,!1);module.exports=WorkerFactory;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit0='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ccc"/></g></g></svg>';module.exports=canvasEdit0;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit1='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ff2323"/></g></g></svg>';module.exports=canvasEdit1;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit2='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ffe232"/></g></g></svg>';module.exports=canvasEdit2;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit3='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#01ff30"/></g></g></svg>';module.exports=canvasEdit3;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit4='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#00ffea"/></g></g></svg>';module.exports=canvasEdit4;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit5='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#0282fa"/></g></g></svg>';module.exports=canvasEdit5;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit6='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#800cf9"/></g></g></svg>';module.exports=canvasEdit6;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit7='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#ff88f7"/></g></g></svg>';module.exports=canvasEdit7;
@@ -0,0 +1 @@
1
+ "use strict";var canvasEdit8='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#994217"/></g></g></svg>';module.exports=canvasEdit8;
@@ -0,0 +1 @@
1
+ "use strict";var INVALID_ICON='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#f33"/></g></g></svg>';module.exports=INVALID_ICON;
@@ -0,0 +1 @@
1
+ "use strict";var baseEditFen='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#f70efa"/></g></g></svg>';module.exports=baseEditFen;
@@ -0,0 +1 @@
1
+ "use strict";var baseEditHuang='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#fdff37"/></g></g></svg>';module.exports=baseEditHuang;
@@ -0,0 +1 @@
1
+ "use strict";var baseEditLan='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#1f0bf9"/></g></g></svg>';module.exports=baseEditLan;
@@ -0,0 +1 @@
1
+ "use strict";var baseEditLv='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#33fe33"/></g></g></svg>';module.exports=baseEditLv;
@@ -0,0 +1 @@
1
+ "use strict";var baseEditQing='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="a"><path d="M0,0H16V-16H0Z" fill="none"/></clipPath><clipPath id="b"><path d="M13.75-2.937H2.25a.5.5,0,0,0-.5.5v.563a.125.125,0,0,0,.125.125h12.25a.125.125,0,0,0,.125-.125v-.562A.5.5,0,0,0,13.75-2.937ZM4.027-4.25a.632.632,0,0,0,.094-.008l2.628-.461a.153.153,0,0,0,.083-.044l6.623-6.623a.156.156,0,0,0,0-.22l-2.6-2.6a.155.155,0,0,0-.111-.045.155.155,0,0,0-.111.045L4.012-7.581a.159.159,0,0,0-.044.083L3.508-4.87a.524.524,0,0,0,.147.466.529.529,0,0,0,.372.155Z" fill="none"/></clipPath></defs><g transform="translate(0 16)"><g clip-path="url(#a)"><path d="M-5-21H21V5H-5Z" fill="rgba(0,0,0,0)"/></g><g clip-path="url(#b)"><path d="M-3.25-19.25h22.5V3.25H-3.25Z" fill="#3fe"/></g></g></svg>';module.exports=baseEditQing;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const headerHeight=61,tipsHeight=40,footerHeight=40,sidebarWidth=240;exports.EStepType=void 0,function(o){o[o.ANNOTATION=1]="ANNOTATION",o[o.QUALITY_INSPECTION=2]="QUALITY_INSPECTION",o[o.PRE_ANNOTATION=3]="PRE_ANNOTATION",o[o.MANUAL_CORRECTION=4]="MANUAL_CORRECTION"}(exports.EStepType||(exports.EStepType={}));const ANNOTATION_MAX_SIZE=1e3;exports.EPageOperator=void 0,function(o){o[o.Backward=0]="Backward",o[o.Forward=1]="Forward",o[o.JumpSkip=2]="JumpSkip",o[o.None=3]="None"}(exports.EPageOperator||(exports.EPageOperator={})),exports.EDragStatus=void 0,function(o){o[o.Start=0]="Start",o[o.Stop=1]="Stop",o[o.Wait=2]="Wait",o[o.Move=3]="Move"}(exports.EDragStatus||(exports.EDragStatus={})),exports.EDragTarget=void 0,function(o){o[o.Point=0]="Point",o[o.Line=1]="Line",o[o.Plane=2]="Plane"}(exports.EDragTarget||(exports.EDragTarget={})),exports.ESortDirection=void 0,function(o){o[o.ascend=0]="ascend",o[o.descend=1]="descend"}(exports.ESortDirection||(exports.ESortDirection={})),exports.EGrowthMode=void 0,function(o){o[o.Intelligence=0]="Intelligence",o[o.Linear=1]="Linear"}(exports.EGrowthMode||(exports.EGrowthMode={})),exports.ELang=void 0,function(o){o.Zh="zh_CN",o.US="en_US"}(exports.ELang||(exports.ELang={})),exports.ERotateDirection=void 0,function(o){o[o.Clockwise=0]="Clockwise",o[o.Anticlockwise=1]="Anticlockwise"}(exports.ERotateDirection||(exports.ERotateDirection={}));const DEFAULT_TEXT_OFFSET={offsetX:-10,offsetY:-10},DEFAULT_TEXT_SHADOW={shadowColor:"rgba(0,0,0,0.6)",shadowOffsetX:0,shadowOffsetY:2,shadowBlur:4},TEXT_ATTRIBUTE_OFFSET={x:8,y:26};exports.ANNOTATION_MAX_SIZE=ANNOTATION_MAX_SIZE,exports.DEFAULT_TEXT_OFFSET=DEFAULT_TEXT_OFFSET,exports.DEFAULT_TEXT_SHADOW=DEFAULT_TEXT_SHADOW,exports.TEXT_ATTRIBUTE_OFFSET=TEXT_ATTRIBUTE_OFFSET,exports.footerHeight=footerHeight,exports.headerHeight=headerHeight,exports.sidebarWidth=sidebarWidth,exports.tipsHeight=tipsHeight;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const ANNOTATION_TYPE={0:"\u76EE\u6807\u68C0\u6D4B",1:"\u56FE\u50CF\u5206\u7C7B"},ANNOTATION_STATUS={0:"\u6807\u6CE8\u6587\u4EF6\u4F20\u8F93\u4E2D",1:"\u6807\u6CE8\u6587\u4EF6\u4F20\u8F93\u91CD\u8BD5",2:"\u6807\u6CE8\u6587\u4EF6\u4F20\u8F93\u5931\u8D25",3:"\u6807\u6CE8\u4E2D",4:"\u4EFB\u52A1\u7EC8\u6B62",5:"\u4EFB\u52A1\u5B8C\u6210",6:"\u6570\u636E\u5DF2\u53D1\u5E03"};exports.EAnnotationStatus=void 0,function(u){u[u.Upload=0]="Upload",u[u.UploadRetry=1]="UploadRetry",u[u.UploadFail=2]="UploadFail",u[u.Annotation=3]="Annotation",u[u.Terminated=4]="Terminated",u[u.Finish=5]="Finish",u[u.Publish=6]="Publish"}(exports.EAnnotationStatus||(exports.EAnnotationStatus={})),exports.ANNOTATION_STATUS=ANNOTATION_STATUS,exports.ANNOTATION_TYPE=ANNOTATION_TYPE;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const rectToolConfig={showConfirm:!1,skipWhileNoDependencies:!1,drawOutsideTarget:!1,copyBackwardResult:!1,minWidth:1,minHeight:1,isShowOrder:!1,filterData:["valid","invalid"],attributeConfigurable:!1,attributeList:[],textConfigurable:!1,textCheckType:0,customFormat:""},tagToolConfig={showConfirm:!1,skipWhileNoDependencies:!1,inputList:[{key:"\u7C7B\u522B1",value:"class1",isMulti:!1,subSelected:[{key:"\u9009\u98791",value:"option1",isDefault:!1},{key:"\u9009\u98792",value:"option1-2",isDefault:!1}]},{key:"\u7C7B\u522B2",value:"class-AH",isMulti:!0,subSelected:[{key:"\u9009\u98792-1",value:"option2-1",isDefault:!1},{key:"\u9009\u98792-2",value:"option2-2",isDefault:!1},{key:"\u9009\u98792-3",value:"option2-3",isDefault:!1}]},{key:"\u7C7B\u522B3",value:"class-0P",isMulti:!1,subSelected:[{key:"\u9009\u98793-1",value:"option3-1",isMulti:!1},{key:"\u9009\u98793-2",value:"option3-2",isDefault:!1},{key:"\u9009\u98793-3",value:"option3-3",isDefault:!1}]}]},lineToolConfig={lineType:0,lineColor:0,edgeAdsorption:!1,outOfTarget:!0,copyBackwardResult:!1,isShowOrder:!1,attributeConfigurable:!1,attributeList:[{key:"\u7C7B\u522B1",value:"\u7C7B\u522B1"},{key:"\u7C7B\u522Bao",value:"class-ao"},{key:"\u7C7B\u522BM1",value:"class-M1"},{key:"\u7C7B\u522BCm",value:"class-Cm"},{key:"\u7C7B\u522Bc3",value:"class-c3"},{key:"\u7C7B\u522Ba0",value:"class-a0"},{key:"\u7C7B\u522Bu7",value:"class-u7"},{key:"\u7C7B\u522BZb",value:"class-Zb"},{key:"\u7C7B\u522Bzi",value:"class-zi"}],textConfigurable:!1,textCheckType:2,customFormat:"",showConfirm:!1,lowerLimitPointNum:2,upperLimitPointNum:"",preReferenceStep:0,skipWhileNoDependencies:!1,filterData:["valid","invalid"]},textToolConfig={showConfirm:!1,skipWhileNoDependencies:!1,enableTextRecognition:!1,recognitionMode:"general",configList:[{label:"\u6587\u672C",key:"text",required:!1,default:"",maxLength:1e3}],filterData:["valid","invalid"]},polygonConfig={lineType:0,lineColor:0,lowerLimitPointNum:3,edgeAdsorption:!1,drawOutsideTarget:!1,copyBackwardResult:!1,isShowOrder:!1,attributeConfigurable:!1,attributeList:[],textConfigurable:!0,textCheckType:0,customFormat:""},getConfig=e=>e==="lineTool"?lineToolConfig:e==="rectTool"?rectToolConfig:e==="tagTool"?tagToolConfig:e==="textTool"?textToolConfig:e==="polygonTool"?polygonConfig:rectToolConfig,styleDefaultConfig={toolColor:{1:{valid:{stroke:"rgba(0,0,255,0.50)",fill:"rgba(0,0,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(0,15,255,1.00)",fill:"rgba(0,15,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(0,15,255,0.80)",fill:"rgba(0,15,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},3:{valid:{stroke:"rgba(0,255,255,0.50)",fill:"rgba(0,255,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(0,212,255,1.00)",fill:"rgba(0,212,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(0,212,255,0.80)",fill:"rgba(0,212,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},5:{valid:{stroke:"rgba(0,255,0,0.50)",fill:"rgba(0,255,0,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(149,255,1.00)",fill:"rgba(149,255,0,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(149,255,0,0.80)",fill:"rgba(149,255,0,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},7:{valid:{stroke:"rgba(255,255,0,0.50)",fill:"rgba(255,255,0,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(255,230,102,1.00)",fill:"rgba(255,213,0,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(255,230,102,0.80)",fill:"rgba(255,230,102,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}},9:{valid:{stroke:"rgba(255,0,255,0.50)",fill:"rgba(255,0,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.80)"},validSelected:{stroke:"rgba(230,102,255,1.00)",fill:"rgba(213,0,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,0.60)",fill:"rgba(255,0,0,0.24)"},validHover:{stroke:"rgba(230,102,255,0.80)",fill:"rgba(230,102,255,0.64)"},invalidHover:{stroke:"rgba(255,0,0,0.50)",fill:"rgba(255,0,0,0.40)"}}},attributeColor:[{valid:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(204,204,204,1.00)",fill:"rgba(204,204,204,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(153,51,255,1.00)",fill:"rgba(153,51,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,254,51,1.00)",fill:"rgba(51,254,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,51,255,1.00)",fill:"rgba(255,51,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(204,255,51,1.00)",fill:"rgba(204,255,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,153,255,1.00)",fill:"rgba(51,153,255,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,153,51,1.00)",fill:"rgba(255,153,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(51,255,238,1.00)",fill:"rgba(51,255,238,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}},{valid:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.40)"},invalid:{stroke:"rgba(255,153,102,1.00)",fill:"rgba(255,153,102,0.40)"},validSelected:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.80)"},invalidSelected:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"},validHover:{stroke:"rgba(255,221,51,1.00)",fill:"rgba(255,221,51,0.80)"},invalidHover:{stroke:"rgba(255,0,0,1.00)",fill:"rgba(255,0,0,0.80)"}}],lineColor:{1:"rgba(102, 111, 255, 1 )",3:"rgba(102, 230, 255, 1)",5:"rgba(191, 255, 102, 1)",7:"rgba(255, 230, 102, 1)",9:"rgba(230, 102, 255, 1)"},attributeLineColor:["rgba(204, 204, 204, 1)","rgba(153, 51, 255, 1)","rgba(51, 254, 51, 1)","rgba(255, 51, 255, 1)","rgba(204, 255, 51, 1)","rgba(51, 153, 255, 1)","rgba(255, 153, 51, 1)","rgba(51, 255, 238, 1)","rgba(255, 221, 51, 1)"],color:1,width:2,opacity:9};exports.getConfig=getConfig,exports.styleDefaultConfig=styleDefaultConfig;
@@ -0,0 +1 @@
1
+ "use strict";var EKeyCode;(function(t){t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.L=76]="L",t[t.R=82]="R",t[t.Z=90]="Z",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.S=83]="S",t[t.Q=81]="Q",t[t.Delete=46]="Delete",t[t.F11=122]="F11",t[t.Space=32]="Space",t[t.Esc=27]="Esc",t[t.Left=37]="Left",t[t.Up=38]="Up",t[t.Right=39]="Right",t[t.Down=40]="Down",t[t.Enter=13]="Enter",t[t.Ctrl=17]="Ctrl",t[t.Alt=18]="Alt",t[t.Shift=16]="Shift",t[t.Tab=9]="Tab",t[t.BackSpace=8]="BackSpace"})(EKeyCode||(EKeyCode={}));var EKeyCode$1=EKeyCode;module.exports=EKeyCode$1;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var icon_canvasEdit0=require("../assets/attributeIcon/icon_canvasEdit0.svg.js"),icon_canvasEdit1=require("../assets/attributeIcon/icon_canvasEdit1.svg.js"),icon_canvasEdit2=require("../assets/attributeIcon/icon_canvasEdit2.svg.js"),icon_canvasEdit3=require("../assets/attributeIcon/icon_canvasEdit3.svg.js"),icon_canvasEdit4=require("../assets/attributeIcon/icon_canvasEdit4.svg.js"),icon_canvasEdit5=require("../assets/attributeIcon/icon_canvasEdit5.svg.js"),icon_canvasEdit6=require("../assets/attributeIcon/icon_canvasEdit6.svg.js"),icon_canvasEdit7=require("../assets/attributeIcon/icon_canvasEdit7.svg.js"),icon_canvasEdit8=require("../assets/attributeIcon/icon_canvasEdit8.svg.js"),icon_editLAN=require("../assets/attributeIcon/icon_editLAN.svg.js"),icon_editQING=require("../assets/attributeIcon/icon_editQING.svg.js"),icon_editLV=require("../assets/attributeIcon/icon_editLV.svg.js"),icon_editHUANG=require("../assets/attributeIcon/icon_editHUANG.svg.js"),icon_editFEN=require("../assets/attributeIcon/icon_editFEN.svg.js"),tool=require("./tool.js"),icon_canvasEdit_miss=require("../assets/attributeIcon/icon_canvasEdit_miss.svg.js");const NULL_ICON=icon_canvasEdit0,HEADER_HEIGHT=61,TAB_HEIGHT=80,SEARCH_HEIGHT=62,PADDING=20,TABLE_ROW_HEIGHT=55,PAGINATION_HEIGHT=55,TIPS_HEIGHT=40,FOOTER_HEIGHT=80,SIDERBAR_WIDTH=240,EDIT_STEP_WIDTH=320,THEME_COLOR="rgba(102, 111, 255, 1)",COLORS_ARRAY=["rgba(128, 12, 249, 1)","rgba(0, 255, 48, 1)","rgba(255, 136, 247, 1)","rgba(255, 226, 50, 1)","rgba(153, 66, 23, 1)","rgba(2, 130, 250, 1)","rgba(255, 35, 35, 1)","rgba(0, 255, 234, 1)"],ICON_ARRAY=[icon_canvasEdit0,icon_canvasEdit6,icon_canvasEdit3,icon_canvasEdit7,icon_canvasEdit2,icon_canvasEdit8,icon_canvasEdit5,icon_canvasEdit1,icon_canvasEdit4],BASE_ICON={1:icon_editLAN,3:icon_editQING,5:icon_editLV,7:icon_editHUANG,9:icon_editFEN},INVALID_COLOR="rgba(255, 51, 51, 1)",NULL_COLOR="rgba(204, 204, 204, 1)",FILTER_TOOL_COLOR={[tool.EFilterToolOperation.lc]:"rgba(153, 51, 255, 1)",[tool.EFilterToolOperation.rc]:"rgba(51, 153, 255, 1)",[tool.EFilterToolOperation.clc]:"rgba(46, 230, 46, 1)",[tool.EFilterToolOperation.crc]:"rgba(255, 51, 51, 1)"};exports.INVALID_ICON=icon_canvasEdit_miss,exports.BASE_ICON=BASE_ICON,exports.COLORS_ARRAY=COLORS_ARRAY,exports.EDIT_STEP_WIDTH=EDIT_STEP_WIDTH,exports.FILTER_TOOL_COLOR=FILTER_TOOL_COLOR,exports.FOOTER_HEIGHT=FOOTER_HEIGHT,exports.HEADER_HEIGHT=HEADER_HEIGHT,exports.ICON_ARRAY=ICON_ARRAY,exports.INVALID_COLOR=INVALID_COLOR,exports.NULL_COLOR=NULL_COLOR,exports.NULL_ICON=NULL_ICON,exports.PADDING=PADDING,exports.PAGINATION_HEIGHT=PAGINATION_HEIGHT,exports.SEARCH_HEIGHT=SEARCH_HEIGHT,exports.SIDERBAR_WIDTH=SIDERBAR_WIDTH,exports.TABLE_ROW_HEIGHT=TABLE_ROW_HEIGHT,exports.TAB_HEIGHT=TAB_HEIGHT,exports.THEME_COLOR=THEME_COLOR,exports.TIPS_HEIGHT=TIPS_HEIGHT;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const editStepWidth=320;exports.EPointCloudName=void 0,function(o){o.PointCloud="pointCloudTool"}(exports.EPointCloudName||(exports.EPointCloudName={})),exports.EVideoToolName=void 0,function(o){o.VideoTextTool="videoTextTool",o.VideoTagTool="videoTagTool",o.VideoClipTool="videoClipTool"}(exports.EVideoToolName||(exports.EVideoToolName={})),exports.EToolType=void 0,function(o){o[o.Rect=0]="Rect",o[o.Tag=1]="Tag"}(exports.EToolType||(exports.EToolType={})),exports.EToolName=void 0,function(o){o.Rect="rectTool",o.Tag="tagTool",o.Point="pointTool",o.PointMarker="pointMarkerTool",o.Segmentation="segmentationTool",o.Filter="filterTool",o.Text="textTool",o.Polygon="polygonTool",o.Line="lineTool",o.LineMarker="lineMarkerTool",o.Empty="emptyTool",o.FolderTag="folderTagTool",o.RectTrack="rectTrackTool",o.Face="faceTool",o.ClientAttribute="clientAttributeTool",o.OCRRelation="OCRRelationTool",o.SegmentByRect="segmentByRectTool"}(exports.EToolName||(exports.EToolName={})),exports.ECheckModel=void 0,function(o){o.Check="check"}(exports.ECheckModel||(exports.ECheckModel={})),exports.ERectPattern=void 0,function(o){o[o.nothing=0]="nothing",o[o.RectBG=1]="RectBG",o[o.showOrder=2]="showOrder"}(exports.ERectPattern||(exports.ERectPattern={}));const TOOL_NAME={[exports.EToolName.Rect]:"\u62C9\u6846",[exports.EToolName.Tag]:"\u6807\u7B7E",[exports.EToolName.Point]:"\u6807\u70B9",[exports.EToolName.PointMarker]:"\u5217\u8868\u6807\u70B9",[exports.EToolName.Segmentation]:"\u524D\u666F\u5206\u5272",[exports.EToolName.Filter]:"\u7B5B\u9009",[exports.EToolName.Text]:"\u6587\u672C",[exports.EToolName.Polygon]:"\u591A\u8FB9\u5F62",[exports.EToolName.Line]:"\u7EBF\u6761",[exports.EToolName.LineMarker]:"\u5217\u8868\u7EBF\u6761",[exports.EToolName.FolderTag]:"\u6587\u4EF6\u5939\u6807\u7B7E",[exports.EToolName.RectTrack]:"\u62C9\u6846\u8DDF\u8E2A",[exports.EToolName.Face]:"\u4EBA\u8138106\u5DE5\u5177",[exports.EToolName.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[exports.EToolName.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177",[exports.EToolName.SegmentByRect]:"\u7B97\u6CD5\u5206\u5272\u8F85\u52A9\u5DE5\u5177",[exports.EVideoToolName.VideoTextTool]:"\u89C6\u9891\u6587\u672C",[exports.EVideoToolName.VideoTagTool]:"\u89C6\u9891\u6807\u7B7E",[exports.EVideoToolName.VideoClipTool]:"\u89C6\u9891\u622A\u53D6",[exports.EPointCloudName.PointCloud]:"\u70B9\u4E91"};exports.EDependPattern=void 0,function(o){o[o.noDepend=1]="noDepend",o[o.dependOrigin=2]="dependOrigin",o[o.dependShape=3]="dependShape",o[o.dependLine=4]="dependLine",o[o.dependPolygon=5]="dependPolygon",o[o.dependPreShape=101]="dependPreShape",o[o.dependPreLine=102]="dependPreLine",o[o.dependPrePolygon=103]="dependPrePolygon"}(exports.EDependPattern||(exports.EDependPattern={})),exports.EFilterToolOperation=void 0,function(o){o.lc="leftClick",o.rc="rightClick",o.clc="ctrlLeftClick",o.crc="ctrlRightClick"}(exports.EFilterToolOperation||(exports.EFilterToolOperation={}));const OPERATION_LIST={leftClick:"\u9F20\u6807\u5DE6\u952E",rightClick:"\u9F20\u6807\u53F3\u952E",ctrlLeftClick:"ctrl + \u9F20\u6807\u5DE6\u952E",ctrlRightClick:"ctrl + \u9F20\u6807\u53F3\u952E"};exports.EAnnotationMode=void 0,function(o){o[o.Normal=1]="Normal",o[o.Modify=2]="Modify"}(exports.EAnnotationMode||(exports.EAnnotationMode={})),exports.ELineTypes=void 0,function(o){o[o.Line=0]="Line",o[o.Curve=1]="Curve"}(exports.ELineTypes||(exports.ELineTypes={})),exports.ELineColor=void 0,function(o){o[o.SingleColor=0]="SingleColor",o[o.MultiColor=1]="MultiColor"}(exports.ELineColor||(exports.ELineColor={})),exports.ESelectedType=void 0,function(o){o[o.Form=1]="Form",o[o.Json=2]="Json"}(exports.ESelectedType||(exports.ESelectedType={})),exports.EDragTarget=void 0,function(o){o[o.Point=0]="Point",o[o.Line=1]="Line",o[o.Plane=2]="Plane"}(exports.EDragTarget||(exports.EDragTarget={})),exports.EDrawPointPattern=void 0,function(o){o[o.None=0]="None",o[o.Drawing=1]="Drawing",o[o.Edit=2]="Edit"}(exports.EDrawPointPattern||(exports.EDrawPointPattern={})),exports.EPageOperator=void 0,function(o){o[o.Backward=0]="Backward",o[o.Forward=1]="Forward",o[o.JumpSkip=2]="JumpSkip",o[o.None=3]="None"}(exports.EPageOperator||(exports.EPageOperator={})),exports.EAuditStatus=void 0,function(o){o[o.Wait=0]="Wait",o[o.Pass=1]="Pass",o[o.Fail=2]="Fail",o[o.Loading=3]="Loading"}(exports.EAuditStatus||(exports.EAuditStatus={})),exports.ETextType=void 0,function(o){o[o.AnyString=0]="AnyString",o[o.Order=1]="Order",o[o.EnglishOnly=2]="EnglishOnly",o[o.NumberOnly=3]="NumberOnly",o[o.CustomFormat=4]="CustomFormat"}(exports.ETextType||(exports.ETextType={}));const TEXT_TYPE={0:"\u4EFB\u610F\u5B57\u7B26",1:"\u5E8F\u53F7",2:"\u4EC5\u82F1\u6587",3:"\u4EC5\u6570\u5B57"},TEXT_ATTRIBUTE_MAX_LENGTH=1e3,TEXT_ATTRIBUTE_LINE_HEIGHT=16,DEFAULT_TEXT_MAX_WIDTH=300,DEFAULT_FONT="normal normal 500 14px Arial";exports.EThumbnailOption=void 0,function(o){o[o.ImgList=1e3]="ImgList",o[o.TrackPrediction=1001]="TrackPrediction",o[o.ImgSearch=1002]="ImgSearch"}(exports.EThumbnailOption||(exports.EThumbnailOption={}));const CLIENT_TOOL_HEAD_TYPE={[exports.EPointCloudName.PointCloud]:"sensebeepc",[exports.EToolName.ClientAttribute]:"sensebeepc-EnumAttributeTool",[exports.EToolName.Face]:"sensebeepc-FacePointsLabellingTool",[exports.EToolName.OCRRelation]:"sensebeepc-OCRRelationTool"},CLIENT_TOOL_NAME={[exports.EPointCloudName.PointCloud]:"\u70B9\u4E91\u5BA2\u6237\u7AEF",[exports.EToolName.ClientAttribute]:"\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",[exports.EToolName.Face]:"\u4EBA\u8138106\u70B9\u5DE5\u5177",[exports.EToolName.OCRRelation]:"OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177"},SEGMENT_NUMBER=16,edgeAdsorptionScope=10;exports.EPolygonPattern=void 0,function(o){o[o.Normal=0]="Normal",o[o.Rect=1]="Rect"}(exports.EPolygonPattern||(exports.EPolygonPattern={})),exports.CLIENT_TOOL_HEAD_TYPE=CLIENT_TOOL_HEAD_TYPE,exports.CLIENT_TOOL_NAME=CLIENT_TOOL_NAME,exports.DEFAULT_FONT=DEFAULT_FONT,exports.DEFAULT_TEXT_MAX_WIDTH=DEFAULT_TEXT_MAX_WIDTH,exports.OPERATION_LIST=OPERATION_LIST,exports.SEGMENT_NUMBER=SEGMENT_NUMBER,exports.TEXT_ATTRIBUTE_LINE_HEIGHT=TEXT_ATTRIBUTE_LINE_HEIGHT,exports.TEXT_ATTRIBUTE_MAX_LENGTH=TEXT_ATTRIBUTE_MAX_LENGTH,exports.TEXT_TYPE=TEXT_TYPE,exports.TOOL_NAME=TOOL_NAME,exports.edgeAdsorptionScope=edgeAdsorptionScope,exports.editStepWidth=editStepWidth;
@@ -0,0 +1 @@
1
+ "use strict";var annotation=require("../constant/annotation.js"),defaultConfig=require("../constant/defaultConfig.js"),scheduler=require("./scheduler.js"),__async=(a,t,e)=>new Promise((o,s)=>{var i=n=>{try{l(e.next(n))}catch(r){s(r)}},c=n=>{try{l(e.throw(n))}catch(r){s(r)}},l=n=>n.done?o(n.value):Promise.resolve(n.value).then(i,c);l((e=e.apply(a,t)).next())});const loadImage=a=>new Promise((t,e)=>{const o=document.createElement("img");o.crossOrigin="Anonymous",o.onerror=s=>{console.error(s),e(o)},o.src=a,o.onload=()=>{t(o)}});class AnnotationEngine{constructor(t){this.setImgSrc=s=>__async(this,null,function*(){const i=yield loadImage(s);!i||this.setImgNode(i)});var e,o;this.container=t.container,this.size=t.size,this.toolName=t.toolName,this.imgNode=t.imgNode,this.config=(e=t.config)!=null?e:JSON.stringify(defaultConfig.getConfig(scheduler.HybridToolUtils.getTopToolName(t.toolName))),this.style=(o=t.style)!=null?o:defaultConfig.styleDefaultConfig,this.toolScheduler=new scheduler.ToolScheduler(t),this.i18nLanguage="cn",this._initToolOperation()}setToolName(t,e){this.toolName=t;const o=e||JSON.stringify(defaultConfig.getConfig(scheduler.HybridToolUtils.getTopToolName(t)));this.config=o,this._initToolOperation()}setImgNode(t,e){this.toolScheduler.setImgNode(t,e),this.imgNode=t}setSize(t){this.size=t,this.toolScheduler.setSize(t)}setStyle(t){this.style=t}_initToolOperation(){this.toolScheduler.destroyAllLayer();let t=[];const e={hiddenImg:!0};scheduler.HybridToolUtils.isSingleTool(this.toolName)?(t=[this.toolName],Object.assign(e,{hiddenImg:!1})):t=this.toolName,t.length>1&&this.toolScheduler.createOperation(void 0,this.imgNode),t.forEach((o,s)=>{const i=this.toolScheduler.createOperation(o,void 0,e);s===t.length-1&&(this.toolInstance=i)}),this.setLang(this.i18nLanguage)}setBasicInfo(t,e){this.dependToolName=t,this.basicResult=e,this.toolInstance.setDependName(t),this.toolInstance.setBasicResult(e),this.toolInstance.renderBasicCanvas()}clearBasicResult(){this.setBasicInfo()}forbidOperation(){this.toolInstance.setForbidOperation(!0)}launchOperation(){this.toolInstance.setForbidOperation(!1)}setLang(t){switch(this.i18nLanguage=t,t){case"cn":this.toolInstance.setLang(annotation.ELang.Zh);break;case"en":this.toolInstance.setLang(annotation.ELang.US);break}}setDataInjectionAtCreation(t){this.toolInstance.setDataInjectionAtCreation(t)}setRenderEnhance(t){this.toolInstance.setRenderEnhance(t)}switchLastTwoCanvas(){const t=this.toolScheduler.switchLastTwoCanvas();if(t)return this.toolInstance=t,t}get firstToolInstance(){return this.toolScheduler.getFirstToolOperation()}setCustomRenderStyle(t){this.toolInstance.setCustomRenderStyle(t)}}module.exports=AnnotationEngine;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),__defProp=Object.defineProperty,__defNormalProp=(y,u,p)=>u in y?__defProp(y,u,{enumerable:!0,configurable:!0,writable:!0,value:p}):y[u]=p,__publicField=(y,u,p)=>(__defNormalProp(y,typeof u!="symbol"?u+"":u,p),p);const _changeEvent={type:"change"},_startEvent={type:"start"},_endEvent={type:"end"};class OrbitControls extends THREE.EventDispatcher{constructor(u,p){super();__publicField(this,"listenToKeyEvents",t=>{t.addEventListener("keydown",onKeyDown),this._domElementKeyEvents=t}),p===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),p===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=u,this.domElement=p,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=Infinity,this.minZoom=0,this.maxZoom=Infinity,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-Infinity,this.maxAzimuthAngle=Infinity,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:THREE.MOUSE.ROTATE,MIDDLE:THREE.MOUSE.DOLLY,RIGHT:THREE.MOUSE.PAN},this.touches={ONE:THREE.TOUCH.ROTATE,TWO:THREE.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(_changeEvent),e.update(),i=a.NONE},this.update=function(){const t=new THREE.Vector3,n=new THREE.Quaternion().setFromUnitVectors(u.up,new THREE.Vector3(0,1,0)),r=n.clone().invert(),c=new THREE.Vector3,l=new THREE.Quaternion,L=2*Math.PI;return function(){const{position:oe}=e.object;t.copy(oe).sub(e.target),t.applyQuaternion(n),s.setFromVector3(t),e.autoRotate&&i===a.NONE&&C(ae()),e.enableDamping?(s.theta+=d.theta*e.dampingFactor,s.phi+=d.phi*e.dampingFactor):(s.theta+=d.theta,s.phi+=d.phi);let h=e.minAzimuthAngle,m=e.maxAzimuthAngle;return isFinite(h)&&isFinite(m)&&(h<-Math.PI?h+=L:h>Math.PI&&(h-=L),m<-Math.PI?m+=L:m>Math.PI&&(m-=L),h<=m?s.theta=Math.max(h,Math.min(m,s.theta)):s.theta=s.theta>(h+m)/2?Math.max(h,s.theta):Math.min(m,s.theta)),s.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,s.phi)),s.makeSafe(),s.radius*=N,s.radius=Math.max(e.minDistance,Math.min(e.maxDistance,s.radius)),e.enableDamping===!0?e.target.addScaledVector(O,e.dampingFactor):e.target.add(O),t.setFromSpherical(s),t.applyQuaternion(r),oe.copy(e.target).add(t),e.object.lookAt(e.target),e.enableDamping===!0?(d.theta*=1-e.dampingFactor,d.phi*=1-e.dampingFactor,O.multiplyScalar(1-e.dampingFactor)):(d.set(0,0,0),O.set(0,0,0)),N=1,S||c.distanceToSquared(e.object.position)>U||8*(1-l.dot(e.object.quaternion))>U?(e.dispatchEvent(_changeEvent),c.copy(e.object.position),l.copy(e.object.quaternion),S=!1,!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",ee),e.domElement.removeEventListener("pointerdown",Q),e.domElement.removeEventListener("pointercancel",J),e.domElement.removeEventListener("wheel",$),e.domElement.removeEventListener("pointermove",k),e.domElement.removeEventListener("pointerup",_),e._domElementKeyEvents!==null&&e._domElementKeyEvents.removeEventListener("keydown",Ee)};const e=this,a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=a.NONE;const U=1e-6,s=new THREE.Spherical,d=new THREE.Spherical;let N=1;const O=new THREE.Vector3;let S=!1;const f=new THREE.Vector2,b=new THREE.Vector2,P=new THREE.Vector2,E=new THREE.Vector2,g=new THREE.Vector2,T=new THREE.Vector2,M=new THREE.Vector2,w=new THREE.Vector2,D=new THREE.Vector2,o=[],R={};function ae(){return 2*Math.PI/60/60*e.autoRotateSpeed}function j(){return Math.pow(.95,e.zoomSpeed)}function C(t){d.theta-=t}function H(t){d.phi-=t}const V=function(){const t=new THREE.Vector3;return function(r,c){t.setFromMatrixColumn(c,0),t.multiplyScalar(-r),O.add(t)}}(),v=function(){const t=new THREE.Vector3;return function(r,c){e.screenSpacePanning===!0?t.setFromMatrixColumn(c,1):(t.setFromMatrixColumn(c,0),t.crossVectors(e.object.up,t)),t.multiplyScalar(r),O.add(t)}}(),A=function(){const t=new THREE.Vector3;return function(r,c){const l=e.domElement;if(e.object.isPerspectiveCamera){const{position:L}=e.object;t.copy(L).sub(e.target);let x=t.length();x*=Math.tan(e.object.fov/2*Math.PI/180),V(2*r*x/l.clientHeight,e.object.matrix),v(2*c*x/l.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(V(r*(e.object.right-e.object.left)/e.object.zoom/l.clientWidth,e.object.matrix),v(c*(e.object.top-e.object.bottom)/e.object.zoom/l.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function I(t){e.object.isPerspectiveCamera?N/=t:e.object.isOrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom*t)),e.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function z(t){e.object.isPerspectiveCamera?N*=t:e.object.isOrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/t)),e.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function Z(t){f.set(t.clientX,t.clientY)}function ie(t){M.set(t.clientX,t.clientY)}function F(t){E.set(t.clientX,t.clientY)}function se(t){b.set(t.clientX,t.clientY),P.subVectors(b,f).multiplyScalar(e.rotateSpeed);const n=e.domElement;C(2*Math.PI*P.x/n.clientHeight),H(2*Math.PI*P.y/n.clientHeight),f.copy(b),e.update()}function re(t){w.set(t.clientX,t.clientY),D.subVectors(w,M),D.y>0?I(j()):D.y<0&&z(j()),M.copy(w),e.update()}function ce(t){g.set(t.clientX,t.clientY),T.subVectors(g,E).multiplyScalar(e.panSpeed),A(T.x,T.y),E.copy(g),e.update()}function le(t){t.deltaY<0?z(j()):t.deltaY>0&&I(j()),e.update()}function ue(t){let n=!1;switch(t.code){case e.keys.UP:A(0,e.keyPanSpeed),n=!0;break;case e.keys.BOTTOM:A(0,-e.keyPanSpeed),n=!0;break;case e.keys.LEFT:A(e.keyPanSpeed,0),n=!0;break;case e.keys.RIGHT:A(-e.keyPanSpeed,0),n=!0;break}n&&(t.preventDefault(),e.update())}function X(){if(o.length===1)f.set(o[0].pageX,o[0].pageY);else{const t=.5*(o[0].pageX+o[1].pageX),n=.5*(o[0].pageY+o[1].pageY);f.set(t,n)}}function K(){if(o.length===1)E.set(o[0].pageX,o[0].pageY);else{const t=.5*(o[0].pageX+o[1].pageX),n=.5*(o[0].pageY+o[1].pageY);E.set(t,n)}}function q(){const t=o[0].pageX-o[1].pageX,n=o[0].pageY-o[1].pageY,r=Math.sqrt(t*t+n*n);M.set(0,r)}function pe(){e.enableZoom&&q(),e.enablePan&&K()}function de(){e.enableZoom&&q(),e.enableRotate&&X()}function W(t){if(o.length==1)b.set(t.pageX,t.pageY);else{const r=Y(t),c=.5*(t.pageX+r.x),l=.5*(t.pageY+r.y);b.set(c,l)}P.subVectors(b,f).multiplyScalar(e.rotateSpeed);const n=e.domElement;C(2*Math.PI*P.x/n.clientHeight),H(2*Math.PI*P.y/n.clientHeight),f.copy(b)}function G(t){if(o.length===1)g.set(t.pageX,t.pageY);else{const n=Y(t),r=.5*(t.pageX+n.x),c=.5*(t.pageY+n.y);g.set(r,c)}T.subVectors(g,E).multiplyScalar(e.panSpeed),A(T.x,T.y),E.copy(g)}function B(t){const n=Y(t),r=t.pageX-n.x,c=t.pageY-n.y,l=Math.sqrt(r*r+c*c);w.set(0,l),D.set(0,Math.pow(w.y/M.y,e.zoomSpeed)),I(D.y),M.copy(w)}function he(t){e.enableZoom&&B(t),e.enablePan&&G(t)}function me(t){e.enableZoom&&B(t),e.enableRotate&&W(t)}function Q(t){e.enabled!==!1&&(o.length===0&&(e.domElement.setPointerCapture(t.pointerId),e.domElement.addEventListener("pointermove",k),e.domElement.addEventListener("pointerup",_)),Oe(t),t.pointerType==="touch"?ge(t):fe(t))}function k(t){e.enabled!==!1&&(t.pointerType==="touch"?ye(t):be(t))}function _(t){te(t),o.length===0&&(e.domElement.releasePointerCapture(t.pointerId),e.domElement.removeEventListener("pointermove",k),e.domElement.removeEventListener("pointerup",_)),e.dispatchEvent(_endEvent),i=a.NONE}function J(t){te(t)}function fe(t){let n;switch(t.button){case 0:n=e.mouseButtons.LEFT;break;case 1:n=e.mouseButtons.MIDDLE;break;case 2:n=e.mouseButtons.RIGHT;break;default:n=-1}switch(n){case THREE.MOUSE.DOLLY:if(e.enableZoom===!1)return;ie(t),i=a.DOLLY;break;case THREE.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(e.enablePan===!1)return;F(t),i=a.PAN}else{if(e.enableRotate===!1)return;Z(t),i=a.ROTATE}break;case THREE.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(e.enableRotate===!1)return;Z(t),i=a.ROTATE}else{if(e.enablePan===!1)return;F(t),i=a.PAN}break;default:i=a.NONE}i!==a.NONE&&e.dispatchEvent(_startEvent)}function be(t){if(e.enabled!==!1)switch(i){case a.ROTATE:if(e.enableRotate===!1)return;se(t);break;case a.DOLLY:if(e.enableZoom===!1)return;re(t);break;case a.PAN:if(e.enablePan===!1)return;ce(t);break}}function $(t){e.enabled===!1||e.enableZoom===!1||i!==a.NONE||(t.preventDefault(),e.dispatchEvent(_startEvent),le(t),e.dispatchEvent(_endEvent))}function Ee(t){e.enabled===!1||e.enablePan===!1||ue(t)}function ge(t){switch(ne(t),o.length){case 1:switch(e.touches.ONE){case THREE.TOUCH.ROTATE:if(e.enableRotate===!1)return;X(),i=a.TOUCH_ROTATE;break;case THREE.TOUCH.PAN:if(e.enablePan===!1)return;K(),i=a.TOUCH_PAN;break;default:i=a.NONE}break;case 2:switch(e.touches.TWO){case THREE.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;pe(),i=a.TOUCH_DOLLY_PAN;break;case THREE.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;de(),i=a.TOUCH_DOLLY_ROTATE;break;default:i=a.NONE}break;default:i=a.NONE}i!==a.NONE&&e.dispatchEvent(_startEvent)}function ye(t){switch(ne(t),i){case a.TOUCH_ROTATE:if(e.enableRotate===!1)return;W(t),e.update();break;case a.TOUCH_PAN:if(e.enablePan===!1)return;G(t),e.update();break;case a.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;he(t),e.update();break;case a.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;me(t),e.update();break;default:i=a.NONE}}function ee(t){e.enabled!==!1&&t.preventDefault()}function Oe(t){o.push(t)}function te(t){delete R[t.pointerId];for(let n=0;n<o.length;n++)if(o[n].pointerId==t.pointerId){o.splice(n,1);return}}function ne(t){let n=R[t.pointerId];n===void 0&&(n=new THREE.Vector2,R[t.pointerId]=n),n.set(t.pageX,t.pageY)}function Y(t){const n=t.pointerId===o[0].pointerId?o[1]:o[0];return R[n.pointerId]}e.domElement.addEventListener("contextmenu",ee),e.domElement.addEventListener("pointerdown",Q),e.domElement.addEventListener("pointercancel",J),e.domElement.addEventListener("wheel",$,{passive:!1}),this.update()}}exports.OrbitControls=OrbitControls;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three");class PCDLoader extends THREE.Loader{constructor(p){super(p);this.littleEndian=!0}load(p,m,f,w){const i=this,l=new THREE.FileLoader(i.manager);l.setPath(i.path),l.setResponseType("arraybuffer"),l.setRequestHeader(i.requestHeader),l.setWithCredentials(i.withCredentials),l.load(p,function(d){try{m(i.parse(d))}catch(h){w?w(h):console.error(h),i.manager.itemError(p)}},f,w)}parse(p){function m(o,e){const a=o.length,n=new Uint8Array(e);let r=0,t=0,s,u,c;do if(s=o[r++],s<1<<5){if(s++,t+s>e)throw new Error("Output buffer is not large enough");if(r+s>a)throw new Error("Invalid compressed data");do n[t++]=o[r++];while(--s)}else{if(u=s>>5,c=t-((s&31)<<8)-1,r>=a)throw new Error("Invalid compressed data");if(u===7&&(u+=o[r++],r>=a))throw new Error("Invalid compressed data");if(c-=o[r++],t+u+2>e)throw new Error("Output buffer is not large enough");if(c<0)throw new Error("Invalid compressed data");if(c>=t)throw new Error("Invalid compressed data");do n[t++]=n[c++];while(--u+2)}while(r<a);return n}function f(o){const e={},a=o.search(/[\n\r]data\s(\S*)\s/i),n=/[\n\r]data\s(\S*)\s/i.exec(o.slice(a-1));if(e.data=n[1],e.headerLen=n[0].length+a,e.str=o.slice(0,e.headerLen),e.str=e.str.replace(/#.*/gi,""),e.version=/version (.*)/i.exec(e.str),e.fields=/fields (.*)/i.exec(e.str),e.size=/size (.*)/i.exec(e.str),e.type=/type (.*)/i.exec(e.str),e.count=/count (.*)/i.exec(e.str),e.width=/width (.*)/i.exec(e.str),e.height=/height (.*)/i.exec(e.str),e.viewpoint=/viewpoint (.*)/i.exec(e.str),e.points=/points (.*)/i.exec(e.str),e.version!==null&&(e.version=parseFloat(e.version[1])),e.fields=e.fields!==null?e.fields[1].split(" "):[],e.type!==null&&(e.type=e.type[1].split(" ")),e.width!==null&&(e.width=parseInt(e.width[1])),e.height!==null&&(e.height=parseInt(e.height[1])),e.viewpoint!==null&&(e.viewpoint=e.viewpoint[1]),e.points!==null&&(e.points=parseInt(e.points[1],10)),e.points===null&&(e.points=e.width*e.height),e.size!==null&&(e.size=e.size[1].split(" ").map(function(t){return parseInt(t,10)})),e.count!==null)e.count=e.count[1].split(" ").map(function(t){return parseInt(t,10)});else{e.count=[];for(let t=0,s=e.fields.length;t<s;t++)e.count.push(1)}e.offset={};let r=0;for(let t=0,s=e.fields.length;t<s;t++)e.data==="ascii"?e.offset[e.fields[t]]=t:(e.offset[e.fields[t]]=r,r+=e.size[t]*e.count[t]);return e.rowSize=r,e}const w=THREE.LoaderUtils.decodeText(new Uint8Array(p)),i=f(w),l=[],d=[],h=[];if(i.data==="ascii"){const{offset:o}=i,a=w.slice(i.headerLen).split(`
2
+ `);for(let n=0,r=a.length;n<r;n++){if(a[n]==="")continue;const t=a[n].split(" ");if(o.x!==void 0&&(l.push(parseFloat(t[o.x])),l.push(parseFloat(t[o.y])),l.push(parseFloat(t[o.z]))),this.genColorByCoord){const u=this.genColorByCoord(parseFloat(t[o.x]),parseFloat(t[o.y]),parseFloat(t[o.z])).map(c=>c/255);h.push(...u)}o.normal_x!==void 0&&(d.push(parseFloat(t[o.normal_x])),d.push(parseFloat(t[o.normal_y])),d.push(parseFloat(t[o.normal_z])))}}if(i.data==="binary_compressed"){const o=new Uint32Array(p.slice(i.headerLen,i.headerLen+8)),e=o[0],a=o[1],n=m(new Uint8Array(p,i.headerLen+8,e),a),r=new DataView(n.buffer),{offset:t}=i;for(let s=0;s<i.points;s++)if(t.x!==void 0&&(l.push(r.getFloat32(i.points*t.x+i.size[0]*s,this.littleEndian)),l.push(r.getFloat32(i.points*t.y+i.size[1]*s,this.littleEndian)),l.push(r.getFloat32(i.points*t.z+i.size[2]*s,this.littleEndian))),t.normal_x!==void 0&&(d.push(r.getFloat32(i.points*t.normal_x+i.size[4]*s,this.littleEndian)),d.push(r.getFloat32(i.points*t.normal_y+i.size[5]*s,this.littleEndian)),d.push(r.getFloat32(i.points*t.normal_z+i.size[6]*s,this.littleEndian))),this.genColorByCoord){const c=this.genColorByCoord(r.getFloat32(i.points*t.x+i.size[0]*s,this.littleEndian),r.getFloat32(i.points*t.y+i.size[0]*s,this.littleEndian),r.getFloat32(i.points*t.z+i.size[0]*s,this.littleEndian)).map(x=>x/255);h.push(...c)}}if(i.data==="binary"){const o=new DataView(p,i.headerLen),{offset:e}=i;for(let a=0,n=0;a<i.points;a++,n+=i.rowSize)if(e.x!==void 0&&(l.push(o.getFloat32(n+e.x,this.littleEndian)),l.push(o.getFloat32(n+e.y,this.littleEndian)),l.push(o.getFloat32(n+e.z,this.littleEndian))),e.normal_x!==void 0&&(d.push(o.getFloat32(n+e.normal_x,this.littleEndian)),d.push(o.getFloat32(n+e.normal_y,this.littleEndian)),d.push(o.getFloat32(n+e.normal_z,this.littleEndian))),this.genColorByCoord){const t=this.genColorByCoord(o.getFloat32(n+e.x,this.littleEndian),o.getFloat32(n+e.y,this.littleEndian),o.getFloat32(n+e.z,this.littleEndian)).map(s=>s/255);h.push(...t)}}const g=new THREE.BufferGeometry;l.length>0&&g.setAttribute("position",new THREE.Float32BufferAttribute(l,3)),d.length>0&&g.setAttribute("normal",new THREE.Float32BufferAttribute(d,3)),h.length>0&&g.setAttribute("color",new THREE.Float32BufferAttribute(h,3)),g.computeBoundingSphere();const y=new THREE.PointsMaterial({size:.01});return h.length>0?y.vertexColors=!0:y.color.setHex(16777215),new THREE.Points(g,y)}genColorByCoord(p,m,f){return f<=0?[128,128,128]:f<5?[255,0,0]:f<10?[0,255,0]:[0,0,255]}}exports.PCDLoader=PCDLoader;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),tool=require("../../constant/tool.js"),CanvasScheduler=require("../../newCore/CanvasScheduler.js"),index=require("./index.js"),pointCloud2dOperation=require("../toolOperation/pointCloud2dOperation.js");const createEmptyImage=e=>{const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const o=t.getContext("2d");return o?(o.fillStyle="black",o.fillRect(0,0,e.width,e.height),t.toDataURL()):""};class PointCloudAnnotation{constructor({size:t,container:o,pcdPath:n,polygonOperationProps:l}){this.updatePolygonList=(C,c)=>{let r=C.map(p=>{const{polygon2d:m}=this.pointCloudInstance.getBoxTopPolygon2DCoordinate(p);return{id:p.id,sourceID:"",pointList:m,isRect:!0}});c&&(r=r.concat(c)),this.pointCloud2dOperation.setResult(r)};const h=this.getDefaultOrthographic(t),g=createEmptyImage(t),d=new Image;d.src=g;const a=new CanvasScheduler.CanvasScheduler({container:o}),s=new index.PointCloud({container:o,noAppend:!0,isOrthographicCamera:!0,orthographicParams:h});n&&s.loadPCDFile(n),a.createCanvas(s.renderer.domElement);const u={container:o,size:t,config:'{ "textConfigurable": false }',imgNode:d,isAppend:!1};l&&Object.assign(u,l);const i=new pointCloud2dOperation(u);i.eventBinding(),i.setPattern(tool.EPolygonPattern.Rect),a.createCanvas(i.canvas,{size:t}),this.pointCloud2dOperation=i,this.pointCloudInstance=s,this.canvasScheduler=a}getDefaultOrthographic(t){return{left:-t.width/2,right:t.width/2,top:t.height/2,bottom:-t.height/2,near:100,far:-100}}initSize(t){this.pointCloudInstance.initOrthographicCamera(this.getDefaultOrthographic(t)),this.pointCloudInstance.init(),this.pointCloudInstance.initCamera(),this.pointCloudInstance.render();const o=createEmptyImage(t),n=new Image;n.src=o,n.onload=()=>{this.pointCloud2dOperation.setImgNode(n),this.pointCloud2dOperation.setCanvasSize(t),this.pointCloud2dOperation.initImgPos()}}addPolygonListOnTopView(t){const o=lbUtils.PointCloudUtils.getBoxParamsFromResultList(t),n=lbUtils.PointCloudUtils.getPolygonListFromResultList(t);this.updatePolygonList(o,n)}updateData(t,o,n){!this.pointCloud2dOperation||!this.pointCloudInstance||(this.pointCloudInstance.loadPCDFile(t,n==null?void 0:n.radius),this.addPolygonListOnTopView(o))}initAllPosition(){this.pointCloudInstance.updateTopCamera(),this.pointCloud2dOperation.initPosition()}clearAllData(){this.pointCloudInstance.clearPointCloudAndRender(),this.pointCloud2dOperation.clearResult()}}exports.PointCloudAnnotation=PointCloudAnnotation;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PCDLoader=require("./PCDLoader.js");class PointCloudCache{constructor(){this.MAX_SIZE=50,this.cacheList=[],this.loadPCDFile=e=>new Promise((s,a)=>{var i;const n=(i=this.pointsMap.get(e))==null?void 0:i.clone();if(n){s(n);return}if(this.cacheList.length>this.MAX_SIZE){const t=this.cacheList.shift();t&&this.pointsMap.delete(t.src)}this.cacheList.push({src:e}),this.pcdLoader.load(e,t=>{this.pointsMap.set(e,t.clone()),s(t)},()=>{},t=>{a(t)})}),this.pcdLoader=new PCDLoader.PCDLoader,this.pointsMap=new Map}static getInstance(){return this.instance==null&&(this.instance=new PointCloudCache),this.instance}}exports.PointCloudCache=PointCloudCache;
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),lbUtils=require("@labelbee/lb-utils"),highlightWorker=require("../../_virtual/highlightWorker.js"),filterBoxWorker=require("../../_virtual/filterBoxWorker.js"),polygonTool=require("../../utils/tool/polygonTool.js"),uuid=require("../../utils/uuid.js"),PCDLoader=require("./PCDLoader.js"),OrbitControls=require("./OrbitControls.js"),cache=require("./cache.js");function _interopNamespace(p){if(p&&p.__esModule)return p;var t=Object.create(null);return p&&Object.keys(p).forEach(function(e){if(e!=="default"){var i=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:function(){return p[e]}})}}),t.default=p,Object.freeze(t)}var THREE__namespace=_interopNamespace(THREE),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(p,t,e)=>t in p?__defProp(p,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):p[t]=e,__spreadValues=(p,t)=>{for(var e in t||(t={}))__hasOwnProp.call(t,e)&&__defNormalProp(p,e,t[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(t))__propIsEnum.call(t,e)&&__defNormalProp(p,e,t[e]);return p},__spreadProps=(p,t)=>__defProps(p,__getOwnPropDescs(t)),__async=(p,t,e)=>new Promise((i,o)=>{var a=s=>{try{r(e.next(s))}catch(c){o(c)}},n=s=>{try{r(e.throw(s))}catch(c){o(c)}},r=s=>s.done?i(s.value):Promise.resolve(s.value).then(a,n);r((e=e.apply(p,t)).next())});const DEFAULT_DISTANCE=30;new highlightWorker;class PointCloud{constructor({container:t,noAppend:e,isOrthographicCamera:i,orthographicParams:o,backgroundColor:a="black"}){this.zAxisLimit=10,this.initCameraPosition=new THREE__namespace.Vector3(-1,0,10),this.isOrthographicCamera=!1,this.pointsUuid="",this.pointCloudObjectName="pointCloud",this.rangeObjectName="range",this.showDirection=!0,this.AddBoxToSense=(n,r=16777215)=>{var s;const c=(s=n.id)!=null?s:uuid();this.removeObjectByName(c);const{center:h,width:l,height:d,depth:y,rotation:x}=n,m=new THREE__namespace.Group,u=new THREE__namespace.BoxGeometry(l,d,y),g=new THREE__namespace.MeshBasicMaterial({color:"blue"}),w=new THREE__namespace.Mesh(u,g),f=new THREE__namespace.BoxHelper(w,r),M=this.generateBoxArrow(n),v=this.generateBoxTrackID(n);m.add(f),m.add(M),m.add(v),m.position.set(h.x,h.y,h.z),m.rotation.set(0,0,x),m.name=c,this.scene.add(m)},this.overridePointShader=n=>{n.vertexShader=`
2
+ attribute float sizes;
3
+ attribute float visibility;
4
+ varying float vVisible;
5
+ ${n.vertexShader}`.replace("gl_PointSize = size;",`gl_PointSize = size;
6
+ vVisible = visibility;
7
+ `),n.fragmentShader=`
8
+ varying float vVisible;
9
+ ${n.fragmentShader}`.replace("#include <clipping_planes_fragment>",`
10
+ if (vVisible < 0.5) discard;
11
+ #include <clipping_planes_fragment>`)},this.loadPCDFile=(n,r)=>__async(this,null,function*(){const s=yield this.cacheInstance.loadPCDFile(n);s.name=this.pointCloudObjectName,this.renderPointCloud(s,r)}),this.loadPCDFileByBox=(n,r,s)=>__async(this,null,function*(){const c=l=>__async(this,null,function*(){const{width:d=0,height:y=0,depth:x=0}=s!=null?s:{},m=yield this.filterPointsByBox(__spreadProps(__spreadValues({},r),{width:r.width+d,height:r.height+y,depth:r.depth+x}),l);if(!m){console.error("filter Error");return}this.clearPointCloud();const u=new THREE__namespace.Points(m.geometry,l.material);u.name=this.pointCloudObjectName,this.scene.add(u),this.render()}),h=yield this.cacheInstance.loadPCDFile(n);c(h)}),this.generateBoxArrow=({width:n,depth:r})=>{const s=new THREE__namespace.Vector3(1,0,0),c=new THREE__namespace.Vector3(-n/2,0,-r/2),h=n,l=16776960,d=new THREE__namespace.ArrowHelper(s,c,h,l);return d.visible=this.showDirection,d},this.generateBoxTrackID=n=>{const r=new THREE__namespace.Texture(this.getTextCanvas(n.trackID.toString()));r.needsUpdate=!0;const s=new THREE__namespace.SpriteMaterial({map:r,depthWrite:!1}),c=new THREE__namespace.Sprite(s);return c.scale.set(5,5,5),c.position.set(-n.width/2,0,n.depth/2+.5),c},this.applyZAxisPoints=n=>{this.zAxisLimit=n,this.filterZAxisPoints(),this.render()},this.updatePointSize=n=>{const r=this.scene.getObjectByName(this.pointCloudObjectName);if(!r)return;const s=r.material.size;n?r.material.size=Math.min(s*1.2,10):r.material.size=Math.max(s/1.2,1),this.render()},this.container=t,this.renderer=new THREE__namespace.WebGLRenderer({antialias:!0}),this.backgroundColor=a,i&&o?(this.isOrthographicCamera=!0,this.camera=new THREE__namespace.OrthographicCamera(o.left,o.right,o.top,o.bottom,o.near,o.far)):this.camera=new THREE__namespace.PerspectiveCamera(30,this.containerWidth/this.containerHeight,1,1e3),this.initCamera(),this.scene=new THREE__namespace.Scene,this.controls=new OrbitControls.OrbitControls(this.camera,this.renderer.domElement),this.pcdLoader=new PCDLoader.PCDLoader,this.axesHelper=new THREE__namespace.AxesHelper(1e3),this.scene.add(this.camera),e||t.appendChild(this.renderer.domElement),this.init(),this.cacheInstance=cache.PointCloudCache.getInstance()}get containerWidth(){return this.container.clientWidth}get containerHeight(){return this.container.clientHeight}setInitCameraPosition(t){this.initCameraPosition=t}initOrthographicCamera(t){if(this.camera.type!=="OrthographicCamera")return;const{left:e,right:i,top:o,bottom:a,near:n,far:r}=t;this.camera.left=e,this.camera.right=i,this.camera.top=o,this.camera.bottom=a,this.camera.near=n,this.camera.far=r,this.camera.updateProjectionMatrix()}initPerspectiveCamera(){this.camera.type==="PerspectiveCamera"&&(this.camera.fov=30,this.camera.aspect=this.containerWidth/this.containerHeight,this.camera.near=1,this.camera.far=1e3,this.camera.updateProjectionMatrix())}initCamera(){const{camera:t}=this;if(this.isOrthographicCamera){const{x:e,y:i,z:o}=this.initCameraPosition;t.position.set(e,i,o)}else t.position.set(-1,0,500);t.up.set(0,0,1)}initControls(){const{controls:t}=this,e=[0,0,0];t.target=new THREE__namespace.Vector3(...e),t.addEventListener("change",()=>{this.render()}),t.maxPolarAngle=Math.PI/2,t.update()}initRenderer(){const{renderer:t}=this;t.setPixelRatio(window.devicePixelRatio),t.setSize(this.containerWidth,this.containerHeight)}init(){const{scene:t}=this;t.background=new THREE__namespace.Color(this.backgroundColor),this.initControls(),this.initRenderer()}removeObjectByName(t){const e=this.scene.getObjectByName(t);e&&e.removeFromParent()}transferKitti2Matrix(t,e,i){const o=lbUtils.MatrixUtils.transferMatrix34FromKitti2Three(t),a=lbUtils.MatrixUtils.transferMatrix33FromKitti2Three(e),n=lbUtils.MatrixUtils.transferMatrix34FromKitti2Three(i),r=this.createThreeMatrix4(o),s=this.createThreeMatrix4(a),c=this.createThreeMatrix4(n);return{composeMatrix4:c.clone().premultiply(s).premultiply(r),PM:r,RM:s,TM:c}}pointCloudLidar2image(t,e){const i=lbUtils.PointCloudUtils.getAllViewData(t),{P:o,R:a,T:n}=e,{composeMatrix4:r}=this.transferKitti2Matrix(o,a,n);return i.map(c=>({type:c.type,pointList:c.pointList.map(h=>this.rotatePoint(h,t.center,t.rotation)).map(h=>this.lidar2image(h,r)).filter(h=>h!==void 0)}))}lidar2image(t,e){const o=new THREE__namespace.Vector4(t.x,t.y,t.z).applyMatrix4(e);if(o.z<0)return;const a=1/o.z,n=new THREE__namespace.Matrix4().set(a,0,0,0,0,a,0,0,0,0,a,0,0,0,0,1);return o.applyMatrix4(n)}generateBox(t,e=16777215){this.AddBoxToSense(t,e),this.render()}generateBoxes(t){t.forEach(e=>{this.generateBox(e)}),this.render()}getOrthographicCamera(t){const{center:e,width:i,height:o}=t,a=10,n=e.x-i/2-a,r=e.x-i/2+a,s=e.y+o/2+a,c=e.y-o/2-a,h=100,l=-100,d=500/h;return{left:n,right:r,top:s,bottom:c,near:h,far:l,zoom:d}}updateCameraByBox(t,e){const{center:i,width:o,height:a,depth:n,rotation:r}=t,s=this.getCameraVector(i,r,{width:o,height:a,depth:n},e);return this.updateCamera(s,i),s}updateOrthoCamera(t,e){const i=this.updateCameraByBox(t,e);return this.camera.zoom=1,this.camera.updateProjectionMatrix(),{cameraPositionVector:i}}updateTopCamera(){this.camera.zoom=1,this.initCamera(),this.initControls(),this.camera.updateProjectionMatrix(),this.render()}updateCamera(t,e){this.camera.position.set(t.x,t.y,t.z),this.controls.target=new THREE__namespace.Vector3(e.x,e.y,e.z),this.controls.update()}resetCamera(){this.updateCamera({x:-1,y:0,z:500},{x:0,y:0,z:0})}createThreeMatrix4(t){return new THREE__namespace.Matrix4().set(...t)}rotatePoint(t,e,i){var o;const a=new THREE__namespace.Vector3(t.x,t.y,(o=t==null?void 0:t.z)!=null?o:1),n=new THREE__namespace.Matrix4().makeRotationZ(i),r=new THREE__namespace.Matrix4().makeTranslation(e.x,e.y,e.z),s=new THREE__namespace.Matrix4().makeTranslation(-e.x,-e.y,-e.z);return a.clone().applyMatrix4(s).applyMatrix4(n).applyMatrix4(r)}getCuboidFromPointCloudBox(t){const{center:e,width:i,height:o,depth:a,rotation:n}=t,r=[{x:e.x+i/2,y:e.y+o/2},{x:e.x+i/2,y:e.y-o/2},{x:e.x-i/2,y:e.y-o/2},{x:e.x-i/2,y:e.y+o/2}].map(h=>{const l=this.rotatePoint(h,e,n);return{x:l.x,y:l.y}}),s=e.z+a/2,c=e.z-a/2;return{polygonPointList:r,zMax:s,zMin:c}}filterPointsByBox(t,e){if(!e){const i=this.scene.getObjectByName(this.pointCloudObjectName);if(!i)return console.error("There is no corresponding point cloud object"),Promise.resolve(void 0);e=i}if(window.Worker){const{zMin:i,zMax:o,polygonPointList:a}=this.getCuboidFromPointCloudBox(t),n=e.geometry.attributes.position.array,r=e.geometry.attributes.color.array,s={boxParams:t,zMin:i,zMax:o,polygonPointList:a,color:r,position:n};return new Promise(c=>{const h=new filterBoxWorker;h.postMessage(s),h.onmessage=l=>{const{color:d,position:y,num:x}=l.data,m=new THREE__namespace.BufferGeometry;m.setAttribute("position",new THREE__namespace.Float32BufferAttribute(y,3)),m.setAttribute("color",new THREE__namespace.Float32BufferAttribute(d,3)),m.computeBoundingSphere(),c({geometry:m,num:x})}})}return Promise.resolve(void 0)}getCameraVector(t,e,i,o=lbUtils.EPerspectiveView.Front,a=DEFAULT_DISTANCE){let n=lbUtils.PerspectiveShiftUtils.frontViewMatrix4(a);switch(o){case lbUtils.EPerspectiveView.Front:break;case lbUtils.EPerspectiveView.Back:n=lbUtils.PerspectiveShiftUtils.backViewMatrix4(a);break;case lbUtils.EPerspectiveView.Left:n=lbUtils.PerspectiveShiftUtils.leftViewMatrix4(a);break;case lbUtils.EPerspectiveView.Right:n=lbUtils.PerspectiveShiftUtils.rightViewMatrix4(a);break;case lbUtils.EPerspectiveView.Top:n=lbUtils.PerspectiveShiftUtils.topViewMatrix4(a);break;case lbUtils.EPerspectiveView.LFT:n=lbUtils.PerspectiveShiftUtils.leftFrontTopViewMatrix4(a,i);break;case lbUtils.EPerspectiveView.RBT:n=lbUtils.PerspectiveShiftUtils.rightBackTopViewMatrix4(a,i);break}const r=this.createThreeMatrix4(n),s=new THREE__namespace.Matrix4().makeTranslation(-t.x,-t.y,-t.z),c=new THREE__namespace.Matrix4().makeTranslation(t.x,t.y,t.z),h=new THREE__namespace.Matrix4().makeRotationZ(e);return new THREE__namespace.Vector3(t.x,t.y,t.z).clone().applyMatrix4(r).applyMatrix4(s).applyMatrix4(h).applyMatrix4(c)}createRange(t){this.removeObjectByName(this.rangeObjectName);const i=new THREE__namespace.EllipseCurve(0,0,t,t,0,2*Math.PI,!1,0).getPoints(50),o=new THREE__namespace.BufferGeometry().setFromPoints(i),a=new THREE__namespace.LineBasicMaterial({color:16711680}),n=new THREE__namespace.Line(o,a);return n.name=this.rangeObjectName,n}renderPointCloud(t,e){t.material.size=1,t.name=this.pointCloudObjectName;const i=new THREE__namespace.PointsMaterial({vertexColors:!0});if(i.onBeforeCompile=this.overridePointShader,e){const a=this.createRange(e);this.scene.add(a)}this.pointsUuid=t.uuid,t.material=i,this.filterZAxisPoints(t);const o=this.scene.getObjectByName(this.pointCloudObjectName);o?(o.geometry.attributes.color=t.geometry.attributes.color,o.geometry.attributes.position=t.geometry.attributes.position,o.geometry.attributes.color.needsUpdate=!0,o.geometry.attributes.position.needsUpdate=!0,o.uuid=t.uuid):this.scene.add(t),this.render()}clearPointCloud(){this.removeObjectByName(this.pointCloudObjectName)}clearPointCloudAndRender(){this.clearPointCloud(),this.render()}highlightOriginPointCloud(t){}setShowDirection(t){this.showDirection=t,this.scene.children.forEach(e=>{e.type==="Group"&&e.children.forEach(i=>{i.type==="ArrowHelper"&&(i.visible=t)})}),this.render()}getTextCanvas(t){const e=document.createElement("canvas"),i=e.getContext("2d");return i&&(i.font=`${50}px " bold`,i.fillStyle="white",i.textAlign="center",i.textBaseline="middle",i.fillText(t,e.width/2,e.height/2)),e}getSensesPointZAxisInPolygon(t){const e=this.scene.children.find(a=>a.uuid===this.pointsUuid);let i=0,o=0;if(e&&(e==null?void 0:e.geometry)){const a=e==null?void 0:e.geometry.attributes.position;for(let n=0;n<a.count;n++){const r=n*3,s=a.getX(r),c=a.getY(r),h=a.getZ(r);polygonTool.isInPolygon({x:s,y:c},t)&&h&&(o=Math.max(h,o),i=Math.min(h,i))}}return{maxZ:o,minZ:i}}getBasicCoordinate2Canvas(t){const e=this.containerWidth/2,i=this.containerHeight/2;return{x:t.x*e+e,y:t.y*i+i,z:t.z}}get basicCoordinate2CanvasMatrix4(){const t=this.containerWidth/2,e=this.containerHeight/2;return new THREE__namespace.Matrix4().set(t,0,0,t,0,e,0,e,0,0,1,0,0,0,0,1)}getCanvas2BasicCoordinate(t){const e=this.containerWidth/2,i=this.containerHeight/2;return new THREE__namespace.Vector3(t.x/e-e/2,-(t.y/i-i/2),1)}getPolygonSidePoints(t){const{center:{x:e,y:i,z:o},height:a,width:n,depth:r}=t,s={x:e+n/2,y:i+a/2,z:o-r/2},c={x:e+n/2,y:i+a/2,z:o+r/2},h={x:e-n/2,y:i+a/2,z:o+r/2},l={x:e-n/2,y:i+a/2,z:o-r/2};return[s,c,h,l]}getPolygonBackPoints(t){const{center:{x:e,y:i,z:o},height:a,width:n,depth:r}=t,s={x:e-n/2,y:i+a/2,z:o+r/2},c={x:e-n/2,y:i+a/2,z:o-r/2},h={x:e-n/2,y:i-a/2,z:o-r/2},l={x:e-n/2,y:i-a/2,z:o+r/2};return[s,c,h,l]}getPolygonTopPoints(t){const{center:{x:e,y:i,z:o},height:a,width:n,depth:r}=t,s={x:e+n/2,y:i+a/2,z:o+r/2},c={x:e+n/2,y:i-a/2,z:o+r/2},h={x:e-n/2,y:i-a/2,z:o+r/2},l={x:e-n/2,y:i+a/2,z:o+r/2};return[s,c,h,l]}getModelTransformationMatrix(t){const{center:{x:e,y:i,z:o},rotation:a}=t,n=new THREE__namespace.Matrix4().makeTranslation(-e,-i,-o),r=new THREE__namespace.Matrix4().makeTranslation(e,i,o),s=new THREE__namespace.Matrix4().makeRotationZ(a);return new THREE__namespace.Matrix4().multiply(r).multiply(s).multiply(n)}getBoxSidePolygon2DCoordinate(t){return this.getBoxPolygon2DCoordinate(t,lbUtils.EPerspectiveView.Left)}getBoxBackPolygon2DCoordinate(t){return this.getBoxPolygon2DCoordinate(t,lbUtils.EPerspectiveView.Back)}boxParams2ViewPolygon(t,e){switch(e){case lbUtils.EPerspectiveView.Left:return this.getPolygonSidePoints(t);case lbUtils.EPerspectiveView.Back:return this.getPolygonBackPoints(t);default:return this.getPolygonTopPoints(t)}}getBoxPolygon2DCoordinate(t,e){const i=this.boxParams2ViewPolygon(t,e),{width:o,height:a}=t,n=new THREE__namespace.Matrix4().premultiply(this.camera.matrixWorldInverse).premultiply(this.camera.projectionMatrix),r=new THREE__namespace.Matrix4().premultiply(this.getModelTransformationMatrix(t)).premultiply(n).premultiply(this.basicCoordinate2CanvasMatrix4);this.sideMatrix=r;const s=i.map(l=>new THREE__namespace.Vector3(l.x,l.y,l.z)).map(l=>l.applyMatrix4(this.sideMatrix)),c=this.containerWidth/o,h=this.containerHeight/a;return{polygon2d:s,zoom:Math.min(c,h)/2}}getBoxTopPolygon2DCoordinate(t){const{width:e,height:i}=t,a=this.getPolygonTopPoints(t).map(s=>new THREE__namespace.Vector3(s.x,s.y,s.z)).map(s=>s.applyMatrix4(this.getModelTransformationMatrix(t))).map(s=>({x:s.y,y:s.x})).map(s=>({x:-(s.x-this.containerWidth/2),y:-(s.y-this.containerHeight/2)})),n=this.containerWidth/e,r=this.containerHeight/i;return{polygon2d:a,zoom:Math.min(n,r)/2}}getNewBoxBySideUpdate(t,e,i,o){const a=new THREE__namespace.Matrix4().makeRotationZ(o.rotation),n=new THREE__namespace.Vector3(-t.x,0,0).applyMatrix4(a);let r=o;return r.center={x:r.center.x+n.x,y:r.center.y+n.y,z:r.center.z-t.z},r=__spreadProps(__spreadValues({},r),{width:r.width+e,height:r.height,depth:r.depth+i}),{newBoxParams:r}}getNewBoxByBackUpdate(t,e,i,o){const a=new THREE__namespace.Matrix4().makeRotationZ(o.rotation),n=new THREE__namespace.Vector3(0,-t.x,0).applyMatrix4(a);let r=o;return r.center={x:r.center.x+n.x,y:r.center.y+n.y,z:r.center.z-t.z},r=__spreadProps(__spreadValues({},r),{width:r.width,height:r.height+e,depth:r.depth+i}),{newBoxParams:r}}getNewBoxBySideUpdateByPoints(t,e,i,o){var a;const n=(a=this.sideMatrix)==null?void 0:a.invert();if(!this.sideMatrix||!n){console.error("No sideMatrix");return}this.camera.zoom=1,this.camera.updateProjectionMatrix();const r=t.map(u=>new THREE__namespace.Vector3(u.x,u.y,u.z)).map(u=>u.applyMatrix4(n)),[s,c,h,l]=r,d=Math.max(Math.abs(s.x-h.x),Math.abs(s.x-c.x)),x=c.add(l).applyMatrix3(new THREE__namespace.Matrix3().set(1/2,0,0,0,1/2,0,0,0,1/2)).clone().applyMatrix3(new THREE__namespace.Matrix3().set(-1,0,0,0,-1,0,0,0,-1)).add(new THREE__namespace.Vector3(o.center.x,o.center.y,o.center.z));return{newBoxParams:__spreadProps(__spreadValues({},o),{center:{x:o.center.x-x.x,y:o.center.y-x.y,z:o.center.z-i},width:d,height:o.height,depth:o.depth+e,rotation:o.rotation})}}filterZAxisPoints(t){const e=t||this.scene.children.find(i=>i.uuid===this.pointsUuid);if(e){const{attributes:i}=e.geometry,{position:o}=i,a=[],{count:n}=o;for(let r=0;r<n;r++){const s=o.getZ(r);a.push(s>this.zAxisLimit?0:1)}e.geometry.setAttribute("visibility",new THREE__namespace.Float32BufferAttribute(a,1)),e.geometry.attributes.visibility.needsUpdate=!0}}render(){this.renderer.render(this.scene,this.camera)}}exports.PointCloud=PointCloud;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var defaultConfig=require("../constant/defaultConfig.js"),EnhanceCommonToolUtils=require("../utils/tool/EnhanceCommonToolUtils.js"),basicToolOperation=require("./toolOperation/basicToolOperation.js");const createEmptyImage=o=>{const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const i=t.getContext("2d");return i?(i.fillStyle="transparent",i.fillRect(0,0,o.width,o.height),t.toDataURL()):""},arraySwap=(o,t,i)=>{const e=o[t];return o[t]=o[i],o[i]=e,o},_HybridToolUtils=class{static isSingleTool(o){return!this.isHybridTool(o)}static isHybridTool(o){return Array.isArray(o)}};let HybridToolUtils=_HybridToolUtils;HybridToolUtils.getTopToolName=o=>_HybridToolUtils.isHybridTool(o)?o[o.length-1]:o;class ToolScheduler{constructor(t){this.toolOperationList=[],this.toolOperationDom=[];var i,e;this.init(),this.container=t.container,this.size=t.size,this.imgNode=t.imgNode,this.config=(i=t.config)!=null?i:JSON.stringify(defaultConfig.getConfig(HybridToolUtils.getTopToolName(t.toolName))),this.style=(e=t.style)!=null?e:defaultConfig.styleDefaultConfig}setImgNode(t,i){this.toolOperationList.forEach(e=>{e.setImgNode(t,i)})}setSize(t){this.toolOperationList.forEach(i=>{i.setSize(t)})}syncPosition(t,i,e,n){this.toolOperationList.forEach(r=>{n!==r&&(r.setCurrentPos(t),r.setZoom(i),r.setImgInfo(e),r.renderBasicCanvas(),r.render())})}get defaultSize(){var t,i;return{width:((t=this.imgNode)==null?void 0:t.width)||this.size.width,height:((i=this.imgNode)==null?void 0:i.height)||this.size.height}}createDom(){const{width:t,height:i}=this.defaultSize,e=window.document.createElement("div");e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width=`${t}px`,e.style.height=`${i}px`;const n=this.toolOperationList.length+1;return e.style.zIndex=`${n}`,e}getEmptyImage(t,i){const e=createEmptyImage({width:t,height:i}),n=new Image;return n.src=e,n}createOperation(t,i,e){var n;const{width:r,height:u}=this.defaultSize,l=this.createDom(),g=this.getEmptyImage(r,u),c={container:l,size:this.size,config:(n=this==null?void 0:this.config)!=null?n:"{}",drawOutSideTarget:!1,style:this.style,imgNode:i||g,hiddenImg:!!t};e&&Object.assign(c,e);let s;if(!t)s=new basicToolOperation.BasicToolOperation(c),l.style.zIndex="0",s.init();else{const a=EnhanceCommonToolUtils.getCurrentOperation(t);if(!a)return;s=new a(c)}return s==null||s.init(),s.canvas.id=t!=null?t:"basicCanvas",s.on("dragMove",({currentPos:a,zoom:h,imgInfo:d})=>{this.syncPosition(a,h,d,s)}),s.on("renderZoom",(a,h,d)=>{a&&h&&this.syncPosition(h,a,d,s)}),t?(this.container.appendChild(l),this.toolOperationList.push(s),this.toolOperationDom.push(l),s):(this.container.insertBefore(l,this.container.childNodes[0]),this.toolOperationList.unshift(s),this.toolOperationDom.unshift(l),s)}switchLastTwoCanvas(){if(this.toolOperationDom.length<3){console.error("switchLastTwoCanvas is just used the layer which has 3 canvas");return}const t=this.toolOperationDom.length,i=t-1,e=t-2,n=this.toolOperationDom[i],r=this.toolOperationDom[e];if(!(!r||!n))return n.style.zIndex=`${i-1}`,r.style.zIndex=`${i}`,this.toolOperationList[i].clearActiveStatus(),this.toolOperationList[i].clearCursorLine(),this.toolOperationList[i].render(),this.toolOperationList=arraySwap(this.toolOperationList,i,e),this.toolOperationDom=arraySwap(this.toolOperationDom,i,e),this.toolOperationList[i]}getFirstToolOperation(){return this.toolOperationList.length>1?this.toolOperationList[1]:this.toolOperationList[0]}destroyAllLayer(){this.toolOperationList.forEach(t=>{t.destroyCanvas(),this.init()})}init(){this.toolOperationList=[],this.toolOperationDom=[]}}exports.HybridToolUtils=HybridToolUtils,exports.ToolScheduler=ToolScheduler;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _=require("lodash"),tool=require("../../constant/tool.js"),ActionsHistory=require("../../utils/ActionsHistory.js"),uuid=require("../../utils/uuid.js"),keyCode=require("../../constant/keyCode.js"),MathUtils=require("../../utils/MathUtils.js"),basicToolOperation=require("./basicToolOperation.js"),LineToolUtils=require("../../utils/tool/LineToolUtils.js"),polygonTool=require("../../utils/tool/polygonTool.js"),CommonToolUtils=require("../../utils/tool/CommonToolUtils.js"),CanvasUtils=require("../../utils/tool/CanvasUtils.js"),DrawUtils=require("../../utils/tool/DrawUtils.js"),StyleUtils=require("../../utils/tool/StyleUtils.js"),AttributeUtils=require("../../utils/tool/AttributeUtils.js"),textAttributeClass=require("./textAttributeClass.js");function _interopDefaultLegacy(d){return d&&typeof d=="object"&&"default"in d?d:{default:d}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(d,e,t)=>e in d?__defProp(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t,__spreadValues=(d,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(d,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(d,t,e[t]);return d},__spreadProps=(d,e)=>__defProps(d,__getOwnPropDescs(e)),EStatus;(function(d){d[d.Create=0]="Create",d[d.Active=1]="Active",d[d.None=2]="None"})(EStatus||(EStatus={}));const SEGMENT_NUMBER=16,LINE_ORDER_OFFSET={x:0,y:20},POINT_RADIUS=3,POINT_ACTIVE_RADIUS=5,INNER_POINT_RADIUS=2;class LineToolOperation extends basicToolOperation.BasicToolOperation{constructor(e){super(e);this.drawActivatedLine=(t,i,n)=>{const s=___default.default.cloneDeep(this.activeLine);if(!s||s.length===0)return;const r=this.isActiveLineValid();let o;const h=this.selectedID?this.lineList.find(l=>l.id===this.selectedID):void 0;h?o=h.order:o=this.nextOrder();const a=this.getLineColorByAttribute({attribute:this.defaultAttribute,valid:!!r});s.map(l=>Object.assign(l,this.coordUtils.getRenderCoord(l))),this.updateActiveArea(),this.drawLine(s,t,a,!0,!0),this.drawLineNumber(s[0],o,a,"",this.defaultAttribute,r),t&&this.isCreate&&this.arc(t,POINT_RADIUS,a),this.cursor&&!this.selectedPoint&&!n&&!this.isShift&&this.arc(this.cursor,POINT_ACTIVE_RADIUS,a)},this.drawHoverPoint=t=>{if(!this.isMousedown&&t&&this.isLineSelected){const i=this.getPointList(this.activeLine),n=this.activeLine.find(r=>LineToolUtils.default.calcDistance(this.coordUtils.getRenderCoord(r),t)<=POINT_ACTIVE_RADIUS);let s;!n&&this.activeLine&&(s=this.findNearestPoint(i,t)),this.hoverPointID=n?n.id:void 0,this.cursor=n||s==null?void 0:s.point}},this.lineList=[],this.activeLine=[],this.coordsInsideActiveArea=!1,this.hoverLineSegmentIndex=-1,this.isShift=!1,this.isReference=!1,this.drawCurveLine=(t,i,n,s=!0,r=!1,o)=>{const h=polygonTool.createSmoothCurvePointsFromPointList(i,SEGMENT_NUMBER);t.save(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=n.color,s&&(t.lineWidth=n.lineWidth),r&&LineToolUtils.default.setReferenceCtx(t),i.forEach(({specialEdge:a},l)=>{const u=h.splice(0,SEGMENT_NUMBER+1);t.save(),t.beginPath(),o===l&&(t.lineWidth=4),u.forEach(({x:c,y:f},g)=>{const L=g>0?"lineTo":"moveTo";a&&LineToolUtils.default.setSpecialEdgeStyle(t),t[L](c,f)}),t.stroke(),t.restore()}),t.restore()},this.drawLine=(t,i,n,s=!1,r=!1)=>{const o=i?t.concat(i):t,h={color:n,lineWidth:r?1:this.lineStyle.lineWidth};this.isCurve?LineToolUtils.default.drawCurveLine(this.ctx,o,h,!s,this.isReference,r?this.hoverLineSegmentIndex:-1):this.drawStraightLine(o,h,r),s&&t.forEach(a=>{var l,u;const c=a.id,f=c&&[this.hoverPointID,(l=this.selectedPoint)==null?void 0:l.id].includes(c)?POINT_ACTIVE_RADIUS:POINT_RADIUS;this.arc(a,f,n),[this.hoverPointID,(u=this.selectedPoint)==null?void 0:u.id].includes(c)||this.arc(a,INNER_POINT_RADIUS,"white")})},this.drawStraightLine=(t,i,n=!1)=>{const{ctx:s}=this;s&&(s.save(),s.lineCap="round",s.lineJoin="round",s.strokeStyle=i.color,s.lineWidth=i.lineWidth,this.isReference&&LineToolUtils.default.setReferenceCtx(s),t.forEach((r,o)=>{if(s.beginPath(),o>0){const h=t[o-1];s.save(),(h==null?void 0:h.specialEdge)&&LineToolUtils.default.setSpecialEdgeStyle(s),n&&this.hoverLineSegmentIndex+1===o&&(s.lineWidth=4),s.moveTo(h.x,h.y),s.lineTo(r.x,r.y),s.stroke(),s.restore()}}),s.restore())},this.drawLines=()=>{try{const t=___default.default.cloneDeep(this.attributeFilteredLines);if(this.isHidden)return;t.forEach(i=>{if(i.id!==this.selectedID&&i.pointList){i.pointList.map(h=>Object.assign(h,this.coordUtils.getRenderCoord(h)));const{order:n,label:s}=i,r=n,o=i&&this.getLineColorByAttribute(i);this.drawLine(i.pointList,void 0,o,!1),this.drawLineNumber(i.pointList[0],r,o,s,i.attribute,i.valid),i.id!==this.textEditingID&&this.drawLineTextAttribute(i.pointList[1],o,i==null?void 0:i.textAttribute)}})}catch(t){console.error(t,"\u7EBF\u6761\u5DE5\u5177\u6570\u636E\u89E3\u6790\u9519\u8BEF"),this.lineList=[],this.clearCanvas()}},this.render=t=>{super.render(),this.drawLines(),this.drawActivatedLine(t,void 0,!0),this.renderTextAttribute(),this.renderCursorLine(this.getLineColor(this.defaultAttribute))},this.moveLineInPolygon=(t,i)=>{var n;if(!Array.isArray(this.activeLine))return!1;((n=this.activeLine)==null?void 0:n.every(r=>this.isInBasicPolygon({x:r.x+t,y:r.y+i})))&&(this.lineDragging=!0,this.moveActiveArea(t,i))},this.moveLineInRectRange=(t,i,n,s)=>{if(this.activeArea===void 0)return;const{top:r,left:o,right:h,bottom:a}=this.activeArea,l=[o,h].map(v=>___default.default.isNumber(v)?v+t:0),u=[r,a].map(v=>___default.default.isNumber(v)?v+i:0),c=o>=0&&h&&MathUtils.default.isInRange(l,n),f=r>=0&&a&&MathUtils.default.isInRange(u,s),g=c?t:0,L=f?i:0;this.lineDragging=!0,this.moveActiveArea(g,L)},this.onRightClick=t=>{if(this.cursor=void 0,this.isCreate){if(this.isLinePointsNotEnough())return;this.stopLineCreating(!0);return}this.setActiveArea(this.getCoordinate(t),!0),this.emit("contextmenu")},this.updateSelectedAttributeAfterHistoryChanged=()=>{if(this.selectedID){const t=this.lineList.find(n=>n.id===this.selectedID),i=t==null?void 0:t.attribute;typeof i=="string"&&(this.defaultAttribute=i,this.updateAttribute(i),this.render())}},this.onLeftClick=t=>{const i=this.getCoordinate(t),{lineDragging:n}=this;if(this.lineDragging=!1,this.isSpaceKey)return;if(this.isNone&&t.ctrlKey){const r=this.findHoverLine(i);r&&this.setInvalidLine(r.id);return}if(this.isLinePointsExceed())return;const s=this.getNextPoint(t,i);if(this.isCreate||this.isNone){this.setCreatStatusAndAddPoint(s);return}if(this.isActive){if(n)return;if(this.isMouseCoordOutsideActiveArea()){this.setNoneStatus(!1),this.setCreatStatusAndAddPoint(s);return}if(t.shiftKey){this.updateLineSegmentSpecial(i);return}if(this.coordsInsideActiveArea&&t.ctrlKey){this.setInvalidLine(this.selectedID);return}this.addLinePointToActiveLine()}},this.onDblclick=()=>{},this.onKeyUp=t=>{if(super.onKeyUp(t),this.isShift=!1,this.hoverLineSegmentIndex=-1,t.keyCode===keyCode.Esc){this.stopLineCreating(!1);return}if(this.isActive){if(t.keyCode===keyCode.Delete){this.deleteLine();return}if(t.keyCode===keyCode.F){this.setInvalidLine(this.selectedID);return}if(t.keyCode===keyCode.Space){this.continueToEdit();return}}this.keyboardEventWhileLineCreating(t)},this.onRightDblClick=t=>{super.onRightDblClick(t);const i=this.getCoordinate(t);if(this.isActive){const n=this.findHoveredPoint(i);if(n){this.deleteSelectedLinePoint(n.id);return}this.deleteSelectedLine(i)}},this.setReference=t=>{this.isReference=t},this.pointsWithinRange=t=>!(this.lowerLimitPointNum&&t<this.lowerLimitPointNum||this.upperLimitPointNum&&t>this.upperLimitPointNum),this.setLineList=t=>{const i=t.length!==this.lineListLen;this.lineList=t,i&&this.emit("updatePageNumber")},this.textChange=t=>{this.config.textConfigurable===!1||!this.selectedID||(this.updateSelectedTextAttribute(t),this.emit("selectedChange"))},this.status=2,this.isMousedown=!1,this.lineDragging=!1,this.isLineValid=!0,this.setConfig(e.config),this.prevAxis={x:0,y:0},this.textEditingID="",this.updateSelectedTextAttribute=this.updateSelectedTextAttribute.bind(this),this.getCurrentSelectedData=this.getCurrentSelectedData.bind(this),this.actionsHistory=new ActionsHistory,this.dependToolConfig={lineType:tool.ELineTypes.Line}}get isLineSelected(){return this.selectedID&&this.activeLine}get selectedLinePoints(){return this.activeLine?this.getPointList(this.activeLine):[]}get isCreate(){return this.status===0}get isActive(){return this.status===1}get isNone(){return this.status===2}get isCurve(){return this.config.lineType===tool.ELineTypes.Curve}get isMultipleColor(){return this.config.lineColor===tool.ELineColor.MultiColor}get imageSize(){return this.rotate%180==0?this.basicImgInfo:{width:this.basicImgInfo.height,height:this.basicImgInfo.width}}get lineListLen(){return this.lineList.length}get edgeAdsorptionEnabled(){return this.edgeAdsorption&&!this.isCurve&&this.lineListLen>0}get attributeConfigurable(){return this.config.attributeConfigurable}get isTextConfigurable(){return this.config.textConfigurable}get isDependPolygon(){return this.dependToolName===tool.EToolName.Polygon}get isDependRect(){return this.dependToolName===tool.EToolName.Rect}get isCurrentAttributeLocked(){return this.attributeLockList.includes(this.defaultAttribute)}get attributeFilteredLines(){return this.attributeLockList.length>0?this.lineList.filter(e=>this.attributeLockList.includes((e==null?void 0:e.attribute)||"")):this.lineList}get enableOutOfTarget(){return this.config.enableOutOfTarget}get showOrder(){return this.config.showOrder}get edgeAdsorption(){return this.config.edgeAdsorption}get attributeList(){return this.config.attributeList}get lowerLimitPointNum(){return this.config.lowerLimitPointNum}get upperLimitPointNum(){return this.config.upperLimitPointNum}get textCheckType(){return this.config.textCheckType}get customFormat(){return this.config.customFormat}get dataList(){return this.lineList}get hasActiveLine(){return this.activeLine&&this.activeLine.length>0}get viewPortLines(){const e=CanvasUtils.getViewPort(this.canvas,this.currentPos,this.zoom);return this.isHidden?[]:this.attributeFilteredLines.filter(t=>{var i;return(i=t==null?void 0:t.pointList)==null?void 0:i.some(n=>CanvasUtils.inViewPort(n,e))})}get lineStyle(){return{lineWidth:this.style.width,color:this.getLineColor(this.defaultAttribute),opacity:this.style.opacity}}get selectedText(){var e,t;return(t=(e=this.lineList.find(i=>i.id===this.selectedID))==null?void 0:e.textAttribute)!=null?t:""}get currentPageResult(){return this.lineList}updateStatus(e,t=!1){if(e!==this.status){if(t){let i="";this.textCheckType===tool.ETextType.Order&&this.isTextConfigurable&&(i=AttributeUtils.default.getTextAttribute(this.lineList,this.textCheckType)),this.emit("updateText",i)}this.status=e,this.lineStatusChanged()}}isInBasicPolygon(e){var t,i;return polygonTool.isInPolygon(e,((t=this.basicResult)==null?void 0:t.pointList)||[],(i=this.dependToolConfig)==null?void 0:i.lineType)}getPolygonPointList(){if(!this.basicResult)return[];const{pointList:e}=this.basicResult,{lineType:t}=this.dependToolConfig;return t===tool.ELineTypes.Curve?polygonTool.createSmoothCurvePoints(e.reduce((i,n)=>[...i,n.x,n.y],[]),.5,!0,20):e}getNextCoordByRenderCoord(e){return this.getNextCoordByAbsCoord(this.coordUtils.getAbsCoord(e))}getNextCoordByAbsCoord(e){var t;const i=(t=this.activeLine)==null?void 0:t.slice(-1)[0];return i?this.coordUtils.getNextCoordByDependTool(e,i):e}pointInLine(e,t,i){return e.filter(n=>n).length<2?!1:e.some((n,s)=>{if(s===0)return!1;const r=this.coordUtils.getRenderCoord(e[s-1]),o=this.coordUtils.getRenderCoord(n);return LineToolUtils.default.isInLine(t,r,o,i)})}arc(e,t=POINT_RADIUS,i){var n,s,r,o,h,a;if(this.ctx){const{x:l,y:u}=e;(n=this.ctx)==null||n.save(),(s=this.ctx)==null||s.beginPath(),this.ctx.fillStyle=i||this.lineStyle.color,(r=this.ctx)==null||r.arc(l,u,t,0,360),(o=this.ctx)==null||o.closePath(),(h=this.ctx)==null||h.fill(),(a=this.ctx)==null||a.restore()}}renderActiveArea(){if(this.isActive&&this.activeArea&&this.ctx){const{top:e,left:t,right:i,bottom:n}=this.activeArea,{x:s,y:r}=this.coordUtils.getRenderCoord({x:t,y:e});this.ctx.save(),this.ctx.beginPath(),this.ctx.strokeStyle="#B3B8FF",this.ctx.rect(s,r,(i-t)*this.zoom,(n-e)*this.zoom),this.ctx.stroke(),this.ctx.restore()}}addLinePoint(e){var t,i,n,s;this.arc(e),(t=this.activeLine)==null||t.push(__spreadProps(__spreadValues({},e),{id:uuid()})),((i=this.activeLine)==null?void 0:i.length)===1?(n=this.actionsHistory)==null||n.initRecord(this.activeLine):(s=this.actionsHistory)==null||s.pushHistory(this.activeLine),this.render()}setCreatStatusAndAddPoint(e,t=!1){this.updateStatus(0,t),this.addLinePoint(e)}isActiveLineValid(){var e;return this.selectedID?(e=this.lineList.find(t=>t.id===this.selectedID))==null?void 0:e.valid:this.isLineValid}nextOrder(){return this.lineListLen===0?1:this.lineList.slice(-1)[0].order+1}getLineColorByAttribute(e,t=!1){return StyleUtils.getStrokeAndFill(this.getColor(e.attribute),e.valid,{isSelected:t}).stroke}updateActiveArea(){this.activeArea=this.getActiveArea(),this.renderActiveArea()}getActiveArea(){return this.hasActiveLine?MathUtils.default.calcViewportBoundaries(this.activeLine,this.isCurve,SEGMENT_NUMBER,this.zoom):void 0}drawLineNumber(e,t=1,i,n="",s,r=!0){var o,h,a;if((this.showOrder||this.attributeConfigurable)&&this.ctx){let l=this.showOrder?t.toString():`${n}`;if(this.attributeConfigurable){const u=s?(a=(h=(o=this.attributeList)==null?void 0:o.find(c=>c.value===s))==null?void 0:h.key)!=null?a:s:"";l=[l,`${!r&&u?"\u65E0\u6548":""}${u}`].filter(c=>c).join("_")}this.drawText(e,l,i)}}drawLineTextAttribute(e,t,i){if(e&&i)return this.drawText(e,i,t,200)}drawText(e,t,i,n){var s,r;this.ctx&&((s=this.ctx)==null||s.save(),this.ctx.font="italic bold 14px SourceHanSansCN-Regular",this.ctx.fillStyle=i,this.ctx.strokeStyle=i,this.ctx.shadowColor="rgba(0, 0, 0, 0.6)",this.ctx.shadowOffsetY=2,this.ctx.shadowBlur=4,n?DrawUtils.wrapText(this.canvas,t,e.x-LINE_ORDER_OFFSET.x,e.y-LINE_ORDER_OFFSET.y,n):this.ctx.fillText(t,e.x-LINE_ORDER_OFFSET.x,e.y-LINE_ORDER_OFFSET.y),(r=this.ctx)==null||r.restore())}moveActiveArea(e,t){this.activeArea&&(this.activeArea=Object.assign(this.activeArea,{top:this.activeArea.top+t,bottom:this.activeArea.bottom+t,right:this.activeArea.right+e,left:this.activeArea.left+e})),this.activeLine&&(this.activeLine.map(i=>Object.assign(i,{x:i.x+e,y:i.y+t})),this.updateLines())}findHoveredPoint(e){if(!!this.activeLine)return this.activeLine.find(t=>{const i=this.coordUtils.getRenderCoord(t);return LineToolUtils.default.calcDistance(i,e)<=POINT_ACTIVE_RADIUS})}findHoverLine(e){return ___default.default.cloneDeep(this.lineList).reverse().find(({pointList:i})=>{const n=i?this.getPointList(i):[],s=this.getLineWidthScope();return n.some((r,o)=>{if(o===0)return!1;const h=this.coordUtils.getRenderCoord(r),a=this.coordUtils.getRenderCoord(n[o-1]);return LineToolUtils.default.isInLine(e,h,a,s)})})}getAdsorptionPoint(e){let t,i,n;return ___default.default.cloneDeep(this.lineList).reverse().forEach(({pointList:s,id:r})=>{if(r===this.selectedID||!s||(s==null?void 0:s.length)<2)return;const o=this.findNearestPoint(s,e);if(o){if(o.minDistance===0){t=o.point;return}(i===void 0||o.minDistance<i)&&(t=o.point,i=o.minDistance)}}),n||t}findNearestPoint(e,t,i=7){let n;const s=i;for(let r=1;r<=e.length-1;r++){const o=this.coordUtils.getRenderCoord(e[r]),h=this.coordUtils.getRenderCoord(e[r-1]),{length:a,footPoint:l}=MathUtils.default.getFootOfPerpendicular(t,o,h),u=LineToolUtils.default.calcTwoPointDistance(o,t),c=LineToolUtils.default.calcTwoPointDistance(h,t);if(u<=i*2){n=o,i=0;break}if(c<=i*2){n=h,i=0;break}a<i&&(n=l,i=a)}return n?{point:n,minDistance:s}:void 0}getPointList(e){return this.isCurve?polygonTool.createSmoothCurvePointsFromPointList(e,SEGMENT_NUMBER):e}moveSelectedLine(e){const t=(e.x-this.prevAxis.x)/this.zoom,i=(e.y-this.prevAxis.y)/this.zoom;if(this.enableOutOfTarget){this.lineDragging=!0,this.moveActiveArea(t,i);return}if(this.isDependPolygon){this.moveLineInPolygon(t,i);return}let n=[0,this.imageSize.width],s=[0,this.imageSize.height];if(this.isDependRect){const{x:r,y:o,width:h,height:a}=this.basicResult;n=[r,r+h],s=[o,o+a]}this.moveLineInRectRange(t,i,n,s)}moveSelectPoint(e){if(!this.selectedPoint)return;const t=e.x-this.prevAxis.x,i=e.y-this.prevAxis.y,n=(this.selectedPoint?this.selectedPoint.x:0)+t/this.zoom,s=(this.selectedPoint?this.selectedPoint.y:0)+i/this.zoom,r={x:n,y:s};Object.assign(this.selectedPoint,this.getNextCoordByAbsCoord(r)),this.updateLines(),this.render()}getCoordByConfig(e,t){var i;const n=!!e.shiftKey,s=e.altKey;if(((i=this.activeLine)==null?void 0:i.length)>0&&n){const r=this.activeLine.slice(-1)[0];return LineToolUtils.default.getVHPoint(r,t,this.coordUtils.getAbsCoord(t),this.coordUtils.getRenderCoord(r))}return this.edgeAdsorptionEnabled&&!s?this.getAdsorptionPoint(t):t}getNextPoint(e,t){const i=this.getCoordByConfig(e,t)||t;return this.enableOutOfTarget?i:this.getNextCoordByRenderCoord(i)}lineHover(){this.render()}mouseMoveHandler(e){const t=this.getCoordinate(e),i=e.which===1;if(this.isCreate){this.hasActiveLine&&this.renderNextPoint(e,t);return}if(this.isNone&&(this.lineHover(),this.edgeAdsorptionEnabled&&!e.altKey)){const n=this.getAdsorptionPoint(t);n&&this.arc(n)}if(this.isActive){if(this.isMousedown&&i){if(this.selectedPoint){this.moveSelectPoint(t);return}if(this.coordsInsideActiveArea){this.moveSelectedLine(t),this.drawActivatedLine(void 0,void 0,!0);return}}this.drawHoverPoint(t),this.render()}}onMouseMove(e){if(super.onMouseMove(e)||this.forbidMouseOperation||!this.imgInfo)return;const t=this.getCoordinate(e);this.mouseMoveHandler(e),this.prevAxis=t}setActiveArea(e,t=!1){const i=this.findHoverLine(e);if(i){const n=this.lineList.findIndex(o=>o.id===(i==null?void 0:i.id)),s=MathUtils.default.calcViewportBoundaries((i==null?void 0:i.pointList)||[],this.isCurve,SEGMENT_NUMBER,this.zoom),r=this.lineList[n];this.updateStatus(1),this.setActiveLine(r.pointList),this.setSelectedLineID(r.id),this.activeArea=s,this.updateLineAttributes(r)}else t&&this.setNoneStatus();this.render()}setActiveLineByID(e){const t=this.lineList.find(i=>i.id===e);if(t){const i=MathUtils.default.calcViewportBoundaries((t==null?void 0:t.pointList)||[],this.isCurve,SEGMENT_NUMBER,this.zoom);this.updateStatus(1),this.setActiveLine(t.pointList),this.setSelectedLineID(t.id),this.activeArea=i,this.updateLineAttributes(t)}this.render()}setActiveLine(e){this.activeLine=e?___default.default.cloneDeep(e):void 0}historyChanged(e){const t=`${e}Enabled`;if(this.isCreate){if(this.actionsHistory&&this.actionsHistory[t]){const i=this.actionsHistory&&this.actionsHistory[e]();this.setActiveLine(i),this.render()}return}if(this.history&&this.history[t]){const i=this.history[e](),n=i==null?void 0:i.find(s=>s.id===this.selectedID);this.lineList=i,this.selectedID&&n?this.setActiveLine(n==null?void 0:n.pointList):this.setNoneStatus(),this.render()}this.emit("dataUpdated",this.lineList)}undo(){this.historyChanged("undo"),this.updateSelectedAttributeAfterHistoryChanged()}redo(){this.historyChanged("redo"),this.updateSelectedAttributeAfterHistoryChanged()}isCoordInsideTarget(e){if(this.isDependPolygon)return this.isInBasicPolygon(e);if(this.isDependRect){const{x:t,y:i,width:n,height:s}=this.basicResult,r=[t,t+n],o=[i,i+s];return MathUtils.default.isInRange(e.x,r)&&MathUtils.default.isInRange(e.y,o)}return MathUtils.default.isInRange(e.x,[0,this.imageSize.width])&&MathUtils.default.isInRange(e.y,[0,this.imageSize.height])}getPointInsertIndex(e,t){if(e&&this.activeLine){const i=this.getPointList(this.activeLine);return this.activeLine.length===2?1:this.activeLine.findIndex((n,s)=>{if(s>0){const r=this.activeLine?this.activeLine[s-1]:void 0,o=this.isCurve?i.slice((s-1)*(SEGMENT_NUMBER+1),s*(SEGMENT_NUMBER+1)):[r,n];return this.pointInLine(o,e,t||this.getLineWidthScope())}return!1})}return-1}getLineWidthScope(){return this.lineStyle.lineWidth}isMouseCoordOutsideActiveArea(){return!this.coordsInsideActiveArea&&!this.selectedPoint}isLinePointsExceed(){return this.isCreate&&this.activeLine&&this.upperLimitPointNum&&~~this.upperLimitPointNum<=this.activeLine.length}isLinePointsNotEnough(){var e;return this.activeLine&&((e=this.activeLine)==null?void 0:e.length)<this.lowerLimitPointNum}updateLineSegmentSpecial(e){const t=this.getPointInsertIndex(e,2)-1;if(t>-1){const i=this.activeLine[t];i.specialEdge=!i.specialEdge,this.hoverLineSegmentIndex=-1,this.render()}}addLinePointToActiveLine(){var e;const t=this.getPointInsertIndex(this.cursor),i=this.pointsWithinRange(this.activeLine.length+1);this.cursor&&t>-1&&i&&(this.activeLine.splice(t,0,__spreadProps(__spreadValues({},this.coordUtils.getAbsCoord(this.cursor)),{id:uuid()})),this.updateLines(),(e=this.history)==null||e.pushHistory(this.lineList),this.render(),this.cursor=void 0)}onMouseDown(e){if(super.onMouseDown(e)||this.forbidMouseOperation||!this.imgInfo)return;const t=this.getCoordinate(e);if(this.isMousedown=!0,this.prevAxis=t,e.which===3){this.cursor=void 0;return}this.selectedPoint=this.findHoveredPoint(t),this.coordsInsideActiveArea=this.isActive&&this.activeArea?LineToolUtils.default.inArea(this.activeArea,this.coordUtils.getAbsCoord(t)):!1,this.lineDragging=!1}lineHasChanged(){const e=this.lineList.find(t=>t.id===this.selectedID);return e?JSON.stringify(e.pointList)!==JSON.stringify(this.activeLine):!1}updateLines(){const e=this.lineList.find(t=>t.id===this.selectedID);e&&(e.pointList=___default.default.cloneDeep(this.activeLine),this.emit("dataUpdated",this.lineList))}onMouseUp(e){const t=()=>{this.isMousedown=!1,this.hoverPointID=void 0,this.cursor=void 0,this.selectedPoint=void 0};if(this.hoverPointID=void 0,super.onMouseUp(e)||this.forbidMouseOperation||!this.imgInfo){t();return}e.which===1&&this.onLeftClick(e),e.which===3&&this.onRightClick(e),t()}isTextValid(e){return AttributeUtils.default.textAttributeValidate(this.textCheckType,this.customFormat,e)}createLineData(){const e=uuid(),t={pointList:___default.default.cloneDeep(this.activeLine),id:e,valid:this.isLineValid,order:this.nextOrder()};return t.attribute=this.defaultAttribute,t}stopLineCreating(e=!0){var t,i,n,s;const r=this.selectedID?!0:!!this.isTextConfigurable;let o;if(e){if(this.selectedID){const h=this.lineList.find(a=>a.id===this.selectedID);o=this.selectedID,h&&(h.pointList=___default.default.cloneWith(this.activeLine),___default.default.isEqual(h.pointList,(t=this.history)==null?void 0:t.pushHistory(this.lineList))||(i=this.history)==null||i.pushHistory(this.lineList))}else if(this.isCreate&&this.activeLine&&this.activeLine.length>1){const h=this.createLineData();o=h.id,this.setLineList([...this.lineList,h]),(n=this.history)==null||n.pushHistory(this.lineList)}}r?this.setActiveStatus(o):this.setNoneStatus(),(s=this.actionsHistory)==null||s.empty(),this.emit("dataUpdated",this.lineList),this.render()}setActiveStatus(e){const t=e?this.lineList.find(i=>i.id===e):void 0;if(t){const i=t==null?void 0:t.pointList;this.updateStatus(1),this.setActiveLine(i),this.setSelectedLineID(e)}else this.setNoneStatus()}setNoneStatus(e=!0){e&&this.updateStatus(2),this.activeLine=[],this.setSelectedLineID(void 0),this.activeArea=void 0,this.isLineValid=!0,this.cursor=void 0}setKeyDownStatus(e,t){this.isShift=t!=null?t:e.keyCode===keyCode.Shift}continueToEdit(){var e;this.updateStatus(0),this.cursor=void 0,(e=this.actionsHistory)==null||e.pushHistory(this.activeLine),this.render()}setInvalidLineOnCreating(e){if(this.selectedID&&e.keyCode!==keyCode.Ctrl||!this.isCreate)return;const t=!e.ctrlKey;this.selectedID?this.setInvalidLine(this.selectedID,t,!1):this.isLineValid=t}onKeyDown(e){if(super.onKeyDown(e),this.setKeyDownStatus(e),e.keyCode===keyCode.Z&&!e.ctrlKey&&this.toggleIsHide(),e.keyCode===keyCode.Shift&&this.render(),e.keyCode===keyCode.Tab){e.preventDefault(),this.selectToNextLine(e);return}if(this.isCreate&&this.keyboardEventWhileLineCreating(e),this.config.attributeConfigurable){const t=AttributeUtils.default.getAttributeByKeycode(e.keyCode,this.config.attributeList);t!==void 0&&this.setDefaultAttribute(t)}}selectToNextLine(e){const t=CommonToolUtils.getNextSelectedRectIDByEvent(this.viewPortLines.map(i=>{var n,s,r,o;return __spreadProps(__spreadValues({},i),{x:(s=(n=i.pointList[0])==null?void 0:n.x)!=null?s:0,y:(o=(r=i.pointList[0])==null?void 0:r.y)!=null?o:0})}),e,this.selectedID);t&&this.setActiveLineByID(t.id)}keyboardEventWhileLineCreating(e){!this.isCreate||(e.keyCode===keyCode.Ctrl&&this.setInvalidLineOnCreating(e),[keyCode.Shift,keyCode.Alt].includes(e.keyCode)&&this.renderNextPoint(e,this.prevAxis))}renderNextPoint(e,t){const i=this.coordUtils.getRenderCoord(this.getNextPoint(e,t));this.render(i)}deleteSelectedLine(e){const t=MathUtils.default.calcViewportBoundaries(this.activeLine,this.isCurve,SEGMENT_NUMBER,this.zoom);LineToolUtils.default.inArea(t,this.coordUtils.getAbsCoord(e))&&this.deleteLine()}deleteSelectedLinePoint(e){var t;this.pointsWithinRange(this.activeLine.length-1)&&e&&(this.setActiveLine(this.activeLine.filter(n=>n.id!==e)),this.updateLines(),(t=this.history)==null||t.pushHistory(this.lineList)),this.cursor=void 0,this.render()}deleteLine(){var e;this.lineList=this.lineList.filter(t=>t.id!==this.selectedID),(e=this.history)==null||e.pushHistory(this.lineList),this.setNoneStatus(),this.emit("dataUpdated",this.lineList),this.render()}setInvalidLine(e,t,i=!0){var n;const s=this.lineList.find(r=>r.id===e);s&&(s.valid=t!==void 0?t:!s.valid,(n=this.history)==null||n.pushHistory(this.lineList),i&&this.render())}empty(){var e,t;this.lineList=[],this.setNoneStatus(),this.selectedPoint=void 0,(e=this.actionsHistory)==null||e.empty(),(t=this.history)==null||t.init(),this.emit("dataUpdated",this.lineList),this.render()}setAttribute(e){var t;this.attributeConfigurable&&(this.defaultAttribute=e,this.setLineAttribute("attribute",e),this.selectedID&&((t=this.history)==null||t.pushHistory(this.lineList)))}setTextAttribute(e){var t;this.isTextConfigurable&&(this.setLineAttribute("textAttribute",e),(t=this.history)==null||t.applyAttribute(this.selectedID,"textAttribute",e))}setLineAttribute(e,t,i){const n=i||this.selectedID;if(n){const s=this.lineList.find(r=>r.id===n);s&&(s[e]=t)}this.render()}updateAttribute(e){this.emit("updateAttribute",e)}updateLineAttributes(e){var t;if(this.attributeConfigurable&&e){const i=(e==null?void 0:e.attribute)||"";this.defaultAttribute=i,this.updateAttribute(i)}if(this.isTextConfigurable&&e){const i=(e==null?void 0:e.textAttribute)||"";this.updateTextAttribute(i)}(t=this.history)==null||t.updateHistory(this.lineList)}lineStatusChanged(){this.emit("lineStatusChanged",{status:this.status,selectedLineID:this.selectedID})}updateTextAttribute(e){if(this.selectedID){const t=this.lineList.find(i=>i.id===this.selectedID);t&&(t.textAttribute=e)}this.emit("updateText",e)}saveData(){this.stopLineCreating(),this.setNoneStatus(),this.render()}setTextEditingID(e){this.textEditingID=e,this.render()}setSelectedLineID(e){var t,i;if(this.selectedID===e)return;const n=this.selectedID;e!==n&&n&&((t=this._textAttributeInstance)==null||t.changeSelected()),e||(i=this._textAttributeInstance)==null||i.clearTextAttribute(),this.selectedID=e,this.emit("selectedChange")}attributeLockListChange(e){this.attributeLockList=e,this.render()}setResult(e){this.setNoneStatus(),this.setLineList(e),this.render()}setConfig(e){super.setConfig(e)}toggleIsHide(){this.setIsHidden(!this.isHidden),this.render()}clearCanvas(){super.clearCanvas()}clearResult(){this.setResult([]),this.setSelectedLineID(void 0),this.render()}exportData(){return[this.lineList,this.basicImgInfo]}setDefaultAttribute(e=""){var t;this.attributeConfigurable&&(this.defaultAttribute=e,this.setLineAttribute("attribute",e),this.selectedID&&((t=this.history)==null||t.pushHistory(this.lineList)),this.emit("changeAttributeSidebar"))}getCurrentSelectedData(){var e,t;const i=this.isActiveLineValid(),n=this.defaultAttribute,s=this.getColor(n),r=i?s==null?void 0:s.valid.stroke:s==null?void 0:s.invalid.stroke,o=(t=(e=this.lineList.find(h=>h.id===this.selectedID))==null?void 0:e.textAttribute)!=null?t:"";return{color:r,textAttribute:o}}renderTextAttribute(){var e,t,i,n;if(!this.ctx||!this.activeLine||((e=this.activeLine)==null?void 0:e.length)<2||this.isCreate)return;const s=this.isActiveLineValid(),r=this.defaultAttribute,{x:o,y:h}=this.activeLine[1],a=this.coordUtils.getRenderCoord({x:o,y:h}),l=this.getColor(r),u=s?l==null?void 0:l.valid.stroke:l==null?void 0:l.invalid.stroke,c=(i=(t=this.lineList.find(f=>f.id===this.selectedID))==null?void 0:t.textAttribute)!=null?i:"";this._textAttributeInstance||(this._textAttributeInstance=new textAttributeClass({container:this.container,icon:this.getTextIconSvg(r),color:u,getCurrentSelectedData:this.getCurrentSelectedData,updateSelectedTextAttribute:this.updateSelectedTextAttribute})),this._textAttributeInstance&&!((n=this._textAttributeInstance)==null?void 0:n.isExit)&&this._textAttributeInstance.appendToContainer(),this._textAttributeInstance.update(`${c}`,{left:a.x,top:a.y,color:u}),this._textAttributeInstance.updateIcon(this.getTextIconSvg(r))}getTextIconSvg(e=""){return AttributeUtils.default.getTextIconSvg(e,this.config.attributeList,this.config.attributeConfigurable,this.baseIcon)}updateSelectedTextAttribute(e){if(this._textAttributeInstance&&e&&this.selectedID){let t=e;!AttributeUtils.default.textAttributeValidate(this.config.textCheckType,"",t)&&(this.emit("messageError",AttributeUtils.default.getErrorNotice(this.config.textCheckType,this.lang)),t=""),this.setTextAttribute(t),this.emit("updateTextAttribute"),this.render()}}}exports.INNER_POINT_RADIUS=INNER_POINT_RADIUS,exports.LINE_ORDER_OFFSET=LINE_ORDER_OFFSET,exports.POINT_ACTIVE_RADIUS=POINT_ACTIVE_RADIUS,exports.POINT_RADIUS=POINT_RADIUS,exports.SEGMENT_NUMBER=SEGMENT_NUMBER,exports.default=LineToolOperation;
@@ -0,0 +1 @@
1
+ "use strict";var uuid=require("../../utils/uuid.js"),keyCode=require("../../constant/keyCode.js"),CommonToolUtils=require("../../utils/tool/CommonToolUtils.js"),basicToolOperation=require("./basicToolOperation.js");class TextToolOperation extends basicToolOperation.BasicToolOperation{constructor(t){super(t);this.getSingleResult=i=>{const e={};return this.config.configList.length>0&&this.config.configList.forEach(n=>{var s;e[n.key]=(s=n.default)!=null?s:""}),{value:e,id:uuid(),sourceID:i!=null?i:CommonToolUtils.getSourceID()}},this.getInitResultList=(i,e)=>i>0?e.map(n=>this.getSingleResult(n.id)):[this.getSingleResult()],this.textList=[],this.setShowDefaultCursor(!0),this.setConfig(t.config),this.initTextDisplayContainer()}get dataList(){return this.textList}get textValueContainerID(){return"textValueContainer"}get textValueContainer(){return document.getElementById(this.textValueContainerID)}get currentPageResult(){return this.textList}setResult(t){var i;this.textList=t,this.toggleTextContainerVisible(!0);const e=(i=this.textList[0])==null?void 0:i.value;e&&Object.keys(e).forEach(n=>{this.renderText(n,e[n])}),this.emit("valueUpdated"),this.toggleTextContainerVisible(!!e)}updateTextValue(t,i){this.textList[0].value[t]=i,this.renderText(t,i),this.emit("valueUpdated")}renderText(t,i){const e=document.getElementById(`textKey${t}`);e&&(e.innerText=i)}getTextDomID(t){return`textKey${t}`}initTextDisplayContainer(){const t=document.createElement("div"),i={position:"absolute",right:"0",top:"0","z-index":"20","max-width":"20%","font-family":"SourceHanSansCN-Regular",background:"rgb(102, 230, 255)",color:"white","word-break":"break-all","line-height":"24px","white-space":"pre-wrap","max-height":"80%","overflow-y":"auto",opacity:"0.6"};t.setAttribute("style",Object.keys(i).reduce((e,n)=>(e+=`${n}: ${i[n]};`,e),"")),t.setAttribute("id",this.textValueContainerID),this.config.configList.forEach(e=>{const n=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div");n.setAttribute("style","padding: 8px 16px"),s.innerText=`${e.key}:`,o.innerText="",o.setAttribute("id",this.getTextDomID(e.key)),n.appendChild(s),n.appendChild(o),t.appendChild(n)}),this.container.appendChild(t)}exportData(){return[this.textList,this.basicImgInfo]}destroyCanvas(){super.destroyCanvas(),this.textValueContainer&&this.container.removeChild(this.textValueContainer)}onKeyDown(t){super.onKeyDown(t),t.keyCode===keyCode.Z&&this.toggleTextContainerVisible()}toggleTextContainerVisible(t){if(this.textValueContainer){const i=(t!==void 0?!t:this.textValueContainer.style.display==="block")?"none":"block";this.textValueContainer.style.display=i}}}module.exports=TextToolOperation;
@@ -0,0 +1 @@
1
+ "use strict";var _=require("lodash"),rgba=require("color-rgba"),DrawUtils=require("../../utils/tool/DrawUtils.js"),AxisUtils=require("../../utils/tool/AxisUtils.js"),RectUtils=require("../../utils/tool/RectUtils.js"),PolygonUtils=require("../../utils/tool/PolygonUtils.js"),MathUtils=require("../../utils/MathUtils.js"),RenderDomClass=require("../../utils/tool/RenderDomClass.js"),tool=require("../../constant/tool.js"),annotation=require("../../constant/annotation.js"),basicToolOperation=require("./basicToolOperation.js");function _interopDefaultLegacy(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var ___default=_interopDefaultLegacy(_),rgba__default=_interopDefaultLegacy(rgba),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(l,t,s)=>t in l?__defProp(l,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[t]=s,__spreadValues=(l,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(l,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(l,s,t[s]);return l},__spreadProps=(l,t)=>__defProps(l,__getOwnPropDescs(t));const newScope=3,DEFAULT_RADIUS=3,DEFAULT_STROKE_COLOR="#6371FF";class ViewOperation extends basicToolOperation.BasicToolOperation{constructor(t){super(__spreadProps(__spreadValues({},t),{showDefaultCursor:!0}));this.style={},this.annotations=[],this.getHoverRectID=i=>{var f,b;const k=this.getCoordinateUnderZoom(i),S=AxisUtils.default.changePointByZoom(k,1/this.zoom);if(((f=this.annotations)==null?void 0:f.length)<=0||!((b=this.annotations)==null?void 0:b.length))return;let m="",w=Number.MAX_SAFE_INTEGER;for(let E=0;E<this.annotations.length;E++){const D=this.annotations[E];switch(D.type){case"rect":{const T=D.annotation;if(RectUtils.isInRect(k,T,newScope,this.zoom)){const g=T.width*T.height;g<w&&(m=T.id,w=g)}break}case"polygon":{const T=D.annotation;if(PolygonUtils.isInPolygon(S,T.pointList)){const g=PolygonUtils.getPolygonArea(T.pointList);g<w&&(m=T.id,w=g)}break}}}return m};var s;this.style=(s=t.style)!=null?s:{stroke:DEFAULT_STROKE_COLOR,thickness:3},this.annotations=t.annotations,this.loading=!1,this.renderDomInstance=new RenderDomClass({container:this.container,height:this.canvas.height})}setLoading(t){this.loading=t,this.render()}onMouseLeave(){super.onMouseLeave(),this.mouseHoverID=void 0,this.emit("onChange","hover",[])}onMouseDown(t){if(super.onMouseDown(t)||this.forbidMouseOperation||!this.imgInfo)return!0;const s=this.mouseHoverID;if(t.button===0){let i=[];s&&(i=[s]),this.emit("onChange","selected",i),this.render()}}onMouseMove(t){if(super.onMouseMove(t)||this.forbidMouseOperation||!this.imgInfo)return;const s=this.mouseHoverID,i=this.getHoverRectID(t);if(s!==i){this.mouseHoverID=i;let f=[];i&&(f=[i]),this.emit("onChange","hover",f),this.render()}}updateData(t){this.annotations=t,this.render()}getSpecificStyle(t){const s=___default.default.pick(t,["stroke","thickness","fill","radius"]),i=__spreadValues(__spreadValues({},this.style),s);return i.stroke&&Object.assign(i,{color:i.stroke}),i}getRenderText(t,s=!1){let i="",f="";return!t||s===!0?{headerText:i,bottomText:f}:((t==null?void 0:t.order)&&(i=`${t.order}`),(t==null?void 0:t.label)&&(i?i=`${i}_${t.label}`:i=`${t.label}`),(t==null?void 0:t.attribute)&&(i?i=`${i} ${t.attribute}`:i=`${t.attribute}`),(t==null?void 0:t.textAttribute)&&(f=t==null?void 0:t.textAttribute),{headerText:i,bottomText:f})}getReferenceOptions(t){return t?{lineCap:"butt",lineDash:[20,20]}:{}}render(){try{if(super.render(),this.loading===!0)return;this.renderDomInstance.render(this.annotations.filter(t=>t.type==="text"&&t.annotation.position==="rt").map(t=>t.annotation)),this.annotations.forEach(t=>{var s,i,f,b,k,S,m,w,E,D,T,g,L;switch(t.type){case"rect":{const e=t.annotation,{hiddenText:c=!1,isReference:n,hiddenRectSize:o=!1}=e,{zoom:d}=this,u=AxisUtils.default.changeRectByZoom(e,this.zoom,this.currentPos),{x:p,y:v,width:h,height:a}=u,r=this.getSpecificStyle(e);if(e.id===this.mouseHoverID||r.fill){const y=rgba__default.default((i=(s=r==null?void 0:r.fill)!=null?s:r==null?void 0:r.stroke)!=null?i:DEFAULT_STROKE_COLOR),A=`rgba(${y[0]}, ${y[1]}, ${y[2]},${y[3]*.8})`;DrawUtils.drawRectWithFill(this.canvas,u,{color:A})}DrawUtils.drawRect(this.canvas,u,__spreadValues(__spreadProps(__spreadValues({},r),{hiddenText:!0}),this.getReferenceOptions(n)));const{headerText:x,bottomText:P}=this.getRenderText(e,e==null?void 0:e.hiddenText);x&&DrawUtils.drawText(this.canvas,{x:p,y:v-6},x,__spreadProps(__spreadValues({color:r.stroke,font:"normal normal 900 14px SourceHanSansCN-Regular"},annotation.DEFAULT_TEXT_SHADOW),{textMaxWidth:300}));const O=`${Math.round(h/d)} * ${Math.round(a/d)}`,R=O.length*7;if(!c&&!o&&DrawUtils.drawText(this.canvas,{x:p+h-R,y:v+a+15},O,__spreadValues({color:r.stroke,font:"normal normal 600 14px Arial"},annotation.DEFAULT_TEXT_SHADOW)),P){const y=20,A=Math.max(20,h-R);DrawUtils.drawText(this.canvas,{x:p,y:v+a+y},e.textAttribute,__spreadValues({color:r.stroke,font:"italic normal 900 14px Arial",textMaxWidth:A},annotation.DEFAULT_TEXT_SHADOW))}break}case"polygon":{const e=t.annotation;if(!(((f=e==null?void 0:e.pointList)==null?void 0:f.length)>=3))return;const{lineType:c=tool.ELineTypes.Line}=e,n=AxisUtils.default.changePointListByZoom((b=e==null?void 0:e.pointList)!=null?b:[],this.zoom,this.currentPos),o=this.getSpecificStyle(e);if(e.id===this.mouseHoverID||o.fill){const a=rgba__default.default((S=(k=o==null?void 0:o.fill)!=null?k:o==null?void 0:o.stroke)!=null?S:DEFAULT_STROKE_COLOR),r=`rgba(${a[0]}, ${a[1]}, ${a[2]},${a[3]*.8})`;DrawUtils.drawPolygonWithFill(this.canvas,n,{color:r,lineType:c})}const d=__spreadProps(__spreadValues(__spreadProps(__spreadValues({},o),{isClose:!0}),this.getReferenceOptions(e==null?void 0:e.isReference)),{lineType:c,strokeColor:o.stroke});let u=[];if(e.showKeyPoint?u=DrawUtils.drawPolygonWithKeyPoint(this.canvas,n,d):u=DrawUtils.drawPolygon(this.canvas,n,d),(e==null?void 0:e.showDirection)===!0&&((m=e==null?void 0:e.pointList)==null?void 0:m.length)>2){let a=n[0],r=MathUtils.default.getLineCenterPoint([n[0],n[1]]);if(c===tool.ELineTypes.Curve){const x=Math.floor(tool.SEGMENT_NUMBER/2);a=u[x],r=u[x+1]}DrawUtils.drawArrowByCanvas(this.canvas,a,r,{color:o.stroke,thickness:o.thickness}),DrawUtils.drawCircle(this.canvas,n[0],o.thickness+6,{color:o.stroke,thickness:o.thickness})}const{headerText:v,bottomText:h}=this.getRenderText(e,e==null?void 0:e.hiddenText);if(v&&DrawUtils.drawText(this.canvas,n[0],v,__spreadValues({color:o.stroke},annotation.DEFAULT_TEXT_OFFSET)),h){const a=n[n.length-1];DrawUtils.drawText(this.canvas,{x:a.x+annotation.TEXT_ATTRIBUTE_OFFSET.x,y:a.y+annotation.TEXT_ATTRIBUTE_OFFSET.y},h,__spreadValues({color:o.stroke},annotation.DEFAULT_TEXT_OFFSET))}break}case"line":{const e=t.annotation;if(!(((w=e==null?void 0:e.pointList)==null?void 0:w.length)>=2))return;const{lineType:c=tool.ELineTypes.Line}=e,n=AxisUtils.default.changePointListByZoom((E=e==null?void 0:e.pointList)!=null?E:[],this.zoom,this.currentPos),o=this.getSpecificStyle(e),d=DrawUtils.drawPolygon(this.canvas,n,__spreadProps(__spreadValues(__spreadValues({},o),this.getReferenceOptions(e==null?void 0:e.isReference)),{lineType:c}));if((e==null?void 0:e.showDirection)===!0&&((D=e==null?void 0:e.pointList)==null?void 0:D.length)>2){let h=n[0],a=MathUtils.default.getLineCenterPoint([n[0],n[1]]);if(c===tool.ELineTypes.Curve){const r=Math.floor(tool.SEGMENT_NUMBER/2);h=d[r],a=d[r+1]}DrawUtils.drawArrowByCanvas(this.canvas,h,a,{color:o.stroke,thickness:o.thickness}),DrawUtils.drawCircle(this.canvas,n[0],o.thickness+6,{color:o.stroke,thickness:o.thickness})}const{headerText:p,bottomText:v}=this.getRenderText(e,e==null?void 0:e.hiddenText);if(p&&DrawUtils.drawText(this.canvas,n[0],p,__spreadValues({color:o.stroke},annotation.DEFAULT_TEXT_OFFSET)),v){const h=n[n.length-1];DrawUtils.drawText(this.canvas,{x:h.x+annotation.TEXT_ATTRIBUTE_OFFSET.x,y:h.y+annotation.TEXT_ATTRIBUTE_OFFSET.y},v,__spreadValues({color:o.stroke},annotation.DEFAULT_TEXT_OFFSET))}break}case"point":{const e=t.annotation,c=AxisUtils.default.changePointByZoom(e,this.zoom,this.currentPos),n=this.getSpecificStyle(e),o=(T=n.radius)!=null?T:DEFAULT_RADIUS;DrawUtils.drawCircle(this.canvas,c,o,n);const{headerText:d,bottomText:u}=this.getRenderText(e,e==null?void 0:e.hiddenText);d&&DrawUtils.drawText(this.canvas,{x:c.x+o/2,y:c.y-o-4},d,{textAlign:"center",color:n.stroke}),u&&DrawUtils.drawText(this.canvas,{x:c.x+o,y:c.y+o+24},u,__spreadValues({color:n.stroke},annotation.DEFAULT_TEXT_OFFSET));break}case"text":{const e=t.annotation,{text:c,x:n,y:o,textMaxWidth:d,color:u="white",background:p="rgba(0, 0, 0, 0.6)",lineHeight:v=25,font:h=tool.DEFAULT_FONT,position:a}=e,r=10,x=10,P=AxisUtils.default.changePointByZoom({x:n,y:o},this.zoom,this.currentPos),{width:O,height:R,fontHeight:y=0}=MathUtils.default.getTextArea(this.canvas,e.text,d,h,v);if(a==="rt")break;DrawUtils.drawRectWithFill(this.canvas,{x:P.x,y:P.y,width:O+x*2,height:R+r*2,id:"",sourceID:"",valid:!0,textAttribute:"",attribute:""},{color:p}),DrawUtils.drawText(this.canvas,{x:P.x+x,y:P.y+y+r},c,{color:u,lineHeight:v,font:h,textMaxWidth:d});break}default:}(L=(g=t.annotation)==null?void 0:g.renderEnhance)==null||L.call(g,{ctx:this.ctx,canvas:this.canvas,currentPos:this.currentPos,zoom:this.zoom,data:t,toolInstance:this})})}catch(t){console.error("ViewOperation Render Error",t)}}}module.exports=ViewOperation;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _=require("lodash"),defaultConfig=require("../../constant/defaultConfig.js"),tool=require("../../constant/tool.js"),MathUtils=require("../../utils/MathUtils.js"),AxisUtils=require("../../utils/tool/AxisUtils.js"),CanvasUtils=require("../../utils/tool/CanvasUtils.js"),CommonToolUtils=require("../../utils/tool/CommonToolUtils.js"),LineToolUtils=require("../../utils/tool/LineToolUtils.js"),annotation=require("../../constant/annotation.js"),keyCode=require("../../constant/keyCode.js"),style=require("../../constant/style.js"),index=require("../../locales/index.js"),constants=require("../../locales/constants.js"),ActionsHistory=require("../../utils/ActionsHistory.js"),AttributeUtils=require("../../utils/tool/AttributeUtils.js"),DblClickEventListener=require("../../utils/tool/DblClickEventListener.js"),DrawUtils=require("../../utils/tool/DrawUtils.js"),ImgPosUtils=require("../../utils/tool/ImgPosUtils.js"),RenderDomUtils=require("../../utils/tool/RenderDomUtils.js"),ZoomUtils=require("../../utils/tool/ZoomUtils.js"),eventListener=require("./eventListener.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(l,t,e)=>t in l?__defProp(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e,__spreadValues=(l,t)=>{for(var e in t||(t={}))__hasOwnProp.call(t,e)&&__defNormalProp(l,e,t[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(t))__propIsEnum.call(t,e)&&__defNormalProp(l,e,t[e]);return l},__spreadProps=(l,t)=>__defProps(l,__getOwnPropDescs(t)),__async=(l,t,e)=>new Promise((i,s)=>{var o=a=>{try{n(e.next(a))}catch(h){s(h)}},r=a=>{try{n(e.throw(a))}catch(h){s(h)}},n=a=>a.done?i(a.value):Promise.resolve(a.value).then(o,r);n((e=e.apply(l,t)).next())});const zoomInfo={min:.2,max:1e3,ratio:.4};class BasicToolOperation extends eventListener{constructor(t){super();this.isDrag=!1,this.isSpaceKey=!1,this.innerZoom=1,this.basicZoom=.01,this.isSpaceClick=!1,this.isDragStart=!1,this.startTime=0,this.initImgPos=()=>__async(this,null,function*(){var c,d;if(!this.imgNode)return;const u=(c=this._imgAttribute)==null?void 0:c.zoomRatio,g=(d=this._imgAttribute)==null?void 0:d.isOriginalSize,{currentPos:m,imgInfo:f,zoom:v}=ImgPosUtils.getInitImgPos(this.size,{width:this.imgNode.width,height:this.imgNode.height},this.rotate,u,g);this.setCurrentPos(m),this.currentPosStorage=m,this.setImgInfo(f),this.setZoom(v),this.render(),this.renderBasicCanvas(),this.emit("dependRender"),this.emit("renderZoom",v,m,f)}),this.getCurrentPos=c=>{const{_firstClickCoordinate:d,currentPosStorage:u}=this;try{let g;return d&&u?g={y:u.y+c.y-d.y,x:u.x+c.x-d.x}:g={x:0,y:0},g}catch(g){return console.error(g),{x:0,y:0}}},this.wheelChangePos=(c,d,u)=>{const{currentPos:g,imgNode:m}=this;if(!m){console.error("unable to load image");return}if(this.zoom===this.basicZoom&&d===-1)return;const f=ZoomUtils.wheelChangePos(m,c,d,g,{zoom:u||this.zoom,innerZoom:this.innerZoom,basicZoom:this.basicZoom,zoomMax:zoomInfo.max,rotate:this.rotate});if(!f)return;const{currentPos:v,ratio:I,zoom:b,imgInfo:y}=f;this.setZoom(b),this.setCurrentPos(v),this.currentPosStorage=v,this.setImgInfo(y),zoomInfo.ratio=I,this.emit("renderZoom",b,v,y)},this.zoomChanged=(c,d=annotation.EGrowthMode.Linear)=>{const u=ZoomUtils.zoomChanged(this.zoom,c,d);this.wheelChangePos(this.getGetCenterCoordinate(),u>this.zoom?1:-1,u),this.render(),this.renderBasicCanvas()},this.zoomChangeOnCenter=c=>{this.wheelChangePos(this.getGetCenterCoordinate(),0,c),this.render(),this.renderBasicCanvas()},this.drawImg=()=>{!this.imgNode||this.hiddenImg===!0||DrawUtils.drawImg(this.basicCanvas,this.imgNode,{zoom:this.zoom,currentPos:this.currentPos,rotate:this.rotate,imgAttribute:this._imgAttribute})};var e,i,s,o,r,n,a,h,C;this.container=t.container,this.showDefaultCursor=t.showDefaultCursor||!1,this.destroyCanvas(),this.createCanvas(t.size,t.isAppend),this.imgNode=t.imgNode,this.isImgError=!t.imgNode,this.basicImgInfo={width:(i=(e=t.imgNode)==null?void 0:e.width)!=null?i:0,height:(o=(s=t.imgNode)==null?void 0:s.height)!=null?o:0,valid:!0,rotate:0},this.forbidOperation=(r=t.forbidOperation)!=null?r:!1,this.forbidBasicResultRender=(n=t.forbidBasicResultRender)!=null?n:!1,this.size=t.size,this.currentPos={x:0,y:0},this.zoom=1,this.coord={x:-1,y:-1},this.currentPosStorage={x:0,y:0},this.isShowCursor=!1,this.style={strokeColor:style.COLORS_ARRAY[4],fillColor:style.COLORS_ARRAY[4],strokeWidth:2,opacity:1},this.attributeLockList=[],this.history=new ActionsHistory,this.style=(a=t.style)!=null?a:{},this._imgAttribute=(h=t.imgAttribute)!=null?h:{},this.isHidden=!1,this.dragStatus=annotation.EDragStatus.Wait,this.defaultAttribute=(C=t==null?void 0:t.defaultAttribute)!=null?C:"",this.forbidCursorLine=!!t.forbidCursorLine,this.lang=annotation.ELang.Zh,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onWheel=this.onWheel.bind(this),this.onLeftDblClick=this.onLeftDblClick.bind(this),this.onRightDblClick=this.onRightDblClick.bind(this),this.onClick=this.onClick.bind(this),this.clearImgDrag=this.clearImgDrag.bind(this),this.dblClickListener=new DblClickEventListener(this.container,200),this.coordUtils=new AxisUtils.CoordinateUtils(this),this.coordUtils.setBasicImgInfo(this.basicImgInfo),this.hiddenImg=t.hiddenImg||!1}onContextmenu(t){t.preventDefault()}get ctx(){var t;return this._ctx||((t=this.canvas)==null?void 0:t.getContext("2d"))}get basicCtx(){var t;return(t=this.basicCanvas)==null?void 0:t.getContext("2d")}get rotate(){var t,e;return(e=(t=this.basicImgInfo)==null?void 0:t.rotate)!=null?e:0}get valid(){var t,e;return(e=(t=this.basicImgInfo)==null?void 0:t.valid)!=null?e:!0}get baseIcon(){return style.BASE_ICON[this.style.color]}get defaultCursor(){return this.showDefaultCursor?"default":"none"}get dataList(){return[]}get hasMarkerConfig(){return this.config.markerConfigurable===!0&&this.config.markerList&&this.config.markerList.length>0}setZoom(t){this.zoom=t,this.innerZoom=t,this.coordUtils.setZoomAndCurrentPos(this.zoom,this.currentPos)}setCurrentPos(t){this.currentPos=t,this.coordUtils.setZoomAndCurrentPos(this.zoom,this.currentPos)}setReferenceData(t){this.referenceData=t}setImgInfo(t){this.imgInfo=t}updatePosition(t){const{zoom:e,currentPos:i}=t;this.setZoom(e),this.setCurrentPos(i),this.currentPosStorage=i,this.renderBasicCanvas(),this.render()}setLang(t){this.lang=t}setShowDefaultCursor(t){this.showDefaultCursor=t,this.container.style.cursor=this.defaultCursor}get forbidMouseOperation(){return!1}get pixelRatio(){var t;return CanvasUtils.getPixelRatio((t=this.canvas)==null?void 0:t.getContext("2d"))}init(){this.eventUnbinding(),this.initPosition(),this.eventBinding(),this.render(),this.renderBasicCanvas()}destroy(){this.destroyCanvas(),this.eventUnbinding()}updateCanvasBasicStyle(t,e,i){const s=this.pixelRatio;t.style.position="absolute",t.width=e.width*s,t.height=e.height*s,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left="0",t.style.top="0",t.style.zIndex=`${i} `}createCanvas(t,e=!0){var i,s;const o=this.pixelRatio,r=document.createElement("canvas");this.updateCanvasBasicStyle(r,t,0),this.basicCanvas=r;const n=document.createElement("canvas");this.updateCanvasBasicStyle(n,t,10),e&&(this.container.hasChildNodes()?(this.container.insertBefore(n,this.container.childNodes[0]),this.container.insertBefore(r,this.container.childNodes[0])):(this.container.appendChild(r),this.container.appendChild(n))),this.canvas=n,this.container.style.cursor=this.defaultCursor,(i=this.ctx)==null||i.scale(o,o),(s=this.basicCtx)==null||s.scale(o,o)}destroyCanvas(){this.canvas&&this.container.contains(this.canvas)&&this.container.removeChild(this.canvas),this.basicCanvas&&this.container.contains(this.basicCanvas)&&this.container.removeChild(this.basicCanvas),this.clearInvalidPage(),this.clearImgDrag()}setStyle(t){this.style=t,this.render()}setImgNode(t,e={}){this.imgNode=t,this.setBasicImgInfo(__spreadValues({width:t.width,height:t.height,valid:!0,rotate:0},e)),this.isImgError===!0&&(this.isImgError=!1,this.emit("changeAnnotationShow")),typeof e.valid=="boolean"&&this.setValid(e.valid),this.initImgPos(),this.render(),this.renderBasicCanvas()}setErrorImg(){const t=this.isImgError;this.isImgError=!0,this.imgNode=void 0,this.setBasicImgInfo({width:0,height:0,valid:!0,rotate:0}),t===!1&&this.emit("changeAnnotationShow")}setBasicImgInfo(t){this.basicImgInfo=t,this.coordUtils.setBasicImgInfo(t)}setForbidOperation(t){this.forbidOperation=t,this.setShowDefaultCursor(!0),this.render()}setForbidCursorLine(t){this.forbidCursorLine=t,this.render()}setIsHidden(t){this.isHidden=t,this.emit("hiddenChange")}setIsShowOrder(t){this.config.isShowOrder=t,this.render()}getCoordinate(t){const e=this.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}getCoordinateUnderZoom(t){const e=this.canvas.getBoundingClientRect();return{x:t.clientX-e.left-this.currentPos.x,y:t.clientY-e.top-this.currentPos.y}}getGetCenterCoordinate(){return{x:this.size.width/2,y:this.size.height/2}}initPosition(){if(this.basicResult&&this.imgInfo){const{basicResult:t,size:e,imgNode:i,_imgAttribute:s,imgInfo:o,dependToolName:r}=this;if(t&&i&&r){let n=t;switch(r){case tool.EToolName.Polygon:case tool.EToolName.Line:{if(t.pointList){const h=MathUtils.default.calcViewportBoundaries(t.pointList);n={x:h.left,y:h.top,width:h.right-h.left,height:h.bottom-h.top}}break}}const a=ImgPosUtils.getBasicRecPos(i,n,e,void 0,s==null?void 0:s.zoomRatio,s==null?void 0:s.isOriginalSize);a&&(this.setCurrentPos(a.currentPos),this.currentPosStorage=this.currentPos,this.setImgInfo(__spreadProps(__spreadValues({},o),{width:o.width/this.innerZoom*a.innerZoom,height:o.height/this.innerZoom*a.innerZoom})),this.setZoom(a.innerZoom),this.render(),this.renderBasicCanvas())}}else this.initImgPos()}undo(){this.history.undo()}redo(){this.history.redo()}clearCanvas(){var t;(t=this.ctx)==null||t.clearRect(0,0,this.size.width,this.size.height)}clearBasicCanvas(){var t;(t=this.basicCtx)==null||t.clearRect(0,0,this.size.width,this.size.height)}eventBinding(){this.dblClickListener.addEvent(()=>{},this.onLeftDblClick,this.onRightDblClick),this.container.addEventListener("mousedown",this.onMouseDown),this.container.addEventListener("mousemove",this.onMouseMove),this.container.addEventListener("mouseup",this.onMouseUp),this.container.addEventListener("mouseleave",this.onMouseLeave),this.container.addEventListener("click",this.onClick),this.container.addEventListener("wheel",this.onWheel),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp),window.parent.document.addEventListener("contextmenu",this.onContextmenu,!1)}eventUnbinding(){this.container.removeEventListener("mousedown",this.onMouseDown),this.container.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("mouseup",this.onMouseUp),this.container.removeEventListener("mouseleave",this.onMouseLeave),this.container.removeEventListener("wheel",this.onWheel),this.container.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),window.parent.document.removeEventListener("contextmenu",this.onContextmenu,!1),this.dblClickListener.removeEvent()}clearImgDrag(){this.isDrag=!1,this.isDragStart=!1,this.isSpaceClick=!1,this.startTime=0,this.container.style.cursor=this.defaultCursor,this.forbidCursorLine=!1}clearCursorLine(){this.coord={x:-1,y:-1}}onMouseDown(t){if(!this.canvas||this.isImgError)return!0;const e=this.getCoordinate(t);(this.isSpaceKey&&t.button===0||t.button===2)&&(t.stopPropagation(),this._firstClickCoordinate=e,this.currentPosStorage=this.currentPos,this.isSpaceClick=!0,this.isDragStart=!0,this.startTime=new Date().getTime())}onMouseMove(t){if(!this.canvas||this.isImgError)return!0;const e=this.getCoordinate(t);this.isShowCursor&&(this.coord=e);try{if(!e||!_.isNumber(e==null?void 0:e.x)||!_.isNumber(e==null?void 0:e.y))throw new Error("coord error");if(this.coord=e,(this.isSpaceClick||this.isDragStart)&&this._firstClickCoordinate){const i=this.getCurrentPos(e);this.setCurrentPos(i),this.isDrag=!0,this.container.style.cursor="grabbing",this.forbidCursorLine=!0,this.renderBasicCanvas(),this.emit("dependRender"),this.emit("dragMove",{currentPos:i,zoom:this.zoom,imgInfo:this.imgInfo})}this.render()}catch(i){console.error(i)}}onMouseUp(t){if(!this.canvas||this.isImgError)return!0;if(this.container.style.cursor=this.defaultCursor,this.forbidCursorLine=!1,this.isDrag=!1,this.isDragStart=!1,this.isSpaceClick=!1,this.startTime!==0&&this._firstClickCoordinate){const e=new Date().getTime(),i=this.getCoordinate(t);if(e-this.startTime>1e3||this.isSpaceKey===!0||LineToolUtils.default.calcTwoPointDistance(i,this._firstClickCoordinate)>10)return t.stopPropagation(),this.startTime=0,this.render(),!0}this.startTime=0,this.render()}onMouseLeave(){this.clearImgDrag()}onClick(t){}onLeftDblClick(t){}onRightDblClick(t){this.clearImgDrag()}onKeyDown(t){switch(t.keyCode===keyCode.Alt&&t.preventDefault(),t.keyCode){case keyCode.Space:this.isSpaceKey=!0;break;case keyCode.Z:if(t.ctrlKey)return t.shiftKey?this.redo():this.undo(),!1;break}return!0}onKeyUp(t){switch(t.keyCode){case keyCode.Space:this.isSpaceKey=!1;break}}exportCustomData(){return{}}onWheel(t,e=!0){if(!this.imgNode||!this.coord)return;t.preventDefault(),t.stopPropagation();const i=this.getCoordinate(t),s=t.deltaY||t.wheelDelta;let o=0;s>0&&this.zoom>zoomInfo.min&&(o=-1),s<0&&this.zoom<zoomInfo.max&&(o=1),this.wheelChangePos(i,o),this.emit("dependRender"),e&&this.render(),this.renderBasicCanvas()}renderCursorLine(t=(e=>(e=this.style.lineColor[0])!=null?e:"")()){if(!this.ctx||this.forbidCursorLine||this.forbidOperation)return;const{x:e,y:i}=this.coord;DrawUtils.drawLine(this.canvas,{x:0,y:i},{x:1e4,y:i},{color:t}),DrawUtils.drawLine(this.canvas,{x:e,y:0},{x:e,y:1e4},{color:t}),DrawUtils.drawCircleWithFill(this.canvas,{x:e,y:i},1,{color:"white"})}setSize(t){var e;this.size=t,this.container.contains(this.canvas)&&(this.destroyCanvas(),this.createCanvas(t),this.eventUnbinding(),this.init(),((e=this.basicImgInfo)==null?void 0:e.valid)===!1&&this.renderInvalidPage())}setImgAttribute(t){const e=this._imgAttribute;if(this._imgAttribute=t,(e==null?void 0:e.zoomRatio)!==t.zoomRatio||e.isOriginalSize!==t.isOriginalSize){this.initImgPos();return}this.renderBasicCanvas(),this.render()}clearResult(t){}setValid(t){this.basicImgInfo.valid=t,t===!1?(this.renderInvalidPage(),this.clearResult(!1)):this.clearInvalidPage()}setRotate(t){this.basicImgInfo.rotate=t}setBasicResult(t){this.basicResult=t,this.coordUtils.setBasicResult(t),this.initPosition(),this.emit("dependRender")}setDependName(t,e){this.dependToolName=t,this.coordUtils.setDependInfo(t,e)}setAttributeLockList(t){this.attributeLockList=t,this.render()}setConfig(t){this.config=CommonToolUtils.jsonParser(t)}setDataInjectionAtCreation(t){this.dataInjectionAtCreation=t}setRenderEnhance(t){this.renderEnhance=t}setCustomRenderStyle(t){this.customRenderStyle=t}updateRotate(){if(this.dependToolName)return this.emit("messageInfo",index.getMessagesByLocale(constants.EMessage.NoRotateInDependence,this.lang)),!1;if(this.dataList.length>0)return this.emit("messageInfo",index.getMessagesByLocale(constants.EMessage.NoRotateNotice,this.lang)),!1;const t=MathUtils.default.getRotate(this.basicImgInfo.rotate);this.basicImgInfo.rotate=t,this.initImgPos(),this.emit("updateResult")}getColor(t="",e=this.config){var i;if((e==null?void 0:e.attributeConfigurable)===!0&&this.style.attributeColor){const r=AttributeUtils.default.getAttributeIndex(t,(i=e.attributeList)!=null?i:[])+1;return this.style.attributeColor[r]}const{color:s,toolColor:o}=this.style;return o?o[s]:defaultConfig.styleDefaultConfig.toolColor["1"]}getLineColor(t=""){var e,i,s;if(((e=this.config)==null?void 0:e.attributeConfigurable)===!0){const n=AttributeUtils.default.getAttributeIndex(t,(s=(i=this.config)==null?void 0:i.attributeList)!=null?s:[])+1;return this.style.attributeLineColor?this.style.attributeLineColor[n]:""}const{color:o,lineColor:r}=this.style;return o&&r?r[o]:""}clearInvalidPage(){this._invalidDOM&&this.container&&this.container.contains(this._invalidDOM)&&(this.container.removeChild(this._invalidDOM),this._invalidDOM=void 0)}renderInvalidPage(){!this.container||this._invalidDOM||(this._invalidDOM=RenderDomUtils.renderInvalidPage(this.container,this.size,this.lang))}renderBasicCanvas(){if(!this.basicCanvas)return;this.clearBasicCanvas(),this.drawImg();const t=3;if(!this.forbidBasicResultRender&&this.basicResult&&this.dependToolName)switch(this.dependToolName){case tool.EToolName.Rect:{DrawUtils.drawRect(this.basicCanvas,AxisUtils.default.changeRectByZoom(this.basicResult,this.zoom,this.currentPos),{color:"rgba(204,204,204,1.00)",thickness:t});break}case tool.EToolName.Polygon:{DrawUtils.drawPolygonWithFillAndLine(this.basicCanvas,AxisUtils.default.changePointListByZoom(this.basicResult.pointList,this.zoom,this.currentPos),{fillColor:"transparent",strokeColor:"rgba(204,204,204,1.00)",isClose:!0,thickness:t});break}case tool.EToolName.Line:{DrawUtils.drawLineWithPointList(this.basicCanvas,AxisUtils.default.changePointListByZoom(this.basicResult.pointList,this.zoom,this.currentPos),{color:"rgba(204,204,204,1.00)",thickness:t});break}}}render(){!this.canvas||!this.ctx||!this.imgNode||this.clearCanvas()}changeStyle(t=this.defaultAttribute){this.emit("changeStyle",{attribute:t})}}exports.BasicToolOperation=BasicToolOperation;
@@ -0,0 +1 @@
1
+ "use strict";var _=require("lodash"),CommonToolUtils=require("../../utils/tool/CommonToolUtils.js"),RectUtils=require("../../utils/tool/RectUtils.js"),TagUtils=require("../../utils/tool/TagUtils.js"),annotation=require("../../constant/annotation.js"),tool=require("../../constant/tool.js"),AttributeUtils=require("../../utils/tool/AttributeUtils.js"),AxisUtils=require("../../utils/tool/AxisUtils.js"),DrawUtils=require("../../utils/tool/DrawUtils.js"),StyleUtils=require("../../utils/tool/StyleUtils.js"),basicToolOperation=require("./basicToolOperation.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(a,e,t)=>e in a?__defProp(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,__spreadValues=(a,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(a,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(a,t,e[t]);return a};const TEXT_ATTRIBUTE_OFFSET={x:8,y:26},newScope=2;class CheckOperation extends basicToolOperation.BasicToolOperation{constructor(e){super(e);this.getHoverRectID=t=>{var i,o;const s=this.getCoordinateUnderZoom(t),l=(o=(i=this.resultList.find(r=>r.toolName===tool.EToolName.Rect))==null?void 0:i.result)!=null?o:[];if(l.length>0){const r=l.filter(n=>RectUtils.isInRect(s,n,newScope,this.zoom));if(r.length===0)return"";if(r.length===1)return r[0].id;if(r.length>1)return r.map(u=>({size:u.width*u.height,id:u.id})).sort((u,h)=>u.size-h.size)[0].id}return""},this.resultList=[],this.hoverID=[],this.fillID=[],this.render=this.render.bind(this),this.drawPolygon=this.drawPolygon.bind(this),this.drawRect=this.drawRect.bind(this),this.drawTag=this.drawTag.bind(this),this.setShowDefaultCursor(!0),this.forbidOperation=!0}onMouseDown(e){var t,i;if(super.onMouseDown(e)||this.forbidMouseOperation||!this.imgInfo)return!0;const o=this.mouseHoverID,s=(i=(t=this.resultList.find(l=>l.toolName===tool.EToolName.Rect))==null?void 0:t.result)!=null?i:[];if(e.button===0){let l=[o],r=!0;o&&s.find(n=>n.id===o&&(n==null?void 0:n.isSelected))&&(r=!1),o||(l=s.map(n=>n.id),r=!1),this.emit("setSelectedID",l,r),this.render()}}updateRotate(){}onMouseMove(e){if(super.onMouseMove(e)||this.forbidMouseOperation||!this.imgInfo)return;const t=this.mouseHoverID,i=this.getHoverRectID(e);if(t!==i){this.mouseHoverID=i;let o=[i];i||(o=[]),this.emit("setHoverID",o),this.render()}}setResult(e){this.resultList=_.cloneDeep(e),this.render()}drawPolygon(e,t){e==null||e.forEach(i=>{var o,s,l,r,n;const u=this.getColor(i.attribute,t),h=StyleUtils.getStrokeAndFill(u,i.valid);let d=(s=(o=this.style)==null?void 0:o.width)!=null?s:2;this.hoverID.includes(i.id)?(d=4,DrawUtils.drawPolygonWithFillAndLine(this.canvas,AxisUtils.default.changePointListByZoom(i.pointList,this.zoom,this.currentPos),{fillColor:h.fill,strokeColor:h.stroke,pointColor:"white",thickness:d,lineCap:"round",isClose:!0,lineType:t==null?void 0:t.lineType})):DrawUtils.drawPolygon(this.canvas,AxisUtils.default.changePointListByZoom(i.pointList,this.zoom,this.currentPos),{color:h.fill,lineType:(l=this.config)==null?void 0:l.lineType,thickness:d,isClose:!0});let c=`${(n=AttributeUtils.default.getAttributeShowText(i.attribute,(r=t==null?void 0:t.attributeList)!=null?r:[]))!=null?n:""}`;(t==null?void 0:t.isShowOrder)&&(i==null?void 0:i.order)>0&&(c=`${i.order} ${c}`),DrawUtils.drawText(this.canvas,AxisUtils.default.changePointByZoom(i.pointList[0],this.zoom,this.currentPos),c,__spreadValues({color:h.stroke},annotation.DEFAULT_TEXT_OFFSET));const v=AxisUtils.default.changePointListByZoom(i.pointList||[],this.zoom,this.currentPos),f=v[v.length-1];DrawUtils.drawText(this.canvas,{x:f.x+TEXT_ATTRIBUTE_OFFSET.x,y:f.y+TEXT_ATTRIBUTE_OFFSET.y},i==null?void 0:i.textAttribute,__spreadValues({color:h.stroke},annotation.DEFAULT_TEXT_OFFSET))})}drawRect(e,t){e==null||e.forEach(i=>{let o=1;this.hoverID.includes(i.id)&&(o=3);const s=this.getColor(i.attribute,t),l=AxisUtils.default.changeRectByZoom(i,this.zoom,this.currentPos);DrawUtils.drawRect(this.canvas,l,{color:(i==null?void 0:i.valid)?s.valid.stroke:s.invalid.stroke,thickness:o}),this.fillID.includes(i.id)&&DrawUtils.drawRectWithFill(this.canvas,l,{color:(i==null?void 0:i.valid)?s.valid.fill:s.invalid.fill})})}drawTag(e,t){const i=e.reduce((o,s)=>[...o,...(t==null?void 0:t.inputList)?TagUtils.getTagNameList(s.result,t.inputList):TagUtils.getTagnameListWithoutConfig(s.result)],[]);DrawUtils.drawTag(this.canvas,i)}setHoverID(e){this.hoverID=e,this.render()}setFillID(e){this.fillID=e,this.render()}render(){var e;super.render(),(e=this.resultList)==null||e.forEach(t=>{switch(t==null?void 0:t.toolName){case tool.EToolName.Rect:this.drawRect(t.result,CommonToolUtils.jsonParser(t.config));break;case tool.EToolName.Polygon:this.drawPolygon(t.result,CommonToolUtils.jsonParser(t.config));break;case tool.EToolName.Tag:this.drawTag(t.result,CommonToolUtils.jsonParser(t.config));break}})}exportData(){return[[],{}]}}module.exports=CheckOperation;
@@ -0,0 +1 @@
1
+ "use strict";class EventListener{constructor(){this._events=new Map}on(t,e){const s=this._events.get(t)||[];s.some(n=>n===e)||this._events.set(t,s.concat(e))}singleOn(t,e){this._events.set(t,[e])}emit(t,...e){const s=this._events.get(t);s&&s.forEach(n=>{n&&n(...e)})}unbind(t,e){const s=this._events.get(t);s&&this._events.set(t,s.filter(n=>n!==e))}unbindAll(t){this._events.delete(t)}}module.exports=EventListener;
@@ -0,0 +1 @@
1
+ "use strict";var rectOperation=require("./rectOperation.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,e,t)=>e in r?__defProp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,__spreadValues=(r,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(r,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(r,t,e[t]);return r},__spreadProps=(r,e)=>__defProps(r,__getOwnPropDescs(e));const config={textConfigurable:!1,attributeConfigurable:!0,attributeList:[]};class MeasureOperation extends rectOperation.RectOperation{constructor(e){super(__spreadProps(__spreadValues({},e),{config:JSON.stringify(config)}))}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||this.setSelectedRectID(this.drawingRect.id)}}module.exports=MeasureOperation;
@@ -0,0 +1 @@
1
+ "use strict";var annotation=require("../../constant/annotation.js"),tool=require("../../constant/tool.js"),AxisUtils=require("../../utils/tool/AxisUtils.js"),CommonToolUtils=require("../../utils/tool/CommonToolUtils.js"),DrawUtils=require("../../utils/tool/DrawUtils.js"),PolygonUtils=require("../../utils/tool/PolygonUtils.js"),StyleUtils=require("../../utils/tool/StyleUtils.js"),polygonOperation=require("./polygonOperation.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,t,e)=>t in o?__defProp(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,__spreadValues=(o,t)=>{for(var e in t||(t={}))__hasOwnProp.call(t,e)&&__defNormalProp(o,e,t[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(t))__propIsEnum.call(t,e)&&__defNormalProp(o,e,t[e]);return o},__spreadProps=(o,t)=>__defProps(o,__getOwnPropDescs(t));class PointCloud2dOperation extends polygonOperation{constructor(t){super(t);this.selectedIDs=[],this.rightMouseUp=i=>{if(this.drawingPointList.length>0){this.addDrawingPointToPolygonList();return}i.ctrlKey&&this.hoverID?this.emit("addSelectedIDs",this.hoverID):this.emit("setSelectedIDs",this.hoverID)},this.onKeyDown=()=>{},this.onKeyUp=()=>{},this.renderSingleSelectedPolygon=i=>{var r;if(this.selectedPolygons){const n=this.getColor(i.attribute),a=StyleUtils.getStrokeAndFill(n,i.valid,{isSelected:!0}),l=AxisUtils.default.changePointListByZoom(i.pointList,this.zoom,this.currentPos);DrawUtils.drawSelectedPolygonWithFillAndLine(this.canvas,l,{fillColor:"transparent",strokeColor:a.stroke,pointColor:"white",thickness:2,lineCap:"round",isClose:!0,lineType:(r=this.config)==null?void 0:r.lineType}),i.isRect===!0&&this.showDirectionLine===!0&&this.renderRectPolygonDirection(l)}};var e,s;this.showDirectionLine=(e=t.showDirectionLine)!=null?e:!0,this.forbidAddNew=(s=t.forbidAddNew)!=null?s:!1}get getSelectedIDs(){return this.selectedIDs}setSelectedIDs(t){this.selectedIDs=t,this.setSelectedID(this.selectedIDs.length===1?this.selectedIDs[0]:""),this.render()}deleteSelectedID(){super.deleteSelectedID(),this.selectedIDs=[],this.emit("deleteSelectedIDs")}get selectedPolygons(){return PolygonUtils.getPolygonByIDs(this.polygonList,this.selectedIDs)}getLineColor(){return"rgba(0, 255, 255, 0.5)"}renderStaticPolygon(){var t;this.isHidden===!1&&((t=this.polygonList)==null||t.forEach(e=>{var s,i,r;if([...this.selectedIDs,this.editPolygonID].includes(e.id))return;const{attribute:n}=e,a=this.getColor(n),l=StyleUtils.getStrokeAndFill(a,e.valid),d=AxisUtils.default.changePointListByZoom(e.pointList||[],this.zoom,this.currentPos);DrawUtils.drawPolygonWithFillAndLine(this.canvas,d,{fillColor:"transparent",strokeColor:l.stroke,pointColor:"white",thickness:(i=(s=this.style)==null?void 0:s.width)!=null?i:2,lineCap:"round",isClose:!0,lineType:(r=this.config)==null?void 0:r.lineType}),e.isRect===!0&&this.showDirectionLine===!0&&this.renderRectPolygonDirection(d)}))}renderSelectedPolygon(){var t;(t=this.selectedPolygons)==null||t.forEach(e=>{this.renderSingleSelectedPolygon(e)})}renderRectPolygonDirection(t){t.length<2||DrawUtils.drawLine(this.canvas,t[0],t[1],{color:"red",thickness:3})}get currentPolygonListByPattern(){return this.polygonList.filter(t=>this.pattern===tool.EPolygonPattern.Rect?t.isRect===!0:this.pattern===tool.EPolygonPattern.Normal?t.isRect!==!0:!0)}getHoverID(t){var e;const s=this.getCoordinateUnderZoom(t),r=this.currentPolygonListByPattern.map(n=>__spreadProps(__spreadValues({},n),{pointList:AxisUtils.default.changePointListByZoom(n.pointList,this.zoom)}));return PolygonUtils.getHoverPolygonID(s,r,10,(e=this.config)==null?void 0:e.lineType)}switchToNextPolygon(t=annotation.ESortDirection.ascend){if(this.drawingPointList.length>0)return;const e=this.currentPolygonListByPattern.map(i=>{var r,n,a,l;return __spreadProps(__spreadValues({},i),{x:(n=(r=i.pointList[0])==null?void 0:r.x)!=null?n:0,y:(l=(a=i.pointList[0])==null?void 0:a.y)!=null?l:0})}),s=CommonToolUtils.getNextSelectedRectID(e,t,this.selectedID);if(s)return this.setSelectedIDs([s.id]),this.render(),[s.id]}setSelectedIdAfterAddingDrawing(t){this.drawingPointList.length!==0&&this.setSelectedID(t)}setSelectedID(t){var e,s;const i=this.selectedID;t!==i&&i&&((e=this._textAttributInstance)==null||e.changeSelected()),t||(s=this._textAttributInstance)==null||s.clearTextAttribute(),this.selectedID=t,this.render()}addPointInDrawing(t){this.forbidAddNew||super.addPointInDrawing(t)}setCanvasSize(t){var e,s;const i=this.pixelRatio;this.size=t,this.setImgInfo(t),this.updateCanvasBasicStyle(this.basicCanvas,t,0),this.updateCanvasBasicStyle(this.canvas,t,10),(e=this.ctx)==null||e.scale(i,i),(s=this.basicCtx)==null||s.scale(i,i),this.initImgPos(),this.renderBasicCanvas(),this.render()}}module.exports=PointCloud2dOperation;