kitchen-simulator 5.0.0-test.1 → 5.0.0-test.12

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 (1627) hide show
  1. package/README.md +1 -1
  2. package/package.json +47 -55
  3. package/src/CrossSignOn.jsx +94 -0
  4. package/src/KitchenConfigurator.jsx +1 -1
  5. package/src/_renderer.jsx +42 -0
  6. package/src/catalog/areas/area/planner-element.jsx +1 -1
  7. package/src/catalog/lines/wall/planner-element.jsx +1 -1
  8. package/src/catalog/mycatalog.js +26 -0
  9. package/src/components/_export.js +29 -0
  10. package/src/components/viewer3d/scene-creator.js +23 -26
  11. package/src/components/viewer3d/viewer3d.js +18 -18
  12. package/src/index.js +1 -4
  13. package/src/renderer.jsx +466 -0
  14. package/es/@history.js +0 -3
  15. package/es/@history.js.map +0 -1
  16. package/es/AppContext.js +0 -4
  17. package/es/AppContext.js.map +0 -1
  18. package/es/KitchenConfigurator.js +0 -1345
  19. package/es/KitchenConfigurator.js.map +0 -1
  20. package/es/KitchenConfiguratorApp.js +0 -532
  21. package/es/KitchenConfiguratorApp.js.map +0 -1
  22. package/es/actions/area-actions.js +0 -15
  23. package/es/actions/area-actions.js.map +0 -1
  24. package/es/actions/export.js +0 -26
  25. package/es/actions/export.js.map +0 -1
  26. package/es/actions/groups-actions.js +0 -90
  27. package/es/actions/groups-actions.js.map +0 -1
  28. package/es/actions/holes-actions.js +0 -120
  29. package/es/actions/holes-actions.js.map +0 -1
  30. package/es/actions/items-actions.js +0 -314
  31. package/es/actions/items-actions.js.map +0 -1
  32. package/es/actions/lines-actions.js +0 -83
  33. package/es/actions/lines-actions.js.map +0 -1
  34. package/es/actions/project-actions.js +0 -282
  35. package/es/actions/project-actions.js.map +0 -1
  36. package/es/actions/scene-actions.js +0 -34
  37. package/es/actions/scene-actions.js.map +0 -1
  38. package/es/actions/user-actions.js +0 -59
  39. package/es/actions/user-actions.js.map +0 -1
  40. package/es/actions/vertices-actions.js +0 -28
  41. package/es/actions/vertices-actions.js.map +0 -1
  42. package/es/actions/viewer2d-actions.js +0 -59
  43. package/es/actions/viewer2d-actions.js.map +0 -1
  44. package/es/actions/viewer3d-actions.js +0 -24
  45. package/es/actions/viewer3d-actions.js.map +0 -1
  46. package/es/catalog/areas/area/planner-element.js +0 -41
  47. package/es/catalog/areas/area/planner-element.js.map +0 -1
  48. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  49. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  50. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  51. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  52. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  53. package/es/catalog/back.png +0 -0
  54. package/es/catalog/catalog.js +0 -278
  55. package/es/catalog/catalog.js.map +0 -1
  56. package/es/catalog/doors.png +0 -0
  57. package/es/catalog/doorways.png +0 -0
  58. package/es/catalog/envMap/nx.hdr +0 -0
  59. package/es/catalog/envMap/ny.hdr +0 -0
  60. package/es/catalog/envMap/nz.hdr +0 -0
  61. package/es/catalog/envMap/px.hdr +0 -0
  62. package/es/catalog/envMap/py.hdr +0 -0
  63. package/es/catalog/envMap/pz.hdr +0 -0
  64. package/es/catalog/factories/area-factory-3d.js +0 -183
  65. package/es/catalog/factories/area-factory-3d.js.map +0 -1
  66. package/es/catalog/factories/area-factory.js +0 -82
  67. package/es/catalog/factories/area-factory.js.map +0 -1
  68. package/es/catalog/factories/export.js +0 -8
  69. package/es/catalog/factories/export.js.map +0 -1
  70. package/es/catalog/factories/wall-factory-3d.js +0 -203
  71. package/es/catalog/factories/wall-factory-3d.js.map +0 -1
  72. package/es/catalog/factories/wall-factory.js +0 -269
  73. package/es/catalog/factories/wall-factory.js.map +0 -1
  74. package/es/catalog/holes/door-closet/planner-element.js +0 -223
  75. package/es/catalog/holes/door-closet/planner-element.js.map +0 -1
  76. package/es/catalog/holes/door-double/door_double.png +0 -0
  77. package/es/catalog/holes/door-double/planner-element.js +0 -316
  78. package/es/catalog/holes/door-double/planner-element.js.map +0 -1
  79. package/es/catalog/holes/door-exterior/planner-element.js +0 -216
  80. package/es/catalog/holes/door-exterior/planner-element.js.map +0 -1
  81. package/es/catalog/holes/door-interior/planner-element.js +0 -228
  82. package/es/catalog/holes/door-interior/planner-element.js.map +0 -1
  83. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  84. package/es/catalog/holes/door-panic/planner-element.js +0 -504
  85. package/es/catalog/holes/door-panic/planner-element.js.map +0 -1
  86. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  87. package/es/catalog/holes/door-panic-double/planner-element.js +0 -464
  88. package/es/catalog/holes/door-panic-double/planner-element.js.map +0 -1
  89. package/es/catalog/holes/door-sliding/planner-element.js +0 -226
  90. package/es/catalog/holes/door-sliding/planner-element.js.map +0 -1
  91. package/es/catalog/holes/doorway-framed/planner-element.js +0 -146
  92. package/es/catalog/holes/doorway-framed/planner-element.js.map +0 -1
  93. package/es/catalog/holes/doorway-frameless/planner-element.js +0 -105
  94. package/es/catalog/holes/doorway-frameless/planner-element.js.map +0 -1
  95. package/es/catalog/holes/gate/gate.jpg +0 -0
  96. package/es/catalog/holes/window-clear/planner-element.js +0 -167
  97. package/es/catalog/holes/window-clear/planner-element.js.map +0 -1
  98. package/es/catalog/holes/window-clear/texture.png +0 -0
  99. package/es/catalog/holes/window-cross/planner-element.js +0 -166
  100. package/es/catalog/holes/window-cross/planner-element.js.map +0 -1
  101. package/es/catalog/holes/window-cross/texture.png +0 -0
  102. package/es/catalog/holes/window-double-hung/planner-element.js +0 -304
  103. package/es/catalog/holes/window-double-hung/planner-element.js.map +0 -1
  104. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  105. package/es/catalog/holes/window-vertical/planner-element.js +0 -277
  106. package/es/catalog/holes/window-vertical/planner-element.js.map +0 -1
  107. package/es/catalog/holes/window-vertical/texture.png +0 -0
  108. package/es/catalog/lines/wall/planner-element.js +0 -71
  109. package/es/catalog/lines/wall/planner-element.js.map +0 -1
  110. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  111. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  112. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  113. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  114. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  115. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  116. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  117. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  118. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  119. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  120. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  121. package/es/catalog/lines/wall/wall.png +0 -0
  122. package/es/catalog/molding/molding-dcm/planner-element.js +0 -30
  123. package/es/catalog/molding/molding-dcm/planner-element.js.map +0 -1
  124. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  125. package/es/catalog/molding/molding-fbm/planner-element.js +0 -30
  126. package/es/catalog/molding/molding-fbm/planner-element.js.map +0 -1
  127. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  128. package/es/catalog/molding/molding-lrm/planner-element.js +0 -30
  129. package/es/catalog/molding/molding-lrm/planner-element.js.map +0 -1
  130. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  131. package/es/catalog/properties/export.js +0 -22
  132. package/es/catalog/properties/export.js.map +0 -1
  133. package/es/catalog/properties/property-checkbox.js +0 -72
  134. package/es/catalog/properties/property-checkbox.js.map +0 -1
  135. package/es/catalog/properties/property-color.js +0 -40
  136. package/es/catalog/properties/property-color.js.map +0 -1
  137. package/es/catalog/properties/property-enum.js +0 -56
  138. package/es/catalog/properties/property-enum.js.map +0 -1
  139. package/es/catalog/properties/property-hidden.js +0 -20
  140. package/es/catalog/properties/property-hidden.js.map +0 -1
  141. package/es/catalog/properties/property-lenght-measure.js +0 -102
  142. package/es/catalog/properties/property-lenght-measure.js.map +0 -1
  143. package/es/catalog/properties/property-length-measure.js +0 -86
  144. package/es/catalog/properties/property-length-measure.js.map +0 -1
  145. package/es/catalog/properties/property-length-measure_hole.js +0 -102
  146. package/es/catalog/properties/property-length-measure_hole.js.map +0 -1
  147. package/es/catalog/properties/property-number.js +0 -49
  148. package/es/catalog/properties/property-number.js.map +0 -1
  149. package/es/catalog/properties/property-read-only.js +0 -27
  150. package/es/catalog/properties/property-read-only.js.map +0 -1
  151. package/es/catalog/properties/property-string.js +0 -49
  152. package/es/catalog/properties/property-string.js.map +0 -1
  153. package/es/catalog/properties/property-toggle.js +0 -40
  154. package/es/catalog/properties/property-toggle.js.map +0 -1
  155. package/es/catalog/properties/shared-property-style.js +0 -15
  156. package/es/catalog/properties/shared-property-style.js.map +0 -1
  157. package/es/catalog/utils/FuseUtils.js +0 -83
  158. package/es/catalog/utils/FuseUtils.js.map +0 -1
  159. package/es/catalog/utils/exporter.js +0 -149
  160. package/es/catalog/utils/exporter.js.map +0 -1
  161. package/es/catalog/utils/geom-utils.js +0 -190
  162. package/es/catalog/utils/geom-utils.js.map +0 -1
  163. package/es/catalog/utils/item-loader.js +0 -1522
  164. package/es/catalog/utils/item-loader.js.map +0 -1
  165. package/es/catalog/utils/load-obj.js +0 -92
  166. package/es/catalog/utils/load-obj.js.map +0 -1
  167. package/es/catalog/utils/mtl-loader.js +0 -358
  168. package/es/catalog/utils/mtl-loader.js.map +0 -1
  169. package/es/catalog/utils/obj-loader.js +0 -477
  170. package/es/catalog/utils/obj-loader.js.map +0 -1
  171. package/es/catalog/windows.png +0 -0
  172. package/es/class/FuseUtils.js +0 -83
  173. package/es/class/FuseUtils.js.map +0 -1
  174. package/es/class/area.js +0 -146
  175. package/es/class/area.js.map +0 -1
  176. package/es/class/export.js +0 -25
  177. package/es/class/export.js.map +0 -1
  178. package/es/class/group.js +0 -441
  179. package/es/class/group.js.map +0 -1
  180. package/es/class/guide.js +0 -63
  181. package/es/class/guide.js.map +0 -1
  182. package/es/class/hole.js +0 -931
  183. package/es/class/hole.js.map +0 -1
  184. package/es/class/item.js +0 -1888
  185. package/es/class/item.js.map +0 -1
  186. package/es/class/layer.js +0 -668
  187. package/es/class/layer.js.map +0 -1
  188. package/es/class/line.js +0 -1290
  189. package/es/class/line.js.map +0 -1
  190. package/es/class/project.js +0 -823
  191. package/es/class/project.js.map +0 -1
  192. package/es/class/vertex.js +0 -267
  193. package/es/class/vertex.js.map +0 -1
  194. package/es/components/atoms/Snackbar/index.js +0 -50
  195. package/es/components/atoms/Snackbar/index.js.map +0 -1
  196. package/es/components/atoms/radio-button/index.js +0 -26
  197. package/es/components/atoms/radio-button/index.js.map +0 -1
  198. package/es/components/atoms/radio-button/styles.js +0 -5
  199. package/es/components/atoms/radio-button/styles.js.map +0 -1
  200. package/es/components/button/MainButton.js +0 -92
  201. package/es/components/button/MainButton.js.map +0 -1
  202. package/es/components/button/ToggleMeasureButton.js +0 -56
  203. package/es/components/button/ToggleMeasureButton.js.map +0 -1
  204. package/es/components/catalog-view/catalog-breadcrumb.js +0 -53
  205. package/es/components/catalog-view/catalog-breadcrumb.js.map +0 -1
  206. package/es/components/catalog-view/catalog-item.js +0 -226
  207. package/es/components/catalog-view/catalog-item.js.map +0 -1
  208. package/es/components/catalog-view/catalog-list.js +0 -182
  209. package/es/components/catalog-view/catalog-list.js.map +0 -1
  210. package/es/components/catalog-view/catalog-page-item.js +0 -130
  211. package/es/components/catalog-view/catalog-page-item.js.map +0 -1
  212. package/es/components/catalog-view/catalog-turn-back-page-item.js +0 -106
  213. package/es/components/catalog-view/catalog-turn-back-page-item.js.map +0 -1
  214. package/es/components/configurator/custom-configurator.js +0 -94
  215. package/es/components/configurator/custom-configurator.js.map +0 -1
  216. package/es/components/configurator/project-configurator.js +0 -131
  217. package/es/components/configurator/project-configurator.js.map +0 -1
  218. package/es/components/content.js +0 -123
  219. package/es/components/content.js.map +0 -1
  220. package/es/components/export.js +0 -24
  221. package/es/components/export.js.map +0 -1
  222. package/es/components/firstsetting/button/styles.js +0 -27
  223. package/es/components/firstsetting/button/styles.js.map +0 -1
  224. package/es/components/firstsetting/export.js +0 -9
  225. package/es/components/firstsetting/export.js.map +0 -1
  226. package/es/components/firstsetting/firstsetting-content-button.js +0 -217
  227. package/es/components/firstsetting/firstsetting-content-button.js.map +0 -1
  228. package/es/components/firstsetting/firstsetting-toggle-button.js +0 -126
  229. package/es/components/firstsetting/firstsetting-toggle-button.js.map +0 -1
  230. package/es/components/firstsetting/firstsetting.js +0 -626
  231. package/es/components/firstsetting/firstsetting.js.map +0 -1
  232. package/es/components/footerbar/button/ControlButton.js +0 -72
  233. package/es/components/footerbar/button/ControlButton.js.map +0 -1
  234. package/es/components/footerbar/button/DirectionButton.js +0 -69
  235. package/es/components/footerbar/button/DirectionButton.js.map +0 -1
  236. package/es/components/footerbar/button/DirectionPanSpinButton.js +0 -50
  237. package/es/components/footerbar/button/DirectionPanSpinButton.js.map +0 -1
  238. package/es/components/footerbar/button/ToggleButton.js +0 -76
  239. package/es/components/footerbar/button/ToggleButton.js.map +0 -1
  240. package/es/components/footerbar/button/ToggleConvertButton.js +0 -73
  241. package/es/components/footerbar/button/ToggleConvertButton.js.map +0 -1
  242. package/es/components/footerbar/button/ToggleMeasureButton.js +0 -52
  243. package/es/components/footerbar/button/ToggleMeasureButton.js.map +0 -1
  244. package/es/components/footerbar/button/styles.js +0 -22
  245. package/es/components/footerbar/button/styles.js.map +0 -1
  246. package/es/components/footerbar/export.js +0 -9
  247. package/es/components/footerbar/export.js.map +0 -1
  248. package/es/components/footerbar/footer-content-button.js +0 -217
  249. package/es/components/footerbar/footer-content-button.js.map +0 -1
  250. package/es/components/footerbar/footer-toggle-button.js +0 -126
  251. package/es/components/footerbar/footer-toggle-button.js.map +0 -1
  252. package/es/components/footerbar/footerbar.js +0 -801
  253. package/es/components/footerbar/footerbar.js.map +0 -1
  254. package/es/components/footerbar/styles.js +0 -34
  255. package/es/components/footerbar/styles.js.map +0 -1
  256. package/es/components/header/button/MenuButton.js +0 -70
  257. package/es/components/header/button/MenuButton.js.map +0 -1
  258. package/es/components/header/button/SaveButton.js +0 -48
  259. package/es/components/header/button/SaveButton.js.map +0 -1
  260. package/es/components/header/button/styles.js +0 -59
  261. package/es/components/header/button/styles.js.map +0 -1
  262. package/es/components/header/export.js +0 -5
  263. package/es/components/header/export.js.map +0 -1
  264. package/es/components/header/header.js +0 -550
  265. package/es/components/header/header.js.map +0 -1
  266. package/es/components/header/header.style.css +0 -47
  267. package/es/components/header/styles.js +0 -41
  268. package/es/components/header/styles.js.map +0 -1
  269. package/es/components/login/Login.js +0 -86
  270. package/es/components/login/Login.js.map +0 -1
  271. package/es/components/login/LoginForm/index.js +0 -132
  272. package/es/components/login/LoginForm/index.js.map +0 -1
  273. package/es/components/login/Register.js +0 -96
  274. package/es/components/login/Register.js.map +0 -1
  275. package/es/components/login/RegisterForm/index.js +0 -230
  276. package/es/components/login/RegisterForm/index.js.map +0 -1
  277. package/es/components/login/jwtService.js +0 -232
  278. package/es/components/login/jwtService.js.map +0 -1
  279. package/es/components/login/style.css +0 -158
  280. package/es/components/login/style.scss +0 -260
  281. package/es/components/molecules/slider/index.js +0 -13
  282. package/es/components/molecules/slider/index.js.map +0 -1
  283. package/es/components/molecules/slider/styles.js +0 -2
  284. package/es/components/molecules/slider/styles.js.map +0 -1
  285. package/es/components/molecules/slider/styles.scss +0 -3
  286. package/es/components/myprojects/export.js +0 -5
  287. package/es/components/myprojects/export.js.map +0 -1
  288. package/es/components/myprojects/index.js +0 -446
  289. package/es/components/myprojects/index.js.map +0 -1
  290. package/es/components/myprojects/styles.js +0 -24
  291. package/es/components/myprojects/styles.js.map +0 -1
  292. package/es/components/sidebar/custom-accordion.js +0 -38
  293. package/es/components/sidebar/custom-accordion.js.map +0 -1
  294. package/es/components/sidebar/export.js +0 -14
  295. package/es/components/sidebar/export.js.map +0 -1
  296. package/es/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js +0 -65
  297. package/es/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js.map +0 -1
  298. package/es/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js +0 -116
  299. package/es/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js.map +0 -1
  300. package/es/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js +0 -126
  301. package/es/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js.map +0 -1
  302. package/es/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js +0 -251
  303. package/es/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js.map +0 -1
  304. package/es/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js +0 -75
  305. package/es/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js.map +0 -1
  306. package/es/components/sidebar/panel-element-editor/element-editor.js +0 -878
  307. package/es/components/sidebar/panel-element-editor/element-editor.js.map +0 -1
  308. package/es/components/sidebar/panel-element-editor/multi-elements-editor.js +0 -2
  309. package/es/components/sidebar/panel-element-editor/multi-elements-editor.js.map +0 -1
  310. package/es/components/sidebar/panel-element-editor/panel-element-editor.js +0 -49
  311. package/es/components/sidebar/panel-element-editor/panel-element-editor.js.map +0 -1
  312. package/es/components/sidebar/panel-element-editor/panel-multi-elements-editor.js +0 -118
  313. package/es/components/sidebar/panel-element-editor/panel-multi-elements-editor.js.map +0 -1
  314. package/es/components/sidebar/panel-group-editor.js +0 -211
  315. package/es/components/sidebar/panel-group-editor.js.map +0 -1
  316. package/es/components/sidebar/panel-groups.js +0 -267
  317. package/es/components/sidebar/panel-groups.js.map +0 -1
  318. package/es/components/sidebar/panel-guides.js +0 -185
  319. package/es/components/sidebar/panel-guides.js.map +0 -1
  320. package/es/components/sidebar/panel-layer-elements.js +0 -251
  321. package/es/components/sidebar/panel-layer-elements.js.map +0 -1
  322. package/es/components/sidebar/panel-layers.js +0 -340
  323. package/es/components/sidebar/panel-layers.js.map +0 -1
  324. package/es/components/sidebar/panel.js +0 -103
  325. package/es/components/sidebar/panel.js.map +0 -1
  326. package/es/components/sidebar/sidebar.js +0 -109
  327. package/es/components/sidebar/sidebar.js.map +0 -1
  328. package/es/components/sidebar/toolbar-panel.js +0 -164
  329. package/es/components/sidebar/toolbar-panel.js.map +0 -1
  330. package/es/components/sign/export.js +0 -6
  331. package/es/components/sign/export.js.map +0 -1
  332. package/es/components/sign/main/index.js +0 -560
  333. package/es/components/sign/main/index.js.map +0 -1
  334. package/es/components/sign/main/styles.js +0 -20
  335. package/es/components/sign/main/styles.js.map +0 -1
  336. package/es/components/style/button.js +0 -114
  337. package/es/components/style/button.js.map +0 -1
  338. package/es/components/style/cancel-button.js +0 -23
  339. package/es/components/style/cancel-button.js.map +0 -1
  340. package/es/components/style/content-container.js +0 -34
  341. package/es/components/style/content-container.js.map +0 -1
  342. package/es/components/style/content-title.js +0 -30
  343. package/es/components/style/content-title.js.map +0 -1
  344. package/es/components/style/delete-button.js +0 -26
  345. package/es/components/style/delete-button.js.map +0 -1
  346. package/es/components/style/export.js +0 -32
  347. package/es/components/style/export.js.map +0 -1
  348. package/es/components/style/form-block.js +0 -25
  349. package/es/components/style/form-block.js.map +0 -1
  350. package/es/components/style/form-color-input.js +0 -28
  351. package/es/components/style/form-color-input.js.map +0 -1
  352. package/es/components/style/form-label.js +0 -27
  353. package/es/components/style/form-label.js.map +0 -1
  354. package/es/components/style/form-number-input.js +0 -190
  355. package/es/components/style/form-number-input.js.map +0 -1
  356. package/es/components/style/form-number-input_2.js +0 -207
  357. package/es/components/style/form-number-input_2.js.map +0 -1
  358. package/es/components/style/form-select.js +0 -21
  359. package/es/components/style/form-select.js.map +0 -1
  360. package/es/components/style/form-slider.js +0 -46
  361. package/es/components/style/form-slider.js.map +0 -1
  362. package/es/components/style/form-submit-button.js +0 -27
  363. package/es/components/style/form-submit-button.js.map +0 -1
  364. package/es/components/style/form-text-input.js +0 -77
  365. package/es/components/style/form-text-input.js.map +0 -1
  366. package/es/components/toolbar/button/ControlButton.js +0 -69
  367. package/es/components/toolbar/button/ControlButton.js.map +0 -1
  368. package/es/components/toolbar/button/DirectionButton.js +0 -50
  369. package/es/components/toolbar/button/DirectionButton.js.map +0 -1
  370. package/es/components/toolbar/button/RightButton.js +0 -133
  371. package/es/components/toolbar/button/RightButton.js.map +0 -1
  372. package/es/components/toolbar/button/ToggleButton.js +0 -59
  373. package/es/components/toolbar/button/ToggleButton.js.map +0 -1
  374. package/es/components/toolbar/button/index.js +0 -88
  375. package/es/components/toolbar/button/index.js.map +0 -1
  376. package/es/components/toolbar/button/styles.js +0 -14
  377. package/es/components/toolbar/button/styles.js.map +0 -1
  378. package/es/components/toolbar/components/DoorStyleMenu.js +0 -105
  379. package/es/components/toolbar/components/DoorStyleMenu.js.map +0 -1
  380. package/es/components/toolbar/components/Pricing.js +0 -101
  381. package/es/components/toolbar/components/Pricing.js.map +0 -1
  382. package/es/components/toolbar/components/ReviewForQuote.js +0 -476
  383. package/es/components/toolbar/components/ReviewForQuote.js.map +0 -1
  384. package/es/components/toolbar/export.js +0 -14
  385. package/es/components/toolbar/export.js.map +0 -1
  386. package/es/components/toolbar/main/Alert.js +0 -125
  387. package/es/components/toolbar/main/Alert.js.map +0 -1
  388. package/es/components/toolbar/main/TakePictureModal.js +0 -100
  389. package/es/components/toolbar/main/TakePictureModal.js.map +0 -1
  390. package/es/components/toolbar/main/confirm-popup.js +0 -88
  391. package/es/components/toolbar/main/confirm-popup.js.map +0 -1
  392. package/es/components/toolbar/main/index.js +0 -4612
  393. package/es/components/toolbar/main/index.js.map +0 -1
  394. package/es/components/toolbar/main/lShaped.json +0 -311
  395. package/es/components/toolbar/main/longNarrow.json +0 -238
  396. package/es/components/toolbar/main/myComponents.js +0 -118
  397. package/es/components/toolbar/main/myComponents.js.map +0 -1
  398. package/es/components/toolbar/main/oRectangle.json +0 -220
  399. package/es/components/toolbar/main/rectangle.json +0 -238
  400. package/es/components/toolbar/main/style.css +0 -107
  401. package/es/components/toolbar/main/styles.js +0 -64
  402. package/es/components/toolbar/main/styles.js.map +0 -1
  403. package/es/components/toolbar/plugin-item.js +0 -150
  404. package/es/components/toolbar/plugin-item.js.map +0 -1
  405. package/es/components/toolbar/popup/appliance/appliance-category/index.js +0 -77
  406. package/es/components/toolbar/popup/appliance/appliance-category/index.js.map +0 -1
  407. package/es/components/toolbar/popup/appliance/choose-appliance/index.js +0 -76
  408. package/es/components/toolbar/popup/appliance/choose-appliance/index.js.map +0 -1
  409. package/es/components/toolbar/popup/appliance/index.js +0 -81
  410. package/es/components/toolbar/popup/appliance/index.js.map +0 -1
  411. package/es/components/toolbar/popup/autosaveprompt/index.js +0 -91
  412. package/es/components/toolbar/popup/autosaveprompt/index.js.map +0 -1
  413. package/es/components/toolbar/popup/autosaveprompt/styles.css +0 -64
  414. package/es/components/toolbar/popup/autosaveprompt/styles.js +0 -9
  415. package/es/components/toolbar/popup/autosaveprompt/styles.js.map +0 -1
  416. package/es/components/toolbar/popup/cabinet/cabinet-category/index.js +0 -77
  417. package/es/components/toolbar/popup/cabinet/cabinet-category/index.js.map +0 -1
  418. package/es/components/toolbar/popup/cabinet/choose-product/index.js +0 -98
  419. package/es/components/toolbar/popup/cabinet/choose-product/index.js.map +0 -1
  420. package/es/components/toolbar/popup/cabinet/index.js +0 -83
  421. package/es/components/toolbar/popup/cabinet/index.js.map +0 -1
  422. package/es/components/toolbar/popup/doorStyle/choose-style/index.js +0 -50
  423. package/es/components/toolbar/popup/doorStyle/choose-style/index.js.map +0 -1
  424. package/es/components/toolbar/popup/doorStyle/index.js +0 -61
  425. package/es/components/toolbar/popup/doorStyle/index.js.map +0 -1
  426. package/es/components/toolbar/popup/doorStyle/style-category/index.js +0 -143
  427. package/es/components/toolbar/popup/doorStyle/style-category/index.js.map +0 -1
  428. package/es/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -3
  429. package/es/components/toolbar/popup/downloadsummary/downloadSummaryContext.js.map +0 -1
  430. package/es/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js +0 -119
  431. package/es/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js.map +0 -1
  432. package/es/components/toolbar/popup/downloadsummary/index.js +0 -564
  433. package/es/components/toolbar/popup/downloadsummary/index.js.map +0 -1
  434. package/es/components/toolbar/popup/downloadsummary/show2D/show2DView.js +0 -51
  435. package/es/components/toolbar/popup/downloadsummary/show2D/show2DView.js.map +0 -1
  436. package/es/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js +0 -191
  437. package/es/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js.map +0 -1
  438. package/es/components/toolbar/popup/downloadsummary/show3D/show3DView.js +0 -245
  439. package/es/components/toolbar/popup/downloadsummary/show3D/show3DView.js.map +0 -1
  440. package/es/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js +0 -1758
  441. package/es/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js.map +0 -1
  442. package/es/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -87
  443. package/es/components/toolbar/popup/downloadsummary/showCabinetInfo.js.map +0 -1
  444. package/es/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js +0 -116
  445. package/es/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js.map +0 -1
  446. package/es/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js +0 -1710
  447. package/es/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js.map +0 -1
  448. package/es/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js +0 -175
  449. package/es/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js.map +0 -1
  450. package/es/components/toolbar/popup/downloadsummary/showWarranty.js +0 -106
  451. package/es/components/toolbar/popup/downloadsummary/showWarranty.js.map +0 -1
  452. package/es/components/toolbar/popup/downloadsummary/styles.css +0 -177
  453. package/es/components/toolbar/popup/downloadsummary/styles.js +0 -40
  454. package/es/components/toolbar/popup/downloadsummary/styles.js.map +0 -1
  455. package/es/components/toolbar/popup/finishingtouch/category/index.js +0 -35
  456. package/es/components/toolbar/popup/finishingtouch/category/index.js.map +0 -1
  457. package/es/components/toolbar/popup/finishingtouch/index.js +0 -47
  458. package/es/components/toolbar/popup/finishingtouch/index.js.map +0 -1
  459. package/es/components/toolbar/popup/finishingtouch/material-edit.js +0 -156
  460. package/es/components/toolbar/popup/finishingtouch/material-edit.js.map +0 -1
  461. package/es/components/toolbar/popup/finishingtouch/product/index.js +0 -56
  462. package/es/components/toolbar/popup/finishingtouch/product/index.js.map +0 -1
  463. package/es/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js +0 -116
  464. package/es/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js.map +0 -1
  465. package/es/components/toolbar/popup/floorplan/choose-floor/index.js +0 -246
  466. package/es/components/toolbar/popup/floorplan/choose-floor/index.js.map +0 -1
  467. package/es/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
  468. package/es/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
  469. package/es/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
  470. package/es/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
  471. package/es/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -11
  472. package/es/components/toolbar/popup/floorplan/choose-floor/styles.js.map +0 -1
  473. package/es/components/toolbar/popup/floorplan/floor-category/index.js +0 -90
  474. package/es/components/toolbar/popup/floorplan/floor-category/index.js.map +0 -1
  475. package/es/components/toolbar/popup/floorplan/index.js +0 -49
  476. package/es/components/toolbar/popup/floorplan/index.js.map +0 -1
  477. package/es/components/toolbar/popup/index.js +0 -188
  478. package/es/components/toolbar/popup/index.js.map +0 -1
  479. package/es/components/toolbar/popup/newproject/index.js +0 -67
  480. package/es/components/toolbar/popup/newproject/index.js.map +0 -1
  481. package/es/components/toolbar/popup/newproject/styles.css +0 -64
  482. package/es/components/toolbar/popup/newproject/styles.js +0 -9
  483. package/es/components/toolbar/popup/newproject/styles.js.map +0 -1
  484. package/es/components/toolbar/popup/product/appliance.js +0 -65
  485. package/es/components/toolbar/popup/product/appliance.js.map +0 -1
  486. package/es/components/toolbar/popup/product/cabinetproduct.js +0 -25
  487. package/es/components/toolbar/popup/product/cabinetproduct.js.map +0 -1
  488. package/es/components/toolbar/popup/product/doorstyle.js +0 -50
  489. package/es/components/toolbar/popup/product/doorstyle.js.map +0 -1
  490. package/es/components/toolbar/popup/product/doorstyleproduct.js +0 -51
  491. package/es/components/toolbar/popup/product/doorstyleproduct.js.map +0 -1
  492. package/es/components/toolbar/popup/product/floor.js +0 -52
  493. package/es/components/toolbar/popup/product/floor.js.map +0 -1
  494. package/es/components/toolbar/popup/product/floorproduct.js +0 -61
  495. package/es/components/toolbar/popup/product/floorproduct.js.map +0 -1
  496. package/es/components/toolbar/popup/product/index.js +0 -52
  497. package/es/components/toolbar/popup/product/index.js.map +0 -1
  498. package/es/components/toolbar/popup/product/primary.js +0 -63
  499. package/es/components/toolbar/popup/product/primary.js.map +0 -1
  500. package/es/components/toolbar/popup/product/productline.js +0 -120
  501. package/es/components/toolbar/popup/product/productline.js.map +0 -1
  502. package/es/components/toolbar/popup/product/reviewItem.js +0 -338
  503. package/es/components/toolbar/popup/product/reviewItem.js.map +0 -1
  504. package/es/components/toolbar/popup/product/reviewMolding.js +0 -282
  505. package/es/components/toolbar/popup/product/reviewMolding.js.map +0 -1
  506. package/es/components/toolbar/popup/product/style.css +0 -54
  507. package/es/components/toolbar/popup/product/styles.js +0 -71
  508. package/es/components/toolbar/popup/product/styles.js.map +0 -1
  509. package/es/components/toolbar/popup/savedesign/FullPictureForm.js +0 -161
  510. package/es/components/toolbar/popup/savedesign/FullPictureForm.js.map +0 -1
  511. package/es/components/toolbar/popup/savedesign/index.js +0 -508
  512. package/es/components/toolbar/popup/savedesign/index.js.map +0 -1
  513. package/es/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
  514. package/es/components/toolbar/popup/savedesign/styles.js +0 -19
  515. package/es/components/toolbar/popup/savedesign/styles.js.map +0 -1
  516. package/es/components/toolbar/popup/setDoorStyleOption/index.js +0 -57
  517. package/es/components/toolbar/popup/setDoorStyleOption/index.js.map +0 -1
  518. package/es/components/toolbar/popup/styles.js +0 -98
  519. package/es/components/toolbar/popup/styles.js.map +0 -1
  520. package/es/components/toolbar/popup/submitforquote/AddToCartOptions.js +0 -157
  521. package/es/components/toolbar/popup/submitforquote/AddToCartOptions.js.map +0 -1
  522. package/es/components/toolbar/popup/submitforquote/CustomerRequestsForm.js +0 -85
  523. package/es/components/toolbar/popup/submitforquote/CustomerRequestsForm.js.map +0 -1
  524. package/es/components/toolbar/popup/submitforquote/SkipDesignerReview.js +0 -36
  525. package/es/components/toolbar/popup/submitforquote/SkipDesignerReview.js.map +0 -1
  526. package/es/components/toolbar/popup/submitforquote/StepDots.js +0 -33
  527. package/es/components/toolbar/popup/submitforquote/StepDots.js.map +0 -1
  528. package/es/components/toolbar/popup/submitforquote/cart-choice.js +0 -132
  529. package/es/components/toolbar/popup/submitforquote/cart-choice.js.map +0 -1
  530. package/es/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -43
  531. package/es/components/toolbar/popup/submitforquote/doorstyle-menus.js.map +0 -1
  532. package/es/components/toolbar/popup/submitforquote/index.js +0 -690
  533. package/es/components/toolbar/popup/submitforquote/index.js.map +0 -1
  534. package/es/components/toolbar/popup/submitforquote/styles.css +0 -105
  535. package/es/components/toolbar/popup/submitforquote/styles.js +0 -31
  536. package/es/components/toolbar/popup/submitforquote/styles.js.map +0 -1
  537. package/es/components/toolbar/popup/submitprompt/index.js +0 -71
  538. package/es/components/toolbar/popup/submitprompt/index.js.map +0 -1
  539. package/es/components/toolbar/popup/submitprompt/styles.css +0 -64
  540. package/es/components/toolbar/popup/submitprompt/styles.js +0 -9
  541. package/es/components/toolbar/popup/submitprompt/styles.js.map +0 -1
  542. package/es/components/toolbar/toolbar-button.js +0 -105
  543. package/es/components/toolbar/toolbar-button.js.map +0 -1
  544. package/es/components/toolbar/toolbar-load-button.js +0 -29
  545. package/es/components/toolbar/toolbar-load-button.js.map +0 -1
  546. package/es/components/toolbar/toolbar-save-button.js +0 -27
  547. package/es/components/toolbar/toolbar-save-button.js.map +0 -1
  548. package/es/components/tutorial-view/Modal.js +0 -498
  549. package/es/components/tutorial-view/Modal.js.map +0 -1
  550. package/es/components/tutorial-view/style.css +0 -111
  551. package/es/components/tutorial-view/styles.js +0 -6
  552. package/es/components/tutorial-view/styles.js.map +0 -1
  553. package/es/components/viewer2d/area.js +0 -83
  554. package/es/components/viewer2d/area.js.map +0 -1
  555. package/es/components/viewer2d/export.js +0 -32
  556. package/es/components/viewer2d/export.js.map +0 -1
  557. package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -38
  558. package/es/components/viewer2d/grids/grid-horizontal-streak.js.map +0 -1
  559. package/es/components/viewer2d/grids/grid-streak.js +0 -38
  560. package/es/components/viewer2d/grids/grid-streak.js.map +0 -1
  561. package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -38
  562. package/es/components/viewer2d/grids/grid-vertical-streak.js.map +0 -1
  563. package/es/components/viewer2d/grids/grids.js +0 -36
  564. package/es/components/viewer2d/grids/grids.js.map +0 -1
  565. package/es/components/viewer2d/group.js +0 -54
  566. package/es/components/viewer2d/group.js.map +0 -1
  567. package/es/components/viewer2d/item.js +0 -514
  568. package/es/components/viewer2d/item.js.map +0 -1
  569. package/es/components/viewer2d/layer.js +0 -165
  570. package/es/components/viewer2d/layer.js.map +0 -1
  571. package/es/components/viewer2d/line.js +0 -889
  572. package/es/components/viewer2d/line.js.map +0 -1
  573. package/es/components/viewer2d/ruler.js +0 -101
  574. package/es/components/viewer2d/ruler.js.map +0 -1
  575. package/es/components/viewer2d/rulerDist.js +0 -147
  576. package/es/components/viewer2d/rulerDist.js.map +0 -1
  577. package/es/components/viewer2d/rulerX.js +0 -152
  578. package/es/components/viewer2d/rulerX.js.map +0 -1
  579. package/es/components/viewer2d/rulerY.js +0 -154
  580. package/es/components/viewer2d/rulerY.js.map +0 -1
  581. package/es/components/viewer2d/scene.js +0 -141
  582. package/es/components/viewer2d/scene.js.map +0 -1
  583. package/es/components/viewer2d/snap.js +0 -75
  584. package/es/components/viewer2d/snap.js.map +0 -1
  585. package/es/components/viewer2d/state.js +0 -79
  586. package/es/components/viewer2d/state.js.map +0 -1
  587. package/es/components/viewer2d/utils.js +0 -163
  588. package/es/components/viewer2d/utils.js.map +0 -1
  589. package/es/components/viewer2d/vertex.js +0 -67
  590. package/es/components/viewer2d/vertex.js.map +0 -1
  591. package/es/components/viewer2d/viewer2d.js +0 -1402
  592. package/es/components/viewer2d/viewer2d.js.map +0 -1
  593. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2593
  594. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js.map +0 -1
  595. package/es/components/viewer3d/dcm.js +0 -402
  596. package/es/components/viewer3d/dcm.js.map +0 -1
  597. package/es/components/viewer3d/fbm.js +0 -415
  598. package/es/components/viewer3d/fbm.js.map +0 -1
  599. package/es/components/viewer3d/front3D.js +0 -67
  600. package/es/components/viewer3d/front3D.js.map +0 -1
  601. package/es/components/viewer3d/grid-creator.js +0 -26
  602. package/es/components/viewer3d/grid-creator.js.map +0 -1
  603. package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -37
  604. package/es/components/viewer3d/grids/grid-horizontal-streak.js.map +0 -1
  605. package/es/components/viewer3d/grids/grid-streak.js +0 -28
  606. package/es/components/viewer3d/grids/grid-streak.js.map +0 -1
  607. package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -37
  608. package/es/components/viewer3d/grids/grid-vertical-streak.js.map +0 -1
  609. package/es/components/viewer3d/libs/first-person-controls.js +0 -68
  610. package/es/components/viewer3d/libs/first-person-controls.js.map +0 -1
  611. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1282
  612. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js.map +0 -1
  613. package/es/components/viewer3d/libs/mtl-loader.js +0 -358
  614. package/es/components/viewer3d/libs/mtl-loader.js.map +0 -1
  615. package/es/components/viewer3d/libs/obj-loader.js +0 -463
  616. package/es/components/viewer3d/libs/obj-loader.js.map +0 -1
  617. package/es/components/viewer3d/libs/orbit-controls.js +0 -699
  618. package/es/components/viewer3d/libs/orbit-controls.js.map +0 -1
  619. package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
  620. package/es/components/viewer3d/libs/pointer-lock-controls.js.map +0 -1
  621. package/es/components/viewer3d/lrm.js +0 -306
  622. package/es/components/viewer3d/lrm.js.map +0 -1
  623. package/es/components/viewer3d/model.js +0 -709
  624. package/es/components/viewer3d/model.js.map +0 -1
  625. package/es/components/viewer3d/pointer-lock-navigation.js +0 -116
  626. package/es/components/viewer3d/pointer-lock-navigation.js.map +0 -1
  627. package/es/components/viewer3d/ruler-utils/itemRect.js +0 -62
  628. package/es/components/viewer3d/ruler-utils/itemRect.js.map +0 -1
  629. package/es/components/viewer3d/ruler-utils/layer3D.js +0 -496
  630. package/es/components/viewer3d/ruler-utils/layer3D.js.map +0 -1
  631. package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -228
  632. package/es/components/viewer3d/ruler-utils/ruler3D.js.map +0 -1
  633. package/es/components/viewer3d/ruler-utils/scene3D.js +0 -62
  634. package/es/components/viewer3d/ruler-utils/scene3D.js.map +0 -1
  635. package/es/components/viewer3d/ruler-utils/state3D.js +0 -19
  636. package/es/components/viewer3d/ruler-utils/state3D.js.map +0 -1
  637. package/es/components/viewer3d/scene-creator.js +0 -3607
  638. package/es/components/viewer3d/scene-creator.js.map +0 -1
  639. package/es/components/viewer3d/three-memory-cleaner.js +0 -52
  640. package/es/components/viewer3d/three-memory-cleaner.js.map +0 -1
  641. package/es/components/viewer3d/viewer3d-first-person.js +0 -316
  642. package/es/components/viewer3d/viewer3d-first-person.js.map +0 -1
  643. package/es/components/viewer3d/viewer3d.js +0 -2504
  644. package/es/components/viewer3d/viewer3d.js.map +0 -1
  645. package/es/components/wizardstep/button/styles.js +0 -60
  646. package/es/components/wizardstep/button/styles.js.map +0 -1
  647. package/es/components/wizardstep/export.js +0 -5
  648. package/es/components/wizardstep/export.js.map +0 -1
  649. package/es/components/wizardstep/index.js +0 -971
  650. package/es/components/wizardstep/index.js.map +0 -1
  651. package/es/components/wizardstep/styles.js +0 -61
  652. package/es/components/wizardstep/styles.js.map +0 -1
  653. package/es/components/wizardstep/wizardstep-content-button.js +0 -217
  654. package/es/components/wizardstep/wizardstep-content-button.js.map +0 -1
  655. package/es/components/wizardstep/wizardstep-toggle-button.js +0 -126
  656. package/es/components/wizardstep/wizardstep-toggle-button.js.map +0 -1
  657. package/es/constants.js +0 -637
  658. package/es/constants.js.map +0 -1
  659. package/es/hooks/useCheckCart.js +0 -53
  660. package/es/hooks/useCheckCart.js.map +0 -1
  661. package/es/hooks/useGetPricesBySku.js +0 -74
  662. package/es/hooks/useGetPricesBySku.js.map +0 -1
  663. package/es/hooks/useValidateToken.js +0 -201
  664. package/es/hooks/useValidateToken.js.map +0 -1
  665. package/es/index.js +0 -18
  666. package/es/index.js.map +0 -1
  667. package/es/models.js +0 -511
  668. package/es/models.js.map +0 -1
  669. package/es/plugins/SVGLoader.js +0 -1413
  670. package/es/plugins/SVGLoader.js.map +0 -1
  671. package/es/plugins/autosave.js +0 -34
  672. package/es/plugins/autosave.js.map +0 -1
  673. package/es/plugins/console-debugger.js +0 -38
  674. package/es/plugins/console-debugger.js.map +0 -1
  675. package/es/plugins/export.js +0 -10
  676. package/es/plugins/export.js.map +0 -1
  677. package/es/plugins/keyboard.js +0 -102
  678. package/es/plugins/keyboard.js.map +0 -1
  679. package/es/reducers/areas-reducer.js +0 -13
  680. package/es/reducers/areas-reducer.js.map +0 -1
  681. package/es/reducers/export.js +0 -26
  682. package/es/reducers/export.js.map +0 -1
  683. package/es/reducers/groups-reducer.js +0 -39
  684. package/es/reducers/groups-reducer.js.map +0 -1
  685. package/es/reducers/holes-reducer.js +0 -63
  686. package/es/reducers/holes-reducer.js.map +0 -1
  687. package/es/reducers/items-reducer.js +0 -144
  688. package/es/reducers/items-reducer.js.map +0 -1
  689. package/es/reducers/lines-reducer.js +0 -46
  690. package/es/reducers/lines-reducer.js.map +0 -1
  691. package/es/reducers/project-reducer.js +0 -130
  692. package/es/reducers/project-reducer.js.map +0 -1
  693. package/es/reducers/reducer.js +0 -20
  694. package/es/reducers/reducer.js.map +0 -1
  695. package/es/reducers/scene-reducer.js +0 -29
  696. package/es/reducers/scene-reducer.js.map +0 -1
  697. package/es/reducers/user-reducer.js +0 -42
  698. package/es/reducers/user-reducer.js.map +0 -1
  699. package/es/reducers/vertices-reducer.js +0 -20
  700. package/es/reducers/vertices-reducer.js.map +0 -1
  701. package/es/reducers/viewer2d-reducer.js +0 -76
  702. package/es/reducers/viewer2d-reducer.js.map +0 -1
  703. package/es/reducers/viewer3d-reducer.js +0 -57
  704. package/es/reducers/viewer3d-reducer.js.map +0 -1
  705. package/es/shared-style.js +0 -67
  706. package/es/shared-style.js.map +0 -1
  707. package/es/styles/export.js +0 -6
  708. package/es/styles/export.js.map +0 -1
  709. package/es/styles/tabs.css +0 -40
  710. package/es/translator/en.js +0 -105
  711. package/es/translator/en.js.map +0 -1
  712. package/es/translator/it.js +0 -80
  713. package/es/translator/it.js.map +0 -1
  714. package/es/translator/ru.js +0 -80
  715. package/es/translator/ru.js.map +0 -1
  716. package/es/translator/translator.js +0 -85
  717. package/es/translator/translator.js.map +0 -1
  718. package/es/utils/browser.js +0 -34
  719. package/es/utils/browser.js.map +0 -1
  720. package/es/utils/email-validator.js +0 -5
  721. package/es/utils/email-validator.js.map +0 -1
  722. package/es/utils/export.js +0 -26
  723. package/es/utils/export.js.map +0 -1
  724. package/es/utils/geometry.js +0 -2237
  725. package/es/utils/geometry.js.map +0 -1
  726. package/es/utils/get-edges-of-subgraphs.js +0 -27
  727. package/es/utils/get-edges-of-subgraphs.js.map +0 -1
  728. package/es/utils/graph-cycles.js +0 -239
  729. package/es/utils/graph-cycles.js.map +0 -1
  730. package/es/utils/graph-inner-cycles.js +0 -47
  731. package/es/utils/graph-inner-cycles.js.map +0 -1
  732. package/es/utils/graph.js +0 -150
  733. package/es/utils/graph.js.map +0 -1
  734. package/es/utils/helper.js +0 -337
  735. package/es/utils/helper.js.map +0 -1
  736. package/es/utils/history.js +0 -30
  737. package/es/utils/history.js.map +0 -1
  738. package/es/utils/id-broker.js +0 -20
  739. package/es/utils/id-broker.js.map +0 -1
  740. package/es/utils/logger.js +0 -9
  741. package/es/utils/logger.js.map +0 -1
  742. package/es/utils/math.js +0 -51
  743. package/es/utils/math.js.map +0 -1
  744. package/es/utils/molding.js +0 -840
  745. package/es/utils/molding.js.map +0 -1
  746. package/es/utils/name-generator.js +0 -19
  747. package/es/utils/name-generator.js.map +0 -1
  748. package/es/utils/objects-utils.js +0 -51
  749. package/es/utils/objects-utils.js.map +0 -1
  750. package/es/utils/phone-validator.js +0 -5
  751. package/es/utils/phone-validator.js.map +0 -1
  752. package/es/utils/process-black-list.js +0 -19
  753. package/es/utils/process-black-list.js.map +0 -1
  754. package/es/utils/react-if.js +0 -19
  755. package/es/utils/react-if.js.map +0 -1
  756. package/es/utils/snap-scene.js +0 -100
  757. package/es/utils/snap-scene.js.map +0 -1
  758. package/es/utils/snap.js +0 -238
  759. package/es/utils/snap.js.map +0 -1
  760. package/es/utils/threeCSG.es6.js +0 -499
  761. package/es/utils/threeCSG.es6.js.map +0 -1
  762. package/es/version.js +0 -2
  763. package/es/version.js.map +0 -1
  764. package/lib/@history.js +0 -11
  765. package/lib/@history.js.map +0 -1
  766. package/lib/AppContext.js +0 -11
  767. package/lib/AppContext.js.map +0 -1
  768. package/lib/KitchenConfigurator.js +0 -1353
  769. package/lib/KitchenConfigurator.js.map +0 -1
  770. package/lib/KitchenConfiguratorApp.js +0 -539
  771. package/lib/KitchenConfiguratorApp.js.map +0 -1
  772. package/lib/actions/area-actions.js +0 -22
  773. package/lib/actions/area-actions.js.map +0 -1
  774. package/lib/actions/export.js +0 -44
  775. package/lib/actions/export.js.map +0 -1
  776. package/lib/actions/groups-actions.js +0 -108
  777. package/lib/actions/groups-actions.js.map +0 -1
  778. package/lib/actions/holes-actions.js +0 -141
  779. package/lib/actions/holes-actions.js.map +0 -1
  780. package/lib/actions/items-actions.js +0 -365
  781. package/lib/actions/items-actions.js.map +0 -1
  782. package/lib/actions/lines-actions.js +0 -98
  783. package/lib/actions/lines-actions.js.map +0 -1
  784. package/lib/actions/project-actions.js +0 -333
  785. package/lib/actions/project-actions.js.map +0 -1
  786. package/lib/actions/scene-actions.js +0 -44
  787. package/lib/actions/scene-actions.js.map +0 -1
  788. package/lib/actions/user-actions.js +0 -69
  789. package/lib/actions/user-actions.js.map +0 -1
  790. package/lib/actions/vertices-actions.js +0 -36
  791. package/lib/actions/vertices-actions.js.map +0 -1
  792. package/lib/actions/viewer2d-actions.js +0 -74
  793. package/lib/actions/viewer2d-actions.js.map +0 -1
  794. package/lib/actions/viewer3d-actions.js +0 -33
  795. package/lib/actions/viewer3d-actions.js.map +0 -1
  796. package/lib/catalog/areas/area/planner-element.js +0 -47
  797. package/lib/catalog/areas/area/planner-element.js.map +0 -1
  798. package/lib/catalog/catalog.js +0 -283
  799. package/lib/catalog/catalog.js.map +0 -1
  800. package/lib/catalog/factories/area-factory-3d.js +0 -192
  801. package/lib/catalog/factories/area-factory-3d.js.map +0 -1
  802. package/lib/catalog/factories/area-factory.js +0 -90
  803. package/lib/catalog/factories/area-factory.js.map +0 -1
  804. package/lib/catalog/factories/export.js +0 -26
  805. package/lib/catalog/factories/export.js.map +0 -1
  806. package/lib/catalog/factories/wall-factory-3d.js +0 -213
  807. package/lib/catalog/factories/wall-factory-3d.js.map +0 -1
  808. package/lib/catalog/factories/wall-factory.js +0 -279
  809. package/lib/catalog/factories/wall-factory.js.map +0 -1
  810. package/lib/catalog/holes/door-closet/planner-element.js +0 -232
  811. package/lib/catalog/holes/door-closet/planner-element.js.map +0 -1
  812. package/lib/catalog/holes/door-double/planner-element.js +0 -325
  813. package/lib/catalog/holes/door-double/planner-element.js.map +0 -1
  814. package/lib/catalog/holes/door-exterior/planner-element.js +0 -225
  815. package/lib/catalog/holes/door-exterior/planner-element.js.map +0 -1
  816. package/lib/catalog/holes/door-interior/planner-element.js +0 -237
  817. package/lib/catalog/holes/door-interior/planner-element.js.map +0 -1
  818. package/lib/catalog/holes/door-panic/planner-element.js +0 -513
  819. package/lib/catalog/holes/door-panic/planner-element.js.map +0 -1
  820. package/lib/catalog/holes/door-panic-double/planner-element.js +0 -473
  821. package/lib/catalog/holes/door-panic-double/planner-element.js.map +0 -1
  822. package/lib/catalog/holes/door-sliding/planner-element.js +0 -235
  823. package/lib/catalog/holes/door-sliding/planner-element.js.map +0 -1
  824. package/lib/catalog/holes/doorway-framed/planner-element.js +0 -155
  825. package/lib/catalog/holes/doorway-framed/planner-element.js.map +0 -1
  826. package/lib/catalog/holes/doorway-frameless/planner-element.js +0 -114
  827. package/lib/catalog/holes/doorway-frameless/planner-element.js.map +0 -1
  828. package/lib/catalog/holes/window-clear/planner-element.js +0 -176
  829. package/lib/catalog/holes/window-clear/planner-element.js.map +0 -1
  830. package/lib/catalog/holes/window-cross/planner-element.js +0 -175
  831. package/lib/catalog/holes/window-cross/planner-element.js.map +0 -1
  832. package/lib/catalog/holes/window-double-hung/planner-element.js +0 -313
  833. package/lib/catalog/holes/window-double-hung/planner-element.js.map +0 -1
  834. package/lib/catalog/holes/window-vertical/planner-element.js +0 -286
  835. package/lib/catalog/holes/window-vertical/planner-element.js.map +0 -1
  836. package/lib/catalog/lines/wall/planner-element.js +0 -77
  837. package/lib/catalog/lines/wall/planner-element.js.map +0 -1
  838. package/lib/catalog/molding/molding-dcm/planner-element.js +0 -39
  839. package/lib/catalog/molding/molding-dcm/planner-element.js.map +0 -1
  840. package/lib/catalog/molding/molding-fbm/planner-element.js +0 -39
  841. package/lib/catalog/molding/molding-fbm/planner-element.js.map +0 -1
  842. package/lib/catalog/molding/molding-lrm/planner-element.js +0 -39
  843. package/lib/catalog/molding/molding-lrm/planner-element.js.map +0 -1
  844. package/lib/catalog/properties/export.js +0 -82
  845. package/lib/catalog/properties/export.js.map +0 -1
  846. package/lib/catalog/properties/property-checkbox.js +0 -79
  847. package/lib/catalog/properties/property-checkbox.js.map +0 -1
  848. package/lib/catalog/properties/property-color.js +0 -47
  849. package/lib/catalog/properties/property-color.js.map +0 -1
  850. package/lib/catalog/properties/property-enum.js +0 -63
  851. package/lib/catalog/properties/property-enum.js.map +0 -1
  852. package/lib/catalog/properties/property-hidden.js +0 -27
  853. package/lib/catalog/properties/property-hidden.js.map +0 -1
  854. package/lib/catalog/properties/property-lenght-measure.js +0 -109
  855. package/lib/catalog/properties/property-lenght-measure.js.map +0 -1
  856. package/lib/catalog/properties/property-length-measure.js +0 -93
  857. package/lib/catalog/properties/property-length-measure.js.map +0 -1
  858. package/lib/catalog/properties/property-length-measure_hole.js +0 -109
  859. package/lib/catalog/properties/property-length-measure_hole.js.map +0 -1
  860. package/lib/catalog/properties/property-number.js +0 -56
  861. package/lib/catalog/properties/property-number.js.map +0 -1
  862. package/lib/catalog/properties/property-read-only.js +0 -34
  863. package/lib/catalog/properties/property-read-only.js.map +0 -1
  864. package/lib/catalog/properties/property-string.js +0 -56
  865. package/lib/catalog/properties/property-string.js.map +0 -1
  866. package/lib/catalog/properties/property-toggle.js +0 -47
  867. package/lib/catalog/properties/property-toggle.js.map +0 -1
  868. package/lib/catalog/properties/shared-property-style.js +0 -21
  869. package/lib/catalog/properties/shared-property-style.js.map +0 -1
  870. package/lib/catalog/utils/FuseUtils.js +0 -89
  871. package/lib/catalog/utils/FuseUtils.js.map +0 -1
  872. package/lib/catalog/utils/exporter.js +0 -156
  873. package/lib/catalog/utils/exporter.js.map +0 -1
  874. package/lib/catalog/utils/geom-utils.js +0 -206
  875. package/lib/catalog/utils/geom-utils.js.map +0 -1
  876. package/lib/catalog/utils/item-loader.js +0 -1534
  877. package/lib/catalog/utils/item-loader.js.map +0 -1
  878. package/lib/catalog/utils/load-obj.js +0 -100
  879. package/lib/catalog/utils/load-obj.js.map +0 -1
  880. package/lib/catalog/utils/mtl-loader.js +0 -360
  881. package/lib/catalog/utils/mtl-loader.js.map +0 -1
  882. package/lib/catalog/utils/obj-loader.js +0 -479
  883. package/lib/catalog/utils/obj-loader.js.map +0 -1
  884. package/lib/class/FuseUtils.js +0 -89
  885. package/lib/class/FuseUtils.js.map +0 -1
  886. package/lib/class/area.js +0 -151
  887. package/lib/class/area.js.map +0 -1
  888. package/lib/class/export.js +0 -97
  889. package/lib/class/export.js.map +0 -1
  890. package/lib/class/group.js +0 -446
  891. package/lib/class/group.js.map +0 -1
  892. package/lib/class/guide.js +0 -68
  893. package/lib/class/guide.js.map +0 -1
  894. package/lib/class/hole.js +0 -935
  895. package/lib/class/hole.js.map +0 -1
  896. package/lib/class/item.js +0 -1894
  897. package/lib/class/item.js.map +0 -1
  898. package/lib/class/layer.js +0 -673
  899. package/lib/class/layer.js.map +0 -1
  900. package/lib/class/line.js +0 -1296
  901. package/lib/class/line.js.map +0 -1
  902. package/lib/class/project.js +0 -829
  903. package/lib/class/project.js.map +0 -1
  904. package/lib/class/vertex.js +0 -272
  905. package/lib/class/vertex.js.map +0 -1
  906. package/lib/components/atoms/Snackbar/index.js +0 -57
  907. package/lib/components/atoms/Snackbar/index.js.map +0 -1
  908. package/lib/components/atoms/radio-button/index.js +0 -33
  909. package/lib/components/atoms/radio-button/index.js.map +0 -1
  910. package/lib/components/atoms/radio-button/styles.js +0 -12
  911. package/lib/components/atoms/radio-button/styles.js.map +0 -1
  912. package/lib/components/button/MainButton.js +0 -98
  913. package/lib/components/button/MainButton.js.map +0 -1
  914. package/lib/components/button/ToggleMeasureButton.js +0 -63
  915. package/lib/components/button/ToggleMeasureButton.js.map +0 -1
  916. package/lib/components/catalog-view/catalog-breadcrumb.js +0 -61
  917. package/lib/components/catalog-view/catalog-breadcrumb.js.map +0 -1
  918. package/lib/components/catalog-view/catalog-item.js +0 -233
  919. package/lib/components/catalog-view/catalog-item.js.map +0 -1
  920. package/lib/components/catalog-view/catalog-list.js +0 -189
  921. package/lib/components/catalog-view/catalog-list.js.map +0 -1
  922. package/lib/components/catalog-view/catalog-page-item.js +0 -137
  923. package/lib/components/catalog-view/catalog-page-item.js.map +0 -1
  924. package/lib/components/catalog-view/catalog-turn-back-page-item.js +0 -113
  925. package/lib/components/catalog-view/catalog-turn-back-page-item.js.map +0 -1
  926. package/lib/components/configurator/custom-configurator.js +0 -101
  927. package/lib/components/configurator/custom-configurator.js.map +0 -1
  928. package/lib/components/configurator/project-configurator.js +0 -138
  929. package/lib/components/configurator/project-configurator.js.map +0 -1
  930. package/lib/components/content.js +0 -132
  931. package/lib/components/content.js.map +0 -1
  932. package/lib/components/export.js +0 -90
  933. package/lib/components/export.js.map +0 -1
  934. package/lib/components/firstsetting/button/styles.js +0 -34
  935. package/lib/components/firstsetting/button/styles.js.map +0 -1
  936. package/lib/components/firstsetting/export.js +0 -16
  937. package/lib/components/firstsetting/export.js.map +0 -1
  938. package/lib/components/firstsetting/firstsetting-content-button.js +0 -224
  939. package/lib/components/firstsetting/firstsetting-content-button.js.map +0 -1
  940. package/lib/components/firstsetting/firstsetting-toggle-button.js +0 -133
  941. package/lib/components/firstsetting/firstsetting-toggle-button.js.map +0 -1
  942. package/lib/components/firstsetting/firstsetting.js +0 -633
  943. package/lib/components/firstsetting/firstsetting.js.map +0 -1
  944. package/lib/components/footerbar/button/ControlButton.js +0 -79
  945. package/lib/components/footerbar/button/ControlButton.js.map +0 -1
  946. package/lib/components/footerbar/button/DirectionButton.js +0 -76
  947. package/lib/components/footerbar/button/DirectionButton.js.map +0 -1
  948. package/lib/components/footerbar/button/DirectionPanSpinButton.js +0 -57
  949. package/lib/components/footerbar/button/DirectionPanSpinButton.js.map +0 -1
  950. package/lib/components/footerbar/button/ToggleButton.js +0 -83
  951. package/lib/components/footerbar/button/ToggleButton.js.map +0 -1
  952. package/lib/components/footerbar/button/ToggleConvertButton.js +0 -80
  953. package/lib/components/footerbar/button/ToggleConvertButton.js.map +0 -1
  954. package/lib/components/footerbar/button/ToggleMeasureButton.js +0 -59
  955. package/lib/components/footerbar/button/ToggleMeasureButton.js.map +0 -1
  956. package/lib/components/footerbar/button/styles.js +0 -29
  957. package/lib/components/footerbar/button/styles.js.map +0 -1
  958. package/lib/components/footerbar/export.js +0 -16
  959. package/lib/components/footerbar/export.js.map +0 -1
  960. package/lib/components/footerbar/footer-content-button.js +0 -224
  961. package/lib/components/footerbar/footer-content-button.js.map +0 -1
  962. package/lib/components/footerbar/footer-toggle-button.js +0 -133
  963. package/lib/components/footerbar/footer-toggle-button.js.map +0 -1
  964. package/lib/components/footerbar/footerbar.js +0 -808
  965. package/lib/components/footerbar/footerbar.js.map +0 -1
  966. package/lib/components/footerbar/styles.js +0 -41
  967. package/lib/components/footerbar/styles.js.map +0 -1
  968. package/lib/components/header/button/MenuButton.js +0 -77
  969. package/lib/components/header/button/MenuButton.js.map +0 -1
  970. package/lib/components/header/button/SaveButton.js +0 -57
  971. package/lib/components/header/button/SaveButton.js.map +0 -1
  972. package/lib/components/header/button/styles.js +0 -68
  973. package/lib/components/header/button/styles.js.map +0 -1
  974. package/lib/components/header/export.js +0 -12
  975. package/lib/components/header/export.js.map +0 -1
  976. package/lib/components/header/header.js +0 -556
  977. package/lib/components/header/header.js.map +0 -1
  978. package/lib/components/header/styles.js +0 -47
  979. package/lib/components/header/styles.js.map +0 -1
  980. package/lib/components/login/Login.js +0 -94
  981. package/lib/components/login/Login.js.map +0 -1
  982. package/lib/components/login/LoginForm/index.js +0 -140
  983. package/lib/components/login/LoginForm/index.js.map +0 -1
  984. package/lib/components/login/Register.js +0 -104
  985. package/lib/components/login/Register.js.map +0 -1
  986. package/lib/components/login/RegisterForm/index.js +0 -237
  987. package/lib/components/login/RegisterForm/index.js.map +0 -1
  988. package/lib/components/login/jwtService.js +0 -239
  989. package/lib/components/login/jwtService.js.map +0 -1
  990. package/lib/components/molecules/slider/index.js +0 -22
  991. package/lib/components/molecules/slider/index.js.map +0 -1
  992. package/lib/components/molecules/slider/styles.js +0 -2
  993. package/lib/components/molecules/slider/styles.js.map +0 -1
  994. package/lib/components/myprojects/export.js +0 -12
  995. package/lib/components/myprojects/export.js.map +0 -1
  996. package/lib/components/myprojects/index.js +0 -453
  997. package/lib/components/myprojects/index.js.map +0 -1
  998. package/lib/components/myprojects/styles.js +0 -31
  999. package/lib/components/myprojects/styles.js.map +0 -1
  1000. package/lib/components/sidebar/custom-accordion.js +0 -45
  1001. package/lib/components/sidebar/custom-accordion.js.map +0 -1
  1002. package/lib/components/sidebar/export.js +0 -50
  1003. package/lib/components/sidebar/export.js.map +0 -1
  1004. package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js +0 -74
  1005. package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js.map +0 -1
  1006. package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js +0 -124
  1007. package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js.map +0 -1
  1008. package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js +0 -135
  1009. package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js.map +0 -1
  1010. package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js +0 -260
  1011. package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js.map +0 -1
  1012. package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js +0 -84
  1013. package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js.map +0 -1
  1014. package/lib/components/sidebar/panel-element-editor/element-editor.js +0 -884
  1015. package/lib/components/sidebar/panel-element-editor/element-editor.js.map +0 -1
  1016. package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js +0 -2
  1017. package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js.map +0 -1
  1018. package/lib/components/sidebar/panel-element-editor/panel-element-editor.js +0 -56
  1019. package/lib/components/sidebar/panel-element-editor/panel-element-editor.js.map +0 -1
  1020. package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js +0 -125
  1021. package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js.map +0 -1
  1022. package/lib/components/sidebar/panel-group-editor.js +0 -218
  1023. package/lib/components/sidebar/panel-group-editor.js.map +0 -1
  1024. package/lib/components/sidebar/panel-groups.js +0 -274
  1025. package/lib/components/sidebar/panel-groups.js.map +0 -1
  1026. package/lib/components/sidebar/panel-guides.js +0 -192
  1027. package/lib/components/sidebar/panel-guides.js.map +0 -1
  1028. package/lib/components/sidebar/panel-layer-elements.js +0 -258
  1029. package/lib/components/sidebar/panel-layer-elements.js.map +0 -1
  1030. package/lib/components/sidebar/panel-layers.js +0 -347
  1031. package/lib/components/sidebar/panel-layers.js.map +0 -1
  1032. package/lib/components/sidebar/panel.js +0 -110
  1033. package/lib/components/sidebar/panel.js.map +0 -1
  1034. package/lib/components/sidebar/sidebar.js +0 -117
  1035. package/lib/components/sidebar/sidebar.js.map +0 -1
  1036. package/lib/components/sidebar/toolbar-panel.js +0 -171
  1037. package/lib/components/sidebar/toolbar-panel.js.map +0 -1
  1038. package/lib/components/sign/export.js +0 -18
  1039. package/lib/components/sign/export.js.map +0 -1
  1040. package/lib/components/sign/main/index.js +0 -567
  1041. package/lib/components/sign/main/index.js.map +0 -1
  1042. package/lib/components/sign/main/styles.js +0 -27
  1043. package/lib/components/sign/main/styles.js.map +0 -1
  1044. package/lib/components/style/button.js +0 -121
  1045. package/lib/components/style/button.js.map +0 -1
  1046. package/lib/components/style/cancel-button.js +0 -30
  1047. package/lib/components/style/cancel-button.js.map +0 -1
  1048. package/lib/components/style/content-container.js +0 -41
  1049. package/lib/components/style/content-container.js.map +0 -1
  1050. package/lib/components/style/content-title.js +0 -38
  1051. package/lib/components/style/content-title.js.map +0 -1
  1052. package/lib/components/style/delete-button.js +0 -35
  1053. package/lib/components/style/delete-button.js.map +0 -1
  1054. package/lib/components/style/export.js +0 -122
  1055. package/lib/components/style/export.js.map +0 -1
  1056. package/lib/components/style/form-block.js +0 -32
  1057. package/lib/components/style/form-block.js.map +0 -1
  1058. package/lib/components/style/form-color-input.js +0 -35
  1059. package/lib/components/style/form-color-input.js.map +0 -1
  1060. package/lib/components/style/form-label.js +0 -34
  1061. package/lib/components/style/form-label.js.map +0 -1
  1062. package/lib/components/style/form-number-input.js +0 -197
  1063. package/lib/components/style/form-number-input.js.map +0 -1
  1064. package/lib/components/style/form-number-input_2.js +0 -214
  1065. package/lib/components/style/form-number-input_2.js.map +0 -1
  1066. package/lib/components/style/form-select.js +0 -30
  1067. package/lib/components/style/form-select.js.map +0 -1
  1068. package/lib/components/style/form-slider.js +0 -53
  1069. package/lib/components/style/form-slider.js.map +0 -1
  1070. package/lib/components/style/form-submit-button.js +0 -36
  1071. package/lib/components/style/form-submit-button.js.map +0 -1
  1072. package/lib/components/style/form-text-input.js +0 -84
  1073. package/lib/components/style/form-text-input.js.map +0 -1
  1074. package/lib/components/toolbar/button/ControlButton.js +0 -76
  1075. package/lib/components/toolbar/button/ControlButton.js.map +0 -1
  1076. package/lib/components/toolbar/button/DirectionButton.js +0 -57
  1077. package/lib/components/toolbar/button/DirectionButton.js.map +0 -1
  1078. package/lib/components/toolbar/button/RightButton.js +0 -140
  1079. package/lib/components/toolbar/button/RightButton.js.map +0 -1
  1080. package/lib/components/toolbar/button/ToggleButton.js +0 -66
  1081. package/lib/components/toolbar/button/ToggleButton.js.map +0 -1
  1082. package/lib/components/toolbar/button/index.js +0 -94
  1083. package/lib/components/toolbar/button/index.js.map +0 -1
  1084. package/lib/components/toolbar/button/styles.js +0 -21
  1085. package/lib/components/toolbar/button/styles.js.map +0 -1
  1086. package/lib/components/toolbar/components/DoorStyleMenu.js +0 -112
  1087. package/lib/components/toolbar/components/DoorStyleMenu.js.map +0 -1
  1088. package/lib/components/toolbar/components/Pricing.js +0 -110
  1089. package/lib/components/toolbar/components/Pricing.js.map +0 -1
  1090. package/lib/components/toolbar/components/ReviewForQuote.js +0 -485
  1091. package/lib/components/toolbar/components/ReviewForQuote.js.map +0 -1
  1092. package/lib/components/toolbar/export.js +0 -50
  1093. package/lib/components/toolbar/export.js.map +0 -1
  1094. package/lib/components/toolbar/main/Alert.js +0 -132
  1095. package/lib/components/toolbar/main/Alert.js.map +0 -1
  1096. package/lib/components/toolbar/main/TakePictureModal.js +0 -109
  1097. package/lib/components/toolbar/main/TakePictureModal.js.map +0 -1
  1098. package/lib/components/toolbar/main/confirm-popup.js +0 -95
  1099. package/lib/components/toolbar/main/confirm-popup.js.map +0 -1
  1100. package/lib/components/toolbar/main/index.js +0 -4619
  1101. package/lib/components/toolbar/main/index.js.map +0 -1
  1102. package/lib/components/toolbar/main/myComponents.js +0 -125
  1103. package/lib/components/toolbar/main/myComponents.js.map +0 -1
  1104. package/lib/components/toolbar/main/styles.js +0 -73
  1105. package/lib/components/toolbar/main/styles.js.map +0 -1
  1106. package/lib/components/toolbar/plugin-item.js +0 -156
  1107. package/lib/components/toolbar/plugin-item.js.map +0 -1
  1108. package/lib/components/toolbar/popup/appliance/appliance-category/index.js +0 -86
  1109. package/lib/components/toolbar/popup/appliance/appliance-category/index.js.map +0 -1
  1110. package/lib/components/toolbar/popup/appliance/choose-appliance/index.js +0 -85
  1111. package/lib/components/toolbar/popup/appliance/choose-appliance/index.js.map +0 -1
  1112. package/lib/components/toolbar/popup/appliance/index.js +0 -89
  1113. package/lib/components/toolbar/popup/appliance/index.js.map +0 -1
  1114. package/lib/components/toolbar/popup/autosaveprompt/index.js +0 -99
  1115. package/lib/components/toolbar/popup/autosaveprompt/index.js.map +0 -1
  1116. package/lib/components/toolbar/popup/autosaveprompt/styles.js +0 -16
  1117. package/lib/components/toolbar/popup/autosaveprompt/styles.js.map +0 -1
  1118. package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js +0 -86
  1119. package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js.map +0 -1
  1120. package/lib/components/toolbar/popup/cabinet/choose-product/index.js +0 -107
  1121. package/lib/components/toolbar/popup/cabinet/choose-product/index.js.map +0 -1
  1122. package/lib/components/toolbar/popup/cabinet/index.js +0 -91
  1123. package/lib/components/toolbar/popup/cabinet/index.js.map +0 -1
  1124. package/lib/components/toolbar/popup/doorStyle/choose-style/index.js +0 -59
  1125. package/lib/components/toolbar/popup/doorStyle/choose-style/index.js.map +0 -1
  1126. package/lib/components/toolbar/popup/doorStyle/index.js +0 -68
  1127. package/lib/components/toolbar/popup/doorStyle/index.js.map +0 -1
  1128. package/lib/components/toolbar/popup/doorStyle/style-category/index.js +0 -152
  1129. package/lib/components/toolbar/popup/doorStyle/style-category/index.js.map +0 -1
  1130. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -9
  1131. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js.map +0 -1
  1132. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js +0 -128
  1133. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js.map +0 -1
  1134. package/lib/components/toolbar/popup/downloadsummary/index.js +0 -572
  1135. package/lib/components/toolbar/popup/downloadsummary/index.js.map +0 -1
  1136. package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js +0 -60
  1137. package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js.map +0 -1
  1138. package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js +0 -200
  1139. package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js.map +0 -1
  1140. package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js +0 -254
  1141. package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js.map +0 -1
  1142. package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js +0 -1762
  1143. package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js.map +0 -1
  1144. package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -96
  1145. package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js.map +0 -1
  1146. package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js +0 -125
  1147. package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js.map +0 -1
  1148. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js +0 -1713
  1149. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js.map +0 -1
  1150. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js +0 -184
  1151. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js.map +0 -1
  1152. package/lib/components/toolbar/popup/downloadsummary/showWarranty.js +0 -115
  1153. package/lib/components/toolbar/popup/downloadsummary/showWarranty.js.map +0 -1
  1154. package/lib/components/toolbar/popup/downloadsummary/styles.js +0 -47
  1155. package/lib/components/toolbar/popup/downloadsummary/styles.js.map +0 -1
  1156. package/lib/components/toolbar/popup/finishingtouch/category/index.js +0 -44
  1157. package/lib/components/toolbar/popup/finishingtouch/category/index.js.map +0 -1
  1158. package/lib/components/toolbar/popup/finishingtouch/index.js +0 -54
  1159. package/lib/components/toolbar/popup/finishingtouch/index.js.map +0 -1
  1160. package/lib/components/toolbar/popup/finishingtouch/material-edit.js +0 -163
  1161. package/lib/components/toolbar/popup/finishingtouch/material-edit.js.map +0 -1
  1162. package/lib/components/toolbar/popup/finishingtouch/product/index.js +0 -65
  1163. package/lib/components/toolbar/popup/finishingtouch/product/index.js.map +0 -1
  1164. package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js +0 -124
  1165. package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js.map +0 -1
  1166. package/lib/components/toolbar/popup/floorplan/choose-floor/index.js +0 -255
  1167. package/lib/components/toolbar/popup/floorplan/choose-floor/index.js.map +0 -1
  1168. package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -20
  1169. package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js.map +0 -1
  1170. package/lib/components/toolbar/popup/floorplan/floor-category/index.js +0 -99
  1171. package/lib/components/toolbar/popup/floorplan/floor-category/index.js.map +0 -1
  1172. package/lib/components/toolbar/popup/floorplan/index.js +0 -56
  1173. package/lib/components/toolbar/popup/floorplan/index.js.map +0 -1
  1174. package/lib/components/toolbar/popup/index.js +0 -195
  1175. package/lib/components/toolbar/popup/index.js.map +0 -1
  1176. package/lib/components/toolbar/popup/newproject/index.js +0 -75
  1177. package/lib/components/toolbar/popup/newproject/index.js.map +0 -1
  1178. package/lib/components/toolbar/popup/newproject/styles.js +0 -16
  1179. package/lib/components/toolbar/popup/newproject/styles.js.map +0 -1
  1180. package/lib/components/toolbar/popup/product/appliance.js +0 -73
  1181. package/lib/components/toolbar/popup/product/appliance.js.map +0 -1
  1182. package/lib/components/toolbar/popup/product/cabinetproduct.js +0 -33
  1183. package/lib/components/toolbar/popup/product/cabinetproduct.js.map +0 -1
  1184. package/lib/components/toolbar/popup/product/doorstyle.js +0 -59
  1185. package/lib/components/toolbar/popup/product/doorstyle.js.map +0 -1
  1186. package/lib/components/toolbar/popup/product/doorstyleproduct.js +0 -59
  1187. package/lib/components/toolbar/popup/product/doorstyleproduct.js.map +0 -1
  1188. package/lib/components/toolbar/popup/product/floor.js +0 -59
  1189. package/lib/components/toolbar/popup/product/floor.js.map +0 -1
  1190. package/lib/components/toolbar/popup/product/floorproduct.js +0 -68
  1191. package/lib/components/toolbar/popup/product/floorproduct.js.map +0 -1
  1192. package/lib/components/toolbar/popup/product/index.js +0 -59
  1193. package/lib/components/toolbar/popup/product/index.js.map +0 -1
  1194. package/lib/components/toolbar/popup/product/primary.js +0 -71
  1195. package/lib/components/toolbar/popup/product/primary.js.map +0 -1
  1196. package/lib/components/toolbar/popup/product/productline.js +0 -128
  1197. package/lib/components/toolbar/popup/product/productline.js.map +0 -1
  1198. package/lib/components/toolbar/popup/product/reviewItem.js +0 -346
  1199. package/lib/components/toolbar/popup/product/reviewItem.js.map +0 -1
  1200. package/lib/components/toolbar/popup/product/reviewMolding.js +0 -291
  1201. package/lib/components/toolbar/popup/product/reviewMolding.js.map +0 -1
  1202. package/lib/components/toolbar/popup/product/styles.js +0 -79
  1203. package/lib/components/toolbar/popup/product/styles.js.map +0 -1
  1204. package/lib/components/toolbar/popup/savedesign/FullPictureForm.js +0 -169
  1205. package/lib/components/toolbar/popup/savedesign/FullPictureForm.js.map +0 -1
  1206. package/lib/components/toolbar/popup/savedesign/index.js +0 -516
  1207. package/lib/components/toolbar/popup/savedesign/index.js.map +0 -1
  1208. package/lib/components/toolbar/popup/savedesign/styles.js +0 -26
  1209. package/lib/components/toolbar/popup/savedesign/styles.js.map +0 -1
  1210. package/lib/components/toolbar/popup/setDoorStyleOption/index.js +0 -64
  1211. package/lib/components/toolbar/popup/setDoorStyleOption/index.js.map +0 -1
  1212. package/lib/components/toolbar/popup/styles.js +0 -104
  1213. package/lib/components/toolbar/popup/styles.js.map +0 -1
  1214. package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js +0 -166
  1215. package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js.map +0 -1
  1216. package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js +0 -93
  1217. package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js.map +0 -1
  1218. package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js +0 -45
  1219. package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js.map +0 -1
  1220. package/lib/components/toolbar/popup/submitforquote/StepDots.js +0 -40
  1221. package/lib/components/toolbar/popup/submitforquote/StepDots.js.map +0 -1
  1222. package/lib/components/toolbar/popup/submitforquote/cart-choice.js +0 -141
  1223. package/lib/components/toolbar/popup/submitforquote/cart-choice.js.map +0 -1
  1224. package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -50
  1225. package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js.map +0 -1
  1226. package/lib/components/toolbar/popup/submitforquote/index.js +0 -698
  1227. package/lib/components/toolbar/popup/submitforquote/index.js.map +0 -1
  1228. package/lib/components/toolbar/popup/submitforquote/styles.js +0 -38
  1229. package/lib/components/toolbar/popup/submitforquote/styles.js.map +0 -1
  1230. package/lib/components/toolbar/popup/submitprompt/index.js +0 -79
  1231. package/lib/components/toolbar/popup/submitprompt/index.js.map +0 -1
  1232. package/lib/components/toolbar/popup/submitprompt/styles.js +0 -16
  1233. package/lib/components/toolbar/popup/submitprompt/styles.js.map +0 -1
  1234. package/lib/components/toolbar/toolbar-button.js +0 -111
  1235. package/lib/components/toolbar/toolbar-button.js.map +0 -1
  1236. package/lib/components/toolbar/toolbar-load-button.js +0 -36
  1237. package/lib/components/toolbar/toolbar-load-button.js.map +0 -1
  1238. package/lib/components/toolbar/toolbar-save-button.js +0 -34
  1239. package/lib/components/toolbar/toolbar-save-button.js.map +0 -1
  1240. package/lib/components/tutorial-view/Modal.js +0 -503
  1241. package/lib/components/tutorial-view/Modal.js.map +0 -1
  1242. package/lib/components/tutorial-view/styles.js +0 -13
  1243. package/lib/components/tutorial-view/styles.js.map +0 -1
  1244. package/lib/components/viewer2d/area.js +0 -90
  1245. package/lib/components/viewer2d/area.js.map +0 -1
  1246. package/lib/components/viewer2d/export.js +0 -122
  1247. package/lib/components/viewer2d/export.js.map +0 -1
  1248. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -45
  1249. package/lib/components/viewer2d/grids/grid-horizontal-streak.js.map +0 -1
  1250. package/lib/components/viewer2d/grids/grid-streak.js +0 -45
  1251. package/lib/components/viewer2d/grids/grid-streak.js.map +0 -1
  1252. package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -45
  1253. package/lib/components/viewer2d/grids/grid-vertical-streak.js.map +0 -1
  1254. package/lib/components/viewer2d/grids/grids.js +0 -45
  1255. package/lib/components/viewer2d/grids/grids.js.map +0 -1
  1256. package/lib/components/viewer2d/group.js +0 -63
  1257. package/lib/components/viewer2d/group.js.map +0 -1
  1258. package/lib/components/viewer2d/item.js +0 -522
  1259. package/lib/components/viewer2d/item.js.map +0 -1
  1260. package/lib/components/viewer2d/layer.js +0 -172
  1261. package/lib/components/viewer2d/layer.js.map +0 -1
  1262. package/lib/components/viewer2d/line.js +0 -899
  1263. package/lib/components/viewer2d/line.js.map +0 -1
  1264. package/lib/components/viewer2d/ruler.js +0 -108
  1265. package/lib/components/viewer2d/ruler.js.map +0 -1
  1266. package/lib/components/viewer2d/rulerDist.js +0 -154
  1267. package/lib/components/viewer2d/rulerDist.js.map +0 -1
  1268. package/lib/components/viewer2d/rulerX.js +0 -159
  1269. package/lib/components/viewer2d/rulerX.js.map +0 -1
  1270. package/lib/components/viewer2d/rulerY.js +0 -161
  1271. package/lib/components/viewer2d/rulerY.js.map +0 -1
  1272. package/lib/components/viewer2d/scene.js +0 -148
  1273. package/lib/components/viewer2d/scene.js.map +0 -1
  1274. package/lib/components/viewer2d/snap.js +0 -84
  1275. package/lib/components/viewer2d/snap.js.map +0 -1
  1276. package/lib/components/viewer2d/state.js +0 -88
  1277. package/lib/components/viewer2d/state.js.map +0 -1
  1278. package/lib/components/viewer2d/utils.js +0 -174
  1279. package/lib/components/viewer2d/utils.js.map +0 -1
  1280. package/lib/components/viewer2d/vertex.js +0 -76
  1281. package/lib/components/viewer2d/vertex.js.map +0 -1
  1282. package/lib/components/viewer2d/viewer2d.js +0 -1409
  1283. package/lib/components/viewer2d/viewer2d.js.map +0 -1
  1284. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2598
  1285. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js.map +0 -1
  1286. package/lib/components/viewer3d/dcm.js +0 -408
  1287. package/lib/components/viewer3d/dcm.js.map +0 -1
  1288. package/lib/components/viewer3d/fbm.js +0 -421
  1289. package/lib/components/viewer3d/fbm.js.map +0 -1
  1290. package/lib/components/viewer3d/front3D.js +0 -76
  1291. package/lib/components/viewer3d/front3D.js.map +0 -1
  1292. package/lib/components/viewer3d/grid-creator.js +0 -35
  1293. package/lib/components/viewer3d/grid-creator.js.map +0 -1
  1294. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -45
  1295. package/lib/components/viewer3d/grids/grid-horizontal-streak.js.map +0 -1
  1296. package/lib/components/viewer3d/grids/grid-streak.js +0 -36
  1297. package/lib/components/viewer3d/grids/grid-streak.js.map +0 -1
  1298. package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -45
  1299. package/lib/components/viewer3d/grids/grid-vertical-streak.js.map +0 -1
  1300. package/lib/components/viewer3d/libs/first-person-controls.js +0 -75
  1301. package/lib/components/viewer3d/libs/first-person-controls.js.map +0 -1
  1302. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1288
  1303. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js.map +0 -1
  1304. package/lib/components/viewer3d/libs/mtl-loader.js +0 -360
  1305. package/lib/components/viewer3d/libs/mtl-loader.js.map +0 -1
  1306. package/lib/components/viewer3d/libs/obj-loader.js +0 -465
  1307. package/lib/components/viewer3d/libs/obj-loader.js.map +0 -1
  1308. package/lib/components/viewer3d/libs/orbit-controls.js +0 -701
  1309. package/lib/components/viewer3d/libs/orbit-controls.js.map +0 -1
  1310. package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -48
  1311. package/lib/components/viewer3d/libs/pointer-lock-controls.js.map +0 -1
  1312. package/lib/components/viewer3d/lrm.js +0 -312
  1313. package/lib/components/viewer3d/lrm.js.map +0 -1
  1314. package/lib/components/viewer3d/model.js +0 -715
  1315. package/lib/components/viewer3d/model.js.map +0 -1
  1316. package/lib/components/viewer3d/pointer-lock-navigation.js +0 -123
  1317. package/lib/components/viewer3d/pointer-lock-navigation.js.map +0 -1
  1318. package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -69
  1319. package/lib/components/viewer3d/ruler-utils/itemRect.js.map +0 -1
  1320. package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -503
  1321. package/lib/components/viewer3d/ruler-utils/layer3D.js.map +0 -1
  1322. package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -235
  1323. package/lib/components/viewer3d/ruler-utils/ruler3D.js.map +0 -1
  1324. package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -70
  1325. package/lib/components/viewer3d/ruler-utils/scene3D.js.map +0 -1
  1326. package/lib/components/viewer3d/ruler-utils/state3D.js +0 -26
  1327. package/lib/components/viewer3d/ruler-utils/state3D.js.map +0 -1
  1328. package/lib/components/viewer3d/scene-creator.js +0 -3641
  1329. package/lib/components/viewer3d/scene-creator.js.map +0 -1
  1330. package/lib/components/viewer3d/three-memory-cleaner.js +0 -61
  1331. package/lib/components/viewer3d/three-memory-cleaner.js.map +0 -1
  1332. package/lib/components/viewer3d/viewer3d-first-person.js +0 -321
  1333. package/lib/components/viewer3d/viewer3d-first-person.js.map +0 -1
  1334. package/lib/components/viewer3d/viewer3d.js +0 -2508
  1335. package/lib/components/viewer3d/viewer3d.js.map +0 -1
  1336. package/lib/components/wizardstep/button/styles.js +0 -67
  1337. package/lib/components/wizardstep/button/styles.js.map +0 -1
  1338. package/lib/components/wizardstep/export.js +0 -12
  1339. package/lib/components/wizardstep/export.js.map +0 -1
  1340. package/lib/components/wizardstep/index.js +0 -978
  1341. package/lib/components/wizardstep/index.js.map +0 -1
  1342. package/lib/components/wizardstep/styles.js +0 -68
  1343. package/lib/components/wizardstep/styles.js.map +0 -1
  1344. package/lib/components/wizardstep/wizardstep-content-button.js +0 -224
  1345. package/lib/components/wizardstep/wizardstep-content-button.js.map +0 -1
  1346. package/lib/components/wizardstep/wizardstep-toggle-button.js +0 -133
  1347. package/lib/components/wizardstep/wizardstep-toggle-button.js.map +0 -1
  1348. package/lib/constants.js +0 -646
  1349. package/lib/constants.js.map +0 -1
  1350. package/lib/hooks/useCheckCart.js +0 -60
  1351. package/lib/hooks/useCheckCart.js.map +0 -1
  1352. package/lib/hooks/useGetPricesBySku.js +0 -81
  1353. package/lib/hooks/useGetPricesBySku.js.map +0 -1
  1354. package/lib/hooks/useValidateToken.js +0 -207
  1355. package/lib/hooks/useValidateToken.js.map +0 -1
  1356. package/lib/index.js +0 -108
  1357. package/lib/index.js.map +0 -1
  1358. package/lib/models.js +0 -518
  1359. package/lib/models.js.map +0 -1
  1360. package/lib/plugins/SVGLoader.js +0 -1418
  1361. package/lib/plugins/SVGLoader.js.map +0 -1
  1362. package/lib/plugins/autosave.js +0 -40
  1363. package/lib/plugins/autosave.js.map +0 -1
  1364. package/lib/plugins/console-debugger.js +0 -45
  1365. package/lib/plugins/console-debugger.js.map +0 -1
  1366. package/lib/plugins/export.js +0 -34
  1367. package/lib/plugins/export.js.map +0 -1
  1368. package/lib/plugins/keyboard.js +0 -108
  1369. package/lib/plugins/keyboard.js.map +0 -1
  1370. package/lib/reducers/areas-reducer.js +0 -19
  1371. package/lib/reducers/areas-reducer.js.map +0 -1
  1372. package/lib/reducers/export.js +0 -98
  1373. package/lib/reducers/export.js.map +0 -1
  1374. package/lib/reducers/groups-reducer.js +0 -45
  1375. package/lib/reducers/groups-reducer.js.map +0 -1
  1376. package/lib/reducers/holes-reducer.js +0 -69
  1377. package/lib/reducers/holes-reducer.js.map +0 -1
  1378. package/lib/reducers/items-reducer.js +0 -147
  1379. package/lib/reducers/items-reducer.js.map +0 -1
  1380. package/lib/reducers/lines-reducer.js +0 -52
  1381. package/lib/reducers/lines-reducer.js.map +0 -1
  1382. package/lib/reducers/project-reducer.js +0 -136
  1383. package/lib/reducers/project-reducer.js.map +0 -1
  1384. package/lib/reducers/reducer.js +0 -27
  1385. package/lib/reducers/reducer.js.map +0 -1
  1386. package/lib/reducers/scene-reducer.js +0 -35
  1387. package/lib/reducers/scene-reducer.js.map +0 -1
  1388. package/lib/reducers/user-reducer.js +0 -48
  1389. package/lib/reducers/user-reducer.js.map +0 -1
  1390. package/lib/reducers/vertices-reducer.js +0 -26
  1391. package/lib/reducers/vertices-reducer.js.map +0 -1
  1392. package/lib/reducers/viewer2d-reducer.js +0 -83
  1393. package/lib/reducers/viewer2d-reducer.js.map +0 -1
  1394. package/lib/reducers/viewer3d-reducer.js +0 -64
  1395. package/lib/reducers/viewer3d-reducer.js.map +0 -1
  1396. package/lib/shared-style.js +0 -73
  1397. package/lib/shared-style.js.map +0 -1
  1398. package/lib/styles/export.js +0 -14
  1399. package/lib/styles/export.js.map +0 -1
  1400. package/lib/translator/en.js +0 -111
  1401. package/lib/translator/en.js.map +0 -1
  1402. package/lib/translator/it.js +0 -86
  1403. package/lib/translator/it.js.map +0 -1
  1404. package/lib/translator/ru.js +0 -86
  1405. package/lib/translator/ru.js.map +0 -1
  1406. package/lib/translator/translator.js +0 -91
  1407. package/lib/translator/translator.js.map +0 -1
  1408. package/lib/utils/browser.js +0 -41
  1409. package/lib/utils/browser.js.map +0 -1
  1410. package/lib/utils/email-validator.js +0 -11
  1411. package/lib/utils/email-validator.js.map +0 -1
  1412. package/lib/utils/export.js +0 -57
  1413. package/lib/utils/export.js.map +0 -1
  1414. package/lib/utils/geometry.js +0 -2329
  1415. package/lib/utils/geometry.js.map +0 -1
  1416. package/lib/utils/get-edges-of-subgraphs.js +0 -29
  1417. package/lib/utils/get-edges-of-subgraphs.js.map +0 -1
  1418. package/lib/utils/graph-cycles.js +0 -241
  1419. package/lib/utils/graph-cycles.js.map +0 -1
  1420. package/lib/utils/graph-inner-cycles.js +0 -55
  1421. package/lib/utils/graph-inner-cycles.js.map +0 -1
  1422. package/lib/utils/graph.js +0 -152
  1423. package/lib/utils/graph.js.map +0 -1
  1424. package/lib/utils/helper.js +0 -360
  1425. package/lib/utils/helper.js.map +0 -1
  1426. package/lib/utils/history.js +0 -37
  1427. package/lib/utils/history.js.map +0 -1
  1428. package/lib/utils/id-broker.js +0 -26
  1429. package/lib/utils/id-broker.js.map +0 -1
  1430. package/lib/utils/logger.js +0 -15
  1431. package/lib/utils/logger.js.map +0 -1
  1432. package/lib/utils/math.js +0 -58
  1433. package/lib/utils/math.js.map +0 -1
  1434. package/lib/utils/molding.js +0 -864
  1435. package/lib/utils/molding.js.map +0 -1
  1436. package/lib/utils/name-generator.js +0 -24
  1437. package/lib/utils/name-generator.js.map +0 -1
  1438. package/lib/utils/objects-utils.js +0 -61
  1439. package/lib/utils/objects-utils.js.map +0 -1
  1440. package/lib/utils/phone-validator.js +0 -11
  1441. package/lib/utils/phone-validator.js.map +0 -1
  1442. package/lib/utils/process-black-list.js +0 -25
  1443. package/lib/utils/process-black-list.js.map +0 -1
  1444. package/lib/utils/react-if.js +0 -25
  1445. package/lib/utils/react-if.js.map +0 -1
  1446. package/lib/utils/snap-scene.js +0 -106
  1447. package/lib/utils/snap-scene.js.map +0 -1
  1448. package/lib/utils/snap.js +0 -250
  1449. package/lib/utils/snap.js.map +0 -1
  1450. package/lib/utils/threeCSG.es6.js +0 -504
  1451. package/lib/utils/threeCSG.es6.js.map +0 -1
  1452. package/lib/version.js +0 -8
  1453. package/lib/version.js.map +0 -1
  1454. package/src/components/catalog-view/catalog-breadcrumb.jsx +0 -53
  1455. package/src/components/catalog-view/catalog-item.jsx +0 -229
  1456. package/src/components/catalog-view/catalog-list.jsx +0 -173
  1457. package/src/components/catalog-view/catalog-page-item.jsx +0 -110
  1458. package/src/components/catalog-view/catalog-turn-back-page-item.jsx +0 -80
  1459. package/src/components/configurator/custom-configurator.jsx +0 -77
  1460. package/src/components/configurator/project-configurator.jsx +0 -120
  1461. package/src/components/export.js +0 -36
  1462. package/src/components/firstsetting/button/styles.js +0 -223
  1463. package/src/components/firstsetting/export.js +0 -9
  1464. package/src/components/firstsetting/firstsetting-content-button.jsx +0 -198
  1465. package/src/components/firstsetting/firstsetting-toggle-button.jsx +0 -101
  1466. package/src/components/firstsetting/firstsetting.jsx +0 -814
  1467. package/src/components/footerbar/button/ControlButton.jsx +0 -43
  1468. package/src/components/footerbar/button/DirectionButton.jsx +0 -54
  1469. package/src/components/footerbar/button/DirectionPanSpinButton.jsx +0 -36
  1470. package/src/components/footerbar/button/ToggleButton.jsx +0 -58
  1471. package/src/components/footerbar/button/ToggleConvertButton.jsx +0 -48
  1472. package/src/components/footerbar/button/ToggleMeasureButton.jsx +0 -33
  1473. package/src/components/footerbar/button/styles.js +0 -217
  1474. package/src/components/footerbar/export.js +0 -9
  1475. package/src/components/footerbar/footer-content-button.jsx +0 -198
  1476. package/src/components/footerbar/footer-toggle-button.jsx +0 -101
  1477. package/src/components/footerbar/footerbar.jsx +0 -1103
  1478. package/src/components/footerbar/styles.js +0 -263
  1479. package/src/components/header/button/MenuButton.jsx +0 -46
  1480. package/src/components/header/button/SaveButton.jsx +0 -54
  1481. package/src/components/header/button/styles.js +0 -181
  1482. package/src/components/header/export.js +0 -5
  1483. package/src/components/header/header.jsx +0 -631
  1484. package/src/components/header/header.style.css +0 -47
  1485. package/src/components/header/styles.js +0 -320
  1486. package/src/components/login/Login.js +0 -77
  1487. package/src/components/login/LoginForm/index.js +0 -108
  1488. package/src/components/login/Register.js +0 -83
  1489. package/src/components/login/RegisterForm/index.js +0 -171
  1490. package/src/components/login/jwtService.js +0 -201
  1491. package/src/components/login/style.css +0 -158
  1492. package/src/components/login/style.scss +0 -260
  1493. package/src/components/myprojects/export.js +0 -5
  1494. package/src/components/myprojects/index.jsx +0 -445
  1495. package/src/components/myprojects/styles.js +0 -241
  1496. package/src/components/sidebar/custom-accordion.jsx +0 -48
  1497. package/src/components/sidebar/export.js +0 -15
  1498. package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +0 -73
  1499. package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +0 -101
  1500. package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +0 -149
  1501. package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +0 -316
  1502. package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +0 -108
  1503. package/src/components/sidebar/panel-element-editor/element-editor.jsx +0 -1070
  1504. package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
  1505. package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +0 -104
  1506. package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +0 -155
  1507. package/src/components/sidebar/panel-group-editor.jsx +0 -272
  1508. package/src/components/sidebar/panel-groups.jsx +0 -310
  1509. package/src/components/sidebar/panel-guides.jsx +0 -192
  1510. package/src/components/sidebar/panel-layer-elements.jsx +0 -298
  1511. package/src/components/sidebar/panel-layers.jsx +0 -381
  1512. package/src/components/sidebar/panel.jsx +0 -71
  1513. package/src/components/sidebar/sidebar.jsx +0 -106
  1514. package/src/components/sidebar/toolbar-panel.jsx +0 -139
  1515. package/src/components/sign/export.js +0 -7
  1516. package/src/components/sign/main/index.jsx +0 -523
  1517. package/src/components/sign/main/styles.js +0 -163
  1518. package/src/components/toolbar/button/ControlButton.jsx +0 -41
  1519. package/src/components/toolbar/button/DirectionButton.jsx +0 -34
  1520. package/src/components/toolbar/button/RightButton.jsx +0 -103
  1521. package/src/components/toolbar/button/ToggleButton.jsx +0 -41
  1522. package/src/components/toolbar/button/index.jsx +0 -55
  1523. package/src/components/toolbar/button/styles.js +0 -127
  1524. package/src/components/toolbar/components/DoorStyleMenu.jsx +0 -103
  1525. package/src/components/toolbar/components/Pricing.jsx +0 -126
  1526. package/src/components/toolbar/components/ReviewForQuote.jsx +0 -635
  1527. package/src/components/toolbar/export.js +0 -21
  1528. package/src/components/toolbar/main/Alert.js +0 -122
  1529. package/src/components/toolbar/main/TakePictureModal.jsx +0 -104
  1530. package/src/components/toolbar/main/confirm-popup.jsx +0 -99
  1531. package/src/components/toolbar/main/index.jsx +0 -5687
  1532. package/src/components/toolbar/main/lShaped.json +0 -311
  1533. package/src/components/toolbar/main/longNarrow.json +0 -238
  1534. package/src/components/toolbar/main/myComponents.js +0 -123
  1535. package/src/components/toolbar/main/oRectangle.json +0 -220
  1536. package/src/components/toolbar/main/rectangle.json +0 -238
  1537. package/src/components/toolbar/main/style.css +0 -107
  1538. package/src/components/toolbar/main/styles.js +0 -696
  1539. package/src/components/toolbar/plugin-item.jsx +0 -123
  1540. package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +0 -73
  1541. package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +0 -102
  1542. package/src/components/toolbar/popup/appliance/index.jsx +0 -83
  1543. package/src/components/toolbar/popup/autosaveprompt/index.jsx +0 -150
  1544. package/src/components/toolbar/popup/autosaveprompt/styles.css +0 -64
  1545. package/src/components/toolbar/popup/autosaveprompt/styles.js +0 -40
  1546. package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +0 -73
  1547. package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +0 -119
  1548. package/src/components/toolbar/popup/cabinet/index.jsx +0 -85
  1549. package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +0 -63
  1550. package/src/components/toolbar/popup/doorStyle/index.jsx +0 -71
  1551. package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +0 -139
  1552. package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -2
  1553. package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +0 -157
  1554. package/src/components/toolbar/popup/downloadsummary/index.jsx +0 -643
  1555. package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +0 -51
  1556. package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +0 -175
  1557. package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +0 -283
  1558. package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +0 -2257
  1559. package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -93
  1560. package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +0 -132
  1561. package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +0 -2198
  1562. package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +0 -152
  1563. package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +0 -149
  1564. package/src/components/toolbar/popup/downloadsummary/styles.css +0 -177
  1565. package/src/components/toolbar/popup/downloadsummary/styles.js +0 -453
  1566. package/src/components/toolbar/popup/finishingtouch/category/index.jsx +0 -34
  1567. package/src/components/toolbar/popup/finishingtouch/index.jsx +0 -58
  1568. package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +0 -112
  1569. package/src/components/toolbar/popup/finishingtouch/product/index.jsx +0 -116
  1570. package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +0 -101
  1571. package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +0 -254
  1572. package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
  1573. package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
  1574. package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
  1575. package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
  1576. package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -86
  1577. package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +0 -109
  1578. package/src/components/toolbar/popup/floorplan/index.jsx +0 -60
  1579. package/src/components/toolbar/popup/index.jsx +0 -241
  1580. package/src/components/toolbar/popup/newproject/index.jsx +0 -59
  1581. package/src/components/toolbar/popup/newproject/styles.css +0 -64
  1582. package/src/components/toolbar/popup/newproject/styles.js +0 -41
  1583. package/src/components/toolbar/popup/product/appliance.jsx +0 -54
  1584. package/src/components/toolbar/popup/product/cabinetproduct.jsx +0 -15
  1585. package/src/components/toolbar/popup/product/doorstyle.jsx +0 -58
  1586. package/src/components/toolbar/popup/product/doorstyleproduct.jsx +0 -47
  1587. package/src/components/toolbar/popup/product/floor.jsx +0 -36
  1588. package/src/components/toolbar/popup/product/floorproduct.jsx +0 -42
  1589. package/src/components/toolbar/popup/product/index.jsx +0 -36
  1590. package/src/components/toolbar/popup/product/primary.jsx +0 -77
  1591. package/src/components/toolbar/popup/product/productline.jsx +0 -93
  1592. package/src/components/toolbar/popup/product/reviewItem.jsx +0 -427
  1593. package/src/components/toolbar/popup/product/reviewMolding.jsx +0 -310
  1594. package/src/components/toolbar/popup/product/style.css +0 -54
  1595. package/src/components/toolbar/popup/product/styles.js +0 -260
  1596. package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +0 -146
  1597. package/src/components/toolbar/popup/savedesign/index.jsx +0 -495
  1598. package/src/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
  1599. package/src/components/toolbar/popup/savedesign/styles.js +0 -151
  1600. package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +0 -87
  1601. package/src/components/toolbar/popup/styles.js +0 -909
  1602. package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +0 -192
  1603. package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +0 -96
  1604. package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +0 -54
  1605. package/src/components/toolbar/popup/submitforquote/StepDots.jsx +0 -25
  1606. package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +0 -116
  1607. package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -38
  1608. package/src/components/toolbar/popup/submitforquote/index.jsx +0 -698
  1609. package/src/components/toolbar/popup/submitforquote/styles.css +0 -105
  1610. package/src/components/toolbar/popup/submitforquote/styles.js +0 -294
  1611. package/src/components/toolbar/popup/submitprompt/index.jsx +0 -89
  1612. package/src/components/toolbar/popup/submitprompt/styles.css +0 -64
  1613. package/src/components/toolbar/popup/submitprompt/styles.js +0 -42
  1614. package/src/components/toolbar/toolbar-button.jsx +0 -90
  1615. package/src/components/toolbar/toolbar-load-button.jsx +0 -36
  1616. package/src/components/toolbar/toolbar-save-button.jsx +0 -32
  1617. package/src/components/wizardstep/button/styles.js +0 -677
  1618. package/src/components/wizardstep/export.js +0 -5
  1619. package/src/components/wizardstep/index.jsx +0 -1372
  1620. package/src/components/wizardstep/styles.js +0 -688
  1621. package/src/components/wizardstep/wizardstep-content-button.jsx +0 -198
  1622. package/src/components/wizardstep/wizardstep-toggle-button.jsx +0 -101
  1623. package/src/hooks/useCheckCart.js +0 -38
  1624. package/src/hooks/useGetPricesBySku.js +0 -59
  1625. package/src/hooks/useValidateToken.js +0 -181
  1626. package/src/styles/export.js +0 -7
  1627. package/src/styles/tabs.css +0 -40
@@ -1,3607 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
9
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
12
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
13
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
- import * as Three from 'three';
15
- import createGrid from './grid-creator';
16
- import { disposeObject } from './three-memory-cleaner';
17
- import { Color, Group } from 'three';
18
- import { isUndefined } from 'util';
19
- import { MODE_DRAWING_ITEM_3D, EPSILON, DISTANCE_EPSILON, OBJTYPE_MESH, ARROW_TEXT_FORECOLOR, ARROW_TEXT_BACKCOLOR, ARROW_TEXT_FONTFACE, UNIT_CENTIMETER, SHADE_DARK_PURPLE_COLOR, MODE_DRAGGING_ITEM_3D, MODE_ROTATING_ITEM_3D, ANIMATE_STEP_MAX, ANIMATE_STEP_MIN, ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT, TOP_MOLDING_LOCATION, MIDDLE_MOLDING_LOCATION, BOTTOM_MOLDING_LOCATION, BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, WALL_CABINET_LAYOUTPOS, DECIMAL_PLACES_2, DIFFERENT_VALUES_PATH_LENGTH, MODE_IDLE_3D, ARRAY_3D_MODES, MODE_IDLE } from '../../constants';
20
- import { IDBroker, GeometryUtils, MoldingUtils } from '../../utils/export';
21
- import convert from 'convert-units';
22
- import { verticesDistance } from '../../utils/geometry';
23
- import * as GeomUtils from '../../../demo/src/catalog/utils/geom-utils';
24
- import { loadTexture } from '../../../demo/src/catalog/utils/item-loader';
25
- import { returnReplaceableDeepSearchType } from '../viewer2d/utils';
26
- import { replaceMeshesWithLineSegments, isElevationView, isEmpty, animateDoor, translateDrawer } from '../../../src/utils/helper';
27
- import { formatNumber } from '../../utils/math';
28
- var transformBox;
29
- export var fVLine = [];
30
- var scene_mode = null;
31
- export function parseData(sceneData, actions, catalog, camera, renderer, mode) {
32
- var planData = {
33
- catalog: catalog,
34
- sceneData: sceneData
35
- };
36
- window.planData = planData;
37
- planData.sceneGraph = {
38
- unit: sceneData.unit,
39
- layers: {},
40
- busyResources: {
41
- layers: {}
42
- },
43
- width: sceneData.width,
44
- height: sceneData.height,
45
- LODs: {}
46
- };
47
- planData.plan = new Three.Object3D();
48
- planData.plan.name = 'plan';
49
- planData.cam = new Three.Object3D();
50
- planData.cam.name = 'cam';
51
-
52
- // Add a grid to the plan
53
- planData.grid = createGrid(sceneData);
54
- planData.grid.name = 'grid';
55
- planData.boundingBox = new Three.Box3().setFromObject(planData.grid);
56
- planData.boundingBox.name = 'boundingBox';
57
- var promises = [];
58
- sceneData.layers.forEach(function (layer) {
59
- if (layer.id === sceneData.selectedLayer || layer.visible) {
60
- promises = promises.concat(createLayerObjects(layer, planData, sceneData, actions, catalog, mode, camera, renderer));
61
- }
62
- });
63
- var p1 = new Promise(function (resolve) {
64
- Promise.all(promises).then(function (value) {
65
- if (planData.plan.parent !== null && planData.plan.children.length !== 0) {
66
- updateBoundingBox(planData, false, mode);
67
-
68
- // if mode is elevation, build elevation scene
69
- if (isElevationView(mode)) buildElevationScene(planData, mode);
70
- }
71
- resolve('success');
72
- });
73
- });
74
- return {
75
- promise: p1,
76
- planData: planData
77
- };
78
-
79
- // return planData;
80
- }
81
- export function visibleTransformBox(flag) {
82
- // if (transformBox instanceof Three.Mesh)
83
- // transformBox.visible = flag;
84
- }
85
- var buildElevationScene = function buildElevationScene(planData, mode) {
86
- var scene = planData.plan.parent;
87
- scene.updateMatrixWorld();
88
- var ELEV_GRP = 'ELEV_GRP';
89
- var oldElevationGroup = scene.getObjectByName(ELEV_GRP);
90
- if (oldElevationGroup) oldElevationGroup.parent.remove(oldElevationGroup);
91
- var elevationGroup = new Three.Group();
92
- scene.traverse(function (obj) {
93
- if (obj.name == 'MainObject') {
94
- var clone = obj.clone();
95
- clone.name = '';
96
- clone.visible = obj.parent.visible;
97
- clone.applyMatrix4(obj.parent.matrixWorld);
98
- elevationGroup.add(clone);
99
- }
100
- });
101
- elevationGroup.name = ELEV_GRP;
102
- elevationGroup.visible = false;
103
- planData.elevationGroup = elevationGroup;
104
- scene.traverse(function (obj) {
105
- if (obj.name == 'MainObject') {
106
- replaceMeshesWithLineSegments(obj);
107
- }
108
- });
109
- scene.add(elevationGroup);
110
- };
111
- function createLayerObjects(layer, planData, sceneData, actions, catalog, mode, camera, renderer) {
112
- var promises = [];
113
- var moldingGroups = MoldingUtils.getAllMoldingGroups(layer);
114
- planData.sceneGraph.layers[layer.id] = {
115
- id: layer.id,
116
- lines: {},
117
- holes: {},
118
- areas: {},
119
- items: {},
120
- countertops: [],
121
- moldingGroups: moldingGroups,
122
- backsplashes: [],
123
- visible: layer.visible,
124
- altitude: layer.altitude
125
- };
126
- planData.sceneGraph.busyResources.layers[layer.id] = {
127
- id: layer.id,
128
- lines: {},
129
- holes: {},
130
- areas: {},
131
- items: {},
132
- moldingGroups: {}
133
- };
134
- // Import lines
135
- layer.lines.forEach(function (line) {
136
- promises.push(addLine(sceneData, planData, layer, line.id, catalog, actions.linesActions, mode));
137
- line.holes.forEach(function (holeID) {
138
- promises.push(addHole(sceneData, planData, layer, holeID, catalog, actions.holesActions, mode));
139
- });
140
- });
141
-
142
- // Import areas
143
- layer.areas.forEach(function (area) {
144
- promises.push(addArea(sceneData, planData, layer, area.id, catalog, actions.areaActions, mode));
145
- });
146
- // Import items
147
- layer.items.forEach(function (item) {
148
- promises.push(addItem(sceneData, planData, layer, item.id, catalog, actions.itemsActions, mode, null, null
149
- // false
150
- ));
151
- });
152
- return promises;
153
- }
154
- var canvas = document.createElement('canvas');
155
- canvas.width = 50;
156
- canvas.height = 100;
157
- canvas.style.width = 50 + 'px';
158
- canvas.style.height = 100 + 'px';
159
- var ctx = canvas.getContext('2d');
160
- ctx.fillStyle = '#FFFFFF';
161
- ctx.strokeStyle = '#ff7400';
162
- ctx.beginPath();
163
- ctx.arc(25, 25, 20, 0, 2 * Math.PI);
164
- ctx.fill();
165
- ctx.stroke();
166
- var img1 = new Image();
167
- img1.crossOrigin = 'anonymous';
168
- img1.src = '/assets/img/svg/3d_item_warning_info.svg';
169
- img1.onload = function () {
170
- ctx.drawImage(img1, 0, 0, 50, 50);
171
- };
172
- ctx.lineWidth = 4;
173
- ctx.beginPath();
174
- ctx.arc(25, 75, 20, 0, 2 * Math.PI);
175
- ctx.fill();
176
- ctx.stroke();
177
- var img2 = new Image();
178
- img2.crossOrigin = 'anonymous';
179
- img2.src = '/assets/img/svg/3d_item_warning_edit.svg';
180
- img2.onload = function () {
181
- ctx.drawImage(img2, 8, 58, 34, 34);
182
- };
183
- export function createWarningObject() {
184
- var warningTexture = new Three.Texture(canvas);
185
- warningTexture.needsUpdate = true;
186
- var warningObj = new Three.Sprite(new Three.SpriteMaterial({
187
- map: warningTexture,
188
- sizeAttenuation: true
189
- }));
190
- warningObj.material.transparent = true;
191
- warningObj.material.depthTest = false;
192
- warningObj.scale.set(20, 40, 20);
193
- warningObj.renderOrder = 3;
194
- warningObj.name = 'warningObj';
195
- return warningObj;
196
- }
197
- export function updateScene(planData, sceneData, oldSceneData, diffArray, actions, catalog) {
198
- var _draggingItem$toJS, _filteredDiffs, _filteredDiffs2;
199
- var mode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
200
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
201
- var angleObj = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
202
- var draggingItem = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : null;
203
- var result = [];
204
- if (mode != null) {
205
- scene_mode = mode;
206
- }
207
- var splitted = diffArray.map(function (el) {
208
- return {
209
- op: el.op,
210
- path: el.path.split('/'),
211
- value: el.value
212
- };
213
- });
214
- var filteredDiffs = filterDiffs(splitted, sceneData, oldSceneData);
215
- //***testing additional filter***
216
- filteredDiffs = filteredDiffs.filter(function (_ref) {
217
- var path = _ref.path;
218
- return path[3] !== 'selected';
219
- });
220
- filteredDiffs = filteredDiffs.filter(function (_ref2) {
221
- var path = _ref2.path;
222
- return path[1] !== 'groups';
223
- });
224
- //*******************************
225
- //This is executed when dragging item is end and performs the updateing filteredDiffs.
226
- if ((sceneData === null || sceneData === void 0 ? void 0 : sceneData.isEndDragging) === true && draggingItem && !isEmpty((_draggingItem$toJS = draggingItem.toJS) === null || _draggingItem$toJS === void 0 ? void 0 : _draggingItem$toJS.call(draggingItem)) && ((_filteredDiffs = filteredDiffs) === null || _filteredDiffs === void 0 || (_filteredDiffs = _filteredDiffs[0]) === null || _filteredDiffs === void 0 || (_filteredDiffs = _filteredDiffs.path) === null || _filteredDiffs === void 0 ? void 0 : _filteredDiffs.length) < DIFFERENT_VALUES_PATH_LENGTH && (_filteredDiffs2 = filteredDiffs) !== null && _filteredDiffs2 !== void 0 && (_filteredDiffs2 = _filteredDiffs2[0]) !== null && _filteredDiffs2 !== void 0 && (_filteredDiffs2 = _filteredDiffs2.path) !== null && _filteredDiffs2 !== void 0 && _filteredDiffs2.includes('showfg')) {
227
- var _draggingItem$getIn, _draggingItem$getIn2;
228
- var layerID = (_draggingItem$getIn = draggingItem.getIn) === null || _draggingItem$getIn === void 0 ? void 0 : _draggingItem$getIn.call(draggingItem, ['layerID']);
229
- var itemID = (_draggingItem$getIn2 = draggingItem.getIn) === null || _draggingItem$getIn2 === void 0 ? void 0 : _draggingItem$getIn2.call(draggingItem, ['itemID']);
230
- if (layerID && itemID) {
231
- var _sceneData$getIn, _sceneData$getIn$toJS, _selLayer$items;
232
- filteredDiffs[0].path = ['', 'layers', layerID, 'items', itemID, 'distArray'];
233
- var selLayer = (_sceneData$getIn = sceneData.getIn) === null || _sceneData$getIn === void 0 || (_sceneData$getIn = _sceneData$getIn.call(sceneData, ['layers', layerID])) === null || _sceneData$getIn === void 0 || (_sceneData$getIn$toJS = _sceneData$getIn.toJS) === null || _sceneData$getIn$toJS === void 0 ? void 0 : _sceneData$getIn$toJS.call(_sceneData$getIn);
234
- var distArray = selLayer === null || selLayer === void 0 || (_selLayer$items = selLayer.items) === null || _selLayer$items === void 0 || (_selLayer$items = _selLayer$items[itemID]) === null || _selLayer$items === void 0 ? void 0 : _selLayer$items.distArray;
235
- filteredDiffs[0].value = distArray;
236
- }
237
- }
238
-
239
- // Check to see if diffs includes changes associated with doorStyle and global molding simultaneously.
240
- var isSettingDoorStyle = false; // If it includes any doorStyle change
241
- var isUpdateMolding = false; // If it includes any global molding change
242
- filteredDiffs.forEach(function (_ref3) {
243
- var path = _ref3.path;
244
- /**
245
- * Every 'doorStyle' change has a 'door_style_id' change.
246
- * So, if door_style_id changes, it indicates 'doorStyle' change.
247
- */
248
- if (['id'].includes(path[path.length - 1])) isSettingDoorStyle = true;
249
-
250
- // If there are any molding change of layer
251
- if (path[1] === 'layers' && path[3] === 'molding') isUpdateMolding = true;
252
- });
253
- if (isSettingDoorStyle && isUpdateMolding)
254
- /**
255
- * If so, any other changes could be ignored.
256
- * Because the molding change of layer invokes 'createLayerObject()'
257
- * and that function re-renders an whole layer.
258
- */
259
- filteredDiffs = filteredDiffs.filter(function (_ref4) {
260
- var path = _ref4.path;
261
- return path[1] === 'layers' && path[3] === 'molding';
262
- });
263
- filteredDiffs.forEach(function (_ref5) {
264
- var op = _ref5.op,
265
- path = _ref5.path,
266
- value = _ref5.value;
267
- /* First of all I need to find the object I need to update */
268
- if (path[1] === 'layers') {
269
- var layer = sceneData.getIn(['layers', path[2]]);
270
- if (path.length === 3 && op === 'remove') {
271
- removeLayer(path[2], planData);
272
- } else if (path.length > 3) {
273
- if (path.length > 5) if (path[5] === 'submodule' || path[5] === 'doorStyle' || path[5] === 'properties') op = 'replace';
274
- switch (op) {
275
- case 'replace':
276
- var promiseValue = replaceObject(path, layer, planData, actions, sceneData, oldSceneData, catalog, mode, value);
277
- if (promiseValue !== undefined) {
278
- result.push(promiseValue.promise);
279
- }
280
- break;
281
- case 'add':
282
- addObject(path, layer, planData, actions, sceneData, oldSceneData, catalog, mode, toolObj);
283
- break;
284
- case 'remove':
285
- if (angleObj) planData.plan.parent.remove(angleObj);
286
- if (toolObj) planData.plan.parent.remove(toolObj);
287
- deleteSpecifiedMeshObjects('WarningBox' + path[4]);
288
- deleteSpecifiedMeshObjects('backsplash' + path[4]);
289
- var item = oldSceneData.getIn(['layers', path[2]]).getIn(['items', path[4]]);
290
- deleteCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
291
- removeObject(path, layer, planData, actions, sceneData, oldSceneData, catalog);
292
- break;
293
- }
294
- }
295
- } else if (path[1] === 'selectedLayer') {
296
- var layerSelectedID = value;
297
- var layerSelected = sceneData.getIn(['layers', layerSelectedID]);
298
- // First of all I check if the new selected layer is not visible
299
- if (!layerSelected.visible) {
300
- // I need to create the objects for this layer
301
- var promises = createLayerObjects(layerSelected, planData, sceneData, actions, catalog, mode);
302
- Promise.all(promises).then(function () {
303
- return updateBoundingBox(planData, false, mode);
304
- });
305
- }
306
- var layerGraph = planData.sceneGraph.layers[oldSceneData.selectedLayer];
307
- if (layerGraph) {
308
- if (!layerGraph.visible) {
309
- // I need to remove the objects for this layer
310
- for (var lineID in layerGraph.lines) removeLine(planData, layerGraph.id, lineID);
311
- for (var areaID in layerGraph.areas) removeArea(planData, layerGraph.id, areaID);
312
- for (var _itemID in layerGraph.items) removeItem(planData, layerGraph.id, _itemID);
313
- for (var holeID in layerGraph.holes) removeHole(planData, layerGraph.id, holeID);
314
- }
315
- }
316
- }
317
- });
318
- var p1 = new Promise(function (resolve) {
319
- Promise.all(result).then(function (replaceValue) {
320
- // if mode is elevation, build elevation scene
321
- // When scene is updated, replaceValue is not empty.
322
- if (isElevationView(mode) && !isEmpty(replaceValue)) buildElevationScene(planData, mode);
323
- resolve('successPromise');
324
- });
325
- });
326
- return {
327
- promise: p1,
328
- planData: planData
329
- };
330
- }
331
- var animate_objects = {};
332
- function myAnimRotate(obj, open_doors, item, isCorner) {
333
- var animateStep = animate_objects[obj.name].animateStep;
334
-
335
- // if open the door, animateStep increases to ANIMATE_STEP_MAX and if close the door, animateStep decreases to ANIMATE_STEP_MIN
336
- animateStep = open_doors ? animateStep + 1 : animateStep - 1;
337
-
338
- // clear interval when the opening or closing door is ended.
339
- if (animateStep > ANIMATE_STEP_MAX || animateStep < ANIMATE_STEP_MIN) {
340
- clearInterval(animate_objects[obj.name].animate_intervalID);
341
- return;
342
- }
343
- animate_objects[obj.name].animateStep = animateStep;
344
- animateDoor(animate_objects[obj.name].offset, obj, open_doors, item, isCorner, 'Opened3D');
345
- }
346
- function myAnimTranslate(obj, open_doors, item) {
347
- var animateStep = animate_objects[obj.name].animateStep;
348
- animateStep = open_doors ? animateStep + 1 : animateStep - 1;
349
- if (animateStep > ANIMATE_STEP_MAX || animateStep < ANIMATE_STEP_MIN) {
350
- clearInterval(animate_objects[obj.name].animate_intervalID);
351
- return;
352
- }
353
- animate_objects[obj.name].animateStep = animateStep;
354
- translateDrawer(item, obj, open_doors, 'Opened3D');
355
- }
356
- function replaceObject(modifiedPath, layer, planData, actions, sceneData, oldSceneData, catalog) {
357
- var mode = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
358
- var value = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
359
- var promises = [];
360
- var matchStr = /\d_(door[^LR1-9]*)(_[LR])?(_[1-9])?$/;
361
- switch (modifiedPath[3]) {
362
- case 'vertices':
363
- if (modifiedPath[5] !== 'selected') {
364
- var vertex = layer.getIn(['vertices', modifiedPath[4]]);
365
- if (modifiedPath[5] === 'x' || modifiedPath[5] === 'y') {
366
- vertex.lines.forEach(function (lineID) {
367
- var lineHoles = oldSceneData.getIn(['layers', layer.id, 'lines', lineID, 'holes']);
368
- if (lineHoles) lineHoles.forEach(function (holeID) {
369
- replaceObject([0, 0, 0, 'holes', holeID, 'selected'], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
370
- });
371
- return replaceObject([0, 0, 0, 'lines', lineID], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
372
- });
373
- vertex.areas.forEach(function (areaID) {
374
- return replaceObject([0, 0, 0, 'areas', areaID], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
375
- });
376
- }
377
- if (modifiedPath[5] === 'areas') {
378
- var areaID = vertex.getIn(['areas', ~~modifiedPath[6]]);
379
- replaceObject([0, 0, 0, 'areas', areaID], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
380
- }
381
- }
382
- break;
383
- case 'holes':
384
- var newHoleData = layer.getIn(['holes', modifiedPath[4]]);
385
- if (catalog.getElement(newHoleData.type).updateRender3D) {
386
- promises.push(updateHole(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.holesActions, function () {
387
- return removeHole(planData, layer.id, newHoleData.id);
388
- }, function () {
389
- return addHole(sceneData, planData, layer, newHoleData.id, catalog, actions.holesActions, mode);
390
- }));
391
- } else {
392
- var lineID = newHoleData.line;
393
- if (modifiedPath[5] === 'selected' || scene_mode === 'MODE_DRAWING_HOLE_3D' || scene_mode === 'MODE_DRAGGING_HOLE_3D') {
394
- // I remove only the hole without removing the wall
395
- removeHole(planData, layer.id, newHoleData.id);
396
- promises.push(addHole(sceneData, planData, layer, newHoleData.id, catalog, actions.holesActions, mode));
397
- } else {
398
- layer.getIn(['lines', lineID, 'holes']).forEach(function (holeID) {
399
- removeHole(planData, layer.id, holeID);
400
- });
401
- removeLine(planData, layer.id, lineID);
402
- promises.push(addLine(sceneData, planData, layer, lineID, catalog, actions.linesActions));
403
- layer.getIn(['lines', lineID, 'holes']).forEach(function (holeID) {
404
- promises.push(addHole(sceneData, planData, layer, holeID, catalog, actions.holesActions, mode));
405
- });
406
- }
407
- }
408
- break;
409
- case 'lines':
410
- var line = layer.getIn(['lines', modifiedPath[4]]);
411
- if (catalog.getElement(line.type).updateRender3D) {
412
- promises.push(updateLine(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.linesActions, function () {
413
- return removeLine(planData, layer.id, modifiedPath[4]);
414
- }, function () {
415
- return addLine(sceneData, planData, layer, modifiedPath[4], catalog, actions.linesActions);
416
- }));
417
- } else {
418
- removeLine(planData, layer.id, modifiedPath[4]);
419
- promises.push(addLine(sceneData, planData, layer, modifiedPath[4], catalog, actions.linesActions));
420
- }
421
- break;
422
- case 'areas':
423
- var area = layer.getIn(['areas', modifiedPath[4]]);
424
- if (catalog.getElement(area.type).updateRender3D) {
425
- promises.push(updateArea(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.areaActions, function () {
426
- return removeArea(planData, layer.id, modifiedPath[4]);
427
- }, function () {
428
- return addArea(sceneData, planData, layer, modifiedPath[4], catalog, actions.areaActions);
429
- }));
430
- } else {
431
- if (planData.sceneGraph.layers[layer.id].areas[modifiedPath[4]]) {
432
- removeArea(planData, layer.id, modifiedPath[4]);
433
- }
434
- promises.push(addArea(sceneData, planData, layer, modifiedPath[4], catalog, actions.areaActions));
435
- }
436
- break;
437
- case 'items':
438
- var item = layer.getIn(['items', modifiedPath[4]]);
439
- deleteCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
440
- var tmpMoldings = _toConsumableArray(planData.sceneGraph.layers[layer.id].moldingGroups);
441
- if (catalog.getElement(item.type).updateRender3D) {
442
- promises.push(updateItem(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.itemsActions, function () {
443
- return removeItem(planData, layer.id, modifiedPath[4], oldSceneData.getIn(['layers', layer.id]), layer);
444
- }, function () {
445
- return addItem(sceneData, planData, layer, modifiedPath[4], catalog, actions.itemsActions, mode);
446
- }));
447
- } else {
448
- var item3D = null;
449
- try {
450
- item3D = planData.sceneGraph.layers[layer.id].items[modifiedPath[4]];
451
- } catch (err) {
452
- console.log('modifiedPath: ', modifiedPath, '\nError: ', err);
453
- return;
454
- }
455
- if (!item3D) return;
456
- var keyIndex = modifiedPath.length - 1;
457
- if (modifiedPath[keyIndex] == 'rotation') {
458
- item3D.rotation.set(0, value * Math.PI / 180 + Math.PI, 0);
459
- setTimeout(function () {
460
- getDistances(layer);
461
- }, 50);
462
- removeSelItemMesh(tmpMoldings, item, planData, mode);
463
- } else if (modifiedPath[keyIndex] == 'x') {
464
- item3D.position.x = value;
465
- setTimeout(function () {
466
- getDistances(layer);
467
- }, 50);
468
- removeSelItemMesh(tmpMoldings, item, planData, mode);
469
- } else if (modifiedPath[keyIndex] == 'y') {
470
- item3D.position.z = -value;
471
- setTimeout(function () {
472
- getDistances(layer);
473
- }, 50);
474
- removeSelItemMesh(tmpMoldings, item, planData, mode);
475
- } else if (modifiedPath[keyIndex] == 'selected') {
476
- var itemType = !!catalog.elements[item.type] ? catalog.elements[item.type].type : catalog.elements[returnReplaceableDeepSearchType(item.type)].type;
477
- if (value == false) {
478
- item3D.children[0].children = item3D.children[0].children.filter(function (item3DElement) {
479
- return item3DElement.name !== 'TransformBox' && item3DElement.name !== 'TransformGizmo';
480
- });
481
- if (item3D) {
482
- if (item3D.children.length > 1) {
483
- item3D.children.pop();
484
- }
485
- var mBoxColor = 0x99c3fb;
486
- var _item = item.toJS();
487
- if (_item.doorStyle.doorStyles !== undefined && _item.doorStyle.doorStyles.cds) {
488
- if (showYelloBox(_item)) {
489
- mBoxColor = 'rgba(232,187,47,1)';
490
- var mBox = GeomUtils.makeMBoxfromObject(item3D, mBoxColor);
491
- var warningObj = createWarningObject();
492
- warningObj.position.set(0, item.properties.get('height').get('length') / 3, 0);
493
- if (mBox) {
494
- mBox.add(warningObj);
495
- item3D.add(mBox);
496
- }
497
- }
498
- }
499
- }
500
- var temp_MGArray = planData.sceneGraph.layers[layer.id].moldingGroups;
501
- } else {
502
- if (item3D.name !== 'pivot' && item3D.children[0].children[item3D.children[0].children.length - 1].name == 'TransformGizmo') return;
503
- if (item3D.children[0].children[item3D.children[0].children.length - 1].name == 'TransformGizmo') {
504
- item3D.children[0].children.pop();
505
- }
506
- var object = item3D.children[0].clone();
507
- if (item3D.children.length > 1) {
508
- item3D.children.pop();
509
- }
510
- item3D.children.pop();
511
- var altitude = item.properties.get('altitude').get('length');
512
- var scalevec = new Three.Vector3(object.scale.x, object.scale.y, object.scale.z);
513
- var posVec = new Three.Vector3(object.position.x, object.position.y, object.position.z);
514
- var newAltitude = item.properties.get('altitude').get('_length');
515
- var newUnit = item.properties.get('altitude').get('_unit') || 'in';
516
- newAltitude = convert(newAltitude).from(newUnit).to(sceneData.unit);
517
- var newWidth = item.properties.get('width').get('_length');
518
- var newWidthUnit = item.properties.get('width').get('_unit') || 'in';
519
- newWidth = convert(newWidth).from(newWidthUnit).to('in');
520
- var newHeight = item.properties.get('height').get('_length');
521
- var newHeightUnit = item.properties.get('height').get('_unit') || 'in';
522
- newHeight = convert(newHeight).from(newHeightUnit).to('in');
523
- var newDepth = item.properties.get('depth').get('_length');
524
- var newDepthUnit = item.properties.get('depth').get('_unit') || 'in';
525
- newDepth = convert(newDepth).from(newDepthUnit).to('in');
526
- var sizeinfo = !!catalog.elements[item.type] ? catalog.elements[item.type].info.sizeinfo : catalog.elements[returnReplaceableDeepSearchType(item.type)].info.sizeinfo;
527
- object.scale.set(1 * newWidth / sizeinfo.width, 1 * newHeight / sizeinfo.height, 1 * newDepth / sizeinfo.depth);
528
- object.position.set(0, 0, 0);
529
- object.rotation.set(0, 0, 0);
530
- var box = GeomUtils.baseBoxHelper(object, 0xffffff);
531
- box.material.lineWidth = 0.01;
532
- var boundingBox = GeomUtils.baseBox3FromObject(object);
533
- var max = boundingBox.max;
534
- var min = boundingBox.min;
535
- var radius = Math.sqrt((boundingBox.max.x - boundingBox.min.x) * (boundingBox.max.x - boundingBox.min.x) + (boundingBox.max.z - boundingBox.min.z) * (boundingBox.max.z - boundingBox.min.z)) / 2;
536
- var moveBox = new Three.BoxGeometry(max.x - min.x, max.y - min.y, max.z - min.z);
537
-
538
- // translate Object
539
- var controlGeom = GeomUtils.controlGeom();
540
-
541
- // rotate Object //////////
542
- var rotGeom = GeomUtils.rotGeoms(radius + 0.05);
543
- // //////////////////////////////////
544
- // upwards Geometry///////////
545
- var upwardsGeom = GeomUtils.upwardsGeom();
546
- var vLineGeom = new Three.BufferGeometry();
547
- var vertices = [(max.x - min.x) / 2 + min.x, 0, max.z, (max.x - min.x) / 2 + min.x, 0, max.z + 1.3];
548
- vLineGeom.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices), 3));
549
- vLineGeom.attributes.position.needsUpdate = true;
550
- var vLineGeom1 = new Three.BufferGeometry();
551
- var vertices1 = [(max.x - min.x) / 2 + min.x, 0, min.z, (max.x - min.x) / 2 + min.x, 0, min.z - 1.3];
552
- vLineGeom1.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices1), 3));
553
- vLineGeom1.attributes.position.needsUpdate = true;
554
- var vLineGeom2 = new Three.BufferGeometry();
555
- var vertices2 = [max.x, 0, max.z - (max.z - min.z) / 2, max.x + 1.3, 0, max.z - (max.z - min.z) / 2];
556
- vLineGeom2.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices2), 3));
557
- var vLineGeom3 = new Three.BufferGeometry();
558
- var vertices3 = [min.x, 0, max.z - (max.z - min.z) / 2, min.x - 1.3, 0, max.z - (max.z - min.z) / 2];
559
- vLineGeom3.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices3), 3));
560
- // ///////////////////////////////////////
561
-
562
- // set names of transform object
563
- var rotFillObj = new Three.Mesh(rotGeom.rotFill, new Three.MeshPhongMaterial({
564
- color: 0x000000,
565
- side: Three.DoubleSide,
566
- colorWrite: true
567
- }));
568
- var rotStrokeObj = new Three.Line(rotGeom.rotStroke, new Three.LineBasicMaterial({
569
- color: 0xffffff,
570
- colorWrite: true
571
- }));
572
- rotFillObj.name = 'rotate';
573
- var upObj = new Three.Mesh(upwardsGeom, new Three.MeshBasicMaterial({
574
- color: 0x000000,
575
- side: Three.DoubleSide
576
- }));
577
- // let upLine = new Three.Line(upwardsGeom, new Three.LineBasicMaterial({ color: 0x000000 }));
578
- // upLine.name = "transUp";
579
- // upObj.add(upLine);
580
- upObj.name = 'transUp';
581
- var upwardbox = new Three.BoxHelper(upObj, 0x326780);
582
- upwardbox.material.lineWidth = 0.01;
583
- fVLine = [];
584
- // let obj = new Three.Mesh(controlGeom, new Three.MeshPhongMaterial({ color: 0xffffff, side: Three.DoubleSide, colorWrite: true }));
585
- // obj.name = "translateX";
586
- var color = SHADE_DARK_PURPLE_COLOR;
587
- var _mBox = new Three.Mesh(moveBox, new Three.MeshBasicMaterial({
588
- color: 0xdd6699,
589
- side: Three.DoubleSide,
590
- transparent: true,
591
- opacity: 0.4
592
- }));
593
- var vLine = new Three.Line(vLineGeom, new Three.LineBasicMaterial({
594
- color: color
595
- }));
596
- var vLine1 = new Three.Line(vLineGeom1, new Three.LineBasicMaterial({
597
- color: color
598
- }));
599
- var vLine2 = new Three.Line(vLineGeom2, new Three.LineBasicMaterial({
600
- color: color
601
- }));
602
- var vLine3 = new Three.Line(vLineGeom3, new Three.LineBasicMaterial({
603
- color: color
604
- }));
605
- fVLine.push(vLine);
606
- fVLine.push(vLine1);
607
- fVLine.push(vLine2);
608
- fVLine.push(vLine3);
609
- vLine.renderOrder = 1;
610
- vLine1.renderOrder = 1;
611
- vLine2.renderOrder = 1;
612
- vLine3.renderOrder = 1;
613
- vLine.material.transparent = true;
614
- vLine1.material.transparent = true;
615
- vLine2.material.transparent = true;
616
- vLine3.material.transparent = true;
617
- vLine.material.depthTest = false;
618
- vLine1.material.depthTest = false;
619
- vLine2.material.depthTest = false;
620
- vLine3.material.depthTest = false;
621
- var uVec = new Three.Vector3(-posVec.x / scalevec.x, -posVec.y / scalevec.y, -posVec.z / scalevec.z);
622
- var blLighting = item.type.includes('Light');
623
- vLine.translateY(blLighting ? 1.6 : 0.1);
624
- vLine1.translateY(blLighting ? 1.6 : 0.1);
625
- vLine2.translateY(blLighting ? 1.6 : 0.1);
626
- vLine3.translateY(blLighting ? 1.6 : 0.1);
627
- upObj.translateOnAxis(uVec, 1);
628
- upObj.translateY(max.y - min.y);
629
- _mBox.name = 'TransformBox';
630
- _mBox.translateOnAxis(new Three.Vector3(uVec.x, uVec.y + (max.y - min.y) / 2, uVec.z), 1);
631
- _mBox.scale.set(1.01, 1.01, 1.01);
632
- var rotFillObj1 = rotFillObj.clone();
633
- var rotStrokeObj1 = rotStrokeObj.clone();
634
- rotFillObj1.rotateY(Math.PI);
635
- rotStrokeObj1.rotateY(Math.PI);
636
- var asrtObj = new Three.Group();
637
- // let asrtObj1 = new Three.Group();
638
- // asrtObj.add(obj);
639
- // asrtObj.add(obj1);
640
- rotFillObj.translateY(blLighting ? 1.6 : 0.1);
641
- rotFillObj1.translateY(blLighting ? 1.6 : 0.1);
642
- rotStrokeObj.translateY(blLighting ? 1.6 : 0.1);
643
- rotStrokeObj1.translateY(blLighting ? 1.6 : 0.1);
644
- upObj.translateY(posVec.y / scalevec.y);
645
- upObj.add(upwardbox);
646
- //asrtObj.add(upObj);
647
- // vLine.translateY(posVec.y / scalevec.y);
648
- // vLine1.translateY(posVec.y / scalevec.y);
649
- // vLine2.translateY(posVec.y / scalevec.y);
650
- // vLine3.translateY(posVec.y / scalevec.y);
651
-
652
- _mBox.translateY(posVec.y / scalevec.y);
653
- // asrtObj.add(rotFillObj);
654
- // asrtObj.add(rotFillObj1);
655
- // asrtObj.add(rotStrokeObj);
656
- // asrtObj.add(rotStrokeObj1);
657
- asrtObj.add(vLine);
658
- asrtObj.add(vLine1);
659
- asrtObj.add(vLine2);
660
- asrtObj.add(vLine3);
661
- asrtObj.add(box);
662
- asrtObj.scale.set(1 / object.scale.x, object.scale.y, 1 / object.scale.z);
663
- _mBox.visible = false;
664
- // transformBox = mBox;
665
- // asrtObj.add(mBox);
666
- asrtObj.name = 'TransformGizmo';
667
- object.add(asrtObj);
668
- object.position.x = posVec.x;
669
- object.position.y = posVec.y;
670
- object.position.z = posVec.z;
671
- // object.rotation.y = Math.PI;
672
- object.scale.set(scalevec.x, scalevec.y, scalevec.z);
673
- item3D.add(object);
674
- if (item3D) {
675
- var _mBoxColor = 0x99c3fb;
676
- var _item2 = item.toJS();
677
- if (_item2.doorStyle.doorStyles !== undefined && _item2.doorStyle.doorStyles.cds) {
678
- if (showYelloBox(_item2)) {
679
- _mBoxColor = 'rgba(232,187,47,1)';
680
- var _mBox2 = GeomUtils.makeMBoxfromObject(item3D, _mBoxColor);
681
- var _warningObj = createWarningObject();
682
- _warningObj.position.set(0, item.properties.get('height').get('length') / 3, 0);
683
- if (_mBox2) {
684
- _mBox2.add(_warningObj);
685
- item3D.add(_mBox2);
686
- }
687
- }
688
- }
689
- }
690
- applyInteract(item3D, function () {
691
- // closes the setting dialog
692
- document.getElementById('setting_dialog').style.display = 'none';
693
- return actions.itemsActions.selectItem(layer.id, modifiedPath[4]);
694
- });
695
- setTimeout(function () {
696
- getDistances(layer);
697
- }, 100);
698
- }
699
- } else if (modifiedPath[keyIndex] == 'length') {
700
- var _object = item3D.children[0];
701
- var prevPos = _object.position;
702
- _object.position.set(prevPos.x, value, prevPos.z);
703
- } else if (modifiedPath[keyIndex] == 'flip_doorhandle') {
704
- updateDoorHandleMesh(item, item3D, value);
705
- var _object2 = item3D.children[0];
706
- var door_animate_offset = _object2.userData.door_animate_offset;
707
- var _loop = function _loop(it) {
708
- if (_object2.children.filter(function (elem) {
709
- return elem.name === it;
710
- }).length) {
711
- var door_match = it.match(matchStr);
712
- var rotate_match_text = item.properties.toJS().flip_doorhandle ? 'rotate_L' : 'rotate_R';
713
- if (door_match[2] === '_L') {
714
- rotate_match_text = item.properties.toJS().flip_doorhandle ? 'rotate_R' : 'rotate_L';
715
- }
716
- _object2.children.filter(function (elem) {
717
- return elem.name === it;
718
- })[0].children[0].children.forEach(function (child) {
719
- if (child.name.endsWith(rotate_match_text)) {
720
- door_animate_offset[it] = {
721
- x: child.position.x,
722
- y: child.position.y,
723
- z: child.position.z
724
- };
725
- }
726
- });
727
- }
728
- };
729
- for (var it in door_animate_offset) {
730
- _loop(it);
731
- }
732
- _object2.userData.door_animate_offset = door_animate_offset;
733
- } else if (modifiedPath[keyIndex] == 'animValue') {
734
- return;
735
- } else if (modifiedPath[keyIndex] == 'open_doors') {
736
- var _object3 = item3D.children[0];
737
- var userData = item3D.children[0].userData;
738
- var moveObjectChildrens = [];
739
- var selectedItem = layer.getIn(['items', layer.selected.toJS().items[0]]).toJS();
740
- _object3.children.forEach(function (child, idx) {
741
- var object_match = child.name.match(/\d_(interior_drawer[^LR1-9]*)(_[LR1-9])?$/) || child.name.match(matchStr);
742
- if (object_match && object_match.length > 2) {
743
- moveObjectChildrens.push({
744
- type: object_match[1],
745
- obj: child
746
- });
747
- animate_objects[child.name] = animate_objects[child.name] || {};
748
- }
749
- });
750
- var temp = moveObjectChildrens.filter(function (item) {
751
- var _object3$userData$doo;
752
- return (_object3$userData$doo = _object3.userData.door_animate_offset[item.obj.name]) === null || _object3$userData$doo === void 0 ? void 0 : _object3$userData$doo.isCorner;
753
- });
754
- var isCorner = temp.length > 0;
755
- moveObjectChildrens.forEach(function (element) {
756
- var _animate_objects$elem, _animate_objects$elem2;
757
- if (((_animate_objects$elem = animate_objects[element.obj.name]) === null || _animate_objects$elem === void 0 ? void 0 : _animate_objects$elem.animateStep) === undefined) {
758
- animate_objects[element.obj.name].animateStep = selectedItem.properties.open_doors ? ANIMATE_STEP_MIN : ANIMATE_STEP_MAX;
759
- }
760
-
761
- // clear origin Interval.
762
- if ((_animate_objects$elem2 = animate_objects[element.obj.name]) !== null && _animate_objects$elem2 !== void 0 && _animate_objects$elem2.animate_intervalID) {
763
- var _animate_objects$elem3;
764
- clearInterval((_animate_objects$elem3 = animate_objects[element.obj.name]) === null || _animate_objects$elem3 === void 0 ? void 0 : _animate_objects$elem3.animate_intervalID);
765
- }
766
- if (element.type === 'door') {
767
- var _userData$door_animat, _element$obj;
768
- // This is excuted when item has door.
769
- var offset = userData === null || userData === void 0 || (_userData$door_animat = userData.door_animate_offset) === null || _userData$door_animat === void 0 ? void 0 : _userData$door_animat[element === null || element === void 0 || (_element$obj = element.obj) === null || _element$obj === void 0 ? void 0 : _element$obj.name];
770
- if (offset) {
771
- var _offset$x, _offset$y, _offset$z;
772
- animate_objects[element.obj.name].offset = {
773
- x: (_offset$x = offset.x) !== null && _offset$x !== void 0 ? _offset$x : 0,
774
- y: (_offset$y = offset.y) !== null && _offset$y !== void 0 ? _offset$y : 0,
775
- z: (_offset$z = offset.z) !== null && _offset$z !== void 0 ? _offset$z : 0
776
- };
777
- } else {
778
- var _element$obj2;
779
- console.warn('⚠ Missing door_animate_offset for', element === null || element === void 0 || (_element$obj2 = element.obj) === null || _element$obj2 === void 0 ? void 0 : _element$obj2.name);
780
- animate_objects[element.obj.name].offset = {
781
- x: 0,
782
- y: 0,
783
- z: 0
784
- };
785
- }
786
-
787
- // Set the interval ID to new interval ID
788
- animate_objects[element.obj.name].animate_intervalID = setInterval(function () {
789
- myAnimRotate(element.obj, selectedItem.properties.open_doors, selectedItem, isCorner);
790
- }, 30);
791
- } else {
792
- // This is excuted when item has drawer box
793
- // Set the interval ID to new interval ID
794
- animate_objects[element.obj.name].animate_intervalID = setInterval(function () {
795
- myAnimTranslate(element.obj, selectedItem.properties.open_doors, selectedItem);
796
- }, 30);
797
- }
798
- });
799
- } else if (['_length', 'doorStyle', 'cabinet_door_style_id', 'counterTop', 'texture', 'drawer_door_handle_1_gltf'].includes(modifiedPath[keyIndex])) {
800
- var rItem = planData.sceneGraph.layers[layer.id].items[modifiedPath[4]];
801
- if (rItem) {
802
- if (rItem.children.length > 1) {
803
- rItem.children.pop();
804
- }
805
- var _mBoxColor2 = 0x99c3fb;
806
- var _item3 = item.toJS();
807
- if (_item3.doorStyle.doorStyles !== undefined && _item3.doorStyle.doorStyles.cds) {
808
- if (showYelloBox(_item3)) {
809
- _mBoxColor2 = 'rgba(232,187,47,1)';
810
- }
811
- }
812
- rItem.children[0].children.forEach(function (rItemElement) {
813
- rItemElement.visible = false;
814
- });
815
- var _mBox3 = GeomUtils.makeMBoxfromObject(rItem, _mBoxColor2);
816
- if (_mBox3) {
817
- //rItem.add (mBox);
818
- }
819
- }
820
- if (rItem != null) {
821
- removeItemWithoutItem(planData, layer.id, modifiedPath[4]);
822
- promises.push(addItem(sceneData, planData, layer, modifiedPath[4], catalog, actions.itemsActions, mode, null, rItem));
823
- setTimeout(function () {
824
- getDistances(layer);
825
- }, 100);
826
- }
827
- break;
828
- }
829
- }
830
- item = layer.getIn(['items', modifiedPath[4]]);
831
- addCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
832
- // Toggle selection should not update molding
833
- if (item.category === 'cabinet' && modifiedPath[modifiedPath.length - 1] !== 'selected') {
834
- planData.sceneGraph.layers[layer.id].moldingGroups = addMolding(tmpMoldings, item, planData, layer, actions.itemsActions, mode) || _toConsumableArray(tmpMoldings);
835
- }
836
- break;
837
- case 'visible':
838
- if (!layer.visible) {
839
- var _layerGraph = planData.sceneGraph.layers[layer.id];
840
- for (var _lineID in _layerGraph.lines) removeLine(planData, layer.id, _lineID);
841
- for (var _areaID in _layerGraph.areas) removeArea(planData, layer.id, _areaID);
842
- for (var itemID in _layerGraph.items) removeItem(planData, layer.id, itemID);
843
- for (var holeID in _layerGraph.holes) removeHole(planData, layer.id, holeID);
844
- } else {
845
- promises = promises.concat(createLayerObjects(layer, planData, sceneData, actions, catalog, mode));
846
- }
847
- break;
848
- case 'unit':
849
- case 'ceilHeight':
850
- case 'opacity':
851
- case 'altitude':
852
- case 'molding':
853
- var layerGraph = planData.sceneGraph.layers[layer.id];
854
- for (var _lineID2 in layerGraph.lines) removeLine(planData, layer.id, _lineID2);
855
- for (var _areaID2 in layerGraph.areas) removeArea(planData, layer.id, _areaID2);
856
- for (var _itemID2 in layerGraph.items) removeItem(planData, layer.id, _itemID2);
857
- for (var _holeID in layerGraph.holes) removeHole(planData, layer.id, _holeID);
858
- promises = promises.concat(createLayerObjects(layer, planData, sceneData, actions, catalog, mode));
859
- }
860
- var p1 = new Promise(function (resolve) {
861
- Promise.all(promises).then(function (values) {
862
- updateBoundingBox(planData, true, mode);
863
- resolve('replaceObject');
864
- });
865
- });
866
- return {
867
- promise: p1
868
- };
869
- }
870
- export function getDistances(layer, isCalcWall) {
871
- fVLine.forEach(function (line, index) {
872
- getLineDistance(line, layer, isCalcWall === undefined ? false : isCalcWall, index);
873
- });
874
- }
875
- function getLineDistance(obj, layer, isCalcWall, index) {
876
- if (obj === undefined) return;
877
- var positionAttribute = obj.geometry.attributes.position;
878
- if (positionAttribute === undefined) return;
879
- var wPoint0 = new Three.Vector3().fromBufferAttribute(positionAttribute, 0).applyMatrix4(obj.matrixWorld);
880
- var wPoint1 = new Three.Vector3().fromBufferAttribute(positionAttribute, 1).applyMatrix4(obj.matrixWorld);
881
- var raycaster = new Three.Raycaster(wPoint0, new Three.Vector3(wPoint1.x - wPoint0.x, wPoint1.y - wPoint0.y, wPoint1.z - wPoint0.z));
882
- var rayDirection = raycaster.ray.direction;
883
- raycaster.camera = new Three.Camera();
884
- rayDirection.normalize();
885
- var meshes = [];
886
- planData.plan.traverse(function (child) {
887
- if (child.isMesh && child.geometry) {
888
- meshes.push(child);
889
- }
890
- });
891
- var intersects = raycaster.intersectObjects(meshes, true);
892
- var lx = wPoint0.x - wPoint1.x;
893
- var ly = wPoint0.y - wPoint1.y;
894
- var lz = wPoint0.z - wPoint1.z;
895
- var length = Math.sqrt(lx * lx + ly * ly + lz * lz);
896
- var scale = 1;
897
- var extrudeSettings = {
898
- steps: 2,
899
- depth: 0.01,
900
- bevelEnabled: false
901
- };
902
- var w = 0.2;
903
- var h = w * (Math.sqrt(3) / 2);
904
- var shape = new Three.Shape();
905
- shape.moveTo(0, 0);
906
- shape.lineTo(-w / 4, h / 2);
907
- shape.lineTo(w / 4, h / 2);
908
- var geom = new Three.ExtrudeGeometry(shape, extrudeSettings);
909
- geom.center();
910
- if (!isCalcWall) {
911
- for (var i = 0; i < intersects.length; i++) {
912
- if (intersects[i].object.name != 'TransformBox' && !intersects[i].object.name.includes('WarningBox') && intersects[i].object.type != 'Line' && intersects[i].object.name != 'rotate' && intersects[i].object.name != 'lineText' && intersects[i].object.type != 'BoxHelper' && !intersects[i].object.name.includes('molding') && intersects[i].object.name != 'soul') {
913
- scale = intersects[i].distance / length;
914
- if (intersects[i].distance <= 0.1) {
915
- scale = 0.1 / length;
916
- }
917
- obj.userData.distance = intersects[i].distance;
918
- obj.userData.target = intersects[i].object;
919
- var originPoint = obj.geometry.attributes.position.array.slice(0, 3);
920
- var _lx = obj.geometry.attributes.position.array[3] - obj.geometry.attributes.position.array[0];
921
- var _ly = obj.geometry.attributes.position.array[4] - obj.geometry.attributes.position.array[1];
922
- var _lz = obj.geometry.attributes.position.array[5] - obj.geometry.attributes.position.array[2];
923
- var newVec = new Three.Vector3(originPoint[0] + _lx * scale, originPoint[1] + _ly * scale, originPoint[2] + _lz * scale);
924
- obj.geometry.attributes.position.array[3] = newVec.x;
925
- obj.geometry.attributes.position.array[4] = newVec.y;
926
- obj.geometry.attributes.position.array[5] = newVec.z;
927
- obj.geometry.attributes.position.needsUpdate = true;
928
- obj.geometry.computeBoundingSphere();
929
- obj.geometry.computeBoundingBox();
930
- var dist = formatNumber(convert(intersects[i].distance).from('cm').to('in'), DECIMAL_PLACES_2);
931
- if (dist > 3) {
932
- var _canvas = getTextCanvas(dist);
933
- var wid = _canvas.width / window.innerWidth * 30;
934
- var hei = _canvas.height / window.innerHeight * 30;
935
- var texture = new Three.Texture(_canvas);
936
- texture.minFilter = Three.LinearFilter;
937
- texture.needsUpdate = true;
938
- var geometry = new Three.PlaneGeometry(wid / 5, hei / 5);
939
- geometry.computeBoundingBox();
940
- var material = new Three.MeshBasicMaterial({
941
- map: texture,
942
- side: Three.DoubleSide
943
- });
944
- var textMesh = new Three.Mesh(geometry, material);
945
- for (; obj.children.length != 0;) {
946
- var temp = obj.children.pop();
947
- disposeObject(temp);
948
- }
949
- textMesh.rotation.set(Math.PI / 2, Math.PI, 0);
950
- // obj.add(textMesh);
951
- textMesh.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
952
- textMesh.name = 'lineText';
953
- textMesh.renderOrder = 2;
954
- textMesh.material.depthTest = false;
955
- textMesh.material.transparent = true;
956
- var sprite1 = new Three.Sprite(new Three.SpriteMaterial({
957
- map: texture
958
- }));
959
- sprite1.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
960
- sprite1.name = 'lineText';
961
- sprite1.renderOrder = 2;
962
- sprite1.scale.set(0.2, 0.1, 0.2);
963
- sprite1.layers.set(1);
964
- obj.add(sprite1);
965
- if (obj.parent != null) {
966
- // is not lighting
967
- var item3D = obj.parent.parent.parent;
968
- var max = item3D.children[0].userData.max;
969
- var min = item3D.children[0].userData.min;
970
- var objW = (max.x - min.x) / 100,
971
- objL = (max.z - min.z) / 100;
972
- var triangle = new Three.Mesh(geom, new Three.MeshBasicMaterial({
973
- color: SHADE_DARK_PURPLE_COLOR
974
- }));
975
- var triangle1 = new Three.Mesh(geom, new Three.MeshBasicMaterial({
976
- color: SHADE_DARK_PURPLE_COLOR
977
- }));
978
- triangle.position.set((index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * (obj.geometry.attributes.position.array[0] + h / 4 + (index % 2 === 0 ? 0 : objW)), newVec.y, (index < 2 ? Math.cos(index * Math.PI) : 0) * (obj.geometry.attributes.position.array[2] + h / 4 + (index % 2 === 0 ? 0 : objL)));
979
- triangle1.position.set(newVec.x - (index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * h / 4, newVec.y, newVec.z - (index < 2 ? Math.cos(index * Math.PI) : 0) * h / 4);
980
- if (index < 2) {
981
- triangle.rotation.x = Math.cos(index * Math.PI) * Math.PI / 2;
982
- triangle1.rotation.x = -Math.cos(index * Math.PI) * Math.PI / 2;
983
- } else {
984
- triangle.rotation.x = -Math.PI / 2;
985
- triangle.rotation.z = -(index === 2 ? 1 : -1) * Math.PI / 2;
986
- triangle1.rotation.x = Math.PI / 2;
987
- triangle1.rotation.z = (index === 2 ? 1 : -1) * Math.PI / 2;
988
- }
989
- triangle.name = 'lineText';
990
- triangle1.name = 'lineText';
991
- triangle.renderOrder = 2;
992
- triangle1.renderOrder = 2;
993
- triangle.material.transparent = true;
994
- triangle1.material.transparent = true;
995
- triangle.material.depthTest = false;
996
- triangle1.material.depthTest = false;
997
- obj.add(triangle);
998
- obj.add(triangle1);
999
- }
1000
- }
1001
-
1002
- // if (obj.userData.distance <= 50 && obj.userData.distance >= 0.5) {
1003
- var real_target = obj.userData.target;
1004
- for (; real_target.name != 'pivot';) {
1005
- if (real_target.parent == null) break;
1006
- real_target = real_target.parent;
1007
- }
1008
- // let item3D = obj.parent.parent.parent;
1009
- // let origin = obj.geometry.vertices[0].clone().applyMatrix4(obj.matrixWorld);
1010
- // let target = obj.geometry.vertices[1].clone().applyMatrix4(obj.matrixWorld);
1011
- // let uVec = new Three.Vector3(target.x - origin.x - 0.2, target.y - origin.y - 0.2, target.z - origin.z - 0.2);
1012
- obj.visible = true;
1013
- if (dist < 3) obj.visible = false;
1014
- return obj;
1015
- }
1016
- }
1017
- }
1018
- var tX = wPoint0.x - planData.plan.position.x;
1019
- var tZ = wPoint0.z - planData.plan.position.z;
1020
- tZ = -tZ;
1021
- var tX1 = wPoint1.x - planData.plan.position.x;
1022
- var tZ1 = wPoint1.z - planData.plan.position.z;
1023
- tZ1 = -tZ1;
1024
- if (!layer) return;
1025
- layer.lines.forEach(function (data) {
1026
- var px = [];
1027
- var py = [];
1028
- var opX = [tX, tX1];
1029
- var opY = [tZ, tZ1];
1030
- data.vertices.forEach(function (vec) {
1031
- var vertices = layer.vertices.get(vec);
1032
- px.push(vertices.x);
1033
- py.push(vertices.y);
1034
- });
1035
- var distance = getIntersectPoint(opX, opY, px, py);
1036
- if (distance != null) {
1037
- obj.userData.distance = distance;
1038
- obj.userData.target = planData.sceneGraph.layers[layer.id].lines[data.get('id')];
1039
- scale = distance / length;
1040
- if (distance <= 0.1) {
1041
- scale = 0.1 / length;
1042
- }
1043
- var _originPoint = obj.geometry.attributes.position.array.slice(0, 3);
1044
- lx = obj.geometry.attributes.position.array[3] - obj.geometry.attributes.position.array[0];
1045
- ly = obj.geometry.attributes.position.array[4] - obj.geometry.attributes.position.array[1];
1046
- lz = obj.geometry.attributes.position.array[5] - obj.geometry.attributes.position.array[2];
1047
- var _newVec = new Three.Vector3(_originPoint.x + lx * scale, _originPoint.y + ly * scale, _originPoint.z + lz * scale);
1048
- obj.geometry.attributes.position.array[3] = _newVec.x;
1049
- obj.geometry.attributes.position.array[4] = _newVec.y;
1050
- obj.geometry.attributes.position.array[5] = _newVec.z;
1051
- obj.geometry.attributes.position.needsUpdate = true;
1052
- var _dist = formatNumber(distance, DECIMAL_PLACES_2);
1053
- if (_dist > 3) {
1054
- var _canvas2 = getTextCanvas(_dist);
1055
- var _wid = _canvas2.width / window.innerWidth * 30;
1056
- var _hei = _canvas2.height / window.innerHeight * 30;
1057
- var _texture = new Three.Texture(_canvas2);
1058
- _texture.needsUpdate = true;
1059
- var _geometry = new Three.PlaneGeometry(_wid / 2, _hei / 2);
1060
- _geometry.computeBoundingBox();
1061
- var _material = new Three.MeshBasicMaterial({
1062
- map: _texture,
1063
- side: Three.DoubleSide
1064
- });
1065
- var _textMesh = new Three.Mesh(_geometry, _material);
1066
- for (; obj.children.length != 0;) {
1067
- var _temp = obj.children.pop();
1068
- disposeObject(_temp);
1069
- }
1070
- _textMesh.rotation.set(Math.PI / 2, Math.PI, 0);
1071
- // obj.add(textMesh);
1072
- _textMesh.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
1073
- _textMesh.name = 'lineText';
1074
- _textMesh.renderOrder = 2;
1075
- _textMesh.material.depthTest = false;
1076
- _textMesh.material.transparent = true;
1077
- var _sprite = new Three.Sprite(new Three.SpriteMaterial({
1078
- map: _texture
1079
- }));
1080
- _sprite.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
1081
- _sprite.name = 'lineText';
1082
- _sprite.scale.set(0.2, 0.1, 0.2);
1083
- _sprite.layers.set(1);
1084
- obj.add(_sprite);
1085
- var _item3D = obj.parent.parent.parent;
1086
- var _max = _item3D.children[0].userData.max;
1087
- var _min = _item3D.children[0].userData.min;
1088
- var _objW = (_max.x - _min.x) / 100,
1089
- _objL = (_max.z - _min.z) / 100;
1090
- var triangle = new Three.Mesh(geom, new Three.MeshBasicMaterial({
1091
- color: SHADE_DARK_PURPLE_COLOR
1092
- }));
1093
- var triangle1 = new Three.Mesh(geom, new Three.MeshBasicMaterial({
1094
- color: SHADE_DARK_PURPLE_COLOR
1095
- }));
1096
- triangle.position.set((index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * (obj.geometry.attributes.position.array[0] + h / 4 + (index % 2 === 0 ? 0 : _objW)), _newVec.y, (index < 2 ? Math.cos(index * Math.PI) : 0) * (obj.geometry.attributes.position.array[2] + h / 4 + (index % 2 === 0 ? 0 : _objL)) - 0.02);
1097
- triangle1.position.set(_newVec.x - (index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * h / 4, _newVec.y, _newVec.z - (index < 2 ? Math.cos(index * Math.PI) : 0) * h / 4);
1098
- if (index < 2) {
1099
- triangle.rotation.x = Math.cos(index * Math.PI) * Math.PI / 2;
1100
- triangle1.rotation.x = -Math.cos(index * Math.PI) * Math.PI / 2;
1101
- } else {
1102
- triangle.rotation.x = -Math.PI / 2;
1103
- triangle.rotation.z = -(index === 2 ? 1 : -1) * Math.PI / 2;
1104
- triangle1.rotation.x = Math.PI / 2;
1105
- triangle1.rotation.z = (index === 2 ? 1 : -1) * Math.PI / 2;
1106
- }
1107
- triangle.name = 'lineText';
1108
- triangle1.name = 'lineText';
1109
- triangle.renderOrder = 2;
1110
- triangle1.renderOrder = 2;
1111
- triangle.material.transparent = true;
1112
- triangle1.material.transparent = true;
1113
- triangle.material.depthTest = false;
1114
- triangle1.material.depthTest = false;
1115
- obj.add(triangle);
1116
- obj.add(triangle1);
1117
- }
1118
- // if (obj.userData.distance <= 50 && obj.userData.distance >= 0.5) {
1119
- // let item3D = obj.parent.parent.parent;
1120
- // let pos = item3D.position.clone();
1121
- // let origin = obj.geometry.vertices[0].clone().applyMatrix4(obj.matrixWorld);
1122
- // let target = obj.geometry.vertices[1].clone().applyMatrix4(obj.matrixWorld);
1123
- // let uVec = new Three.Vector3(target.x - origin.x - 0.2, target.y - origin.y - 0.2, target.z - origin.z - 0.2);
1124
- obj.visible = true;
1125
- if (_dist > 3) obj.visible = false;
1126
- return obj;
1127
- // itemsActions.updateDraggingItemChanged(pos.x - uVec.x, -pos.z + uVec.z);
1128
- // }
1129
- }
1130
- });
1131
- obj.visible = false;
1132
- return obj;
1133
- }
1134
- export function getIntersectPoint(opX, opY, pX, pY) {
1135
- var oA;
1136
- if (opX[1] == opX[0]) oA = null;else oA = (opY[1] - opY[0]) / (opX[1] - opX[0]);
1137
- var A;
1138
- if (pX[1] == pX[0]) A = null;else A = (pY[1] - pY[0]) / (pX[1] - pX[0]);
1139
- if (oA == A) return null;
1140
- if (oA != null && A != null) {
1141
- var oB = opY[0] - oA * opX[0];
1142
- var B = pY[0] - A * pX[0];
1143
- var iX = (B - oB) / (oA - A);
1144
- if (pX[0] <= iX && iX <= pX[1] || pX[0] >= iX && iX >= pX[1]) {
1145
- if (opX[0] <= opX[1] && opX[0] <= iX || opX[0] >= opX[1] && opX[0] >= iX) {
1146
- var iY = pY[0] + A * (iX - pX[0]);
1147
- var distance = Math.sqrt((opX[0] - iX) * (opX[0] - iX) + (opY[0] - iY) * (opY[0] - iY));
1148
- return distance;
1149
- }
1150
- return null;
1151
- }
1152
- }
1153
- if (oA == null) {
1154
- var _iX = opX[0];
1155
- if (A != null) {
1156
- if (pX[0] <= _iX && _iX <= pX[1] || pX[0] >= _iX && _iX >= pX[1]) {
1157
- var _iY = pY[0] + A * (_iX - pX[0]);
1158
- if (opY[0] <= _iY && opY[0] <= opY[1] || opY[0] >= _iY && opY[0] >= opY[1]) {
1159
- var _distance = Math.sqrt((opX[0] - _iX) * (opX[0] - _iX) + (opY[0] - _iY) * (opY[0] - _iY));
1160
- return _distance;
1161
- }
1162
- }
1163
- }
1164
- }
1165
- if (A == null) {
1166
- var _iX2 = pX[0];
1167
- if (oA != null) {
1168
- var _iY2 = _iX2 * oA + opY[0] - oA * opX[0];
1169
- if (pY[0] <= _iY2 && _iY2 <= pY[1] || pY[0] >= _iY2 && _iY2 >= pY[1]) {
1170
- if (opY[0] <= _iY2 && opY[0] <= opY[1] || opY[0] >= _iY2 && opY[0] >= opY[1]) {
1171
- var _distance2 = Math.sqrt((opX[0] - _iX2) * (opX[0] - _iX2) + (opY[0] - _iY2) * (opY[0] - _iY2));
1172
- return _distance2;
1173
- }
1174
- }
1175
- }
1176
- }
1177
- return null;
1178
- }
1179
- function gcd(a, b) {
1180
- return a % b ? gcd(b, a % b) : b;
1181
- }
1182
- function getTextCanvas(text) {
1183
- var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1184
- var canvas = document.createElement('canvas');
1185
- var ctx = canvas.getContext('2d');
1186
- var fontSize = 16;
1187
- var integral = String(text) + "''";
1188
- parameters.fontName = parameters.fontName || ARROW_TEXT_FONTFACE;
1189
-
1190
- // Prepare the font to be able to measure
1191
- ctx.font = "".concat(fontSize, "px ") + parameters.fontName;
1192
- if (parameters.italic) {
1193
- ctx.font = "italic ".concat(fontSize, "px ") + parameters.fontName;
1194
- }
1195
- if (parameters.bold) {
1196
- ctx.font = "bold ".concat(fontSize, "px ") + parameters.fontName;
1197
- }
1198
- if (parameters.bold && parameters.italic) {
1199
- ctx.font = "italic bold ".concat(fontSize, "px ") + parameters.fontName;
1200
- }
1201
- var textMetrics = ctx.measureText(integral);
1202
- var width = 70;
1203
- var height = fontSize + 20;
1204
-
1205
- // Resize canvas to match text size
1206
- canvas.width = width;
1207
- canvas.height = height;
1208
- canvas.style.width = width + 'px';
1209
- canvas.style.height = height + 'px';
1210
-
1211
- // Re-apply font since canvas is resized.
1212
- ctx.font = "".concat(fontSize, "px ") + parameters.fontName;
1213
- if (parameters.italic) {
1214
- ctx.font = "italic ".concat(fontSize, "px ") + parameters.fontName;
1215
- }
1216
- if (parameters.bold) {
1217
- ctx.font = "bold ".concat(fontSize, "px ") + parameters.fontName;
1218
- }
1219
- if (parameters.bold && parameters.italic) {
1220
- ctx.font = "italic bold ".concat(fontSize, "px ") + parameters.fontName;
1221
- }
1222
- //ctx.textAlign = parameters.align || "center";
1223
- ctx.textBaseline = parameters.baseline || 'middle';
1224
- var r = 10;
1225
- // Make the canvas transparent for simplicity
1226
- ctx.fillStyle = ARROW_TEXT_BACKCOLOR;
1227
- // ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
1228
- var w = ctx.canvas.width;
1229
- var h = ctx.canvas.height;
1230
- ctx.beginPath();
1231
- ctx.moveTo(r, 0);
1232
- ctx.lineTo(w - r, 0);
1233
- ctx.arcTo(w, 0, w, r, r);
1234
- ctx.lineTo(w, h - r);
1235
- ctx.arcTo(w, h, w - r, h, r);
1236
- ctx.lineTo(r, h);
1237
- ctx.arcTo(0, h, 0, h - r, r);
1238
- ctx.lineTo(0, r);
1239
- ctx.arcTo(0, 0, r, 0, r);
1240
- // ctx.arcTo(w+r, h+2*r, w+r, 0, r);
1241
- ctx.fill();
1242
- ctx.fillStyle = parameters.fillColor || ARROW_TEXT_FORECOLOR;
1243
- ctx.fillText(integral, (width - textMetrics.width) / 2, height / 2);
1244
- ctx.strokeStyle = parameters.strokeColor || ARROW_TEXT_FORECOLOR;
1245
- ctx.strokeText(integral, (width - textMetrics.width) / 2, height / 2);
1246
-
1247
- // ctx.font = `${fontSize - 5}px ` + parameters.fontName;
1248
- // const denoMetrics = ctx.measureText(deno);
1249
- // const numoMetrics = ctx.measureText(numo);
1250
- // ctx.fillStyle = ARROW_TEXT_FORECOLOR;
1251
- // ctx.fillRect(
1252
- // ctx.canvas.width / 2 + 3,
1253
- // ctx.canvas.height / 2 - 2,
1254
- // denoMetrics.width,
1255
- // 1
1256
- // );
1257
-
1258
- // const denoMetrics = ctx.measureText(deno);
1259
- // ctx.fillStyle = ARROW_TEXT_FORECOLOR;
1260
- // ctx.fillRect(
1261
- // ctx.canvas.width / 2 + 3,
1262
- // ctx.canvas.height / 2 - 2,
1263
- // denoMetrics.width,
1264
- // 1
1265
- // );
1266
-
1267
- // ctx.fillStyle = parameters.fillColor || ARROW_TEXT_FORECOLOR;
1268
- // ctx.fillText(
1269
- // numo,
1270
- // ctx.canvas.width / 2 + 3 + (denoMetrics.width - numoMetrics.width) / 2,
1271
- // height / 2 - 8
1272
- // );
1273
- // ctx.font = `${fontSize}px ` + parameters.fontName;
1274
- // ctx.fillText(
1275
- // "''",
1276
- // ctx.canvas.width / 2 + 4 + denoMetrics.width,
1277
- // height / 2 - 7
1278
- // );
1279
- // ctx.font = `${fontSize - 5}px ` + parameters.fontName;
1280
-
1281
- // ctx.strokeStyle = parameters.strokeColor || ARROW_TEXT_FORECOLOR;
1282
- // ctx.strokeText(
1283
- // numo,
1284
- // ctx.canvas.width / 2 + 3 + (denoMetrics.width - numoMetrics.width) / 2,
1285
- // height / 2 - 8
1286
- // );
1287
-
1288
- // ctx.fillStyle = parameters.fillColor || ARROW_TEXT_FORECOLOR;
1289
- // ctx.fillText(deno, ctx.canvas.width / 2 + 3, height / 2 + 8);
1290
- // ctx.strokeStyle = parameters.strokeColor || ARROW_TEXT_FORECOLOR;
1291
- // ctx.strokeText(deno, ctx.canvas.width / 2 + 3, height / 2 + 8);
1292
- return canvas;
1293
- }
1294
- function removeObject(modifiedPath, layer, planData, actions, sceneData, oldSceneData, catalog) {
1295
- var promises = [];
1296
- switch (modifiedPath[3]) {
1297
- case 'lines':
1298
- // Here I remove the line with all its holes
1299
- var lineID = modifiedPath[4];
1300
- oldSceneData.getIn(['layers', layer.id, 'lines', lineID, 'holes']).forEach(function (holeID) {
1301
- removeHole(planData, layer.id, holeID);
1302
- });
1303
- removeLine(planData, layer.id, lineID);
1304
- var mode = oldSceneData.mode;
1305
- if (ARRAY_3D_MODES.includes(mode)) mode = MODE_IDLE_3D;else mode = MODE_IDLE;
1306
- if (modifiedPath.length > 5) {
1307
- // I removed an hole, so I should add the new line
1308
- promises.push(addLine(sceneData, planData, layer, lineID, catalog, actions.linesActions));
1309
- layer.getIn(['lines', lineID, 'holes']).forEach(function (holeID) {
1310
- promises.push(addHole(sceneData, planData, layer, holeID, catalog, actions.holesActions, mode));
1311
- });
1312
- }
1313
- break;
1314
- case 'areas':
1315
- if (modifiedPath.length === 5) {
1316
- // I am removing an entire area
1317
- removeArea(planData, layer.id, modifiedPath[4]);
1318
- }
1319
- break;
1320
- case 'items':
1321
- if (modifiedPath.length === 5) {
1322
- // I am removing an item
1323
- removeItem(planData, layer.id, modifiedPath[4], oldSceneData.getIn(['layers', layer.id]), layer);
1324
- }
1325
- break;
1326
- }
1327
- Promise.all(promises).then(function (values) {
1328
- return updateBoundingBox(planData);
1329
- });
1330
- }
1331
- function removeLayer(layerId, planData) {
1332
- var layerGraph = planData.sceneGraph.layers[layerId];
1333
- for (var lineID in layerGraph.lines) removeLine(planData, layerId, lineID);
1334
- for (var areaID in layerGraph.areas) removeArea(planData, layerId, areaID);
1335
- for (var itemID in layerGraph.items) removeItem(planData, layerId, itemID);
1336
- for (var holeID in layerGraph.holes) removeHole(planData, layerId, holeID);
1337
- delete planData.sceneGraph.layers[layerId];
1338
- }
1339
- function removeHole(planData, layerId, holeID) {
1340
- if (planData.sceneGraph.busyResources.layers[layerId].holes[holeID]) {
1341
- setTimeout(function () {
1342
- return removeHole(planData, layerId, holeID);
1343
- }, 100);
1344
- return;
1345
- }
1346
- planData.sceneGraph.busyResources.layers[layerId].holes[holeID] = true;
1347
- var hole3D = planData.sceneGraph.layers[layerId].holes[holeID];
1348
- if (hole3D) {
1349
- planData.plan.remove(hole3D);
1350
- disposeObject(hole3D);
1351
- delete planData.sceneGraph.layers[layerId].holes[holeID];
1352
- delete planData.sceneGraph.LODs[holeID];
1353
- hole3D = null;
1354
- updateBoundingBox(planData, true);
1355
- }
1356
- planData.sceneGraph.busyResources.layers[layerId].holes[holeID] = false;
1357
- }
1358
- function removeLine(planData, layerId, lineID) {
1359
- if (planData.sceneGraph.busyResources.layers[layerId].lines[lineID]) {
1360
- setTimeout(function () {
1361
- return removeLine(planData, layerId, lineID);
1362
- }, 100);
1363
- return;
1364
- }
1365
- planData.sceneGraph.busyResources.layers[layerId].lines[lineID] = true;
1366
- var line3D = planData.sceneGraph.layers[layerId].lines[lineID];
1367
- if (line3D) {
1368
- planData.plan.remove(line3D);
1369
- disposeObject(line3D);
1370
- delete planData.sceneGraph.layers[layerId].lines[lineID];
1371
- delete planData.sceneGraph.LODs[lineID];
1372
- line3D = null;
1373
- updateBoundingBox(planData, true);
1374
- }
1375
- planData.sceneGraph.busyResources.layers[layerId].lines[lineID] = false;
1376
- }
1377
- function removeArea(planData, layerId, areaID) {
1378
- if (planData.sceneGraph.busyResources.layers[layerId].areas[areaID]) {
1379
- setTimeout(function () {
1380
- return removeArea(planData, layerId, areaID);
1381
- }, 100);
1382
- return;
1383
- }
1384
- planData.sceneGraph.busyResources.layers[layerId].areas[areaID] = true;
1385
- var area3D = planData.sceneGraph.layers[layerId].areas[areaID];
1386
- if (area3D) {
1387
- planData.plan.remove(area3D);
1388
- disposeObject(area3D);
1389
- delete planData.sceneGraph.layers[layerId].areas[areaID];
1390
- delete planData.sceneGraph.LODs[areaID];
1391
- area3D = null;
1392
- updateBoundingBox(planData, true);
1393
- }
1394
- planData.sceneGraph.busyResources.layers[layerId].areas[areaID] = false;
1395
- }
1396
- export function removeItem(planData, layerId, itemID) {
1397
- var oldSceneLayer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1398
- var newSceneLayer = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1399
- if (planData.sceneGraph.busyResources.layers[layerId].items[itemID]) {
1400
- setTimeout(function () {
1401
- return removeItem(planData, layerId, itemID, oldSceneLayer, newSceneLayer);
1402
- }, 100);
1403
- return;
1404
- }
1405
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = true;
1406
-
1407
- // The layer variable is layer that contains the deleted item.
1408
- var layer = oldSceneLayer ? oldSceneLayer : planData.sceneData.getIn(['layers', layerId]);
1409
- var item = layer.getIn(['items', itemID]); // deleted item.
1410
- deleteCountertop(planData.sceneGraph.layers[layerId].countertops, item, planData, layer);
1411
- planData.sceneGraph.layers[layerId].moldingGroups = deleteAllMolding(planData.sceneGraph.layers[layerId].moldingGroups, item, planData, layer, newSceneLayer);
1412
- var item3D = planData.sceneGraph.layers[layerId].items[itemID];
1413
- if (item3D) {
1414
- planData.plan.remove(item3D);
1415
- disposeObject(item3D);
1416
- delete planData.sceneGraph.layers[layerId].items[itemID];
1417
- delete planData.sceneGraph.LODs[itemID];
1418
- item3D = null;
1419
- updateBoundingBox(planData, true);
1420
- }
1421
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = false;
1422
- }
1423
- function removeItemWithoutItem(planData, layerId, itemID) {
1424
- if (planData.sceneGraph.busyResources.layers[layerId].items[itemID]) {
1425
- setTimeout(function () {
1426
- return removeItemWithoutItem(planData, layerId, itemID);
1427
- }, 100);
1428
- return;
1429
- }
1430
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = true;
1431
- var layer = planData.sceneData.getIn(['layers', layerId]);
1432
- var item = layer.getIn(['items', itemID]);
1433
- deleteCountertop(planData.sceneGraph.layers[layerId].countertops, item, planData, layer);
1434
- var item3D = planData.sceneGraph.layers[layerId].items[itemID];
1435
- if (item3D) {
1436
- planData.plan.remove(item3D);
1437
- disposeObject(item3D);
1438
- item3D = null;
1439
- updateBoundingBox(planData);
1440
- delete planData.sceneGraph.layers[layerId].items[itemID];
1441
- delete planData.sceneGraph.LODs[itemID];
1442
- }
1443
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = false;
1444
- }
1445
-
1446
- //TODO generate an area's replace if vertex has been changed
1447
- function addObject(modifiedPath, layer, planData, actions, sceneData, oldSceneData, catalog, mode, toolObj) {
1448
- if (modifiedPath.length >= 5) {
1449
- var addPromise = null,
1450
- addAction = null;
1451
- switch (modifiedPath[3]) {
1452
- case 'lines':
1453
- if (modifiedPath[5] === 'holes' && scene_mode !== 'MODE_DRAWING_HOLE_3D' && scene_mode !== 'MODE_DRAGGING_HOLE_3D') {
1454
- removeLine(planData, layer.id, modifiedPath[4]);
1455
- }
1456
- if (scene_mode !== 'MODE_DRAWING_HOLE_3D' && scene_mode !== 'MODE_DRAGGING_HOLE_3D') {
1457
- addPromise = addLine;
1458
- }
1459
- addAction = actions.linesActions;
1460
- break;
1461
- case 'areas':
1462
- addPromise = addArea;
1463
- addAction = actions.areaActions;
1464
- break;
1465
- case 'items':
1466
- addPromise = addItem;
1467
- addAction = actions.itemsActions;
1468
- break;
1469
- case 'holes':
1470
- addPromise = addHole;
1471
- addAction = actions.holesActions;
1472
- break;
1473
- }
1474
- if (addPromise) {
1475
- // if( addPromise(sceneData, planData, layer, modifiedPath[4], catalog, addAction) === undefined ) {
1476
- // return;
1477
- // }
1478
- addPromise(sceneData, planData, layer, modifiedPath[4], catalog, addAction, mode, toolObj).then(function () {
1479
- return updateBoundingBox(planData);
1480
- });
1481
- }
1482
- }
1483
- }
1484
- function addHole(sceneData, planData, layer, holeID, catalog, holesActions, mode) {
1485
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1486
- var holeData = layer.getIn(['holes', holeID]);
1487
-
1488
- // Create the hole object
1489
- return holeData === undefined ? '' : catalog.getElement(holeData.type).render3D(holeData, layer, sceneData).then(function (object) {
1490
- if (object instanceof Three.LOD) {
1491
- planData.sceneGraph.LODs[holeID] = object;
1492
- }
1493
- object.children.forEach(function (item) {
1494
- var name = item.name;
1495
- item.castShadow = true;
1496
- var texture;
1497
- if (name.includes('_wood')) {
1498
- texture = loadTexture('/assets/img/texture/white1px.jpg');
1499
- } else if (name.includes('_glass')) {
1500
- var material = new Three.MeshPhysicalMaterial({
1501
- roughness: 0.5,
1502
- transmission: 1,
1503
- thickness: 0.5,
1504
- // Add refraction!
1505
- transparency: 0.6
1506
- });
1507
- item.material = material;
1508
- return item;
1509
- } else if (name.includes('_steel')) {
1510
- texture = loadTexture('/assets/img/texture/steel.jpg');
1511
- } else if (name.includes('_glass')) {
1512
- var _material2 = new Three.MeshPhysicalMaterial({
1513
- roughness: 0.5,
1514
- transmission: 1,
1515
- thickness: 0.5,
1516
- // Add refraction!
1517
- transparency: 0.6
1518
- });
1519
- item.material = _material2;
1520
- return item;
1521
- }
1522
- });
1523
- if (holeData.selected) {
1524
- // if object is drawing in 3d mode and selected
1525
- if (holeData.type === 'FrameLess Doorway') {
1526
- var x, y, z;
1527
- x = holeData.getIn(['properties', 'width', 'length']) || 0;
1528
- y = holeData.getIn(['properties', 'height', 'length']) || 0;
1529
- z = holeData.getIn(['properties', 'thickness', 'length']) || 0;
1530
- var moveBox = new Three.BoxGeometry(x, y, z);
1531
- var mBox = new Three.Mesh(moveBox, new Three.MeshBasicMaterial({
1532
- color: 0x99c3fb,
1533
- side: Three.DoubleSide,
1534
- transparent: true,
1535
- opacity: 0.4
1536
- }));
1537
- mBox.name = 'FrameLessDoormBox';
1538
- mBox.renderOrder = 1;
1539
- if (mBox !== undefined) {
1540
- object.add(mBox);
1541
- }
1542
- } else {
1543
- var _boundingBox = GeomUtils.baseBox3FromObject(object);
1544
- if (_boundingBox === undefined) return;
1545
- var max = _boundingBox.max;
1546
- if (!Number.isFinite(max.x)) return;
1547
- var transGroup = new Three.Group();
1548
- var extrudeSettings = {
1549
- depth: 1,
1550
- bevelEnabled: true,
1551
- bevelSegments: 2,
1552
- steps: 2,
1553
- bevelSize: 1,
1554
- bevelThickness: 1
1555
- };
1556
- var triangleShape = new Three.Shape().moveTo(max.x, 15) // A
1557
- .lineTo(max.x + 6, 15) // B
1558
- .lineTo(max.x + 6, 30) // C
1559
- .lineTo(max.x + 16, 0) // D
1560
- .lineTo(max.x + 6, -29) // E
1561
- .lineTo(max.x + 6, -15) // F
1562
- .lineTo(max.x, -15) // G
1563
- .lineTo(max.x, 15); // close path
1564
- var transHole_Right = GeomUtils.addShape(triangleShape, extrudeSettings, scene_mode !== 'MODE_DRAGGING_HOLE_3D' ? 0x000000 : 0x99c3fb, 0, 0, 0, 0, 0, 0, 1);
1565
- transHole_Right.name = 'transHole_Right';
1566
- transGroup.add(transHole_Right);
1567
- triangleShape = new Three.Shape().moveTo(-max.x, 15) // A
1568
- .lineTo(-(max.x + 6), 15) // B
1569
- .lineTo(-(max.x + 6), 30) // C
1570
- .lineTo(-(max.x + 16), 0) // D
1571
- .lineTo(-(max.x + 6), -29) // E
1572
- .lineTo(-(max.x + 6), -15) // F
1573
- .lineTo(-max.x, -15) // G
1574
- .lineTo(-max.x, 15); // close path
1575
- var transHole_Left = GeomUtils.addShape(triangleShape, extrudeSettings, scene_mode !== 'MODE_DRAGGING_HOLE_3D' ? 0x000000 : 0x99c3fb, 0, 0, 0, 0, 0, 0, 1);
1576
- transHole_Left.name = 'transHole_Left';
1577
- transGroup.add(transHole_Left);
1578
- transGroup.scale.set(1 / object.scale.x, 1 / object.scale.y, 1 / object.scale.z);
1579
- object.add(transGroup);
1580
- }
1581
- }
1582
- var pivot = new Three.Object3D();
1583
- pivot.name = 'pivot';
1584
- if (isElevationView(mode)) {
1585
- var lineID = holeData.getIn(['line']);
1586
- if (planData.sceneGraph.layers['layer-1'].lines[lineID].visible) {
1587
- pivot.visible = true;
1588
- } else {
1589
- pivot.visible = false;
1590
- }
1591
- object.traverse(function (obj) {
1592
- replaceMeshesWithLineSegments(obj);
1593
- });
1594
- }
1595
- pivot.add(object);
1596
- var line = layer.getIn(['lines', holeData.line]);
1597
-
1598
- // First of all I need to find the vertices of this line
1599
- var vertex0 = layer.vertices.get(line.vertices.get(0));
1600
- var vertex1 = layer.vertices.get(line.vertices.get(1));
1601
- var offset = holeData.offset;
1602
- if (vertex0.x > vertex1.x) {
1603
- var tmp = vertex0;
1604
- vertex0 = vertex1;
1605
- vertex1 = tmp;
1606
- offset = 1 - offset;
1607
- }
1608
- var distance = Math.sqrt(Math.pow(vertex0.x - vertex1.x, 2) + Math.pow(vertex0.y - vertex1.y, 2));
1609
- var alpha = Math.asin((vertex1.y - vertex0.y) / distance);
1610
- var boundingBox = new Three.Box3().setFromObject(pivot);
1611
- var center = [(boundingBox.max.x - boundingBox.min.x) / 2 + boundingBox.min.x, (boundingBox.max.y - boundingBox.min.y) / 2 + boundingBox.min.y, (boundingBox.max.z - boundingBox.min.z) / 2 + boundingBox.min.z];
1612
- var holeAltitude = holeData.properties.getIn(['altitude', 'length']);
1613
- var holeHeight = holeData.properties.getIn(['height', 'length']);
1614
- pivot.rotation.y = alpha;
1615
- pivot.position.x = vertex0.x + distance * offset * Math.cos(alpha) - center[0] * Math.cos(alpha) - center[2] * Math.sin(alpha);
1616
- pivot.position.y = holeAltitude + holeHeight / 2 - center[1] + layer.altitude;
1617
- pivot.position.z = -vertex0.y - distance * offset * Math.sin(alpha) - center[2] * Math.cos(alpha) + center[0] * Math.sin(alpha);
1618
- pivot.userData.type = 'hole';
1619
- pivot.userData.layerId = layer.id;
1620
- pivot.userData.holeId = holeData.id;
1621
-
1622
- // if holeId is existing, remove it first
1623
- var childLen = planData.plan.children.length;
1624
- var children = [];
1625
- for (var i = 0; i < childLen; i++) {
1626
- if (planData.plan.children[i].userData.holeId != holeData.id) children.push(planData.plan.children[i]);
1627
- }
1628
- planData.plan.children = children;
1629
- planData.plan.add(pivot);
1630
- planData.sceneGraph.layers[layer.id].holes[holeData.id] = pivot;
1631
- applyInteract(pivot, function () {
1632
- document.getElementById('setting_dialog').style.display = 'none';
1633
- return holesActions.selectHole(layer.id, holeData.id);
1634
- });
1635
- var opacity = layer.opacity;
1636
- if (holeData.selected) {
1637
- opacity = 1;
1638
- }
1639
- applyOpacity(pivot, opacity);
1640
- });
1641
- }
1642
- function updateHole(sceneData, oldSceneData, planData, layer, holeID, differences, catalog, holesActions, selfDestroy, selfBuild) {
1643
- var hole = layer.getIn(['holes', holeID]);
1644
- var oldHole = oldSceneData.getIn(['layers', layer.id, 'holes', holeID]);
1645
- var mesh = planData.sceneGraph.layers[layer.id].holes[holeID];
1646
- if (!mesh) return null;
1647
- return catalog.getElement(hole.type).updateRender3D(hole, layer, sceneData, mesh, oldHole, differences, selfDestroy, selfBuild);
1648
- }
1649
- function addLine(sceneData, planData, layer, lineID, catalog, linesActions) {
1650
- var mode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
1651
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1652
- if (planData.sceneGraph.busyResources.layers[layer.id].lines[lineID]) {
1653
- setTimeout(function () {
1654
- return addLine(sceneData, planData, layer, lineID, catalog, linesActions, mode);
1655
- }, 100);
1656
- return;
1657
- }
1658
- planData.sceneGraph.busyResources.layers[layer.id].lines[lineID] = true;
1659
- var line = layer.getIn(['lines', lineID]);
1660
- line.userData.stateMode = scene_mode;
1661
-
1662
- // First of all I need to find the vertices of this line
1663
- var vertex0 = layer.vertices.get(line.vertices.get(0));
1664
- var vertex1 = layer.vertices.get(line.vertices.get(1));
1665
- if (vertex0.x > vertex1.x) {
1666
- var tmp = vertex0;
1667
- vertex0 = vertex1;
1668
- vertex1 = tmp;
1669
- }
1670
- return catalog.getElement(line.type).render3D(line, layer, sceneData, mode).then(function (line3D) {
1671
- if (line3D === null) {
1672
- return;
1673
- }
1674
- if (line3D instanceof Three.LOD) {
1675
- planData.sceneGraph.LODs[line.id] = line3D;
1676
- }
1677
- var pivot = new Three.Object3D();
1678
- pivot.name = 'pivot';
1679
- pivot.add(line3D);
1680
- pivot.position.x = (vertex0.x + vertex1.x) / 2;
1681
- pivot.position.y = layer.altitude;
1682
- pivot.position.z = -(vertex0.y + vertex1.y) / 2;
1683
- pivot.userData.type = 'line';
1684
-
1685
- // In elevation view, show(visible = true) just selected wall pivot. If not, hidden(visible = false)
1686
- if (isElevationView(mode)) {
1687
- var lineVisible;
1688
- if (line.selected) {
1689
- pivot.traverse(function (obj) {
1690
- replaceMeshesWithLineSegments(obj);
1691
- });
1692
- lineVisible = true;
1693
- } else {
1694
- lineVisible = false;
1695
- }
1696
- pivot.visible = lineVisible;
1697
- }
1698
- pivot.userData.layerId = layer.id;
1699
- pivot.userData.lineId = lineID;
1700
- planData.plan.add(pivot);
1701
- planData.sceneGraph.layers[layer.id].lines[lineID] = pivot;
1702
- applyInteract(pivot, function () {
1703
- document.getElementById('setting_dialog').style.display = 'none';
1704
- return linesActions.selectLine(layer.id, line.id);
1705
- });
1706
- var opacity = layer.opacity;
1707
- if (line.selected) {
1708
- opacity = 1;
1709
- }
1710
- applyOpacity(pivot, opacity);
1711
- planData.sceneGraph.busyResources.layers[layer.id].lines[lineID] = false;
1712
- });
1713
- }
1714
- function updateLine(sceneData, oldSceneData, planData, layer, lineID, differences, catalog, linesActions, selfDestroy, selfBuild) {
1715
- var line = layer.getIn(['lines', lineID]);
1716
- var oldLine = oldSceneData.getIn(['layers', layer.id, 'lines', lineID]);
1717
- var mesh = planData.sceneGraph.layers[layer.id].lines[lineID];
1718
- if (!mesh) return null;
1719
- return catalog.getElement(line.type).updateRender3D(line, layer, sceneData, mesh, oldLine, differences, selfDestroy, selfBuild);
1720
- }
1721
- function addArea(sceneData, planData, layer, areaID, catalog, areaActions, mode) {
1722
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1723
- if (planData.sceneGraph.busyResources.layers[layer.id].areas[areaID]) {
1724
- setTimeout(function () {
1725
- return addArea(sceneData, planData, layer, areaID, catalog, areaActions, mode);
1726
- }, 100);
1727
- return;
1728
- }
1729
- planData.sceneGraph.busyResources.layers[layer.id].areas[areaID] = true;
1730
- var area = layer.getIn(['areas', areaID]);
1731
- var interactFunction = function interactFunction() {
1732
- return areaActions.selectArea(layer.id, areaID);
1733
- };
1734
- return catalog.getElement(area.type).render3D(area, layer, sceneData).then(function (area3D) {
1735
- if (area3D instanceof Three.LOD) {
1736
- planData.sceneGraph.LODs[areaID] = area3D;
1737
- }
1738
- var pivot = new Three.Object3D();
1739
- var floorSupport = area3D.userData.floorSupport;
1740
- floorSupport.onBeforeRender = function (renderer, scene, camera, geometry, material, group) {
1741
- var floorMesh = this.parent.getObjectByName('floor');
1742
- if (geometry.attributes.normal === undefined) return floorMesh.visible = false;
1743
- geometry.computeVertexNormals();
1744
- var normals = geometry.attributes.normal.array;
1745
- var pos = new Three.Vector4(0, 0, 0, 1);
1746
- pos = pos.applyMatrix4(this.matrixWorld);
1747
- pos = pos.applyMatrix4(camera.matrixWorldInverse);
1748
- var normal = new Three.Vector4(normals[0], normals[1], normals[2], 0);
1749
- normal = normal.applyMatrix4(this.matrixWorld);
1750
- normal = normal.applyMatrix4(camera.matrixWorldInverse);
1751
- if (floorMesh) {
1752
- if (normal.dot(pos) <= 0) {
1753
- floorMesh.visible = true;
1754
- } else {
1755
- floorMesh.visible = false;
1756
- }
1757
- }
1758
- };
1759
- var ceil = area3D.userData.floorSupport.clone();
1760
- var ceilMaterial = new Three.MeshStandardMaterial({
1761
- color: 0xdfdfdf,
1762
- side: Three.BackSide,
1763
- roughness: 0.3,
1764
- metalness: 0.4
1765
- });
1766
- ceil.name = 'ceil';
1767
- ceil.material = ceilMaterial;
1768
- var vertices = [];
1769
- var lines = [];
1770
- var height = 100;
1771
- area.vertices.forEach(function (data) {
1772
- vertices.push(data);
1773
- });
1774
- layer.lines.forEach(function (data) {
1775
- lines.push(data);
1776
- });
1777
- var _loop2 = function _loop2() {
1778
- var data = lines[i];
1779
- var realVec = [];
1780
- data.vertices.forEach(function (vec) {
1781
- realVec.push(vec);
1782
- });
1783
- if (vertices.includes(realVec[0]) && vertices.includes(realVec[1])) {
1784
- height = convert(layer.ceilHeight).from(layer.unit).to(UNIT_CENTIMETER);
1785
- // height = data.properties.getIn(["height", "length"]);
1786
- return 1; // break
1787
- }
1788
- };
1789
- for (var i = 0; i < lines.length; i++) {
1790
- if (_loop2()) break;
1791
- }
1792
- ceil.translateZ(convert(layer.ceilHeight).from(layer.unit).to(UNIT_CENTIMETER));
1793
- pivot.name = 'pivot';
1794
- pivot.add(area3D);
1795
- pivot.add(area3D.userData.floorSupport);
1796
- pivot.add(ceil);
1797
- pivot.position.y = layer.altitude;
1798
-
1799
- // if elevation view, show just wall - not show floor and ceil
1800
- if (isElevationView(mode)) pivot.visible = false;
1801
- planData.plan.add(pivot);
1802
- planData.sceneGraph.layers[layer.id].areas[areaID] = pivot;
1803
- document.getElementById('setting_dialog').style.display = 'none';
1804
- applyInteract(pivot, interactFunction);
1805
- var opacity = layer.opacity;
1806
- if (area.selected) {
1807
- opacity = 1;
1808
- }
1809
- applyOpacity(pivot, opacity);
1810
- planData.sceneGraph.busyResources.layers[layer.id].areas[areaID] = false;
1811
- });
1812
- }
1813
- function updateArea(sceneData, oldSceneData, planData, layer, areaID, differences, catalog, areaActions, selfDestroy, selfBuild) {
1814
- var area = layer.getIn(['areas', areaID]);
1815
- var oldArea = oldSceneData.getIn(['layers', layer.id, 'areas', areaID]);
1816
- var mesh = planData.sceneGraph.layers[layer.id].areas[areaID];
1817
- if (!mesh) return null;
1818
- return catalog.getElement(area.type).updateRender3D(area, layer, sceneData, mesh, oldArea, differences, selfDestroy, selfBuild);
1819
- }
1820
- function addItem(sceneData, planData, layer, itemID, catalog, itemsActions) {
1821
- var mode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
1822
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1823
- var rItem = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
1824
- var bAddMolding = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : true;
1825
- if (planData.sceneGraph.busyResources.layers[layer.id].items[itemID]) {
1826
- setTimeout(function () {
1827
- return addItem(sceneData, planData, layer, itemID, catalog, itemsActions, mode, toolObj, rItem, bAddMolding);
1828
- }, 100);
1829
- return;
1830
- }
1831
- var item = layer.getIn(['items', itemID]);
1832
- if (item.doorStyle === null) {
1833
- console.log(item.name + 's doorStyle is null!');
1834
- return;
1835
- }
1836
- if (!sceneData.loadFlag && scene_mode == MODE_DRAWING_ITEM_3D) {
1837
- itemsActions.toggleLoadingCabinet();
1838
- }
1839
- var catalogElement = catalog.getElement(item.type);
1840
- if (!catalogElement) catalogElement = catalog.getElement(returnReplaceableDeepSearchType(item.type));
1841
- if (!catalogElement) return false;
1842
- return catalogElement.render3D(item, layer, sceneData, mode).then(function (item3D) {
1843
- if (item3D instanceof Three.LOD) {
1844
- planData.sceneGraph.LODs[itemID] = item3D;
1845
- }
1846
- if (rItem !== null) {
1847
- planData.plan.remove(rItem);
1848
- disposeObject(rItem);
1849
- rItem = null;
1850
- }
1851
- var pivot = new Three.Object3D();
1852
- pivot.name = 'pivot';
1853
- pivot.add(item3D);
1854
- if (pivot) {
1855
- var mBoxColor = 0x99c3fb;
1856
- var _item = item.toJS();
1857
- if (_item.doorStyle.doorStyles !== undefined && _item.doorStyle.doorStyles.cds) {
1858
- if (showYelloBox(_item)) {
1859
- mBoxColor = 'rgba(232,187,47,1)';
1860
- } else {
1861
- pivot.children[0].children.forEach(function (pivotElement) {
1862
- pivotElement.visible = false;
1863
- });
1864
- }
1865
- var mBox = GeomUtils.makeMBoxfromObject(pivot, mBoxColor);
1866
- var warningObj = createWarningObject();
1867
- warningObj.position.set(0, item.properties.get('height').get('length') / 3, 0);
1868
- if (mBox) {
1869
- mBox.add(warningObj);
1870
- pivot.add(mBox);
1871
- }
1872
- }
1873
- }
1874
- if (item.selected) {
1875
- var tranformControl = item3D.children[item3D.children.length - 1];
1876
- transformBox = tranformControl.children[tranformControl.children.length - 1];
1877
- }
1878
- pivot.rotation.y = item.rotation * Math.PI / 180 + Math.PI;
1879
- // pivot.rotation.y = item.rotation;
1880
- pivot.position.x = item.x;
1881
- pivot.position.y = layer.altitude;
1882
- pivot.position.z = -item.y;
1883
- applyInteract(item3D, function () {
1884
- // closes the setting dialog
1885
- document.getElementById('setting_dialog').style.display = 'none';
1886
- return itemsActions.selectItem(layer.id, item.id);
1887
- });
1888
- var opacity = layer.opacity;
1889
- if (item.selected) {
1890
- opacity = 1;
1891
- fVLine = [];
1892
- var TransformGizmo = item3D.children[item3D.children.length - 1];
1893
- TransformGizmo.children.forEach(function (child) {
1894
- if (child.type === 'Line' && child.geometry.attributes !== undefined) fVLine.push(child);
1895
- });
1896
- setTimeout(function () {
1897
- getDistances();
1898
- }, 50);
1899
- }
1900
- applyOpacity(pivot, opacity);
1901
- pivot.userData.type = 'item';
1902
- pivot.userData.layerId = layer.id;
1903
- pivot.userData.itemId = item.id;
1904
-
1905
- /**
1906
- *
1907
- * @param {array} itemRect Array of item's 4 side lines
1908
- * @returns {boolean} true (if item is snapped into wall) or false (if item is not snapped into wall)
1909
- */
1910
- //////////////////
1911
- ///// wall ///////
1912
- // 3 ***** 2
1913
- // * *
1914
- // * item *
1915
- // * *
1916
- // 0 ***** 1
1917
-
1918
- var getItemVisible = function getItemVisible(itemRect) {
1919
- var selectedLine = layer.lines.get(layer.selected.lines.toJS()[0]);
1920
- var itemVisible = false;
1921
- var vertex0 = layer.vertices.get(selectedLine.vertices.get(0));
1922
- var vertex1 = layer.vertices.get(selectedLine.vertices.get(1));
1923
- var l0 = {
1924
- x: vertex0.x,
1925
- y: vertex0.y
1926
- };
1927
- var l1 = {
1928
- x: vertex1.x,
1929
- y: vertex1.y
1930
- };
1931
- var r0 = itemRect.rect[0];
1932
- var r1 = itemRect.rect[1];
1933
- var r2 = itemRect.rect[2];
1934
- var r3 = itemRect.rect[3];
1935
-
1936
- // it doesn't need consider distance between item's line01 (frontside - it has door) and wall
1937
- var delta12 = GeometryUtils.distancePointFromLineSegment(l0, l1, (r1.x + r2.x) / 2, (r1.y + r2.y) / 2); // distance between item's line12 and wall
1938
- var delta23 = GeometryUtils.distancePointFromLineSegment(l0, l1, (r2.x + r3.x) / 2, (r2.y + r3.y) / 2); // distance between item's line23 and wall
1939
- var delta30 = GeometryUtils.distancePointFromLineSegment(l0, l1, (r3.x + r0.x) / 2, (r3.y + r0.y) / 2); // distance between item's line30 and wall
1940
-
1941
- if (delta12 < DISTANCE_EPSILON || delta23 < DISTANCE_EPSILON || delta30 < DISTANCE_EPSILON) {
1942
- itemVisible = true;
1943
- }
1944
- return itemVisible;
1945
- };
1946
- var val = {
1947
- pos: {
1948
- x: item.x,
1949
- y: item.y
1950
- },
1951
- rotRad: item.rotation / 180 * Math.PI
1952
- };
1953
- var catid = item.type;
1954
- var cat = catalog.elements[catid];
1955
- if (!cat) cat = catalog.elements[returnReplaceableDeepSearchType(catid)];
1956
- var width = convert(item.properties.getIn(['width', '_length'])).from('in').to(sceneData.unit);
1957
- var height = convert(item.properties.getIn(['height', '_length'])).from('in').to(sceneData.unit);
1958
- var depth = convert(item.properties.getIn(['depth', '_length'])).from('in').to(sceneData.unit);
1959
- val.size = {
1960
- width: width,
1961
- height: height,
1962
- depth: depth
1963
- };
1964
- val.layoutpos = cat.info.layoutpos;
1965
- val.is_corner = cat.info.is_corner;
1966
- val.item = item;
1967
- var calcrect = GeometryUtils.getCalcRectFromItem3D(val);
1968
-
1969
- // In elevation view, determin if item show or not
1970
- if (isElevationView(mode)) pivot.visible = getItemVisible(calcrect);
1971
- planData.plan.add(pivot);
1972
- planData.sceneGraph.layers[layer.id].items[item.id] = pivot;
1973
- //In a 3D view, merge each couterTop of equal height into a single conuterTop.
1974
- if (!isElevationView(mode)) {
1975
- addCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
1976
- }
1977
- if (bAddMolding && item.category === 'cabinet' && (isElevationView(mode) && getItemVisible(calcrect) || !isElevationView(mode))) {
1978
- planData.sceneGraph.layers[layer.id].moldingGroups = addMolding(planData.sceneGraph.layers[layer.id].moldingGroups, item, planData, layer, itemsActions, mode) || planData.sceneGraph.layers[layer.id].moldingGroups;
1979
- }
1980
- if (pivot) {
1981
- // update the tool object's position to selected object's position
1982
- var selectedItem = planData.sceneGraph.layers[sceneData.selectedLayer].items[itemID];
1983
- var itemPos = selectedItem.position.clone();
1984
- if (!isEmpty(toolObj)) {
1985
- toolObj.position.set(planData.plan.position.x + itemPos.x, selectedItem.category === 'lighting' ? -planData.plan.position.y - selectedItem.properties.get('height').get('length') : planData.plan.position.y + selectedItem.children[0].position.y, planData.plan.position.z + itemPos.z);
1986
- }
1987
- pivot.children[0].children.forEach(function (pivotElement) {
1988
- pivotElement.visible = true;
1989
- });
1990
- if (pivot.children.length > 1) {
1991
- var _item4 = item.toJS();
1992
- if (_item4.doorStyle.doorStyles !== undefined) {
1993
- if (_item4.category === 'cabinet') {
1994
- if (_item4.doorStyle.doorStyles.cds.some(function (element) {
1995
- return element.itemID === item.itemID;
1996
- })) {
1997
- pivot.children.pop();
1998
- }
1999
- } else {
2000
- pivot.children.pop();
2001
- }
2002
- }
2003
- }
2004
- }
2005
- applyInteract(pivot, function () {
2006
- document.getElementById('setting_dialog').style.display = 'none';
2007
- return itemsActions.selectItem(layer.id, item.id);
2008
- });
2009
- setTimeout(function () {
2010
- return getDistances(layer);
2011
- }, 100);
2012
- if (!sceneData.loadFlag && scene_mode == MODE_DRAWING_ITEM_3D) {
2013
- itemsActions.endLoading();
2014
- itemsActions.toggleLoadingCabinet();
2015
- }
2016
- });
2017
- }
2018
- function updateItem(sceneData, oldSceneData, planData, layer, itemID, differences, catalog, itemsActions, selfDestroy, selfBuild) {
2019
- var item = layer.getIn(['items', itemID]);
2020
- var oldItem = oldSceneData.getIn(['layers', layer.id, 'items', itemID]);
2021
- var mesh = planData.sceneGraph.layers[layer.id].items[itemID];
2022
- if (!mesh) return null;
2023
- return catalog.getElement(item.type).updateRender3D(item, layer, sceneData, mesh, oldItem, differences, selfDestroy, selfBuild);
2024
- }
2025
-
2026
- // Apply interact function to children of an Object3D
2027
- function applyInteract(object, interactFunction) {
2028
- document.getElementById('setting_dialog').style.display = 'none';
2029
- object.traverse(function (child) {
2030
- if (child instanceof Three.Mesh) {
2031
- child.interact = interactFunction;
2032
- }
2033
- });
2034
- }
2035
-
2036
- // Apply opacity to children of an Object3D
2037
- function applyOpacity(object, opacity) {
2038
- object.traverse(function (child) {
2039
- if (child instanceof Three.Mesh) {
2040
- if (child.material && !Array.isArray(child.material)) {
2041
- // child.material.materials.forEach(materialChild => {
2042
- // materialChild.transparent = true;
2043
- // if (materialChild.maxOpacity) {
2044
- // materialChild.opacity = Math.min(materialChild.maxOpacity, opacity);
2045
- // } else if (materialChild.opacity && materialChild.opacity > opacity) {
2046
- // materialChild.maxOpacity = materialChild.opacity;
2047
- // materialChild.opacity = opacity;
2048
- // }
2049
- // });
2050
- } else if (child.material instanceof Array) {
2051
- child.material.forEach(function (material) {
2052
- material.transparent = true;
2053
- if (material.maxOpacity) {
2054
- material.opacity = Math.min(material.maxOpacity, opacity);
2055
- } else if (material.opacity && material.opacity > opacity) {
2056
- material.maxOpacity = material.opacity;
2057
- material.opacity = opacity;
2058
- }
2059
- });
2060
- } else {
2061
- child.material.transparent = true;
2062
- if (child.material.maxOpacity) {
2063
- child.material.opacity = Math.min(child.material.maxOpacity, opacity);
2064
- } else if (child.material.opacity && child.material.opacity > opacity) {
2065
- child.material.maxOpacity = child.material.opacity;
2066
- child.material.opacity = opacity;
2067
- }
2068
- }
2069
- }
2070
- });
2071
- }
2072
- function updateBoundingBox(planData) {
2073
- var flag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2074
- var mode = arguments.length > 2 ? arguments[2] : undefined;
2075
- if (scene_mode == MODE_DRAWING_ITEM_3D) return;
2076
- var newBoundingBox = new Three.Box3().setFromObject(planData.plan);
2077
- if (isFinite(newBoundingBox.max.x) && isFinite(newBoundingBox.min.x) && isFinite(newBoundingBox.max.y) && isFinite(newBoundingBox.min.y) && isFinite(newBoundingBox.max.z) && isFinite(newBoundingBox.min.z)) {
2078
- var newCenter = new Three.Vector3((newBoundingBox.max.x - newBoundingBox.min.x) / 2 + newBoundingBox.min.x, (newBoundingBox.max.y - newBoundingBox.min.y) / 2 + newBoundingBox.min.y, (newBoundingBox.max.z - newBoundingBox.min.z) / 2 + newBoundingBox.min.z);
2079
- if (!flag) {
2080
- planData.plan.position.sub(newCenter);
2081
- planData.grid.position.sub(newCenter);
2082
- if (isElevationView(mode)) {
2083
- planData.cam.position.sub(newCenter);
2084
- }
2085
- }
2086
- newBoundingBox.min.sub(newCenter);
2087
- newBoundingBox.max.sub(newCenter);
2088
- planData.boundingBox = newBoundingBox;
2089
- }
2090
- }
2091
-
2092
- /**
2093
- * Filter the array of diffs
2094
- * @param diffArray
2095
- * @param sceneData
2096
- * @param oldSceneData
2097
- * @returns {Array}
2098
- */
2099
- function filterDiffs(diffArray, sceneData, oldSceneData) {
2100
- return minimizeRemoveDiffsWhenSwitchingLayers(minimizeChangePropertiesAfterSelectionsDiffs(minimizeChangePropertiesDiffs(diffArray, sceneData, oldSceneData), sceneData, oldSceneData), sceneData, oldSceneData);
2101
- }
2102
-
2103
- /**
2104
- * Reduces the number of remove diffs when switching an hidden layer
2105
- * @param diffArray the array of the diffs
2106
- * @param sceneData
2107
- * @param oldSceneData
2108
- * @returns {Array}
2109
- */
2110
- function minimizeRemoveDiffsWhenSwitchingLayers(diffArray, sceneData, oldSceneData) {
2111
- var foundDiff;
2112
- var i;
2113
- for (i = 0; i < diffArray.length && !foundDiff; i++) {
2114
- if (diffArray[i].path[1] === 'selectedLayer') {
2115
- foundDiff = diffArray[i];
2116
- }
2117
- }
2118
- if (foundDiff) {
2119
- if (!sceneData.getIn(['layers', oldSceneData.selectedLayer, 'visible'])) {
2120
- return diffArray.filter(function (_ref6) {
2121
- var op = _ref6.op,
2122
- path = _ref6.path;
2123
- return !(path[path.length - 1] === 'selected' && path[1] === 'layers' && path[2] === oldSceneData.selectedLayer) && !(op === 'remove' && path.indexOf(oldSceneData.selectedLayer) !== -1);
2124
- });
2125
- }
2126
- }
2127
- return diffArray;
2128
- }
2129
-
2130
- /**
2131
- * Reduces the number of change properties diffs for selected elements
2132
- * @param diffArray the array of the diffs
2133
- * @param sceneData
2134
- * @param oldSceneData
2135
- * @returns {Array}
2136
- */
2137
- function minimizeChangePropertiesAfterSelectionsDiffs(diffArray, sceneData, oldSceneData) {
2138
- var idsFound = {};
2139
- diffArray.forEach(function (_ref7) {
2140
- var path = _ref7.path;
2141
- if (path[5] === 'selected') {
2142
- idsFound[path[4]] = path[4];
2143
- }
2144
- });
2145
- return diffArray.filter(function (_ref8) {
2146
- var path = _ref8.path;
2147
- if (path[5] === 'properties') {
2148
- return idsFound[path[4]] ? false : true;
2149
- }
2150
- return true;
2151
- });
2152
- }
2153
-
2154
- /**
2155
- * Reduces the number of change properties diffs
2156
- * @param diffArray the array of the diffs
2157
- * @param sceneData
2158
- * @param oldSceneData
2159
- * @returns {Array}
2160
- */
2161
- function minimizeChangePropertiesDiffs(diffArray, sceneData, oldSceneData) {
2162
- var idsFound = {};
2163
- return diffArray.filter(function (_ref9) {
2164
- var path = _ref9.path;
2165
- if (path[5] === 'properties') {
2166
- return idsFound[path[4]] ? false : idsFound[path[4]] = true;
2167
- } else if (path[5] === 'misc') {
2168
- // Remove misc changes
2169
- return false;
2170
- }
2171
- return true;
2172
- });
2173
- }
2174
-
2175
- // countertops:
2176
- // o id:
2177
- // o items: [itemid]
2178
- // o ct3d: 3d object
2179
- // o catid
2180
- // o pos
2181
- // o rotRad
2182
- // o size
2183
- function createCTFromItem(item, unit, catalog) {
2184
- return createCTFromItems([item], unit, catalog);
2185
- }
2186
- function createCTFromItems(items, unit, catalog) {
2187
- var item0 = items[0];
2188
- var item1 = items[items.length - 1];
2189
- var CTId = IDBroker.acquireID();
2190
- var ct3d = null;
2191
- var catid = item0.type;
2192
- var pos = {
2193
- x: (item0.x + item1.x) / 2,
2194
- y: (item0.y + item1.y) / 2
2195
- };
2196
- var rotRad = item0.rotation / 180 * Math.PI;
2197
- var cat = catalog.elements[catid];
2198
- // let width = convert(item0.properties.getIn(['width', '_length'])).from('in').to('cm');
2199
- // let depth = convert(item0.properties.getIn(['depth', '_length'])).from('in').to('cm');
2200
- // let height = convert(item0.properties.getIn(['height', '_length'])).from('in').to('cm');
2201
- var width = item0.properties.get('width').get('_length');
2202
- var widthUnit = item0.properties.get('width').get('_unit') || 'cm';
2203
- width = convert(width).from(widthUnit).to('cm');
2204
- var depth = item0.properties.get('depth').get('_length');
2205
- var depthUnit = item0.properties.get('depth').get('_unit') || 'cm';
2206
- depth = convert(depth).from(depthUnit).to('cm');
2207
- var height = item0.properties.get('height').get('_length');
2208
- var heightUnit = item0.properties.get('height').get('_unit') || 'cm';
2209
- height = convert(height).from(heightUnit).to('cm');
2210
- var size = {
2211
- width: width * items.length,
2212
- depth: depth,
2213
- height: height
2214
- };
2215
- return {
2216
- id: CTId,
2217
- items: items,
2218
- ct3d: ct3d,
2219
- catid: catid,
2220
- pos: pos,
2221
- rotRad: rotRad,
2222
- size: size
2223
- };
2224
- }
2225
- export function createMDFromItem(item, lines, molding) {
2226
- var MDId = IDBroker.acquireID();
2227
- var z = item.properties.get('altitude').get('_length');
2228
- var zUnit = item.properties.get('altitude').get('_unit') || 'cm';
2229
- z = convert(z).from(zUnit).to('cm');
2230
- var height = item.properties.get('height').get('_length');
2231
- var heightUnit = item.properties.get('height').get('_unit') || 'cm';
2232
- height = convert(height).from(heightUnit).to('cm');
2233
- switch (molding.location_type) {
2234
- case TOP_MOLDING_LOCATION:
2235
- z += height;
2236
- break;
2237
- case MIDDLE_MOLDING_LOCATION:
2238
- z += height / 2;
2239
- break;
2240
- case BOTTOM_MOLDING_LOCATION:
2241
- z += 0;
2242
- break;
2243
- default:
2244
- break;
2245
- }
2246
- return {
2247
- id: MDId,
2248
- items: [item],
2249
- meshes: [],
2250
- pos: {
2251
- x: 0,
2252
- y: 0,
2253
- z: z
2254
- },
2255
- size: {
2256
- width: 0,
2257
- depth: 0,
2258
- height: 0
2259
- },
2260
- lines: lines,
2261
- molding: molding,
2262
- pointGroups: []
2263
- };
2264
- }
2265
- function tryAdjacent(ct1, ct2) {
2266
- if (ct1.catid.includes('Dishwasher') && ct1.catid.includes('BF')) {
2267
- var temp = ct1;
2268
- ct1 = ct2;
2269
- ct2 = temp;
2270
- }
2271
- log('----tryAdjacent', ct1.id, ct2.id);
2272
- if (!ct2.catid.includes('Dishwasher') && !ct2.catid.includes('BF') && ct1.catid != ct2.catid) return false;
2273
- if (ct1.rotRad != ct2.rotRad) return false;
2274
- log('ct1', ct1.pos.x, ct1.pos.y, ct1.size.width);
2275
- log('ct2', ct2.pos.x, ct2.pos.y, ct2.size.width);
2276
- var dist = GeometryUtils.verticesDistance(ct1.pos, ct2.pos);
2277
- var totalwidth = ct1.size.width + ct2.size.width;
2278
- log('epsilon', dist, totalwidth, Math.abs(2 * dist - totalwidth));
2279
- if (Math.abs(2 * dist - totalwidth) / totalwidth > 1e-3) return false;
2280
- log('----success');
2281
- var newpos = {
2282
- x: (ct1.pos.x * ct1.size.width + ct2.pos.x * ct2.size.width) / totalwidth,
2283
- y: (ct1.pos.y * ct1.size.width + ct2.pos.y * ct2.size.width) / totalwidth
2284
- };
2285
- var newsize = {
2286
- width: totalwidth,
2287
- depth: ct1.size.depth,
2288
- height: ct1.size.height
2289
- };
2290
- var CTId = IDBroker.acquireID();
2291
- var items = GeometryUtils.compareVertices(ct1.pos, ct2.pos) > 0 ? [].concat(_toConsumableArray(ct1.items), _toConsumableArray(ct2.items)) : [].concat(_toConsumableArray(ct2.items), _toConsumableArray(ct1.items));
2292
- var ct3d = null;
2293
- var catid = ct1.catid;
2294
- return {
2295
- id: CTId,
2296
- items: items,
2297
- ct3d: ct3d,
2298
- catid: catid,
2299
- pos: newpos,
2300
- rotRad: ct1.rotRad,
2301
- size: newsize
2302
- };
2303
- }
2304
- function isParallelLines(line1, line2) {
2305
- var isParallel = false;
2306
- if (Math.abs(line1[0].y - line1[1].y) <= EPSILON && Math.abs(line2[0].y - line2[1].y) <= EPSILON) isParallel = true;
2307
- if (Math.abs(line1[0].x - line1[1].x) <= EPSILON && Math.abs(line2[0].x - line2[1].x) <= EPSILON) isParallel = true;
2308
- if (Math.abs((line1[0].x - line1[1].x) / (line1[0].y - line1[1].y) - (line2[0].x - line2[1].x) / (line2[0].y - line2[1].y)) <= EPSILON) isParallel = true;
2309
- if (isParallel) {
2310
- return true;
2311
- }
2312
- return false;
2313
- }
2314
- export function tryAdjacentMD(md1, md2, molding) {
2315
- log('----tryAdjacent', md1.id, md2.id);
2316
- if (Math.abs(md1.pos.z - md2.pos.z) > EPSILON) return false;
2317
- var id1 = md1.items[0].doorStyle.hasOwnProperty('id') ? md1.items[0].doorStyle.id : md1.items[0].doorStyle.toJS().id,
2318
- id2 = md2.items[0].doorStyle.hasOwnProperty('id') ? md2.items[0].doorStyle.id : md2.items[0].doorStyle.toJS().id;
2319
- if (id1 !== id2) return false;
2320
- var newLines = md1.lines.concat(md2.lines);
2321
- var isMerge = false;
2322
- md1.lines.forEach(function (line1) {
2323
- md2.lines.map(function (line2) {
2324
- // filter removed lines
2325
- if (newLines.findIndex(function (a) {
2326
- return a[2] === line1[2];
2327
- }) === -1 || newLines.findIndex(function (a) {
2328
- return a[2] === line2[2];
2329
- }) === -1) return false;
2330
- // is parallel two lines
2331
- if (isParallelLines(line1, line2)) {
2332
- var disLine1 = GeometryUtils.verticesDistance(line1[0], line1[1]);
2333
- var disLine2 = GeometryUtils.verticesDistance(line2[0], line2[1]);
2334
- if (GeometryUtils.sameMDistances(GeometryUtils.verticesDistance(line2[0], line1[0]) + GeometryUtils.verticesDistance(line1[1], line2[1]), Math.abs(disLine2 - disLine1))) {
2335
- newLines = newLines.filter(function (a) {
2336
- return !(a[2] === line1[2] || a[2] === line2[2]);
2337
- });
2338
- if (!GeometryUtils.sameMPoints(line1[0], line2[0])) newLines.push([line1[0], line2[0], IDBroker.acquireID()]);
2339
- if (!GeometryUtils.sameMPoints(line1[1], line2[1])) newLines.push([line1[1], line2[1], IDBroker.acquireID()]);
2340
- isMerge = true;
2341
- return false;
2342
- }
2343
- if (GeometryUtils.sameMDistances(GeometryUtils.verticesDistance(line2[0], line1[1]) + GeometryUtils.verticesDistance(line1[0], line2[1]), Math.abs(disLine2 - disLine1))) {
2344
- newLines = newLines.filter(function (a) {
2345
- return !(a[2] === line1[2] || a[2] === line2[2]);
2346
- });
2347
- if (!GeometryUtils.sameMPoints(line1[1], line2[0])) newLines.push([line1[1], line2[0], IDBroker.acquireID()]);
2348
- if (!GeometryUtils.sameMPoints(line1[0], line2[1])) newLines.push([line1[0], line2[1], IDBroker.acquireID()]);
2349
- isMerge = true;
2350
- return false;
2351
- }
2352
- var samePointNum = -1,
2353
- i = 0;
2354
- while (i < 4 && samePointNum === -1) {
2355
- if (GeometryUtils.sameMPoints(line1[Math.floor(i / 2)], line2[i % 2]) && GeometryUtils.sameMDistances(disLine1 + disLine2, GeometryUtils.verticesDistance(line1[Math.floor((3 - i) / 2)], line2[(3 - i) % 2]))) {
2356
- samePointNum = 3 - i;
2357
- } else {
2358
- i++;
2359
- }
2360
- }
2361
- if (samePointNum > -1) {
2362
- newLines = newLines.filter(function (a) {
2363
- return !(a[2] === line1[2] || a[2] === line2[2]);
2364
- });
2365
- newLines.push([_objectSpread({}, line1[Math.floor(samePointNum / 2)]), _objectSpread({}, line2[samePointNum % 2]), IDBroker.acquireID()]);
2366
- isMerge = true;
2367
- return false;
2368
- }
2369
- var pointNum = -1,
2370
- k = 0;
2371
- while (k < 4 && pointNum === -1) {
2372
- if (GeometryUtils.sameMDistances(GeometryUtils.verticesDistance(line1[Math.floor(k / 2)], line2[k % 2]) + GeometryUtils.verticesDistance(line1[1 - Math.floor(k / 2)], line2[k % 2]), disLine1) && GeometryUtils.sameMDistances(GeometryUtils.verticesDistance(line1[1 - Math.floor(k / 2)], line2[k % 2]) + GeometryUtils.verticesDistance(line1[1 - Math.floor(k / 2)], line2[1 - k % 2]), disLine2)) {
2373
- pointNum = k;
2374
- } else {
2375
- k++;
2376
- }
2377
- }
2378
- }
2379
- return false;
2380
- });
2381
- });
2382
- if (!newLines.length) return _objectSpread({}, md2);
2383
- if (!isMerge) return false;
2384
- return {
2385
- id: IDBroker.acquireID(),
2386
- items: [].concat(_toConsumableArray(md2.items.filter(function (item) {
2387
- return md1.items.findIndex(function (it) {
2388
- return it.id === item.id;
2389
- }) === -1;
2390
- })), _toConsumableArray(md1.items)),
2391
- meshes: [],
2392
- pos: md1.pos,
2393
- size: md1.size,
2394
- lines: newLines,
2395
- molding: molding
2396
- };
2397
- }
2398
- function showItemCT(item, CT, visible, planData, layer) {
2399
- var item3D = planData.sceneGraph.layers[layer.id].items[item.id];
2400
- if (item3D === undefined) return undefined;
2401
- item3D.traverse(function (child) {
2402
- if (child.name.includes('countertop')) {
2403
- child.visible = visible;
2404
- if (child.material.map === null) {
2405
- var normalMap = item.counterTop.uri;
2406
- var interiortexture = loadTexture(normalMap);
2407
- applyTexture(child.material, interiortexture, 100, 100);
2408
- child.material.color = new Color(1, 1, 1);
2409
- return;
2410
- }
2411
- child.material.map.repeat.x = 1;
2412
- }
2413
- });
2414
- }
2415
- function getCountertopMesh(item, visible, planData, layer) {
2416
- if (item.type.includes('Dishwasher')) return undefined;
2417
- if (item.type.includes('BF')) return undefined;
2418
- var item3D = planData.sceneGraph.layers[layer.id].items[item.id];
2419
- var countertop = null;
2420
- if (item3D === undefined) return undefined;
2421
- item3D.traverse(function (child) {
2422
- if (child.name.includes('countertop')) {
2423
- countertop = child;
2424
- }
2425
- });
2426
- return countertop;
2427
- }
2428
- function getDoorStyleMaterial(items, planData, layer, name) {
2429
- var item3D = null;
2430
- // find Item with visible = true, in elevation mode
2431
- items.forEach(function (item) {
2432
- var tempItem = null;
2433
- tempItem = planData.sceneGraph.layers[layer.id].items[item.id];
2434
- if (tempItem && tempItem.visible) {
2435
- item3D = tempItem;
2436
- }
2437
- });
2438
- var door_mesh = null;
2439
- if (!item3D) return undefined;
2440
- item3D.traverse(function (child) {
2441
- if (!door_mesh && !child.name.includes('countertop') && !child.name.includes('_interior_') && !child.name.includes('handle') && child.type === OBJTYPE_MESH) {
2442
- door_mesh = child;
2443
- }
2444
- });
2445
- return door_mesh && door_mesh.material;
2446
- }
2447
- function addCTMesh(countertop, planData, layer) {
2448
- if (countertop.items.length == 1) {
2449
- showItemCT(countertop.items[0], countertop, true, planData, layer);
2450
- } else {
2451
- var ctMesh = null;
2452
- countertop.items.some(function (item) {
2453
- ctMesh = getCountertopMesh(item, true, planData, layer);
2454
- return ctMesh != null;
2455
- });
2456
- if (!ctMesh) return;
2457
- if (0) {
2458
- var material = ctMesh.material;
2459
- var thickness = 3.81;
2460
- var geometry = new Three.BoxGeometry(countertop.size.width, thickness, countertop.size.depth);
2461
- var ct3d = new Three.Mesh(geometry, material);
2462
- countertop.ct3d = ct3d;
2463
- planData.plan.add(ct3d);
2464
- ct3d.position.x = countertop.pos.x;
2465
- ct3d.position.z = -countertop.pos.y;
2466
- ct3d.position.y = countertop.size.height + thickness / 2;
2467
- ct3d.quaternion.setFromAxisAngle(new Three.Vector3(0, 1, 0), countertop.rotRad);
2468
- ct3d.name = 'countertops';
2469
- } else {
2470
- var _ct3d = ctMesh.clone();
2471
- countertop.ct3d = _ct3d;
2472
- _ct3d.visible = true;
2473
- _ct3d.material = ctMesh.material.clone();
2474
- if (_ct3d.material.map !== null) {
2475
- _ct3d.material.map.copy(ctMesh.material.map);
2476
- _ct3d.material.map.repeat.x = countertop.items.length;
2477
- }
2478
- ctMesh.updateMatrix();
2479
- ctMesh.parent.updateMatrix();
2480
- ctMesh.parent.parent.updateMatrix();
2481
- var ctmeshMat = ctMesh.matrix;
2482
- var objMat = ctMesh.parent.matrix;
2483
- var pivotMat = ctMesh.parent.parent.matrix;
2484
- pivotMat.setPosition(new Three.Vector3(countertop.pos.x, 0, -countertop.pos.y));
2485
- var width = countertop.items.find(function (ct) {
2486
- return !ct.type.includes('Dishwasher') && !ct.type.includes('BF');
2487
- }).properties.get('width').get('_length');
2488
- var unit_width = countertop.items.find(function (ct) {
2489
- return !ct.type.includes('Dishwasher') && !ct.type.includes('BF');
2490
- }).properties.get('width').get('_unit') || 'cm';
2491
- width = convert(width).from(unit_width).to('cm');
2492
- pivotMat.scale(new Three.Vector3(countertop.size.width / width, 1, 1));
2493
- var finalMat = objMat.premultiply(pivotMat);
2494
- _ct3d.applyMatrix4(finalMat);
2495
- planData.plan.add(_ct3d);
2496
- _ct3d.name = 'countertops';
2497
- }
2498
- }
2499
- }
2500
- function getArea(a, b, c) {
2501
- return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y);
2502
- }
2503
- function isSingleQuadrilateral(groupCount, pointGroup) {
2504
- return groupCount === 1 && pointGroup.length === 4;
2505
- }
2506
-
2507
- /**
2508
- * @param MDV - molding points
2509
- * @param width - cabinet width
2510
- * @param depth - cabinet depth ( z axis )
2511
- * @param model - molding info that appear in real 3D
2512
- */
2513
- function moldingVertices(mPointGroup, mdGeo, MDV, model, svg_width, svg_height, groupCount) {
2514
- var pointGroup = mPointGroup;
2515
- var length = pointGroup.length;
2516
- var isSnap = true;
2517
-
2518
- // Point O
2519
- var o = new Three.Vector2(0, 0);
2520
- if (GeometryUtils.samePoints(pointGroup[0], pointGroup[length - 1])) {
2521
- pointGroup = pointGroup.slice(0, length - 1);
2522
- length--;
2523
- isSnap = false;
2524
- }
2525
- var verticesArray = [];
2526
- var t = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
2527
- if (!isSnap && isSingleQuadrilateral(groupCount, pointGroup)) {
2528
- var tmp_pos = [];
2529
- t.forEach(function (tmp) {
2530
- pointGroup.forEach(function (point) {
2531
- if (point.x * tmp[0] > 0 && point.y * tmp[1] > 0) {
2532
- tmp_pos.push(point);
2533
- }
2534
- });
2535
- });
2536
- pointGroup = tmp_pos;
2537
- }
2538
- pointGroup.forEach(function (cur, i) {
2539
- var prev = isSnap && i === 0 ? cur : pointGroup[(i + length - 1) % length];
2540
- var next = isSnap && i === length - 1 ? cur : pointGroup[(i + 1) % length];
2541
- var vecPC = cur.clone().sub(prev); // vector from point `prev` to point `cur`
2542
- var vecNC = cur.clone().sub(next); // vector from point `next` to point `cur`
2543
-
2544
- // Calculate normal vector to `vecPC`
2545
- var vecNorm = new Three.Vector2(0, 1);
2546
- if (vecPC.x) {
2547
- if (vecPC.x > 0) {
2548
- vecNorm = new Three.Vector2(-vecPC.y / vecPC.x, 1);
2549
- } else {
2550
- vecNorm = new Three.Vector2(vecPC.y / vecPC.x, -1);
2551
- }
2552
- } else {
2553
- if (vecPC.y === 0) {
2554
- if (vecNC.x) {
2555
- if (vecNC.x > 0) {
2556
- vecNorm = new Three.Vector2(vecNC.y / vecNC.x, -1);
2557
- } else {
2558
- vecNorm = new Three.Vector2(-vecNC.y / vecNC.x, 1);
2559
- }
2560
- } else {
2561
- if (vecNC.y > 0) {
2562
- vecNorm = new Three.Vector2(1, 0);
2563
- } else {
2564
- vecNorm = new Three.Vector2(-1, 0);
2565
- }
2566
- }
2567
- } else {
2568
- if (vecPC.y > 0) {
2569
- vecNorm = new Three.Vector2(-1, 0);
2570
- } else {
2571
- vecNorm = new Three.Vector2(1, 0);
2572
- }
2573
- }
2574
- }
2575
- var p1 = cur.clone().add(vecNorm); // the point that's away from `cur` by `vecNorm`
2576
- if (getArea(prev, p1, cur) > 0) {
2577
- vecNorm.multiplyScalar(-1);
2578
- }
2579
- var area = 0.5 * getArea(prev, cur, next);
2580
- var lenPN = next.clone().sub(prev).length();
2581
- var lenNC = vecNC.length();
2582
- var lenPC = vecPC.length();
2583
- var alpha = Math.acos((lenNC * lenNC + lenPC * lenPC - lenPN * lenPN) / (2 * lenNC * lenPC));
2584
- if (area < 0) alpha = 2 * Math.PI - alpha; // Exterior Angle
2585
- alpha /= 2;
2586
- if (isNaN(alpha)) {
2587
- alpha = Math.PI / 2;
2588
- }
2589
- vecNorm.rotateAround(o, Math.PI / 2 - alpha);
2590
- vecNorm.normalize();
2591
- vecNorm.multiplyScalar(1 / Math.sin(alpha));
2592
-
2593
- // Make 3D Points
2594
- MDV.forEach(function (p) {
2595
- var x = cur.x - vecNorm.x * ((p.x / svg_width - 0.5) * model.length);
2596
- var y = (0.5 - p.y / svg_height) * model.width;
2597
- var z = -cur.y + vecNorm.y * ((p.x / svg_width - 0.5) * model.length);
2598
- if (mdGeo.attributes.hasOwnProperty('position')) verticesArray = mdGeo.attributes.position.array;
2599
- verticesArray.push(x, y, z);
2600
- });
2601
- });
2602
- var mdGeo1 = mdGeo.setAttribute('position', new Three.BufferAttribute(new Float32Array(verticesArray), 3));
2603
- mdGeo1.needsUpdate = true;
2604
- return mdGeo1;
2605
- }
2606
- var dcmFace = function dcmFace(a, leng, MDV) {
2607
- for (var i = a; i < a + 2; i++) {
2608
- var f_a1 = i;
2609
- var f_b1 = i + leng;
2610
- var f_c1 = i + leng + 1;
2611
- var f_a2 = i;
2612
- var f_b2 = i + 1;
2613
- var f_c2 = f_c1;
2614
- var _indices = Array.from(MDV.index.array);
2615
- _indices.push(f_a1, f_b1, f_c1, f_c2, f_b2, f_a2);
2616
- MDV.setIndex(_indices);
2617
- }
2618
- var indices = Array.from(MDV.index.array);
2619
- indices.push(a + 2, a + leng + 2, a + leng + 4, a + leng + 4, a + 4, a + 2);
2620
- MDV.setIndex(indices);
2621
- for (var _i = a + 4; _i < a + 74; _i++) {
2622
- var _f_a = _i;
2623
- var _f_b = _i + leng;
2624
- var _f_c = _i + leng + 1;
2625
- var _f_a2 = _i;
2626
- var _f_b2 = _i + 1;
2627
- var _f_c2 = _f_c;
2628
- var _indices2 = Array.from(MDV.index.array);
2629
- _indices2.push(_f_a, _f_b, _f_c, _f_c2, _f_b2, _f_a2);
2630
- MDV.setIndex(_indices2);
2631
- }
2632
- var faces = Array.from(MDV.index.array);
2633
- faces.push(a + 50, a + 3, a + 103, a + 103, a + 150, a + 50);
2634
- MDV.setIndex(faces);
2635
- };
2636
- var fbmFace = function fbmFace(a, leng, MDV) {
2637
- var total_leng = leng * 4;
2638
- for (var i = a; i < a + leng - 1; i++) {
2639
- var f_a1 = i;
2640
- var f_b1 = (i + leng) % total_leng;
2641
- var f_c1 = (i + leng + 1) % total_leng;
2642
- var f_a2 = i;
2643
- var f_b2 = i + 1;
2644
- var f_c2 = f_c1;
2645
- var indices = [];
2646
- if (MDV.index !== null) {
2647
- indices = Array.from(MDV.index.array);
2648
- }
2649
- indices.push(f_a1, f_b1, f_c1, f_c2, f_b2, f_a2);
2650
- MDV.setIndex(indices);
2651
- }
2652
- };
2653
- var assignUVs = function assignUVs(geometry) {
2654
- geometry.computeBoundingBox();
2655
- var h = 400;
2656
- var _geometry$boundingBox = geometry.boundingBox,
2657
- min = _geometry$boundingBox.min,
2658
- max = _geometry$boundingBox.max;
2659
- var offset = new Three.Vector2(0 - min.x, 0 - min.z);
2660
- var range = new Three.Vector2(max.x - min.x, max.z - min.z);
2661
- geometry.faceVertexUvs[0] = geometry.faces.map(function (face) {
2662
- var v1 = geometry.vertices[face.a];
2663
- var v2 = geometry.vertices[face.b];
2664
- var v3 = geometry.vertices[face.c];
2665
- return [new Three.Vector2((v1.x + offset.x) / range.x, (v1.z + offset.y) / (range.y + h)), new Three.Vector2((v2.x + offset.x) / range.x, (v2.z + offset.y) / (range.y + h)), new Three.Vector2((v3.x + offset.x) / range.x, (v3.z + offset.y) / (range.y + h))];
2666
- });
2667
- geometry.uvsNeedUpdate = true;
2668
- };
2669
- var assignUVsA = function assignUVsA(geometry) {
2670
- geometry.computeBoundingBox();
2671
- var h = 200;
2672
- var _geometry$boundingBox2 = geometry.boundingBox,
2673
- min = _geometry$boundingBox2.min,
2674
- max = _geometry$boundingBox2.max;
2675
- var offset = new Three.Vector2(0 - min.x, 0 - min.y);
2676
- var range = new Three.Vector2(max.x - min.x, max.y - min.y);
2677
- geometry.faceVertexUvs[0] = geometry.faces.map(function (face) {
2678
- var v1 = geometry.vertices[face.a];
2679
- var v2 = geometry.vertices[face.b];
2680
- var v3 = geometry.vertices[face.c];
2681
- return [new Three.Vector2((v1.x + offset.x) / (range.x + h), (v1.y + offset.y) / (range.y + h)), new Three.Vector2((v2.x + offset.x) / (range.x + h), (v2.y + offset.y) / (range.y + h)), new Three.Vector2((v3.x + offset.x) / (range.x + h), (v3.y + offset.y) / (range.y + h))];
2682
- });
2683
- geometry.uvsNeedUpdate = true;
2684
- };
2685
-
2686
- /*
2687
- Remove specified type of 3d object easily
2688
- */
2689
- export function deleteSpecifiedMeshObjects(type) {
2690
- var childLen = planData.plan.children.length;
2691
- var children = [];
2692
- for (var i = 0; i < childLen; i++) {
2693
- if (planData.plan.children[i].name != type) children.push(planData.plan.children[i]);
2694
- }
2695
- planData.plan.children = children;
2696
- }
2697
- export function getMeshesFromScene() {
2698
- var childLen = planData.plan.children.length;
2699
- var children = [];
2700
- for (var i = 0; i < childLen; i++) {
2701
- if (planData.plan.children[i].type == OBJTYPE_MESH) children.push(planData.plan.children[i]);
2702
- }
2703
- return children;
2704
- }
2705
- export function threedfabs(a) {
2706
- return a > 0 ? a : -a;
2707
- }
2708
- export function getDistanceBetweenLineSegment(pos1, pos2, pos3, pos4) {
2709
- if (pos1.x == pos2.x && pos3.x == pos4.x) return pos3.x - pos1.x;else if (pos1.y == pos2.y && pos3.y == pos4.y) return pos3.y - pos1.y;else return -1;
2710
- }
2711
-
2712
- /**
2713
- * check to see if an item is suitable for the given doorStyle.
2714
- * @param _item
2715
- * @returns true if it's not suitable.
2716
- */
2717
- export function showYelloBox(_item) {
2718
- var _doorStyle;
2719
- var doorStyle = _item === null || _item === void 0 ? void 0 : _item.doorStyle;
2720
-
2721
- // If doorStyle is an Immutable Map, convert to plain JS
2722
- if (doorStyle && typeof doorStyle.toJS === 'function') {
2723
- doorStyle = doorStyle.toJS();
2724
- }
2725
- var isItemCabinet = (_item === null || _item === void 0 ? void 0 : _item.category) === 'cabinet';
2726
- var cds = (_doorStyle = doorStyle) === null || _doorStyle === void 0 || (_doorStyle = _doorStyle.doorStyles) === null || _doorStyle === void 0 ? void 0 : _doorStyle.cds;
2727
-
2728
- // hasItemCDS: item is suitable if its itemID exists in cds
2729
- var hasItemCDS = isItemCabinet && Array.isArray(cds) ? cds.some(function (element) {
2730
- return element.itemID === _item.itemID;
2731
- }) : false;
2732
-
2733
- // return true if it's a cabinet but not suitable for the current doorStyle
2734
- return isItemCabinet && !hasItemCDS;
2735
- }
2736
- function isSimilar(a, b) {
2737
- if (threedfabs(a - b) <= 0.01) return 1;
2738
- return 0;
2739
- }
2740
- export function sameSign(pos1, pos2, pos3) {
2741
- var ch1 = 0.0;
2742
- var ch2 = 1.0;
2743
- if (isSimilar(pos1.x, pos2.x) && isSimilar(pos1.x, pos3.x)) {
2744
- ch1 = (pos2.y - pos1.y) * (pos3.y - pos1.y);
2745
- } else if (isSimilar(pos1.y, pos2.y) && isSimilar(pos1.y, pos3.y)) {
2746
- ch1 = (pos2.x - pos1.x) * (pos3.x - pos1.x);
2747
- } else {
2748
- ch1 = (pos2.y - pos1.y) * 1.0 / (pos2.x - pos1.x);
2749
- ch2 = (pos3.y - pos1.y) * 1.0 / (pos3.x - pos1.x);
2750
- }
2751
- if (ch1 * ch2 >= 0) return 1;
2752
- return 0;
2753
- }
2754
- export function getTotalDistance(pos, rect) {
2755
- var sum = 0;
2756
- for (var i = 0; i < rect.length; i++) {
2757
- sum += verticesDistance(pos, rect[i]);
2758
- }
2759
- return sum;
2760
- }
2761
- var applyTexture = function applyTexture(material, texture, length, height) {
2762
- if (texture) {
2763
- material.map = texture;
2764
- material.needsUpdate = true;
2765
- material.map.wrapS = Three.RepeatWrapping;
2766
- material.map.wrapT = Three.RepeatWrapping;
2767
- material.map.repeat.set(length * 0.01, height * 0.01);
2768
- if (texture.normal) {
2769
- material.normalMap = loadTexture(texture.normal.uri);
2770
- material.normalScale = new Vector2(texture.normal.normalScaleX, texture.normal.normalScaleY);
2771
- material.normalMap.wrapS = Three.RepeatWrapping;
2772
- material.normalMap.wrapT = Three.RepeatWrapping;
2773
- material.normalMap.repeat.set(length * texture.normal.lengthRepeatScale, height * texture.normal.heightRepeatScale);
2774
- }
2775
- }
2776
- };
2777
-
2778
- /**
2779
- *
2780
- * @param {{is_corner:number,itemInfo:Item,layoutpos:string,pos:{x:number,y:number},rect:[{x:number,y:number}],
2781
- * rotRad:number,size:{depth:number,width:number,height:number}}} item
2782
- * @param {Layer} layer
2783
- * @param {{boundingBox:Box3,catalog:Catalog,grid: Object3D,plan: Object3D,sceneData: Scene,sceneGraph}} planData
2784
- * @param {Scene} scene
2785
- */
2786
- export function createBacksplash(item, layer, planData, scene) {
2787
- var sceneGraph = planData.sceneGraph;
2788
- var selectedLayer = planData.sceneData.selectedLayer;
2789
- /**
2790
- * @type {[{backsplash,info:{rotY:number,posX:number,posY:number,posZ:number,splashWidth:number,splashHeight:number,splashDepth:number,id:string}}]}
2791
- */
2792
- var backsplashes = sceneGraph.layers[selectedLayer].backsplashes;
2793
- var backsplashApplied = layer.get('backsplashApplied');
2794
- var name = 'backsplash' + item.itemInfo.id;
2795
- var index = backsplashes.findIndex(function (item) {
2796
- return item.backsplash.name === name;
2797
- });
2798
- var itemToSave = {
2799
- backsplash: null,
2800
- info: {}
2801
- };
2802
- if (!item.itemInfo.backsplashVisible) {
2803
- // If backsplash is not visible
2804
- if (index >= 0) {
2805
- backsplashes.splice(index, 1); // Remove from backsplashes array
2806
- }
2807
- return;
2808
- }
2809
-
2810
- // Get wall items
2811
-
2812
- var i,
2813
- wallItems = [];
2814
- var allWallItems = GeometryUtils.getAllItemSpecified(scene, planData.catalog, WALL_CABINET_LAYOUTPOS);
2815
- for (i = 0; i < allWallItems.others.length; i++) wallItems.push(allWallItems.others[i]);
2816
- if (allWallItems.cur) wallItems.push(allWallItems.cur);
2817
-
2818
- // Get information of item itself
2819
-
2820
- var altitude = item.itemInfo.properties.get('altitude').get('_length');
2821
- var altitudeUnit = item.itemInfo.properties.get('altitude').get('_unit') || 'cm';
2822
- altitude = convert(altitude).from(altitudeUnit).to('cm');
2823
- var thickness = 1,
2824
- /** Height --- altitude */depth;
2825
-
2826
- // Calc wall & hole items info
2827
-
2828
- /**
2829
- * Wall & Hole items info
2830
- * @type {[{x:number,width:number,altitude:number}]}
2831
- */
2832
- var altItems = [],
2833
- flag = false;
2834
- wallItems.map(function (wallItem) {
2835
- var altitude = wallItem.itemInfo.properties.get('altitude').get('_length');
2836
- var altitudeUnit = wallItem.itemInfo.properties.get('altitude').get('_unit') || 'cm';
2837
- altitude = convert(altitude).from(altitudeUnit).to('cm');
2838
- altItems.push({
2839
- x: wallItem.pos.x,
2840
- width: wallItem.size.width,
2841
- altitude: altitude
2842
- });
2843
- });
2844
- layer.holes.map(function (hole) {
2845
- var width = hole.properties.getIn(['width', 'length']);
2846
- var altitude = hole.properties.getIn(['altitude', 'length']);
2847
- altItems.push({
2848
- x: hole.x,
2849
- width: width,
2850
- altitude: altitude
2851
- });
2852
- });
2853
- if (altItems.length > 0) {
2854
- depth = altItems[0].altitude;
2855
- altItems.map(function (altItem) {
2856
- if (item.pos.x + item.size.width / 2 >= altItem.x - altItem.width / 2 && item.pos.x - item.size.width / 2 <= altItem.x + altItem.width / 2) {
2857
- if (depth >= altItem.altitude) {
2858
- depth = altItem.altitude;
2859
- flag = true;
2860
- }
2861
- }
2862
- });
2863
- }
2864
- if (!flag) depth = 52 * 2.54;
2865
-
2866
- // Get backsplash info
2867
-
2868
- var posX = item.pos.x - Math.sin(item.rotRad) * (item.size.depth / 2 - thickness);
2869
- var posY = altitude + depth / 2;
2870
- var posZ = -item.pos.y - Math.cos(item.rotRad) * (item.size.depth / 2 - thickness);
2871
- // TODO If you want apply backsplash to walls that's not vertical or horizontal ( slope )
2872
- // You must update this calcuating rotY
2873
- var rotY = item.rotRad;
2874
- var posX1 = item.pos.x + Math.cos(item.rotRad) * (item.size.width / 2 - thickness);
2875
- var posY1 = altitude + depth / 2;
2876
- var posZ1 = -item.pos.y - Math.sin(item.rotRad) * (item.size.width / 2 - thickness);
2877
- // TODO If you want apply backsplash to walls that's not vertical or horizontal ( slope )
2878
- // You must update this calcuating rotY
2879
- var rotY1 = item.rotRad + Math.PI / 2;
2880
- var splashWidth = item.size.width;
2881
- var splashHeight = depth;
2882
- var splashDepth = thickness;
2883
-
2884
- // Find mergeable other backsplashes
2885
-
2886
- var info, wholeWidth, /** Width factor */factor, distance, halfWidth, /** To get new center */centerFactor;
2887
- var _iterator = _createForOfIteratorHelper(backsplashes),
2888
- _step;
2889
- try {
2890
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
2891
- var back = _step.value;
2892
- info = back.info;
2893
- if (info.height === splashHeight && info.rotY === rotY) {
2894
- factor = Math.cos(rotY) || 1;
2895
- distance = Math.hypot(posX - info.posX, posZ - info.posZ) / factor;
2896
- halfWidth = (info.width + splashWidth) / 2;
2897
- if (Math.abs(distance - halfWidth) < 1e-2) {
2898
- // dispose `back`
2899
- if (info.id) {
2900
- deleteSpecifiedMeshObjects('backsplash' + info.id);
2901
- }
2902
-
2903
- // Get center position
2904
- wholeWidth = info.width + splashWidth;
2905
- centerFactor = info.width / wholeWidth;
2906
- posX = posX + centerFactor * (info.posX - posX);
2907
- posZ = posZ + centerFactor * (info.posZ - posZ);
2908
- splashWidth = wholeWidth;
2909
- }
2910
- }
2911
- }
2912
- } catch (err) {
2913
- _iterator.e(err);
2914
- } finally {
2915
- _iterator.f();
2916
- }
2917
- itemToSave.info.posX = posX;
2918
- itemToSave.info.posY = posY;
2919
- itemToSave.info.posZ = posZ;
2920
- itemToSave.info.rotY = rotY;
2921
- itemToSave.info.width = splashWidth;
2922
- itemToSave.info.height = splashHeight;
2923
- itemToSave.info.depth = splashDepth;
2924
-
2925
- // Make material
2926
-
2927
- var texture = layer.get('backsplash');
2928
- var areaMaterial = new Three.MeshStandardMaterial({
2929
- side: Three.DoubleSide,
2930
- metalness: texture.metalness,
2931
- roughness: texture.roughness
2932
- });
2933
- var interiortexture = loadTexture(texture.uri);
2934
- applyTexture(areaMaterial, interiortexture, splashWidth * 1.5, splashHeight * 1.5);
2935
-
2936
- // Make geometry
2937
- var geometry = new Three.BoxGeometry(splashWidth, splashHeight, splashDepth);
2938
-
2939
- // Make backsplash mesh
2940
-
2941
- var backsplash = itemToSave.backsplash = new Three.Mesh(geometry, areaMaterial);
2942
- backsplash.position.x = itemToSave.info.posX;
2943
- backsplash.position.y = itemToSave.info.posY;
2944
- backsplash.position.z = itemToSave.info.posZ;
2945
- backsplash.rotation.y = itemToSave.info.rotY;
2946
- var allLines = GeometryUtils.getAllLines(layer);
2947
- var allLineRects = GeometryUtils.buildRectFromLines(layer, allLines);
2948
- if (item.is_corner && GeometryUtils.isSnappedSideLine(item, allLineRects)) {
2949
- // corner cabinet item.itemInfo.getIn(["cabinet_category"]) === "Corner Base Cabinets"
2950
- var geometry1 = new Three.BoxGeometry(splashWidth, splashHeight, splashDepth);
2951
- // Make backsplash mesh
2952
- //console.log(sceneGraph.layers["layer-1"].lines);
2953
- var backsplash1 = itemToSave.backsplash = new Three.Mesh(geometry1, areaMaterial);
2954
- backsplash1.position.x = posX1;
2955
- backsplash1.position.y = posY1;
2956
- backsplash1.position.z = posZ1;
2957
- backsplash1.rotation.y = rotY1;
2958
- var newBacksplash = new Group();
2959
- newBacksplash.add(backsplash);
2960
- newBacksplash.add(backsplash1);
2961
- backsplash = newBacksplash;
2962
- }
2963
- itemToSave.info.id = item.itemInfo.id;
2964
- deleteSpecifiedMeshObjects('backsplash' + item.itemInfo.id);
2965
- if (item.rotRad % (Math.PI / 2) === 0) planData.plan.add(backsplash);
2966
- backsplash.name = name;
2967
- backsplash.visible = item.itemInfo.get('backsplashVisible') && backsplashApplied && item.rotRad % (Math.PI / 2) === 0;
2968
-
2969
- // Save to scene graph
2970
-
2971
- if (index < 0) {
2972
- backsplashes.push(itemToSave);
2973
- } else {
2974
- disposeObject(backsplashes[index].backsplash);
2975
- backsplashes.splice(index, 1, itemToSave);
2976
- }
2977
- }
2978
-
2979
- /**
2980
- * @param {Map} item - Selected Item
2981
- */
2982
- function addMGMesh(molding, planData, layer) {
2983
- var _molding$molding;
2984
- var flag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
2985
- var point = [];
2986
- var data = molding === null || molding === void 0 || (_molding$molding = molding.molding) === null || _molding$molding === void 0 ? void 0 : _molding$molding.data;
2987
- if (isEmpty(data)) return;
2988
- var paths = data.paths,
2989
- svg_width = data.svg_width,
2990
- svg_height = data.svg_height;
2991
- for (var i = 0; i < paths.length; i++) {
2992
- var path = paths[i];
2993
- for (var j = 0, jl = path.subPaths.length; j < jl; j++) {
2994
- var subPath = new Three.Path();
2995
- if (path.subPaths[j].hasOwnProperty('metadata')) {
2996
- subPath.fromJSON(path.subPaths[j]);
2997
- } else {
2998
- subPath = path.subPaths[j];
2999
- }
3000
- point = subPath.getPoints();
3001
- }
3002
- }
3003
- _addMGMesh(molding, planData, layer, point, svg_width, svg_height, flag);
3004
- }
3005
- var isBaseCabinet = function isBaseCabinet(item) {
3006
- return item.layoutpos === BASE_CABINET_LAYOUTPOS;
3007
- };
3008
-
3009
- /**
3010
- * @param data - Molding SVG Points
3011
- */
3012
-
3013
- // function assignUVs
3014
- function _addMGMesh(molding, planData, layer, data, svg_width, svg_height, flag) {
3015
- var child = molding.molding;
3016
- var material = getDoorStyleMaterial(molding.items, planData, layer, child.name);
3017
- if (!material) return;
3018
- material = new Three.MeshStandardMaterial(material);
3019
- // let texture = loadTexture(material.map.image.src);
3020
- // var material1 = new Three.MeshLambertMaterial( { map:texture } );
3021
- material.side = parseInt(Three.DoubleSide);
3022
- // let layoutType = molding.items[0].layoutpos;
3023
- // let visible = molding.items[0];
3024
- molding.pointGroups.forEach(function (pointGroup) {
3025
- var geometry = new Three.BufferGeometry();
3026
- var length = data.length; //point array
3027
- var temp_unit = child.height_unit;
3028
- if (temp_unit === 'inch') {
3029
- child.height = convert(child.height).from('in').to('cm');
3030
- child.height_unit = 'cm';
3031
- }
3032
- temp_unit = child.width_unit;
3033
- if (temp_unit === 'inch') {
3034
- child.width = convert(child.width).from('in').to('cm');
3035
- child.width_unit = 'cm';
3036
- }
3037
- temp_unit = child.length_unit;
3038
- if (temp_unit === 'inch') {
3039
- child.length = convert(child.length).from('in').to('cm');
3040
- child.length_unit = 'cm';
3041
- }
3042
- geometry.needsUpdate = true;
3043
- geometry = moldingVertices(pointGroup, geometry, data, child, svg_width, svg_height, molding.pointGroups.length);
3044
- var total = geometry.attributes.position.count;
3045
- var len = geometry.attributes.position.count / length;
3046
- if (!GeometryUtils.samePoints(pointGroup[0], pointGroup[pointGroup.length - 1])) {
3047
- len--;
3048
- }
3049
- for (var i = 0; i < len; i++) {
3050
- for (var j = i * length; j < (i + 1) * length - 1; j++) {
3051
- var f_a1 = j;
3052
- var f_b1 = (j + length) % total;
3053
- var f_c1 = (j + length + 1) % total;
3054
- var f_a2 = j;
3055
- var f_b2 = j + 1;
3056
- var f_c2 = f_c1;
3057
- var indices = [];
3058
- if (geometry.index !== null) {
3059
- indices = Array.from(geometry.index.array);
3060
- }
3061
- indices.push(f_a1, f_b1, f_c1, f_c2, f_b2, f_a2);
3062
- geometry.setIndex(indices);
3063
- }
3064
- }
3065
-
3066
- // handle molding texture
3067
- // (0, e[i]) ------------- (1, e[i])
3068
- // ----------- --- -----------
3069
- // ----------- --- -----------
3070
- // ----------- --- -----------
3071
- // ----------- --- -----------
3072
- // (0, e[i+1]) ------------- (1, e[i+1])
3073
- geometry = geometry.toNonIndexed();
3074
- var sumDistance = 0;
3075
- var sumDistanceArray = [0];
3076
- var finalDistance = 0;
3077
- var uvs_element_array = [];
3078
- for (var _i2 = 0; _i2 < data.length - 1; _i2++) {
3079
- var v1 = {
3080
- x: data[_i2].x,
3081
- y: data[_i2].y
3082
- };
3083
- var v2 = {
3084
- x: data[_i2 + 1].x,
3085
- y: data[_i2 + 1].y
3086
- };
3087
- var posDistance = verticesDistance(v1, v2);
3088
- sumDistance += posDistance;
3089
- if (_i2 === data.length - 2) finalDistance = sumDistance;
3090
- sumDistanceArray.push(sumDistance);
3091
- }
3092
- for (var _i3 = 0; _i3 < sumDistanceArray.length; _i3++) {
3093
- uvs_element_array.push(sumDistanceArray[_i3] / finalDistance);
3094
- }
3095
- var uvs = [];
3096
- var uvs_item = [];
3097
- for (var _i4 = 0; _i4 < uvs_element_array.length - 1; _i4++) {
3098
- uvs_item = [0, uvs_element_array[_i4], 1, uvs_element_array[_i4], 1, uvs_element_array[_i4 + 1], 1, uvs_element_array[_i4 + 1], 0, uvs_element_array[_i4 + 1], 0, uvs_element_array[_i4]];
3099
- uvs.push.apply(uvs, _toConsumableArray(uvs_item));
3100
- }
3101
- var all_uvs = [];
3102
- for (var _i5 = 0; _i5 < pointGroup.length; _i5++) {
3103
- all_uvs.push.apply(all_uvs, uvs);
3104
- }
3105
- geometry.setAttribute('uv', new Three.BufferAttribute(new Float32Array(all_uvs), 2));
3106
- geometry.computeVertexNormals();
3107
- var fbm3d = new Three.Mesh(geometry, material);
3108
- fbm3d.position.x = molding.pos.x;
3109
- fbm3d.position.z = -molding.pos.y;
3110
- fbm3d.position.y = molding.pos.z;
3111
- planData.plan.add(fbm3d);
3112
- fbm3d.name = child.name + molding.id + 'molding';
3113
- molding.meshes.push(fbm3d);
3114
- fbm3d.visible = true;
3115
- fbm3d.castShadow = true;
3116
- });
3117
- }
3118
- function deleteCTMesh(countertop, planData, layer) {
3119
- log('--deleteCTMesh', countertop);
3120
- if (countertop.items.length == 1) {
3121
- showItemCT(countertop.items[0], countertop, false, planData, layer);
3122
- } else {
3123
- var ct3d = countertop.ct3d;
3124
- if (ct3d) {
3125
- planData.plan.remove(ct3d);
3126
- disposeObject(ct3d);
3127
- }
3128
- }
3129
- }
3130
- export function deleteMGMesh(molding, planData) {
3131
- var mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3132
- // mode is 3D or elevation
3133
- molding.meshes.forEach(function (mesh) {
3134
- if (isElevationView(mode)) {
3135
- var _planData$plan$childr;
3136
- // when elevation mode, remove obj same as selected global molding_name in platnData.plan
3137
- (_planData$plan$childr = planData.plan.children) === null || _planData$plan$childr === void 0 || _planData$plan$childr.forEach(function (obj) {
3138
- var parent = obj.parent;
3139
- if (obj.name.match(mesh.name)) parent.remove(obj);
3140
- });
3141
- } else {
3142
- // when 3D mode
3143
- planData.plan.remove(mesh);
3144
- disposeObject(mesh);
3145
- }
3146
- });
3147
- molding.meshes = [];
3148
- }
3149
- function log() {
3150
- // console.log(...arguments);
3151
- }
3152
- function addCountertop(CTArray, addItem, planData, layer) {
3153
- log('addCountertop', _toConsumableArray(CTArray), addItem.id);
3154
- var tmp = planData;
3155
- tmp = tmp && tmp.catalog.getElement(addItem.type);
3156
- if (!tmp) tmp = planData.catalog.getElement(returnReplaceableDeepSearchType(addItem.type));
3157
- var long_name = tmp && tmp.long_name;
3158
- if (long_name.includes('Sink ')) return;
3159
- var newCT = createCTFromItem(addItem, planData.sceneGraph.unit, planData.catalog);
3160
- var oldCT = null;
3161
- var extCT = false;
3162
- var extCTIndex = -1;
3163
- var tryMergeCT = function tryMergeCT() {
3164
- extCTIndex = CTArray.findIndex(function (el) {
3165
- extCT = tryAdjacent(newCT, el);
3166
- return extCT != false;
3167
- });
3168
- return extCTIndex >= 0;
3169
- };
3170
- while (tryMergeCT()) {
3171
- oldCT = CTArray.splice(extCTIndex, 1)[0];
3172
- deleteCTMesh(newCT, planData, layer);
3173
- deleteCTMesh(oldCT, planData, layer);
3174
- newCT = extCT;
3175
- }
3176
- addCTMesh(newCT, planData, layer);
3177
- CTArray.push(newCT);
3178
- }
3179
- export function deleteCountertop(CTArray, delItem, planData, layer) {
3180
- if (delItem == undefined) {
3181
- return;
3182
- }
3183
- log('deleteCountertop', _toConsumableArray(CTArray), delItem.id);
3184
- var delCT = null;
3185
- var delItemIndex = -1;
3186
- var delCTIndex = CTArray.findIndex(function (el) {
3187
- delItemIndex = el.items.findIndex(function (el) {
3188
- return el.id == delItem.id;
3189
- });
3190
- return delItemIndex >= 0;
3191
- });
3192
- if (delCTIndex < 0) return;
3193
- delCT = CTArray.splice(delCTIndex, 1)[0];
3194
- if (delCT.items.length > 1) {
3195
- deleteCTMesh(delCT, planData, layer);
3196
- var ct1 = delCT.items.slice(0, delItemIndex);
3197
- var ct2 = delCT.items.slice(delItemIndex + 1);
3198
- [ct1, ct2].forEach(function (cts) {
3199
- if (cts.length == 0) return;
3200
- var newCT = createCTFromItems(cts, planData.sceneGraph.unit, planData.catalog);
3201
- CTArray.push(newCT);
3202
- addCTMesh(newCT, planData, layer);
3203
- });
3204
- }
3205
- }
3206
- export function deleteAllMolding(MGArray, delItem, planData, oldSceneLayer, newSceneLayer) {
3207
- var tempMGArray = _toConsumableArray(MGArray);
3208
- if (isEmpty(delItem)) {
3209
- return tempMGArray;
3210
- }
3211
-
3212
- // remove the MGs which includes delItem
3213
- tempMGArray = tempMGArray.filter(function (mg) {
3214
- if (mg.items.some(function (it) {
3215
- return it.id === delItem.id;
3216
- })) {
3217
- deleteMGMesh(mg, planData, null);
3218
- return false;
3219
- } else return true;
3220
- });
3221
- if (newSceneLayer !== null) {
3222
- // find the snapped items with delItem
3223
- var snappedItems = [];
3224
- oldSceneLayer.items.toArray().forEach(function (oItem) {
3225
- if (oItem.category === 'cabinet' && oItem.id !== delItem.id && MoldingUtils.isItemSnappedItem(delItem, oItem)) {
3226
- snappedItems.push(oItem);
3227
- }
3228
- });
3229
-
3230
- // update molding group array with snapped items in the new scene layer
3231
- for (var i = 0; i < snappedItems.length; i++) {
3232
- tempMGArray = updateMoldingGroupArray(tempMGArray, snappedItems[i], planData, newSceneLayer, null, null, 0);
3233
- }
3234
- }
3235
- return tempMGArray;
3236
- }
3237
- export function addMolding(MGArray, addItem, planData, layer, itemActions, mode) {
3238
- if (addItem.selected && [MODE_DRAGGING_ITEM_3D, MODE_ROTATING_ITEM_3D].includes(mode)) return false;
3239
-
3240
- // If the item is not available for current doorStyle
3241
- if (showYelloBox(addItem))
3242
- // Do not add molding to that item
3243
- return MGArray;
3244
-
3245
- // if (
3246
- // !(
3247
- // (addItem.layoutpos === BASE_CABINET_LAYOUTPOS &&
3248
- // !GeometryUtils.isSnappedLine(
3249
- // MoldingUtils.getItemRect(addItem),
3250
- // GeometryUtils.buildRectFromLines(
3251
- // layer,
3252
- // GeometryUtils.getAllLines(layer)
3253
- // )
3254
- // )) ||
3255
- // ((addItem.layoutpos === WALL_CABINET_LAYOUTPOS ||
3256
- // addItem.layoutpos === TALL_CABINET_LAYOUTPOS) &&
3257
- // GeometryUtils.isSnappedLine(
3258
- // MoldingUtils.getItemRect(addItem),
3259
- // GeometryUtils.buildRectFromLines(
3260
- // layer,
3261
- // GeometryUtils.getAllLines(layer)
3262
- // )
3263
- // ))
3264
- // )
3265
- // )
3266
- // return false;
3267
-
3268
- // update the molding group array.
3269
- var temp_MGArray = updateMoldingGroupArray(MGArray, addItem, planData, layer, itemActions, mode, 0);
3270
- temp_MGArray.forEach(function (mg) {
3271
- var moldingMesh = mg.meshes[0];
3272
- if (isElevationView(mode)) {
3273
- if (!isEmpty(moldingMesh)) {
3274
- replaceMeshesWithLineSegments(moldingMesh);
3275
- }
3276
- }
3277
- });
3278
- return temp_MGArray;
3279
- }
3280
- export function updateMoldingGroupArray(MGArray, selItem, planData, layer) {
3281
- var itemActions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
3282
- var mode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
3283
- var cnt = arguments.length > 6 ? arguments[6] : undefined;
3284
- try {
3285
- cnt++;
3286
- if (cnt > 100) return MGArray;
3287
- var temp_MGArray = _toConsumableArray(MGArray);
3288
- if (isEmpty(selItem)) return temp_MGArray;
3289
- var isEnableMolding = MoldingUtils.isEnableItemForMolding(layer, selItem);
3290
- // Make a items group with selItem to create the new MG(molding group) array of selItem
3291
- var itemsForGroup = [selItem];
3292
- var i = 0;
3293
- while (i < itemsForGroup.length) {
3294
- layer.items.toArray().forEach(function (curItem) {
3295
- if (!itemsForGroup.some(function (it) {
3296
- return it.id === curItem.id;
3297
- }) && curItem.category === 'cabinet' && MoldingUtils.isSameMoldingLayoutpos(curItem, itemsForGroup[i]) && MoldingUtils.isItemSnappedItem(itemsForGroup[i], curItem)) {
3298
- itemsForGroup.push(curItem);
3299
- }
3300
- });
3301
- i++;
3302
- }
3303
-
3304
- // Create the new MG(molding group) array of selItem
3305
- var new_MGArray = MoldingUtils.getAllMoldingGroups(layer, itemsForGroup);
3306
-
3307
- // get molding settings of update molding from adjoined item's molding
3308
- var changeMoldings = [];
3309
- new_MGArray.forEach(function (mg) {
3310
- if (mg.items.some(function (it) {
3311
- return it.id === selItem.id;
3312
- }) && mg.items.length > 1) {
3313
- var destItem = mg.items.find(function (it) {
3314
- return it.id !== selItem.id;
3315
- });
3316
- var destMolding = destItem.molding.find(function (md) {
3317
- return md.location_type === mg.location_type;
3318
- });
3319
-
3320
- // if current item has not destination molding then set it to the current molding
3321
- if (!isEmpty(destMolding) && !selItem.molding.some(function (md) {
3322
- return md.location_type === destMolding.location_type;
3323
- })) {
3324
- // only update with the same height cabinet or update the bottom molding setting
3325
- // itemActions.setMolding(destMoldings[i], false);
3326
- changeMoldings.push(destMolding);
3327
- } else if (isEmpty(destMolding) && selItem.molding.some(function (md) {
3328
- return md.location_type === mg.location_type;
3329
- })) {
3330
- // if current item has more molding than adjoined then remove theses moldings
3331
- // itemActions.setMolding(selItem.molding[i], false);
3332
- changeMoldings.push(selItem.molding.find(function (md) {
3333
- return md.location_type === mg.location_type;
3334
- }));
3335
- }
3336
- }
3337
- });
3338
- var regenMGItemList = [];
3339
- // An old MG and a new MG include a same item && The location_type of Two MGs are same
3340
- // Then replace the old MG with the new MG
3341
- temp_MGArray = temp_MGArray.filter(function (oldMG) {
3342
- var filteredNewMGList = new_MGArray.filter(function (mg) {
3343
- return mg.location_type === oldMG.location_type;
3344
- });
3345
- if (isEmpty(filteredNewMGList)) {
3346
- return true;
3347
- }
3348
- var _loop3 = function _loop3() {
3349
- var newMG = filteredNewMGList[k];
3350
- if (oldMG.items.some(function (it) {
3351
- return it.id === selItem.id;
3352
- })) {
3353
- // if current action is a seprating item from group, then have to regenerate the MGs of old snapped items
3354
- if (oldMG.items.filter(function (oIt) {
3355
- return !newMG.items.some(function (nIt) {
3356
- return nIt.id === oIt.id;
3357
- });
3358
- }).length > 0) {
3359
- oldMG.items.forEach(function (oIt) {
3360
- if (oIt.id !== selItem.id && !regenMGItemList.some(function (rIt) {
3361
- return rIt.id === oIt.id;
3362
- })) regenMGItemList.push(oIt);
3363
- });
3364
- }
3365
- }
3366
- // remove the old MG meshes
3367
- for (var _i6 = 0; _i6 < oldMG.items.length; _i6++) {
3368
- var oItem = oldMG.items[_i6];
3369
- for (var j = 0; j < newMG.items.length; j++) {
3370
- var nItem = newMG.items[j];
3371
- if (oItem.id === nItem.id) {
3372
- deleteMGMesh(oldMG, planData, mode);
3373
- // if (oldMG.items.length > 1) {
3374
- // // separating item from group
3375
- // oldMG.items.splice(i, 1);
3376
- // // update the old molding group info
3377
- // const mIdx = oldMG.items[0].molding.findIndex(
3378
- // m => m.location_type == oldMG.location_type
3379
- // );
3380
- // if (mIdx >= 0) {
3381
- // let molding = oldMG.items[0].molding[mIdx];
3382
- // oldMG = MoldingUtils.createMonldingGroup(
3383
- // oldMG,
3384
- // layer,
3385
- // molding,
3386
- // planData.catalog
3387
- // );
3388
- // addMGMesh(oldMG, planData, layer);
3389
- // }
3390
- // return true;
3391
- // }
3392
- return {
3393
- v: false
3394
- };
3395
- }
3396
- }
3397
- }
3398
- },
3399
- _ret;
3400
- for (var k = 0; k < filteredNewMGList.length; k++) {
3401
- _ret = _loop3();
3402
- if (_ret) return _ret.v;
3403
- }
3404
- return true;
3405
- });
3406
- if (changeMoldings.length === 0 && isEnableMolding) {
3407
- // refresh mesh of the updating molding groups
3408
- new_MGArray.forEach(function (mg, index) {
3409
- if (mg.items[0].molding.some(function (mol) {
3410
- return mol.location_type === mg.location_type;
3411
- })) {
3412
- var molding = mg.items[0].molding.filter(function (mol) {
3413
- return mol.location_type === mg.location_type;
3414
- })[0];
3415
- if (mg.molding === null || mg.molding.itemID !== mol.itemID || mg.lines === null || mg.points === null) {
3416
- if (mg.molding !== null && mg.molding.itemID !== molding.itemID) {
3417
- deleteMGMesh(mg, planData, mode);
3418
- }
3419
- mg = MoldingUtils.createMonldingGroup(mg, layer, molding, planData.catalog);
3420
- }
3421
- if (!mg.meshes.length) {
3422
- addMGMesh(mg, planData, layer);
3423
- }
3424
- } else {
3425
- deleteMGMesh(mg, planData, mode);
3426
- }
3427
- });
3428
- }
3429
- new_MGArray.forEach(function (mg) {
3430
- return temp_MGArray.push(mg);
3431
- });
3432
- regenMGItemList.forEach(function (it) {
3433
- temp_MGArray = updateMoldingGroupArray(temp_MGArray, it, planData, layer, itemActions, mode, cnt);
3434
- });
3435
- if (changeMoldings.length > 0 && itemActions !== null) {
3436
- setTimeout(function () {
3437
- changeMoldings.forEach(function (chMolding) {
3438
- itemActions.setMolding(chMolding, false);
3439
- });
3440
- }, 200);
3441
- }
3442
- return temp_MGArray;
3443
- } catch (e) {
3444
- console.log('update molding catched :', e);
3445
- return MGArray;
3446
- }
3447
- }
3448
- export function removeSelItemMesh(MGArray, selItem, planData, mode) {
3449
- if (selItem) {
3450
- if (!selItem.selected) {
3451
- return;
3452
- }
3453
- MGArray.forEach(function (mg) {
3454
- if (mg.items.some(function (it) {
3455
- return it.id === selItem.id;
3456
- })) deleteMGMesh(mg, planData, mode);
3457
- });
3458
- }
3459
- }
3460
-
3461
- /**
3462
- * Flip door handle
3463
- * @param item Scene state item ( redux )
3464
- * @param item3D Mesh
3465
- * @param {Boolean} flip Determines handle position.
3466
- * @note When `flip` is set
3467
- *
3468
- * `true`
3469
- * * Left side door - use left handle (LL)
3470
- * * Right side door - use right handle (RR)
3471
- *
3472
- * `false`
3473
- * * Left side door - use right handle (LR)
3474
- * * Right side door - use left handle (RL)
3475
- *
3476
- * And one-door-cabinet is the same case with the left door of two-door-cabinet
3477
- */
3478
- export function updateDoorHandleMesh(_, item3D, flip) {
3479
- if (!item3D) {
3480
- console.error('Item mesh is undefined.');
3481
- return;
3482
- }
3483
-
3484
- /**
3485
- * Mesh whose name pass this regexp is a place holder for a door
3486
- * which is the parent or grand parent of a door mesh and its handles
3487
- */
3488
- var doorReg = /ph_.*[^(drawer)]_door(?:_(L|R))?(?:_[1-9])?$/;
3489
- var doorHandleReg = /ph_.*_door_.*_handle_(L|R)?(_[1-9])?/;
3490
- item3D.traverse(function (child) {
3491
- /**
3492
- * Hold the name of the place holder for door and its position
3493
- * @type {[string,"L"|"R"|undefined]}
3494
- */
3495
- var doorRegResult = doorReg.exec(child.name);
3496
- if (doorRegResult) {
3497
- // `child` is place holder for door mesh, and also grand parent of on[0]e
3498
- var phDoor = child.children[0];
3499
- if (!phDoor) {
3500
- return console.error('Group is no valid.');
3501
- }
3502
- var doorHandle = null;
3503
- var phRight = null;
3504
- var phLeft = null;
3505
-
3506
- // Find door_handle, ph_left, ph_right 3D item
3507
- phDoor.traverse(function (childOfDoor) {
3508
- /**
3509
- * @type {[string, "L"|"R"]}
3510
- */
3511
- var result = doorHandleReg.exec(childOfDoor.name);
3512
- if (result !== null) {
3513
- // `childOfDoor` is place holder for door handle
3514
-
3515
- switch (result[1]) {
3516
- case 'L':
3517
- phLeft = childOfDoor;
3518
- break;
3519
- case 'R':
3520
- phRight = childOfDoor;
3521
- break;
3522
- default:
3523
- console.error('Place holder type should be L or R.');
3524
- return;
3525
- }
3526
- if (childOfDoor.children.length !== 0) {
3527
- // It has a door handle
3528
- doorHandle = childOfDoor.children[0];
3529
- }
3530
- }
3531
- });
3532
-
3533
- // Change door handle position
3534
- if (doorHandle && phLeft && phRight) {
3535
- // Remove handles for re-addition
3536
- if (phLeft.children.length) {
3537
- phLeft.remove(doorHandle);
3538
- }
3539
- if (phRight.children.length) {
3540
- phRight.remove(doorHandle);
3541
- }
3542
- switch (doorRegResult[1]) {
3543
- case undefined: // Single door cabinet
3544
- case 'R':
3545
- // Right side door
3546
- (flip ? phRight : phLeft).add(doorHandle);
3547
- break;
3548
- case 'L':
3549
- // Left side door
3550
- (flip ? phLeft : phRight).add(doorHandle);
3551
- break;
3552
- }
3553
- } else {
3554
- console.error('door_handle or ph_left or ph_right is null.');
3555
- }
3556
- }
3557
- });
3558
- }
3559
- export function addWarningBox(itemId, altitude, planData) {
3560
- deleteSpecifiedMeshObjects('WarningBox' + itemId);
3561
- var item3D = planData.sceneGraph.layers[planData.sceneData.selectedLayer].items[itemId];
3562
- if (item3D == undefined) return;
3563
- var altitudeLength = convert(altitude).from('in').to('cm');
3564
- var sBounding = item3D.children[0].userData;
3565
- var width = sBounding.max.x - sBounding.min.x;
3566
- var height = sBounding.max.y - sBounding.min.y;
3567
- var depth = sBounding.max.z - sBounding.min.z;
3568
- var warnBoxGeom = new Three.BoxGeometry(width, height, depth);
3569
- var warnBoxObj = new Three.Mesh(warnBoxGeom, new Three.MeshBasicMaterial({
3570
- color: 0xff2200,
3571
- opacity: 0.8,
3572
- transparent: true,
3573
- blending: Three.MultiplyBlending
3574
- }));
3575
- var box = new Three.BoxHelper(warnBoxObj, 0x000000);
3576
- box.material.linewidth = 2;
3577
- box.material.depthTest = false;
3578
- box.renderOrder = 200;
3579
- warnBoxObj.add(box);
3580
- warnBoxObj.position.set(item3D.position.x, altitudeLength + item3D.position.y + height / 2, item3D.position.z);
3581
- warnBoxObj.rotation.set(item3D.rotation.x, item3D.rotation.y, item3D.rotation.z);
3582
- warnBoxObj.name = 'WarningBox' + itemId;
3583
- // planData.plan.add(warnBoxObj);
3584
- }
3585
- export function checkCabinetOverlap(itemPos, itemRect, holeItems, planData) {
3586
- if (holeItems.length) {
3587
- var depth = itemRect.size.depth;
3588
- var i;
3589
- for (i = 0; i < holeItems.length; i++) {
3590
- var hole = holeItems[i];
3591
- var holeAlti = hole.altitude;
3592
- if (holeAlti >= depth) continue;
3593
- if (Math.abs(Math.sin(itemRect.rotRad)) === 1) {
3594
- if (itemPos.y + itemRect.size.width / 2 >= hole.y - hole.width / 2 && itemPos.y - itemRect.size.width / 2 <= hole.y + hole.width / 2 && (itemRect.rotRad == 0 || itemRect.rotRad == -Math.PI / 2 ? itemPos.x <= hole.x && itemPos.x + itemRect.size.height >= hole.x : itemPos.x >= hole.x && itemPos.x - itemRect.size.height <= hole.x)) break;
3595
- } else {
3596
- if (itemPos.x + itemRect.size.width / 2 >= hole.x - hole.width / 2 && itemPos.x - itemRect.size.width / 2 <= hole.x + hole.width / 2 && (itemRect.rotRad == 0 || itemRect.rotRad == -Math.PI / 2 ? itemPos.y <= hole.y && itemPos.y + itemRect.size.height >= hole.y : itemPos.y >= hole.y && itemPos.y - itemRect.size.height <= hole.y)) break;
3597
- }
3598
- }
3599
- if (i != holeItems.length) {
3600
- var altitude = itemRect.itemInfo.properties.get('altitude').get('_length');
3601
- var altitudeUnit = itemRect.itemInfo.properties.get('altitude').get('_unit') || 'cm';
3602
- altitude = convert(altitude).from(altitudeUnit).to('cm');
3603
- addWarningBox(itemRect.itemInfo.id, altitude, planData);
3604
- }
3605
- }
3606
- }
3607
- //# sourceMappingURL=scene-creator.js.map