@labelbee/lb-annotation 1.14.0-alpha.2 → 1.14.0-alpha.3

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 (187) hide show
  1. package/dist/_virtual/MathUtilsWorker.js +8 -1
  2. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +35 -2
  3. package/dist/_virtual/filterBoxWorker.js +8 -1
  4. package/dist/_virtual/highlightWorker.js +8 -1
  5. package/dist/assets/attributeIcon/icon_canvasEdit0.svg.js +5 -1
  6. package/dist/assets/attributeIcon/icon_canvasEdit1.svg.js +5 -1
  7. package/dist/assets/attributeIcon/icon_canvasEdit2.svg.js +5 -1
  8. package/dist/assets/attributeIcon/icon_canvasEdit3.svg.js +5 -1
  9. package/dist/assets/attributeIcon/icon_canvasEdit4.svg.js +5 -1
  10. package/dist/assets/attributeIcon/icon_canvasEdit5.svg.js +5 -1
  11. package/dist/assets/attributeIcon/icon_canvasEdit6.svg.js +5 -1
  12. package/dist/assets/attributeIcon/icon_canvasEdit7.svg.js +5 -1
  13. package/dist/assets/attributeIcon/icon_canvasEdit8.svg.js +5 -1
  14. package/dist/assets/attributeIcon/icon_canvasEdit_miss.svg.js +5 -1
  15. package/dist/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -5
  16. package/dist/assets/attributeIcon/icon_cuboidLeft.svg.js +5 -7
  17. package/dist/assets/attributeIcon/icon_cuboidMore.svg.js +5 -5
  18. package/dist/assets/attributeIcon/icon_cuboidRight.svg.js +5 -5
  19. package/dist/assets/attributeIcon/icon_cuboidTop.svg.js +5 -12
  20. package/dist/assets/attributeIcon/icon_editFEN.svg.js +5 -1
  21. package/dist/assets/attributeIcon/icon_editHUANG.svg.js +5 -1
  22. package/dist/assets/attributeIcon/icon_editLAN.svg.js +5 -1
  23. package/dist/assets/attributeIcon/icon_editLV.svg.js +5 -1
  24. package/dist/assets/attributeIcon/icon_editQING.svg.js +5 -1
  25. package/dist/constant/annotation.js +127 -1
  26. package/dist/constant/annotationTask.js +30 -1
  27. package/dist/constant/defaultConfig.js +266 -1
  28. package/dist/constant/keyCode.js +38 -1
  29. package/dist/constant/style.js +98 -1
  30. package/dist/constant/tool.js +236 -1
  31. package/dist/core/index.js +150 -1
  32. package/dist/core/pointCloud/OrbitControls.js +665 -1
  33. package/dist/core/pointCloud/PCDLoader.js +260 -2
  34. package/dist/core/pointCloud/annotation.js +215 -1
  35. package/dist/core/pointCloud/cache.js +53 -1
  36. package/dist/core/pointCloud/index.js +991 -5
  37. package/dist/core/pointCloud/matrix.js +138 -1
  38. package/dist/core/pointCloud/segmentation.js +144 -0
  39. package/dist/core/pointCloud/selector/Sse3dLassoSelector.js +26 -0
  40. package/dist/core/pointCloud/selector/Sse3dSelector.js +16 -0
  41. package/dist/core/scheduler.js +233 -1
  42. package/dist/core/toolOperation/LineToolOperation.js +1434 -1
  43. package/dist/core/toolOperation/ScribbleTool.js +292 -1
  44. package/dist/core/toolOperation/TextToolOperation.js +131 -1
  45. package/dist/core/toolOperation/ViewOperation.js +556 -1
  46. package/dist/core/toolOperation/basicToolOperation.js +881 -1
  47. package/dist/core/toolOperation/checkOperation.js +208 -1
  48. package/dist/core/toolOperation/cuboidOperation.js +754 -1
  49. package/dist/core/toolOperation/cuboidToggleButtonClass.js +152 -7
  50. package/dist/core/toolOperation/eventListener.js +37 -1
  51. package/dist/core/toolOperation/measureOperation.js +41 -1
  52. package/dist/core/toolOperation/pointCloud2dOperation.js +365 -1
  53. package/dist/core/toolOperation/pointOperation.js +696 -1
  54. package/dist/core/toolOperation/polygonOperation.js +1251 -1
  55. package/dist/core/toolOperation/rectOperation.js +1233 -1
  56. package/dist/core/toolOperation/segmentByRect.js +174 -1
  57. package/dist/core/toolOperation/tagOperation.js +201 -3
  58. package/dist/core/toolOperation/textAttributeClass.js +182 -16
  59. package/dist/index.js +185 -1
  60. package/dist/locales/constants.js +24 -1
  61. package/dist/locales/en_US/message.js +25 -1
  62. package/dist/locales/index.js +19 -1
  63. package/dist/locales/zh_CN/message.js +25 -1
  64. package/dist/newCore/CanvasScheduler.js +35 -1
  65. package/dist/types/core/pointCloud/segmentation.d.ts +0 -0
  66. package/dist/types/core/pointCloud/selector/Sse3dLassoSelector.d.ts +0 -0
  67. package/dist/types/core/pointCloud/selector/Sse3dSelector.d.ts +0 -0
  68. package/dist/utils/ActionsHistory.js +84 -1
  69. package/dist/utils/ImgUtils.js +23 -1
  70. package/dist/utils/MathUtils.js +385 -2
  71. package/dist/utils/VectorUtils.js +25 -1
  72. package/dist/utils/tool/AttributeUtils.js +218 -1
  73. package/dist/utils/tool/AxisUtils.js +340 -1
  74. package/dist/utils/tool/CanvasUtils.js +62 -1
  75. package/dist/utils/tool/CommonToolUtils.js +174 -1
  76. package/dist/utils/tool/CuboidUtils.js +704 -1
  77. package/dist/utils/tool/DblClickEventListener.js +102 -1
  78. package/dist/utils/tool/DrawUtils.js +492 -3
  79. package/dist/utils/tool/EnhanceCommonToolUtils.js +53 -1
  80. package/dist/utils/tool/ImgPosUtils.js +58 -1
  81. package/dist/utils/tool/LineToolUtils.js +261 -1
  82. package/dist/utils/tool/MarkerUtils.js +56 -1
  83. package/dist/utils/tool/PolygonUtils.js +460 -1
  84. package/dist/utils/tool/RectUtils.js +155 -1
  85. package/dist/utils/tool/RenderDomClass.js +57 -7
  86. package/dist/utils/tool/RenderDomUtils.js +21 -4
  87. package/dist/utils/tool/StyleUtils.js +31 -1
  88. package/dist/utils/tool/TagUtils.js +129 -1
  89. package/dist/utils/tool/UnitUtils.js +12 -1
  90. package/dist/utils/tool/ZoomUtils.js +72 -1
  91. package/dist/utils/tool/polygonTool.js +133 -1
  92. package/dist/utils/uuid.js +26 -1
  93. package/es/_virtual/MathUtilsWorker.js +6 -1
  94. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
  95. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
  96. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -2
  97. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
  98. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
  99. package/es/_virtual/filterBoxWorker.js +6 -1
  100. package/es/_virtual/highlightWorker.js +6 -1
  101. package/es/assets/attributeIcon/icon_canvasEdit0.svg.js +3 -1
  102. package/es/assets/attributeIcon/icon_canvasEdit1.svg.js +3 -1
  103. package/es/assets/attributeIcon/icon_canvasEdit2.svg.js +3 -1
  104. package/es/assets/attributeIcon/icon_canvasEdit3.svg.js +3 -1
  105. package/es/assets/attributeIcon/icon_canvasEdit4.svg.js +3 -1
  106. package/es/assets/attributeIcon/icon_canvasEdit5.svg.js +3 -1
  107. package/es/assets/attributeIcon/icon_canvasEdit6.svg.js +3 -1
  108. package/es/assets/attributeIcon/icon_canvasEdit7.svg.js +3 -1
  109. package/es/assets/attributeIcon/icon_canvasEdit8.svg.js +3 -1
  110. package/es/assets/attributeIcon/icon_canvasEdit_miss.svg.js +3 -1
  111. package/es/assets/attributeIcon/icon_cuboidFAB.svg.js +3 -5
  112. package/es/assets/attributeIcon/icon_cuboidLeft.svg.js +3 -7
  113. package/es/assets/attributeIcon/icon_cuboidMore.svg.js +3 -5
  114. package/es/assets/attributeIcon/icon_cuboidRight.svg.js +3 -5
  115. package/es/assets/attributeIcon/icon_cuboidTop.svg.js +3 -12
  116. package/es/assets/attributeIcon/icon_editFEN.svg.js +3 -1
  117. package/es/assets/attributeIcon/icon_editHUANG.svg.js +3 -1
  118. package/es/assets/attributeIcon/icon_editLAN.svg.js +3 -1
  119. package/es/assets/attributeIcon/icon_editLV.svg.js +3 -1
  120. package/es/assets/attributeIcon/icon_editQING.svg.js +3 -1
  121. package/es/constant/annotation.js +113 -1
  122. package/es/constant/annotationTask.js +25 -1
  123. package/es/constant/defaultConfig.js +260 -1
  124. package/es/constant/keyCode.js +36 -1
  125. package/es/constant/style.js +74 -1
  126. package/es/constant/tool.js +220 -1
  127. package/es/core/index.js +148 -1
  128. package/es/core/pointCloud/OrbitControls.js +661 -1
  129. package/es/core/pointCloud/PCDLoader.js +256 -2
  130. package/es/core/pointCloud/annotation.js +211 -1
  131. package/es/core/pointCloud/cache.js +49 -1
  132. package/es/core/pointCloud/index.js +962 -5
  133. package/es/core/pointCloud/matrix.js +109 -1
  134. package/es/core/pointCloud/segmentation.js +120 -0
  135. package/es/core/pointCloud/selector/Sse3dLassoSelector.js +24 -0
  136. package/es/core/pointCloud/selector/Sse3dSelector.js +14 -0
  137. package/es/core/scheduler.js +228 -1
  138. package/es/core/toolOperation/LineToolOperation.js +1421 -1
  139. package/es/core/toolOperation/ScribbleTool.js +290 -1
  140. package/es/core/toolOperation/TextToolOperation.js +129 -1
  141. package/es/core/toolOperation/ViewOperation.js +549 -1
  142. package/es/core/toolOperation/basicToolOperation.js +877 -1
  143. package/es/core/toolOperation/checkOperation.js +206 -1
  144. package/es/core/toolOperation/cuboidOperation.js +752 -1
  145. package/es/core/toolOperation/cuboidToggleButtonClass.js +150 -7
  146. package/es/core/toolOperation/eventListener.js +35 -1
  147. package/es/core/toolOperation/measureOperation.js +39 -1
  148. package/es/core/toolOperation/pointCloud2dOperation.js +359 -1
  149. package/es/core/toolOperation/pointOperation.js +690 -1
  150. package/es/core/toolOperation/polygonOperation.js +1245 -1
  151. package/es/core/toolOperation/rectOperation.js +1228 -1
  152. package/es/core/toolOperation/scribbleTool2.js +249 -0
  153. package/es/core/toolOperation/segmentByRect.js +172 -1
  154. package/es/core/toolOperation/tagOperation.js +199 -3
  155. package/es/core/toolOperation/textAttributeClass.js +180 -16
  156. package/es/index.js +46 -1
  157. package/es/locales/constants.js +22 -1
  158. package/es/locales/en_US/message.js +23 -1
  159. package/es/locales/index.js +17 -1
  160. package/es/locales/zh_CN/message.js +23 -1
  161. package/es/newCore/CanvasScheduler.js +31 -1
  162. package/es/utils/ActionsHistory.js +78 -1
  163. package/es/utils/ImgUtils.js +21 -1
  164. package/es/utils/MathUtils.js +380 -2
  165. package/es/utils/VectorUtils.js +23 -1
  166. package/es/utils/tool/AttributeUtils.js +212 -1
  167. package/es/utils/tool/AxisUtils.js +335 -1
  168. package/es/utils/tool/CanvasUtils.js +60 -1
  169. package/es/utils/tool/CommonToolUtils.js +172 -1
  170. package/es/utils/tool/CuboidUtils.js +680 -1
  171. package/es/utils/tool/DblClickEventListener.js +100 -1
  172. package/es/utils/tool/DrawUtils.js +490 -3
  173. package/es/utils/tool/EnhanceCommonToolUtils.js +48 -1
  174. package/es/utils/tool/ImgPosUtils.js +56 -1
  175. package/es/utils/tool/LineToolUtils.js +255 -1
  176. package/es/utils/tool/MarkerUtils.js +54 -1
  177. package/es/utils/tool/PolygonUtils.js +458 -1
  178. package/es/utils/tool/RectUtils.js +153 -1
  179. package/es/utils/tool/RenderDomClass.js +55 -7
  180. package/es/utils/tool/RenderDomUtils.js +19 -4
  181. package/es/utils/tool/StyleUtils.js +29 -1
  182. package/es/utils/tool/TagUtils.js +127 -1
  183. package/es/utils/tool/UnitUtils.js +10 -1
  184. package/es/utils/tool/ZoomUtils.js +70 -1
  185. package/es/utils/tool/polygonTool.js +126 -1
  186. package/es/utils/uuid.js +24 -1
  187. package/package.json +7 -5
@@ -1 +1,138 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),lbUtils=require("@labelbee/lb-utils"),uuid=require("../../utils/uuid.js");function _interopNamespace(r){if(r&&r.__esModule)return r;var t=Object.create(null);return r&&Object.keys(r).forEach(function(e){if(e!=="default"){var i=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:function(){return r[e]}})}}),t.default=r,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=(r,t,e)=>t in r?__defProp(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,__spreadValues=(r,t)=>{for(var e in t||(t={}))__hasOwnProp.call(t,e)&&__defNormalProp(r,e,t[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(t))__propIsEnum.call(t,e)&&__defNormalProp(r,e,t[e]);return r},__spreadProps=(r,t)=>__defProps(r,__getOwnPropDescs(t));function createThreeMatrix4(r){return new THREE__namespace.Matrix4().set(...r)}function transferKitti2Matrix(r,t,e){const i=lbUtils.MatrixUtils.transferMatrix34FromKitti2Three(r),a=lbUtils.MatrixUtils.transferMatrix33FromKitti2Three(t),n=lbUtils.MatrixUtils.transferMatrix34FromKitti2Three(e),l=createThreeMatrix4(i),c=createThreeMatrix4(a),s=createThreeMatrix4(n);return{composeMatrix4:s.clone().premultiply(c).premultiply(l),PM:l,RM:c,TM:s}}function rotatePoint(r,t,e){var i;const a=new THREE__namespace.Vector3(r.x,r.y,(i=r==null?void 0:r.z)!=null?i:1),n=new THREE__namespace.Matrix4().makeRotationZ(e),l=new THREE__namespace.Matrix4().makeTranslation(t.x,t.y,t.z),c=new THREE__namespace.Matrix4().makeTranslation(-t.x,-t.y,-t.z);return a.clone().applyMatrix4(c).applyMatrix4(n).applyMatrix4(l)}function lidar2image(r,t){const i=new THREE__namespace.Vector4(r.x,r.y,r.z).applyMatrix4(t);if(i.z<0)return;const a=1/i.z,n=new THREE__namespace.Matrix4().set(a,0,0,0,0,a,0,0,0,0,a,0,0,0,0,1);return i.applyMatrix4(n)}function getCuboidFromPointCloudBox(r){const{center:t,width:e,height:i,depth:a,rotation:n}=r,l=[{x:t.x+e/2,y:t.y-i/2},{x:t.x+e/2,y:t.y+i/2},{x:t.x-e/2,y:t.y+i/2},{x:t.x-e/2,y:t.y-i/2}].map(o=>{const u=rotatePoint(o,t,n);return{x:u.x,y:u.y}}),c=t.z+a/2,s=t.z-a/2;return __spreadProps(__spreadValues({},r),{polygonPointList:l,zMax:c,zMin:s})}function pointCloudLidar2image(r,t){const e=lbUtils.PointCloudUtils.getAllViewData(r),{P:i,R:a,T:n}=t,{composeMatrix4:l}=transferKitti2Matrix(i,a,n);return e.map(s=>({type:s.type,pointList:s.pointList.map(o=>rotatePoint(o,r.center,r.rotation)).map(o=>lidar2image(o,l)).map(o=>{if(!!o)return{id:uuid(),x:o==null?void 0:o.x,y:o==null?void 0:o.y}}).filter(o=>o!==void 0)})).filter(s=>s.pointList.length!==0)}exports.createThreeMatrix4=createThreeMatrix4,exports.getCuboidFromPointCloudBox=getCuboidFromPointCloudBox,exports.lidar2image=lidar2image,exports.pointCloudLidar2image=pointCloudLidar2image,exports.rotatePoint=rotatePoint,exports.transferKitti2Matrix=transferKitti2Matrix;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var THREE = require('three');
6
+ var lbUtils = require('@labelbee/lb-utils');
7
+ var uuid = require('../../utils/uuid.js');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
28
+
29
+ var __defProp = Object.defineProperty;
30
+ var __defProps = Object.defineProperties;
31
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
32
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
33
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
34
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
35
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
36
+ var __spreadValues = (a, b) => {
37
+ for (var prop in b || (b = {}))
38
+ if (__hasOwnProp.call(b, prop))
39
+ __defNormalProp(a, prop, b[prop]);
40
+ if (__getOwnPropSymbols)
41
+ for (var prop of __getOwnPropSymbols(b)) {
42
+ if (__propIsEnum.call(b, prop))
43
+ __defNormalProp(a, prop, b[prop]);
44
+ }
45
+ return a;
46
+ };
47
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
48
+ function createThreeMatrix4(matrix4) {
49
+ return new THREE__namespace.Matrix4().set(...matrix4);
50
+ }
51
+ function transferKitti2Matrix(P, R, T) {
52
+ const PMA = lbUtils.MatrixUtils.transferMatrix34FromKitti2Three(P);
53
+ const RMA = lbUtils.MatrixUtils.transferMatrix33FromKitti2Three(R);
54
+ const TMA = lbUtils.MatrixUtils.transferMatrix34FromKitti2Three(T);
55
+ const PM = createThreeMatrix4(PMA);
56
+ const RM = createThreeMatrix4(RMA);
57
+ const TM = createThreeMatrix4(TMA);
58
+ return {
59
+ composeMatrix4: TM.clone().premultiply(RM).premultiply(PM),
60
+ PM,
61
+ RM,
62
+ TM
63
+ };
64
+ }
65
+ function rotatePoint(points, centerPoint, rotationZ) {
66
+ var _a;
67
+ const pointVector = new THREE__namespace.Vector3(points.x, points.y, (_a = points == null ? void 0 : points.z) != null ? _a : 1);
68
+ const Rz = new THREE__namespace.Matrix4().makeRotationZ(rotationZ);
69
+ const TFrom = new THREE__namespace.Matrix4().makeTranslation(centerPoint.x, centerPoint.y, centerPoint.z);
70
+ const TBack = new THREE__namespace.Matrix4().makeTranslation(-centerPoint.x, -centerPoint.y, -centerPoint.z);
71
+ return pointVector.clone().applyMatrix4(TBack).applyMatrix4(Rz).applyMatrix4(TFrom);
72
+ }
73
+ function lidar2image(point, composeMatrix4) {
74
+ const vector = new THREE__namespace.Vector4(point.x, point.y, point.z);
75
+ const newV = vector.applyMatrix4(composeMatrix4);
76
+ if (newV.z < 0) {
77
+ return void 0;
78
+ }
79
+ const z = 1 / newV.z;
80
+ const fixMatrix4 = new THREE__namespace.Matrix4().set(z, 0, 0, 0, 0, z, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);
81
+ return newV.applyMatrix4(fixMatrix4);
82
+ }
83
+ function getCuboidFromPointCloudBox(boxParams) {
84
+ const {center, width, height, depth, rotation} = boxParams;
85
+ const polygonPointList = [
86
+ {
87
+ x: center.x + width / 2,
88
+ y: center.y - height / 2
89
+ },
90
+ {
91
+ x: center.x + width / 2,
92
+ y: center.y + height / 2
93
+ },
94
+ {
95
+ x: center.x - width / 2,
96
+ y: center.y + height / 2
97
+ },
98
+ {
99
+ x: center.x - width / 2,
100
+ y: center.y - height / 2
101
+ }
102
+ ].map((v) => {
103
+ const vector = rotatePoint(v, center, rotation);
104
+ return {
105
+ x: vector.x,
106
+ y: vector.y
107
+ };
108
+ });
109
+ const zMax = center.z + depth / 2;
110
+ const zMin = center.z - depth / 2;
111
+ return __spreadProps(__spreadValues({}, boxParams), {
112
+ polygonPointList,
113
+ zMax,
114
+ zMin
115
+ });
116
+ }
117
+ function pointCloudLidar2image(boxParams, cameraMatrix) {
118
+ const allViewData = lbUtils.PointCloudUtils.getAllViewData(boxParams);
119
+ const {P, R, T} = cameraMatrix;
120
+ const {composeMatrix4} = transferKitti2Matrix(P, R, T);
121
+ const transferViewData = allViewData.map((viewData) => ({
122
+ type: viewData.type,
123
+ pointList: viewData.pointList.map((point) => rotatePoint(point, boxParams.center, boxParams.rotation)).map((point) => lidar2image(point, composeMatrix4)).map((point) => {
124
+ if (!point) {
125
+ return void 0;
126
+ }
127
+ return {id: uuid(), x: point == null ? void 0 : point.x, y: point == null ? void 0 : point.y};
128
+ }).filter((v) => v !== void 0)
129
+ })).filter((v) => v.pointList.length !== 0);
130
+ return transferViewData;
131
+ }
132
+
133
+ exports.createThreeMatrix4 = createThreeMatrix4;
134
+ exports.getCuboidFromPointCloudBox = getCuboidFromPointCloudBox;
135
+ exports.lidar2image = lidar2image;
136
+ exports.pointCloudLidar2image = pointCloudLidar2image;
137
+ exports.rotatePoint = rotatePoint;
138
+ exports.transferKitti2Matrix = transferKitti2Matrix;
@@ -0,0 +1,144 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DrawUtils = require('../../utils/tool/DrawUtils.js');
6
+ var THREE = require('three');
7
+ var Sse3dLassoSelector = require('./selector/Sse3dLassoSelector.js');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
28
+
29
+ class PointCloudSegmentOperation {
30
+ constructor(props) {
31
+ this.pointer = new THREE__namespace.Vector2();
32
+ this._forbidRender = false;
33
+ this.polygon = [];
34
+ this.startX = NaN;
35
+ this.startY = NaN;
36
+ this.onMouseMove = (iev) => {
37
+ const coord = this.getCoordinate(iev);
38
+ this.pointer.x = coord.x / this.dom.clientWidth * 2 - 1;
39
+ this.pointer.y = -(coord.y / this.dom.clientHeight) * 2 + 1;
40
+ const ev = {
41
+ offsetX: iev.offsetX,
42
+ offsetY: iev.offsetY,
43
+ pageX: iev.pageX,
44
+ pageY: iev.pageY,
45
+ which: iev.buttons === 2 ? 3 : 0
46
+ };
47
+ this.selector.mouseDrag(ev);
48
+ };
49
+ this.onMouseDown = (iev) => {
50
+ this._forbidRender = true;
51
+ const ev = {
52
+ offsetX: iev.offsetX,
53
+ offsetY: iev.offsetY,
54
+ pageX: iev.pageX,
55
+ pageY: iev.pageY,
56
+ which: iev.buttons === 2 ? 3 : 0
57
+ };
58
+ this.selector.mouseDown(ev);
59
+ };
60
+ this.onMouseUp = (iev) => {
61
+ const ev = {
62
+ offsetX: iev.offsetX,
63
+ offsetY: iev.offsetY,
64
+ pageX: iev.pageX,
65
+ pageY: iev.pageY,
66
+ which: iev.buttons === 2 ? 3 : 0
67
+ };
68
+ this.selector.mouseUp(ev);
69
+ };
70
+ this.render = ({camera, scene}) => {
71
+ const originPolygon = this.selector.polygon;
72
+ const polygon = [];
73
+ if (originPolygon.length > 0 && this.mouseCanvas) {
74
+ for (let i = 0; i < originPolygon.length; i += 2) {
75
+ polygon.push({
76
+ x: originPolygon[i * 2],
77
+ y: originPolygon[i * 2 + 1]
78
+ });
79
+ }
80
+ console.log("polygon", polygon);
81
+ DrawUtils.drawPolygon(this.mouseCanvas, polygon, {isClose: false, color: "red"});
82
+ }
83
+ };
84
+ this.dom = props.dom;
85
+ this.selector = new Sse3dLassoSelector(this);
86
+ const canvas = document.createElement("canvas");
87
+ canvas.id = "canvasMouse";
88
+ this.updateCanvasBasicStyle(canvas, {width: this.dom.clientWidth, height: this.dom.clientHeight}, 10);
89
+ this.dom.appendChild(canvas);
90
+ canvas.addEventListener("pointermove", this.onMouseMove);
91
+ canvas.addEventListener("pointerdown", this.onMouseDown);
92
+ canvas.addEventListener("pointerup", this.onMouseUp);
93
+ canvas.oncontextmenu = (e) => {
94
+ e.preventDefault();
95
+ };
96
+ canvas.getContext("2d");
97
+ this.mouseCanvas = canvas;
98
+ this.getPointsInPolygon = props.getPointsInPolygon;
99
+ this.setupRaycaster();
100
+ const geometry = new THREE__namespace.BufferGeometry();
101
+ const pointsMaterial = new THREE__namespace.PointsMaterial({size: 10, color: "red"});
102
+ geometry.setAttribute("position", new THREE__namespace.BufferAttribute(new Float32Array([0, 0, 0]), 3));
103
+ this._highlight_Point = new THREE__namespace.Points(geometry, pointsMaterial);
104
+ this.emitRender = props.render;
105
+ const geometry2 = new THREE__namespace.BufferGeometry();
106
+ const pointsMaterial2 = new THREE__namespace.PointsMaterial({size: 5, color: "white"});
107
+ geometry2.setAttribute("position", new THREE__namespace.BufferAttribute(new Float32Array([0, 0, 0]), 3));
108
+ this._temp = new THREE__namespace.Points(geometry2, pointsMaterial2);
109
+ }
110
+ updateCanvasBasicStyle(canvas, size, zIndex) {
111
+ const pixel = 2;
112
+ canvas.style.position = "absolute";
113
+ canvas.width = size.width * pixel;
114
+ canvas.height = size.height * pixel;
115
+ canvas.style.width = `${size.width}px`;
116
+ canvas.style.height = `${size.height}px`;
117
+ canvas.style.left = "0";
118
+ canvas.style.top = "0";
119
+ canvas.style.zIndex = `${zIndex} `;
120
+ }
121
+ addMorePoint(scene) {
122
+ scene.add(this._highlight_Point);
123
+ scene.add(this._temp);
124
+ }
125
+ getCoordinate(e) {
126
+ const bounding = this.dom.getBoundingClientRect();
127
+ return {
128
+ x: e.clientX - bounding.left,
129
+ y: e.clientY - bounding.top
130
+ };
131
+ }
132
+ setupRaycaster() {
133
+ const boundingBox = {x: 10, y: 10, z: 10};
134
+ const numberOfPoints = 10;
135
+ this.raycaster = new THREE__namespace.Raycaster();
136
+ const threshold = Math.cbrt(boundingBox.x * boundingBox.y * boundingBox.z / numberOfPoints) / 3;
137
+ if (this.raycaster) {
138
+ this.raycaster.params.Points.threshold = threshold;
139
+ this.raycaster.linePrecision = 0.1;
140
+ }
141
+ }
142
+ }
143
+
144
+ exports.PointCloudSegmentOperation = PointCloudSegmentOperation;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var Sse3dSelector = require('./Sse3dSelector.js');
4
+
5
+ class Sse3dLassoSelector extends Sse3dSelector {
6
+ mouseDown(ev) {
7
+ if (ev.which === 3) {
8
+ this.pushPoint(ev.offsetX, ev.offsetY);
9
+ }
10
+ }
11
+ mouseUp(ev) {
12
+ if (ev.which === 3) {
13
+ this.scene.getPointsInPolygon(this.polygon);
14
+ this.polygon.length = 0;
15
+ }
16
+ }
17
+ mouseDrag(ev) {
18
+ console.log("ev", ev.which);
19
+ if (ev.which === 3) {
20
+ this.pushPoint(ev.offsetX, ev.offsetY);
21
+ this.scene.emitRender(true);
22
+ }
23
+ }
24
+ }
25
+
26
+ module.exports = Sse3dLassoSelector;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ class Sse3dSelector {
4
+ constructor(scene) {
5
+ this.scene = scene;
6
+ this.polygon = [];
7
+ }
8
+ pushPoint(x, y) {
9
+ this.polygon.push([x, y]);
10
+ }
11
+ deactivate() {
12
+ this.polygon.length = 0;
13
+ }
14
+ }
15
+
16
+ module.exports = Sse3dSelector;
@@ -1 +1,233 @@
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=e=>{const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");return i?(i.fillStyle="transparent",i.fillRect(0,0,e.width,e.height),t.toDataURL()):""},arraySwap=(e,t,i)=>{const o=e[t];return e[t]=e[i],e[i]=o,e},_HybridToolUtils=class{static isSingleTool(e){return!this.isHybridTool(e)}static isHybridTool(e){return Array.isArray(e)}};let HybridToolUtils=_HybridToolUtils;HybridToolUtils.getTopToolName=e=>_HybridToolUtils.isHybridTool(e)?e[e.length-1]:e;class ToolScheduler{constructor(t){this.toolOperationList=[],this.toolOperationDom=[],this.toolOperationNameList=[];var i,o;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=(o=t.style)!=null?o:defaultConfig.styleDefaultConfig}setImgNode(t,i){this.toolOperationList.forEach(o=>{o.setImgNode(t,i)})}setImgAttribute(t){this.toolOperationList.forEach(i=>{i.setImgAttribute(t)})}setSize(t){this.toolOperationList.forEach(i=>{i.setSize(t)})}syncPosition(t,i,o,s){this.toolOperationList.forEach(a=>{s!==a&&(a.setCurrentPos(t),a.setZoom(i),a.setImgInfo(o),a.renderBasicCanvas(),a.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,o=window.document.createElement("div");o.style.position="absolute",o.style.left="0",o.style.top="0",o.style.width=`${t}px`,o.style.height=`${i}px`;const s=this.toolOperationList.length+1;return o.style.zIndex=`${s}`,o}getEmptyImage(t,i){const o=createEmptyImage({width:t,height:i}),s=new Image;return s.src=o,s}createOperation(t,i,o){var s;const{width:a,height:l}=this.defaultSize,r=this.createDom(),d=this.getEmptyImage(a,l),h={container:r,size:this.size,config:(s=this==null?void 0:this.config)!=null?s:"{}",drawOutSideTarget:!1,style:this.style,imgNode:i||d,hiddenImg:!!t};o&&Object.assign(h,o);let n;if(!t)n=new basicToolOperation.BasicToolOperation(h),r.style.zIndex="0",n.init();else{const c=EnhanceCommonToolUtils.getCurrentOperation(t);if(!c)return;n=new c(h)}return n==null||n.init(),n.canvas.id=t!=null?t:"basicCanvas",n.on("dragMove",({currentPos:c,zoom:p,imgInfo:u})=>{this.syncPosition(c,p,u,n)}),n.on("renderZoom",(c,p,u)=>{c&&p&&this.syncPosition(p,c,u,n)}),t?(this.container.appendChild(r),this.toolOperationList.push(n),this.toolOperationNameList.push(t),this.toolOperationDom.push(r),n):(this.container.insertBefore(r,this.container.childNodes[0]),this.toolOperationList.unshift(n),this.toolOperationDom.unshift(r),n)}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,o=t-2,s=this.toolOperationDom[i],a=this.toolOperationDom[o];if(!(!a||!s))return s.style.zIndex=`${i-1}`,a.style.zIndex=`${i}`,this.toolOperationList[i].clearActiveStatus(),this.toolOperationList[i].clearCursorLine(),this.toolOperationList[i].render(),this.toolOperationList=arraySwap(this.toolOperationList,i,o),this.toolOperationDom=arraySwap(this.toolOperationDom,i,o),this.toolOperationList[i]}getFirstToolOperation(){return this.toolOperationList.length>1?this.toolOperationList[1]:this.toolOperationList[0]}switchToCanvas(t){var i,o,s,a;const l=this.toolOperationNameList.indexOf(t);if(l<0||this.toolOperationList.length<1||l>this.toolOperationDom.length-1)return;const r=this.toolOperationDom.length-1,d=this.toolOperationDom[l],h=this.toolOperationDom[r];if(!d||!h)return;const n=h.style.zIndex;return h.style.zIndex=`${d.style.zIndex}`,d.style.zIndex=`${n}`,(o=(i=this.toolOperationList[r]).clearActiveStatus)==null||o.call(i),(a=(s=this.toolOperationList[r]).clearCursorLine)==null||a.call(s),this.toolOperationList[r].render(),this.toolOperationList=arraySwap(this.toolOperationList,r,l),this.toolOperationDom=arraySwap(this.toolOperationDom,r,l),this.toolOperationNameList=arraySwap(this.toolOperationNameList,r,l),this.toolOperationList[r]}updateDataByToolName(t,i){const o=this.toolOperationNameList.indexOf(t);o>=0&&this.toolOperationList[o].setResult(i)}clearStatusAndResult(){this.toolOperationList.forEach(t=>{var i;(i=t.clearActiveStatus)==null||i.call(t),t.clearResult()})}destroyAllLayer(){this.toolOperationList.forEach(t=>{t.destroyCanvas(),this.init()})}init(){this.toolOperationList=[],this.toolOperationDom=[]}}exports.HybridToolUtils=HybridToolUtils,exports.ToolScheduler=ToolScheduler;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var defaultConfig = require('../constant/defaultConfig.js');
6
+ var EnhanceCommonToolUtils = require('../utils/tool/EnhanceCommonToolUtils.js');
7
+ var basicToolOperation = require('./toolOperation/basicToolOperation.js');
8
+
9
+ const createEmptyImage = (size) => {
10
+ const canvas = document.createElement("canvas");
11
+ canvas.width = size.width;
12
+ canvas.height = size.height;
13
+ const ctx = canvas.getContext("2d");
14
+ if (ctx) {
15
+ ctx.fillStyle = "transparent";
16
+ ctx.fillRect(0, 0, size.width, size.height);
17
+ return canvas.toDataURL();
18
+ }
19
+ return "";
20
+ };
21
+ const arraySwap = (array, index1, index2) => {
22
+ const a = array[index1];
23
+ array[index1] = array[index2];
24
+ array[index2] = a;
25
+ return array;
26
+ };
27
+ const _HybridToolUtils = class {
28
+ static isSingleTool(toolName) {
29
+ return !this.isHybridTool(toolName);
30
+ }
31
+ static isHybridTool(toolName) {
32
+ return Array.isArray(toolName);
33
+ }
34
+ };
35
+ let HybridToolUtils = _HybridToolUtils;
36
+ HybridToolUtils.getTopToolName = (toolName) => {
37
+ return _HybridToolUtils.isHybridTool(toolName) ? toolName[toolName.length - 1] : toolName;
38
+ };
39
+ class ToolScheduler {
40
+ constructor(props) {
41
+ this.toolOperationList = [];
42
+ this.toolOperationDom = [];
43
+ this.toolOperationNameList = [];
44
+ var _a, _b;
45
+ this.init();
46
+ this.container = props.container;
47
+ this.size = props.size;
48
+ this.imgNode = props.imgNode;
49
+ this.config = (_a = props.config) != null ? _a : JSON.stringify(defaultConfig.getConfig(HybridToolUtils.getTopToolName(props.toolName)));
50
+ this.style = (_b = props.style) != null ? _b : defaultConfig.styleDefaultConfig;
51
+ }
52
+ setImgNode(imgNode, basicImgInfo) {
53
+ this.toolOperationList.forEach((toolInstance) => {
54
+ toolInstance.setImgNode(imgNode, basicImgInfo);
55
+ });
56
+ }
57
+ setImgAttribute(imgAttribute) {
58
+ this.toolOperationList.forEach((toolInstance) => {
59
+ toolInstance.setImgAttribute(imgAttribute);
60
+ });
61
+ }
62
+ setSize(size) {
63
+ this.toolOperationList.forEach((toolInstance) => {
64
+ toolInstance.setSize(size);
65
+ });
66
+ }
67
+ syncPosition(currentPos, zoom, imgInfo, currentToolInstance) {
68
+ this.toolOperationList.forEach((toolInstance) => {
69
+ if (currentToolInstance === toolInstance) {
70
+ return;
71
+ }
72
+ toolInstance.setCurrentPos(currentPos);
73
+ toolInstance.setZoom(zoom);
74
+ toolInstance.setImgInfo(imgInfo);
75
+ toolInstance.renderBasicCanvas();
76
+ toolInstance.render();
77
+ });
78
+ }
79
+ get defaultSize() {
80
+ var _a, _b;
81
+ return {
82
+ width: ((_a = this.imgNode) == null ? void 0 : _a.width) || this.size.width,
83
+ height: ((_b = this.imgNode) == null ? void 0 : _b.height) || this.size.height
84
+ };
85
+ }
86
+ createDom() {
87
+ const {width, height} = this.defaultSize;
88
+ const dom = window.document.createElement("div");
89
+ dom.style.position = "absolute";
90
+ dom.style.left = "0";
91
+ dom.style.top = "0";
92
+ dom.style.width = `${width}px`;
93
+ dom.style.height = `${height}px`;
94
+ const zIndex = this.toolOperationList.length + 1;
95
+ dom.style.zIndex = `${zIndex}`;
96
+ return dom;
97
+ }
98
+ getEmptyImage(width, height) {
99
+ const imgSrc = createEmptyImage({width, height});
100
+ const emptyImgNode = new Image();
101
+ emptyImgNode.src = imgSrc;
102
+ return emptyImgNode;
103
+ }
104
+ createOperation(tool, imgNode, config) {
105
+ var _a;
106
+ const {width, height} = this.defaultSize;
107
+ const dom = this.createDom();
108
+ const emptyImgNode = this.getEmptyImage(width, height);
109
+ const defaultData = {
110
+ container: dom,
111
+ size: this.size,
112
+ config: (_a = this == null ? void 0 : this.config) != null ? _a : "{}",
113
+ drawOutSideTarget: false,
114
+ style: this.style,
115
+ imgNode: imgNode || emptyImgNode,
116
+ hiddenImg: !!tool
117
+ };
118
+ if (config) {
119
+ Object.assign(defaultData, config);
120
+ }
121
+ let toolInstance;
122
+ if (!tool) {
123
+ toolInstance = new basicToolOperation.BasicToolOperation(defaultData);
124
+ dom.style.zIndex = "0";
125
+ toolInstance.init();
126
+ } else {
127
+ const ToolOperation = EnhanceCommonToolUtils.getCurrentOperation(tool);
128
+ if (!ToolOperation) {
129
+ return;
130
+ }
131
+ toolInstance = new ToolOperation(defaultData);
132
+ }
133
+ toolInstance == null ? void 0 : toolInstance.init();
134
+ toolInstance.canvas.id = tool != null ? tool : "basicCanvas";
135
+ toolInstance.on("dragMove", ({currentPos, zoom, imgInfo}) => {
136
+ this.syncPosition(currentPos, zoom, imgInfo, toolInstance);
137
+ });
138
+ toolInstance.on("renderZoom", (zoom, currentPos, imgInfo) => {
139
+ if (zoom && currentPos) {
140
+ this.syncPosition(currentPos, zoom, imgInfo, toolInstance);
141
+ }
142
+ });
143
+ if (!tool) {
144
+ this.container.insertBefore(dom, this.container.childNodes[0]);
145
+ this.toolOperationList.unshift(toolInstance);
146
+ this.toolOperationDom.unshift(dom);
147
+ return toolInstance;
148
+ }
149
+ this.container.appendChild(dom);
150
+ this.toolOperationList.push(toolInstance);
151
+ this.toolOperationNameList.push(tool);
152
+ this.toolOperationDom.push(dom);
153
+ return toolInstance;
154
+ }
155
+ switchLastTwoCanvas() {
156
+ if (this.toolOperationDom.length < 3) {
157
+ console.error("switchLastTwoCanvas is just used the layer which has 3 canvas");
158
+ return;
159
+ }
160
+ const len = this.toolOperationDom.length;
161
+ const lastOneIndex = len - 1;
162
+ const last2SecondIndex = len - 2;
163
+ const lastOneDom = this.toolOperationDom[lastOneIndex];
164
+ const last2SecondDom = this.toolOperationDom[last2SecondIndex];
165
+ if (!last2SecondDom || !lastOneDom) {
166
+ return;
167
+ }
168
+ lastOneDom.style.zIndex = `${lastOneIndex - 1}`;
169
+ last2SecondDom.style.zIndex = `${lastOneIndex}`;
170
+ this.toolOperationList[lastOneIndex].clearActiveStatus();
171
+ this.toolOperationList[lastOneIndex].clearCursorLine();
172
+ this.toolOperationList[lastOneIndex].render();
173
+ this.toolOperationList = arraySwap(this.toolOperationList, lastOneIndex, last2SecondIndex);
174
+ this.toolOperationDom = arraySwap(this.toolOperationDom, lastOneIndex, last2SecondIndex);
175
+ return this.toolOperationList[lastOneIndex];
176
+ }
177
+ getFirstToolOperation() {
178
+ if (this.toolOperationList.length > 1) {
179
+ return this.toolOperationList[1];
180
+ }
181
+ return this.toolOperationList[0];
182
+ }
183
+ switchToCanvas(toolName) {
184
+ var _a, _b, _c, _d;
185
+ const chosenIndex = this.toolOperationNameList.indexOf(toolName);
186
+ if (chosenIndex < 0 || this.toolOperationList.length < 1 || chosenIndex > this.toolOperationDom.length - 1) {
187
+ return;
188
+ }
189
+ const lastOneIndex = this.toolOperationDom.length - 1;
190
+ const chosenDom = this.toolOperationDom[chosenIndex];
191
+ const lastOneDom = this.toolOperationDom[lastOneIndex];
192
+ if (!chosenDom || !lastOneDom) {
193
+ return;
194
+ }
195
+ const temp = lastOneDom.style.zIndex;
196
+ lastOneDom.style.zIndex = `${chosenDom.style.zIndex}`;
197
+ chosenDom.style.zIndex = `${temp}`;
198
+ (_b = (_a = this.toolOperationList[lastOneIndex]).clearActiveStatus) == null ? void 0 : _b.call(_a);
199
+ (_d = (_c = this.toolOperationList[lastOneIndex]).clearCursorLine) == null ? void 0 : _d.call(_c);
200
+ this.toolOperationList[lastOneIndex].render();
201
+ this.toolOperationList = arraySwap(this.toolOperationList, lastOneIndex, chosenIndex);
202
+ this.toolOperationDom = arraySwap(this.toolOperationDom, lastOneIndex, chosenIndex);
203
+ this.toolOperationNameList = arraySwap(this.toolOperationNameList, lastOneIndex, chosenIndex);
204
+ return this.toolOperationList[lastOneIndex];
205
+ }
206
+ updateDataByToolName(toolName, result) {
207
+ const operationIndex = this.toolOperationNameList.indexOf(toolName);
208
+ if (operationIndex >= 0) {
209
+ const operationInstance = this.toolOperationList[operationIndex];
210
+ operationInstance.setResult(result);
211
+ }
212
+ }
213
+ clearStatusAndResult() {
214
+ this.toolOperationList.forEach((toolInstance) => {
215
+ var _a;
216
+ (_a = toolInstance.clearActiveStatus) == null ? void 0 : _a.call(toolInstance);
217
+ toolInstance.clearResult();
218
+ });
219
+ }
220
+ destroyAllLayer() {
221
+ this.toolOperationList.forEach((toolInstance) => {
222
+ toolInstance.destroyCanvas();
223
+ this.init();
224
+ });
225
+ }
226
+ init() {
227
+ this.toolOperationList = [];
228
+ this.toolOperationDom = [];
229
+ }
230
+ }
231
+
232
+ exports.HybridToolUtils = HybridToolUtils;
233
+ exports.ToolScheduler = ToolScheduler;