kitchen-simulator 5.0.0-test.3 → 5.0.0-test.5

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 (1098) hide show
  1. package/es/KitchenConfigurator.js +1 -1
  2. package/es/KitchenConfigurator.js.map +1 -1
  3. package/package.json +8 -13
  4. package/lib/@history.js +0 -11
  5. package/lib/@history.js.map +0 -1
  6. package/lib/AppContext.js +0 -11
  7. package/lib/AppContext.js.map +0 -1
  8. package/lib/KitchenConfigurator.js +0 -1353
  9. package/lib/KitchenConfigurator.js.map +0 -1
  10. package/lib/KitchenConfiguratorApp.js +0 -539
  11. package/lib/KitchenConfiguratorApp.js.map +0 -1
  12. package/lib/actions/area-actions.js +0 -22
  13. package/lib/actions/area-actions.js.map +0 -1
  14. package/lib/actions/export.js +0 -44
  15. package/lib/actions/export.js.map +0 -1
  16. package/lib/actions/groups-actions.js +0 -108
  17. package/lib/actions/groups-actions.js.map +0 -1
  18. package/lib/actions/holes-actions.js +0 -141
  19. package/lib/actions/holes-actions.js.map +0 -1
  20. package/lib/actions/items-actions.js +0 -365
  21. package/lib/actions/items-actions.js.map +0 -1
  22. package/lib/actions/lines-actions.js +0 -98
  23. package/lib/actions/lines-actions.js.map +0 -1
  24. package/lib/actions/project-actions.js +0 -333
  25. package/lib/actions/project-actions.js.map +0 -1
  26. package/lib/actions/scene-actions.js +0 -44
  27. package/lib/actions/scene-actions.js.map +0 -1
  28. package/lib/actions/user-actions.js +0 -69
  29. package/lib/actions/user-actions.js.map +0 -1
  30. package/lib/actions/vertices-actions.js +0 -36
  31. package/lib/actions/vertices-actions.js.map +0 -1
  32. package/lib/actions/viewer2d-actions.js +0 -74
  33. package/lib/actions/viewer2d-actions.js.map +0 -1
  34. package/lib/actions/viewer3d-actions.js +0 -33
  35. package/lib/actions/viewer3d-actions.js.map +0 -1
  36. package/lib/catalog/areas/area/planner-element.js +0 -47
  37. package/lib/catalog/areas/area/planner-element.js.map +0 -1
  38. package/lib/catalog/catalog.js +0 -283
  39. package/lib/catalog/catalog.js.map +0 -1
  40. package/lib/catalog/factories/area-factory-3d.js +0 -192
  41. package/lib/catalog/factories/area-factory-3d.js.map +0 -1
  42. package/lib/catalog/factories/area-factory.js +0 -90
  43. package/lib/catalog/factories/area-factory.js.map +0 -1
  44. package/lib/catalog/factories/export.js +0 -26
  45. package/lib/catalog/factories/export.js.map +0 -1
  46. package/lib/catalog/factories/wall-factory-3d.js +0 -213
  47. package/lib/catalog/factories/wall-factory-3d.js.map +0 -1
  48. package/lib/catalog/factories/wall-factory.js +0 -279
  49. package/lib/catalog/factories/wall-factory.js.map +0 -1
  50. package/lib/catalog/holes/door-closet/planner-element.js +0 -232
  51. package/lib/catalog/holes/door-closet/planner-element.js.map +0 -1
  52. package/lib/catalog/holes/door-double/planner-element.js +0 -325
  53. package/lib/catalog/holes/door-double/planner-element.js.map +0 -1
  54. package/lib/catalog/holes/door-exterior/planner-element.js +0 -225
  55. package/lib/catalog/holes/door-exterior/planner-element.js.map +0 -1
  56. package/lib/catalog/holes/door-interior/planner-element.js +0 -237
  57. package/lib/catalog/holes/door-interior/planner-element.js.map +0 -1
  58. package/lib/catalog/holes/door-panic/planner-element.js +0 -513
  59. package/lib/catalog/holes/door-panic/planner-element.js.map +0 -1
  60. package/lib/catalog/holes/door-panic-double/planner-element.js +0 -473
  61. package/lib/catalog/holes/door-panic-double/planner-element.js.map +0 -1
  62. package/lib/catalog/holes/door-sliding/planner-element.js +0 -235
  63. package/lib/catalog/holes/door-sliding/planner-element.js.map +0 -1
  64. package/lib/catalog/holes/doorway-framed/planner-element.js +0 -155
  65. package/lib/catalog/holes/doorway-framed/planner-element.js.map +0 -1
  66. package/lib/catalog/holes/doorway-frameless/planner-element.js +0 -114
  67. package/lib/catalog/holes/doorway-frameless/planner-element.js.map +0 -1
  68. package/lib/catalog/holes/window-clear/planner-element.js +0 -176
  69. package/lib/catalog/holes/window-clear/planner-element.js.map +0 -1
  70. package/lib/catalog/holes/window-cross/planner-element.js +0 -175
  71. package/lib/catalog/holes/window-cross/planner-element.js.map +0 -1
  72. package/lib/catalog/holes/window-double-hung/planner-element.js +0 -313
  73. package/lib/catalog/holes/window-double-hung/planner-element.js.map +0 -1
  74. package/lib/catalog/holes/window-vertical/planner-element.js +0 -286
  75. package/lib/catalog/holes/window-vertical/planner-element.js.map +0 -1
  76. package/lib/catalog/lines/wall/planner-element.js +0 -77
  77. package/lib/catalog/lines/wall/planner-element.js.map +0 -1
  78. package/lib/catalog/molding/molding-dcm/planner-element.js +0 -39
  79. package/lib/catalog/molding/molding-dcm/planner-element.js.map +0 -1
  80. package/lib/catalog/molding/molding-fbm/planner-element.js +0 -39
  81. package/lib/catalog/molding/molding-fbm/planner-element.js.map +0 -1
  82. package/lib/catalog/molding/molding-lrm/planner-element.js +0 -39
  83. package/lib/catalog/molding/molding-lrm/planner-element.js.map +0 -1
  84. package/lib/catalog/properties/export.js +0 -82
  85. package/lib/catalog/properties/export.js.map +0 -1
  86. package/lib/catalog/properties/property-checkbox.js +0 -79
  87. package/lib/catalog/properties/property-checkbox.js.map +0 -1
  88. package/lib/catalog/properties/property-color.js +0 -47
  89. package/lib/catalog/properties/property-color.js.map +0 -1
  90. package/lib/catalog/properties/property-enum.js +0 -63
  91. package/lib/catalog/properties/property-enum.js.map +0 -1
  92. package/lib/catalog/properties/property-hidden.js +0 -27
  93. package/lib/catalog/properties/property-hidden.js.map +0 -1
  94. package/lib/catalog/properties/property-lenght-measure.js +0 -109
  95. package/lib/catalog/properties/property-lenght-measure.js.map +0 -1
  96. package/lib/catalog/properties/property-length-measure.js +0 -93
  97. package/lib/catalog/properties/property-length-measure.js.map +0 -1
  98. package/lib/catalog/properties/property-length-measure_hole.js +0 -109
  99. package/lib/catalog/properties/property-length-measure_hole.js.map +0 -1
  100. package/lib/catalog/properties/property-number.js +0 -56
  101. package/lib/catalog/properties/property-number.js.map +0 -1
  102. package/lib/catalog/properties/property-read-only.js +0 -34
  103. package/lib/catalog/properties/property-read-only.js.map +0 -1
  104. package/lib/catalog/properties/property-string.js +0 -56
  105. package/lib/catalog/properties/property-string.js.map +0 -1
  106. package/lib/catalog/properties/property-toggle.js +0 -47
  107. package/lib/catalog/properties/property-toggle.js.map +0 -1
  108. package/lib/catalog/properties/shared-property-style.js +0 -21
  109. package/lib/catalog/properties/shared-property-style.js.map +0 -1
  110. package/lib/catalog/utils/FuseUtils.js +0 -89
  111. package/lib/catalog/utils/FuseUtils.js.map +0 -1
  112. package/lib/catalog/utils/exporter.js +0 -156
  113. package/lib/catalog/utils/exporter.js.map +0 -1
  114. package/lib/catalog/utils/geom-utils.js +0 -206
  115. package/lib/catalog/utils/geom-utils.js.map +0 -1
  116. package/lib/catalog/utils/item-loader.js +0 -1534
  117. package/lib/catalog/utils/item-loader.js.map +0 -1
  118. package/lib/catalog/utils/load-obj.js +0 -100
  119. package/lib/catalog/utils/load-obj.js.map +0 -1
  120. package/lib/catalog/utils/mtl-loader.js +0 -360
  121. package/lib/catalog/utils/mtl-loader.js.map +0 -1
  122. package/lib/catalog/utils/obj-loader.js +0 -479
  123. package/lib/catalog/utils/obj-loader.js.map +0 -1
  124. package/lib/class/FuseUtils.js +0 -89
  125. package/lib/class/FuseUtils.js.map +0 -1
  126. package/lib/class/area.js +0 -151
  127. package/lib/class/area.js.map +0 -1
  128. package/lib/class/export.js +0 -97
  129. package/lib/class/export.js.map +0 -1
  130. package/lib/class/group.js +0 -446
  131. package/lib/class/group.js.map +0 -1
  132. package/lib/class/guide.js +0 -68
  133. package/lib/class/guide.js.map +0 -1
  134. package/lib/class/hole.js +0 -935
  135. package/lib/class/hole.js.map +0 -1
  136. package/lib/class/item.js +0 -1894
  137. package/lib/class/item.js.map +0 -1
  138. package/lib/class/layer.js +0 -673
  139. package/lib/class/layer.js.map +0 -1
  140. package/lib/class/line.js +0 -1296
  141. package/lib/class/line.js.map +0 -1
  142. package/lib/class/project.js +0 -829
  143. package/lib/class/project.js.map +0 -1
  144. package/lib/class/vertex.js +0 -272
  145. package/lib/class/vertex.js.map +0 -1
  146. package/lib/components/atoms/Snackbar/index.js +0 -57
  147. package/lib/components/atoms/Snackbar/index.js.map +0 -1
  148. package/lib/components/atoms/radio-button/index.js +0 -33
  149. package/lib/components/atoms/radio-button/index.js.map +0 -1
  150. package/lib/components/atoms/radio-button/styles.js +0 -12
  151. package/lib/components/atoms/radio-button/styles.js.map +0 -1
  152. package/lib/components/button/MainButton.js +0 -98
  153. package/lib/components/button/MainButton.js.map +0 -1
  154. package/lib/components/button/ToggleMeasureButton.js +0 -63
  155. package/lib/components/button/ToggleMeasureButton.js.map +0 -1
  156. package/lib/components/catalog-view/catalog-breadcrumb.js +0 -61
  157. package/lib/components/catalog-view/catalog-breadcrumb.js.map +0 -1
  158. package/lib/components/catalog-view/catalog-item.js +0 -233
  159. package/lib/components/catalog-view/catalog-item.js.map +0 -1
  160. package/lib/components/catalog-view/catalog-list.js +0 -189
  161. package/lib/components/catalog-view/catalog-list.js.map +0 -1
  162. package/lib/components/catalog-view/catalog-page-item.js +0 -137
  163. package/lib/components/catalog-view/catalog-page-item.js.map +0 -1
  164. package/lib/components/catalog-view/catalog-turn-back-page-item.js +0 -113
  165. package/lib/components/catalog-view/catalog-turn-back-page-item.js.map +0 -1
  166. package/lib/components/configurator/custom-configurator.js +0 -101
  167. package/lib/components/configurator/custom-configurator.js.map +0 -1
  168. package/lib/components/configurator/project-configurator.js +0 -138
  169. package/lib/components/configurator/project-configurator.js.map +0 -1
  170. package/lib/components/content.js +0 -132
  171. package/lib/components/content.js.map +0 -1
  172. package/lib/components/export.js +0 -90
  173. package/lib/components/export.js.map +0 -1
  174. package/lib/components/firstsetting/button/styles.js +0 -34
  175. package/lib/components/firstsetting/button/styles.js.map +0 -1
  176. package/lib/components/firstsetting/export.js +0 -16
  177. package/lib/components/firstsetting/export.js.map +0 -1
  178. package/lib/components/firstsetting/firstsetting-content-button.js +0 -224
  179. package/lib/components/firstsetting/firstsetting-content-button.js.map +0 -1
  180. package/lib/components/firstsetting/firstsetting-toggle-button.js +0 -133
  181. package/lib/components/firstsetting/firstsetting-toggle-button.js.map +0 -1
  182. package/lib/components/firstsetting/firstsetting.js +0 -633
  183. package/lib/components/firstsetting/firstsetting.js.map +0 -1
  184. package/lib/components/footerbar/button/ControlButton.js +0 -79
  185. package/lib/components/footerbar/button/ControlButton.js.map +0 -1
  186. package/lib/components/footerbar/button/DirectionButton.js +0 -76
  187. package/lib/components/footerbar/button/DirectionButton.js.map +0 -1
  188. package/lib/components/footerbar/button/DirectionPanSpinButton.js +0 -57
  189. package/lib/components/footerbar/button/DirectionPanSpinButton.js.map +0 -1
  190. package/lib/components/footerbar/button/ToggleButton.js +0 -83
  191. package/lib/components/footerbar/button/ToggleButton.js.map +0 -1
  192. package/lib/components/footerbar/button/ToggleConvertButton.js +0 -80
  193. package/lib/components/footerbar/button/ToggleConvertButton.js.map +0 -1
  194. package/lib/components/footerbar/button/ToggleMeasureButton.js +0 -59
  195. package/lib/components/footerbar/button/ToggleMeasureButton.js.map +0 -1
  196. package/lib/components/footerbar/button/styles.js +0 -29
  197. package/lib/components/footerbar/button/styles.js.map +0 -1
  198. package/lib/components/footerbar/export.js +0 -16
  199. package/lib/components/footerbar/export.js.map +0 -1
  200. package/lib/components/footerbar/footer-content-button.js +0 -224
  201. package/lib/components/footerbar/footer-content-button.js.map +0 -1
  202. package/lib/components/footerbar/footer-toggle-button.js +0 -133
  203. package/lib/components/footerbar/footer-toggle-button.js.map +0 -1
  204. package/lib/components/footerbar/footerbar.js +0 -808
  205. package/lib/components/footerbar/footerbar.js.map +0 -1
  206. package/lib/components/footerbar/styles.js +0 -41
  207. package/lib/components/footerbar/styles.js.map +0 -1
  208. package/lib/components/header/button/MenuButton.js +0 -77
  209. package/lib/components/header/button/MenuButton.js.map +0 -1
  210. package/lib/components/header/button/SaveButton.js +0 -57
  211. package/lib/components/header/button/SaveButton.js.map +0 -1
  212. package/lib/components/header/button/styles.js +0 -68
  213. package/lib/components/header/button/styles.js.map +0 -1
  214. package/lib/components/header/export.js +0 -12
  215. package/lib/components/header/export.js.map +0 -1
  216. package/lib/components/header/header.js +0 -556
  217. package/lib/components/header/header.js.map +0 -1
  218. package/lib/components/header/styles.js +0 -47
  219. package/lib/components/header/styles.js.map +0 -1
  220. package/lib/components/login/Login.js +0 -94
  221. package/lib/components/login/Login.js.map +0 -1
  222. package/lib/components/login/LoginForm/index.js +0 -140
  223. package/lib/components/login/LoginForm/index.js.map +0 -1
  224. package/lib/components/login/Register.js +0 -104
  225. package/lib/components/login/Register.js.map +0 -1
  226. package/lib/components/login/RegisterForm/index.js +0 -237
  227. package/lib/components/login/RegisterForm/index.js.map +0 -1
  228. package/lib/components/login/jwtService.js +0 -239
  229. package/lib/components/login/jwtService.js.map +0 -1
  230. package/lib/components/molecules/slider/index.js +0 -22
  231. package/lib/components/molecules/slider/index.js.map +0 -1
  232. package/lib/components/molecules/slider/styles.js +0 -2
  233. package/lib/components/molecules/slider/styles.js.map +0 -1
  234. package/lib/components/myprojects/export.js +0 -12
  235. package/lib/components/myprojects/export.js.map +0 -1
  236. package/lib/components/myprojects/index.js +0 -453
  237. package/lib/components/myprojects/index.js.map +0 -1
  238. package/lib/components/myprojects/styles.js +0 -31
  239. package/lib/components/myprojects/styles.js.map +0 -1
  240. package/lib/components/sidebar/custom-accordion.js +0 -45
  241. package/lib/components/sidebar/custom-accordion.js.map +0 -1
  242. package/lib/components/sidebar/export.js +0 -50
  243. package/lib/components/sidebar/export.js.map +0 -1
  244. package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js +0 -74
  245. package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js.map +0 -1
  246. package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js +0 -124
  247. package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js.map +0 -1
  248. package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js +0 -135
  249. package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js.map +0 -1
  250. package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js +0 -260
  251. package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js.map +0 -1
  252. package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js +0 -84
  253. package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js.map +0 -1
  254. package/lib/components/sidebar/panel-element-editor/element-editor.js +0 -884
  255. package/lib/components/sidebar/panel-element-editor/element-editor.js.map +0 -1
  256. package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js +0 -2
  257. package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js.map +0 -1
  258. package/lib/components/sidebar/panel-element-editor/panel-element-editor.js +0 -56
  259. package/lib/components/sidebar/panel-element-editor/panel-element-editor.js.map +0 -1
  260. package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js +0 -125
  261. package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js.map +0 -1
  262. package/lib/components/sidebar/panel-group-editor.js +0 -218
  263. package/lib/components/sidebar/panel-group-editor.js.map +0 -1
  264. package/lib/components/sidebar/panel-groups.js +0 -274
  265. package/lib/components/sidebar/panel-groups.js.map +0 -1
  266. package/lib/components/sidebar/panel-guides.js +0 -192
  267. package/lib/components/sidebar/panel-guides.js.map +0 -1
  268. package/lib/components/sidebar/panel-layer-elements.js +0 -258
  269. package/lib/components/sidebar/panel-layer-elements.js.map +0 -1
  270. package/lib/components/sidebar/panel-layers.js +0 -347
  271. package/lib/components/sidebar/panel-layers.js.map +0 -1
  272. package/lib/components/sidebar/panel.js +0 -110
  273. package/lib/components/sidebar/panel.js.map +0 -1
  274. package/lib/components/sidebar/sidebar.js +0 -117
  275. package/lib/components/sidebar/sidebar.js.map +0 -1
  276. package/lib/components/sidebar/toolbar-panel.js +0 -171
  277. package/lib/components/sidebar/toolbar-panel.js.map +0 -1
  278. package/lib/components/sign/export.js +0 -18
  279. package/lib/components/sign/export.js.map +0 -1
  280. package/lib/components/sign/main/index.js +0 -567
  281. package/lib/components/sign/main/index.js.map +0 -1
  282. package/lib/components/sign/main/styles.js +0 -27
  283. package/lib/components/sign/main/styles.js.map +0 -1
  284. package/lib/components/style/button.js +0 -121
  285. package/lib/components/style/button.js.map +0 -1
  286. package/lib/components/style/cancel-button.js +0 -30
  287. package/lib/components/style/cancel-button.js.map +0 -1
  288. package/lib/components/style/content-container.js +0 -41
  289. package/lib/components/style/content-container.js.map +0 -1
  290. package/lib/components/style/content-title.js +0 -38
  291. package/lib/components/style/content-title.js.map +0 -1
  292. package/lib/components/style/delete-button.js +0 -35
  293. package/lib/components/style/delete-button.js.map +0 -1
  294. package/lib/components/style/export.js +0 -122
  295. package/lib/components/style/export.js.map +0 -1
  296. package/lib/components/style/form-block.js +0 -32
  297. package/lib/components/style/form-block.js.map +0 -1
  298. package/lib/components/style/form-color-input.js +0 -35
  299. package/lib/components/style/form-color-input.js.map +0 -1
  300. package/lib/components/style/form-label.js +0 -34
  301. package/lib/components/style/form-label.js.map +0 -1
  302. package/lib/components/style/form-number-input.js +0 -197
  303. package/lib/components/style/form-number-input.js.map +0 -1
  304. package/lib/components/style/form-number-input_2.js +0 -214
  305. package/lib/components/style/form-number-input_2.js.map +0 -1
  306. package/lib/components/style/form-select.js +0 -30
  307. package/lib/components/style/form-select.js.map +0 -1
  308. package/lib/components/style/form-slider.js +0 -53
  309. package/lib/components/style/form-slider.js.map +0 -1
  310. package/lib/components/style/form-submit-button.js +0 -36
  311. package/lib/components/style/form-submit-button.js.map +0 -1
  312. package/lib/components/style/form-text-input.js +0 -84
  313. package/lib/components/style/form-text-input.js.map +0 -1
  314. package/lib/components/toolbar/button/ControlButton.js +0 -76
  315. package/lib/components/toolbar/button/ControlButton.js.map +0 -1
  316. package/lib/components/toolbar/button/DirectionButton.js +0 -57
  317. package/lib/components/toolbar/button/DirectionButton.js.map +0 -1
  318. package/lib/components/toolbar/button/RightButton.js +0 -140
  319. package/lib/components/toolbar/button/RightButton.js.map +0 -1
  320. package/lib/components/toolbar/button/ToggleButton.js +0 -66
  321. package/lib/components/toolbar/button/ToggleButton.js.map +0 -1
  322. package/lib/components/toolbar/button/index.js +0 -94
  323. package/lib/components/toolbar/button/index.js.map +0 -1
  324. package/lib/components/toolbar/button/styles.js +0 -21
  325. package/lib/components/toolbar/button/styles.js.map +0 -1
  326. package/lib/components/toolbar/components/DoorStyleMenu.js +0 -112
  327. package/lib/components/toolbar/components/DoorStyleMenu.js.map +0 -1
  328. package/lib/components/toolbar/components/Pricing.js +0 -110
  329. package/lib/components/toolbar/components/Pricing.js.map +0 -1
  330. package/lib/components/toolbar/components/ReviewForQuote.js +0 -485
  331. package/lib/components/toolbar/components/ReviewForQuote.js.map +0 -1
  332. package/lib/components/toolbar/export.js +0 -50
  333. package/lib/components/toolbar/export.js.map +0 -1
  334. package/lib/components/toolbar/main/Alert.js +0 -132
  335. package/lib/components/toolbar/main/Alert.js.map +0 -1
  336. package/lib/components/toolbar/main/TakePictureModal.js +0 -109
  337. package/lib/components/toolbar/main/TakePictureModal.js.map +0 -1
  338. package/lib/components/toolbar/main/confirm-popup.js +0 -95
  339. package/lib/components/toolbar/main/confirm-popup.js.map +0 -1
  340. package/lib/components/toolbar/main/index.js +0 -4619
  341. package/lib/components/toolbar/main/index.js.map +0 -1
  342. package/lib/components/toolbar/main/myComponents.js +0 -125
  343. package/lib/components/toolbar/main/myComponents.js.map +0 -1
  344. package/lib/components/toolbar/main/styles.js +0 -73
  345. package/lib/components/toolbar/main/styles.js.map +0 -1
  346. package/lib/components/toolbar/plugin-item.js +0 -156
  347. package/lib/components/toolbar/plugin-item.js.map +0 -1
  348. package/lib/components/toolbar/popup/appliance/appliance-category/index.js +0 -86
  349. package/lib/components/toolbar/popup/appliance/appliance-category/index.js.map +0 -1
  350. package/lib/components/toolbar/popup/appliance/choose-appliance/index.js +0 -85
  351. package/lib/components/toolbar/popup/appliance/choose-appliance/index.js.map +0 -1
  352. package/lib/components/toolbar/popup/appliance/index.js +0 -89
  353. package/lib/components/toolbar/popup/appliance/index.js.map +0 -1
  354. package/lib/components/toolbar/popup/autosaveprompt/index.js +0 -99
  355. package/lib/components/toolbar/popup/autosaveprompt/index.js.map +0 -1
  356. package/lib/components/toolbar/popup/autosaveprompt/styles.js +0 -16
  357. package/lib/components/toolbar/popup/autosaveprompt/styles.js.map +0 -1
  358. package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js +0 -86
  359. package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js.map +0 -1
  360. package/lib/components/toolbar/popup/cabinet/choose-product/index.js +0 -107
  361. package/lib/components/toolbar/popup/cabinet/choose-product/index.js.map +0 -1
  362. package/lib/components/toolbar/popup/cabinet/index.js +0 -91
  363. package/lib/components/toolbar/popup/cabinet/index.js.map +0 -1
  364. package/lib/components/toolbar/popup/doorStyle/choose-style/index.js +0 -59
  365. package/lib/components/toolbar/popup/doorStyle/choose-style/index.js.map +0 -1
  366. package/lib/components/toolbar/popup/doorStyle/index.js +0 -68
  367. package/lib/components/toolbar/popup/doorStyle/index.js.map +0 -1
  368. package/lib/components/toolbar/popup/doorStyle/style-category/index.js +0 -152
  369. package/lib/components/toolbar/popup/doorStyle/style-category/index.js.map +0 -1
  370. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -9
  371. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js.map +0 -1
  372. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js +0 -128
  373. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js.map +0 -1
  374. package/lib/components/toolbar/popup/downloadsummary/index.js +0 -572
  375. package/lib/components/toolbar/popup/downloadsummary/index.js.map +0 -1
  376. package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js +0 -60
  377. package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js.map +0 -1
  378. package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js +0 -200
  379. package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js.map +0 -1
  380. package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js +0 -254
  381. package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js.map +0 -1
  382. package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js +0 -1762
  383. package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js.map +0 -1
  384. package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -96
  385. package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js.map +0 -1
  386. package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js +0 -125
  387. package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js.map +0 -1
  388. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js +0 -1713
  389. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js.map +0 -1
  390. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js +0 -184
  391. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js.map +0 -1
  392. package/lib/components/toolbar/popup/downloadsummary/showWarranty.js +0 -115
  393. package/lib/components/toolbar/popup/downloadsummary/showWarranty.js.map +0 -1
  394. package/lib/components/toolbar/popup/downloadsummary/styles.js +0 -47
  395. package/lib/components/toolbar/popup/downloadsummary/styles.js.map +0 -1
  396. package/lib/components/toolbar/popup/finishingtouch/category/index.js +0 -44
  397. package/lib/components/toolbar/popup/finishingtouch/category/index.js.map +0 -1
  398. package/lib/components/toolbar/popup/finishingtouch/index.js +0 -54
  399. package/lib/components/toolbar/popup/finishingtouch/index.js.map +0 -1
  400. package/lib/components/toolbar/popup/finishingtouch/material-edit.js +0 -163
  401. package/lib/components/toolbar/popup/finishingtouch/material-edit.js.map +0 -1
  402. package/lib/components/toolbar/popup/finishingtouch/product/index.js +0 -65
  403. package/lib/components/toolbar/popup/finishingtouch/product/index.js.map +0 -1
  404. package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js +0 -124
  405. package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js.map +0 -1
  406. package/lib/components/toolbar/popup/floorplan/choose-floor/index.js +0 -255
  407. package/lib/components/toolbar/popup/floorplan/choose-floor/index.js.map +0 -1
  408. package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -20
  409. package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js.map +0 -1
  410. package/lib/components/toolbar/popup/floorplan/floor-category/index.js +0 -99
  411. package/lib/components/toolbar/popup/floorplan/floor-category/index.js.map +0 -1
  412. package/lib/components/toolbar/popup/floorplan/index.js +0 -56
  413. package/lib/components/toolbar/popup/floorplan/index.js.map +0 -1
  414. package/lib/components/toolbar/popup/index.js +0 -195
  415. package/lib/components/toolbar/popup/index.js.map +0 -1
  416. package/lib/components/toolbar/popup/newproject/index.js +0 -75
  417. package/lib/components/toolbar/popup/newproject/index.js.map +0 -1
  418. package/lib/components/toolbar/popup/newproject/styles.js +0 -16
  419. package/lib/components/toolbar/popup/newproject/styles.js.map +0 -1
  420. package/lib/components/toolbar/popup/product/appliance.js +0 -73
  421. package/lib/components/toolbar/popup/product/appliance.js.map +0 -1
  422. package/lib/components/toolbar/popup/product/cabinetproduct.js +0 -33
  423. package/lib/components/toolbar/popup/product/cabinetproduct.js.map +0 -1
  424. package/lib/components/toolbar/popup/product/doorstyle.js +0 -59
  425. package/lib/components/toolbar/popup/product/doorstyle.js.map +0 -1
  426. package/lib/components/toolbar/popup/product/doorstyleproduct.js +0 -59
  427. package/lib/components/toolbar/popup/product/doorstyleproduct.js.map +0 -1
  428. package/lib/components/toolbar/popup/product/floor.js +0 -59
  429. package/lib/components/toolbar/popup/product/floor.js.map +0 -1
  430. package/lib/components/toolbar/popup/product/floorproduct.js +0 -68
  431. package/lib/components/toolbar/popup/product/floorproduct.js.map +0 -1
  432. package/lib/components/toolbar/popup/product/index.js +0 -59
  433. package/lib/components/toolbar/popup/product/index.js.map +0 -1
  434. package/lib/components/toolbar/popup/product/primary.js +0 -71
  435. package/lib/components/toolbar/popup/product/primary.js.map +0 -1
  436. package/lib/components/toolbar/popup/product/productline.js +0 -128
  437. package/lib/components/toolbar/popup/product/productline.js.map +0 -1
  438. package/lib/components/toolbar/popup/product/reviewItem.js +0 -346
  439. package/lib/components/toolbar/popup/product/reviewItem.js.map +0 -1
  440. package/lib/components/toolbar/popup/product/reviewMolding.js +0 -291
  441. package/lib/components/toolbar/popup/product/reviewMolding.js.map +0 -1
  442. package/lib/components/toolbar/popup/product/styles.js +0 -79
  443. package/lib/components/toolbar/popup/product/styles.js.map +0 -1
  444. package/lib/components/toolbar/popup/savedesign/FullPictureForm.js +0 -169
  445. package/lib/components/toolbar/popup/savedesign/FullPictureForm.js.map +0 -1
  446. package/lib/components/toolbar/popup/savedesign/index.js +0 -516
  447. package/lib/components/toolbar/popup/savedesign/index.js.map +0 -1
  448. package/lib/components/toolbar/popup/savedesign/styles.js +0 -26
  449. package/lib/components/toolbar/popup/savedesign/styles.js.map +0 -1
  450. package/lib/components/toolbar/popup/setDoorStyleOption/index.js +0 -64
  451. package/lib/components/toolbar/popup/setDoorStyleOption/index.js.map +0 -1
  452. package/lib/components/toolbar/popup/styles.js +0 -104
  453. package/lib/components/toolbar/popup/styles.js.map +0 -1
  454. package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js +0 -166
  455. package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js.map +0 -1
  456. package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js +0 -93
  457. package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js.map +0 -1
  458. package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js +0 -45
  459. package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js.map +0 -1
  460. package/lib/components/toolbar/popup/submitforquote/StepDots.js +0 -40
  461. package/lib/components/toolbar/popup/submitforquote/StepDots.js.map +0 -1
  462. package/lib/components/toolbar/popup/submitforquote/cart-choice.js +0 -141
  463. package/lib/components/toolbar/popup/submitforquote/cart-choice.js.map +0 -1
  464. package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -50
  465. package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js.map +0 -1
  466. package/lib/components/toolbar/popup/submitforquote/index.js +0 -698
  467. package/lib/components/toolbar/popup/submitforquote/index.js.map +0 -1
  468. package/lib/components/toolbar/popup/submitforquote/styles.js +0 -38
  469. package/lib/components/toolbar/popup/submitforquote/styles.js.map +0 -1
  470. package/lib/components/toolbar/popup/submitprompt/index.js +0 -79
  471. package/lib/components/toolbar/popup/submitprompt/index.js.map +0 -1
  472. package/lib/components/toolbar/popup/submitprompt/styles.js +0 -16
  473. package/lib/components/toolbar/popup/submitprompt/styles.js.map +0 -1
  474. package/lib/components/toolbar/toolbar-button.js +0 -111
  475. package/lib/components/toolbar/toolbar-button.js.map +0 -1
  476. package/lib/components/toolbar/toolbar-load-button.js +0 -36
  477. package/lib/components/toolbar/toolbar-load-button.js.map +0 -1
  478. package/lib/components/toolbar/toolbar-save-button.js +0 -34
  479. package/lib/components/toolbar/toolbar-save-button.js.map +0 -1
  480. package/lib/components/tutorial-view/Modal.js +0 -503
  481. package/lib/components/tutorial-view/Modal.js.map +0 -1
  482. package/lib/components/tutorial-view/styles.js +0 -13
  483. package/lib/components/tutorial-view/styles.js.map +0 -1
  484. package/lib/components/viewer2d/area.js +0 -90
  485. package/lib/components/viewer2d/area.js.map +0 -1
  486. package/lib/components/viewer2d/export.js +0 -122
  487. package/lib/components/viewer2d/export.js.map +0 -1
  488. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -45
  489. package/lib/components/viewer2d/grids/grid-horizontal-streak.js.map +0 -1
  490. package/lib/components/viewer2d/grids/grid-streak.js +0 -45
  491. package/lib/components/viewer2d/grids/grid-streak.js.map +0 -1
  492. package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -45
  493. package/lib/components/viewer2d/grids/grid-vertical-streak.js.map +0 -1
  494. package/lib/components/viewer2d/grids/grids.js +0 -45
  495. package/lib/components/viewer2d/grids/grids.js.map +0 -1
  496. package/lib/components/viewer2d/group.js +0 -63
  497. package/lib/components/viewer2d/group.js.map +0 -1
  498. package/lib/components/viewer2d/item.js +0 -522
  499. package/lib/components/viewer2d/item.js.map +0 -1
  500. package/lib/components/viewer2d/layer.js +0 -172
  501. package/lib/components/viewer2d/layer.js.map +0 -1
  502. package/lib/components/viewer2d/line.js +0 -899
  503. package/lib/components/viewer2d/line.js.map +0 -1
  504. package/lib/components/viewer2d/ruler.js +0 -108
  505. package/lib/components/viewer2d/ruler.js.map +0 -1
  506. package/lib/components/viewer2d/rulerDist.js +0 -154
  507. package/lib/components/viewer2d/rulerDist.js.map +0 -1
  508. package/lib/components/viewer2d/rulerX.js +0 -159
  509. package/lib/components/viewer2d/rulerX.js.map +0 -1
  510. package/lib/components/viewer2d/rulerY.js +0 -161
  511. package/lib/components/viewer2d/rulerY.js.map +0 -1
  512. package/lib/components/viewer2d/scene.js +0 -148
  513. package/lib/components/viewer2d/scene.js.map +0 -1
  514. package/lib/components/viewer2d/snap.js +0 -84
  515. package/lib/components/viewer2d/snap.js.map +0 -1
  516. package/lib/components/viewer2d/state.js +0 -88
  517. package/lib/components/viewer2d/state.js.map +0 -1
  518. package/lib/components/viewer2d/utils.js +0 -174
  519. package/lib/components/viewer2d/utils.js.map +0 -1
  520. package/lib/components/viewer2d/vertex.js +0 -76
  521. package/lib/components/viewer2d/vertex.js.map +0 -1
  522. package/lib/components/viewer2d/viewer2d.js +0 -1409
  523. package/lib/components/viewer2d/viewer2d.js.map +0 -1
  524. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2598
  525. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js.map +0 -1
  526. package/lib/components/viewer3d/dcm.js +0 -408
  527. package/lib/components/viewer3d/dcm.js.map +0 -1
  528. package/lib/components/viewer3d/fbm.js +0 -421
  529. package/lib/components/viewer3d/fbm.js.map +0 -1
  530. package/lib/components/viewer3d/front3D.js +0 -76
  531. package/lib/components/viewer3d/front3D.js.map +0 -1
  532. package/lib/components/viewer3d/grid-creator.js +0 -35
  533. package/lib/components/viewer3d/grid-creator.js.map +0 -1
  534. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -45
  535. package/lib/components/viewer3d/grids/grid-horizontal-streak.js.map +0 -1
  536. package/lib/components/viewer3d/grids/grid-streak.js +0 -36
  537. package/lib/components/viewer3d/grids/grid-streak.js.map +0 -1
  538. package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -45
  539. package/lib/components/viewer3d/grids/grid-vertical-streak.js.map +0 -1
  540. package/lib/components/viewer3d/libs/first-person-controls.js +0 -75
  541. package/lib/components/viewer3d/libs/first-person-controls.js.map +0 -1
  542. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1288
  543. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js.map +0 -1
  544. package/lib/components/viewer3d/libs/mtl-loader.js +0 -360
  545. package/lib/components/viewer3d/libs/mtl-loader.js.map +0 -1
  546. package/lib/components/viewer3d/libs/obj-loader.js +0 -465
  547. package/lib/components/viewer3d/libs/obj-loader.js.map +0 -1
  548. package/lib/components/viewer3d/libs/orbit-controls.js +0 -701
  549. package/lib/components/viewer3d/libs/orbit-controls.js.map +0 -1
  550. package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -48
  551. package/lib/components/viewer3d/libs/pointer-lock-controls.js.map +0 -1
  552. package/lib/components/viewer3d/lrm.js +0 -312
  553. package/lib/components/viewer3d/lrm.js.map +0 -1
  554. package/lib/components/viewer3d/model.js +0 -715
  555. package/lib/components/viewer3d/model.js.map +0 -1
  556. package/lib/components/viewer3d/pointer-lock-navigation.js +0 -123
  557. package/lib/components/viewer3d/pointer-lock-navigation.js.map +0 -1
  558. package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -69
  559. package/lib/components/viewer3d/ruler-utils/itemRect.js.map +0 -1
  560. package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -503
  561. package/lib/components/viewer3d/ruler-utils/layer3D.js.map +0 -1
  562. package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -235
  563. package/lib/components/viewer3d/ruler-utils/ruler3D.js.map +0 -1
  564. package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -70
  565. package/lib/components/viewer3d/ruler-utils/scene3D.js.map +0 -1
  566. package/lib/components/viewer3d/ruler-utils/state3D.js +0 -26
  567. package/lib/components/viewer3d/ruler-utils/state3D.js.map +0 -1
  568. package/lib/components/viewer3d/scene-creator.js +0 -3641
  569. package/lib/components/viewer3d/scene-creator.js.map +0 -1
  570. package/lib/components/viewer3d/three-memory-cleaner.js +0 -61
  571. package/lib/components/viewer3d/three-memory-cleaner.js.map +0 -1
  572. package/lib/components/viewer3d/viewer3d-first-person.js +0 -321
  573. package/lib/components/viewer3d/viewer3d-first-person.js.map +0 -1
  574. package/lib/components/viewer3d/viewer3d.js +0 -2508
  575. package/lib/components/viewer3d/viewer3d.js.map +0 -1
  576. package/lib/components/wizardstep/button/styles.js +0 -67
  577. package/lib/components/wizardstep/button/styles.js.map +0 -1
  578. package/lib/components/wizardstep/export.js +0 -12
  579. package/lib/components/wizardstep/export.js.map +0 -1
  580. package/lib/components/wizardstep/index.js +0 -978
  581. package/lib/components/wizardstep/index.js.map +0 -1
  582. package/lib/components/wizardstep/styles.js +0 -68
  583. package/lib/components/wizardstep/styles.js.map +0 -1
  584. package/lib/components/wizardstep/wizardstep-content-button.js +0 -224
  585. package/lib/components/wizardstep/wizardstep-content-button.js.map +0 -1
  586. package/lib/components/wizardstep/wizardstep-toggle-button.js +0 -133
  587. package/lib/components/wizardstep/wizardstep-toggle-button.js.map +0 -1
  588. package/lib/constants.js +0 -646
  589. package/lib/constants.js.map +0 -1
  590. package/lib/hooks/useCheckCart.js +0 -60
  591. package/lib/hooks/useCheckCart.js.map +0 -1
  592. package/lib/hooks/useGetPricesBySku.js +0 -81
  593. package/lib/hooks/useGetPricesBySku.js.map +0 -1
  594. package/lib/hooks/useValidateToken.js +0 -207
  595. package/lib/hooks/useValidateToken.js.map +0 -1
  596. package/lib/index.js +0 -102
  597. package/lib/index.js.map +0 -1
  598. package/lib/models.js +0 -518
  599. package/lib/models.js.map +0 -1
  600. package/lib/plugins/SVGLoader.js +0 -1418
  601. package/lib/plugins/SVGLoader.js.map +0 -1
  602. package/lib/plugins/autosave.js +0 -40
  603. package/lib/plugins/autosave.js.map +0 -1
  604. package/lib/plugins/console-debugger.js +0 -45
  605. package/lib/plugins/console-debugger.js.map +0 -1
  606. package/lib/plugins/export.js +0 -34
  607. package/lib/plugins/export.js.map +0 -1
  608. package/lib/plugins/keyboard.js +0 -108
  609. package/lib/plugins/keyboard.js.map +0 -1
  610. package/lib/reducers/areas-reducer.js +0 -19
  611. package/lib/reducers/areas-reducer.js.map +0 -1
  612. package/lib/reducers/export.js +0 -98
  613. package/lib/reducers/export.js.map +0 -1
  614. package/lib/reducers/groups-reducer.js +0 -45
  615. package/lib/reducers/groups-reducer.js.map +0 -1
  616. package/lib/reducers/holes-reducer.js +0 -69
  617. package/lib/reducers/holes-reducer.js.map +0 -1
  618. package/lib/reducers/items-reducer.js +0 -147
  619. package/lib/reducers/items-reducer.js.map +0 -1
  620. package/lib/reducers/lines-reducer.js +0 -52
  621. package/lib/reducers/lines-reducer.js.map +0 -1
  622. package/lib/reducers/project-reducer.js +0 -136
  623. package/lib/reducers/project-reducer.js.map +0 -1
  624. package/lib/reducers/reducer.js +0 -27
  625. package/lib/reducers/reducer.js.map +0 -1
  626. package/lib/reducers/scene-reducer.js +0 -35
  627. package/lib/reducers/scene-reducer.js.map +0 -1
  628. package/lib/reducers/user-reducer.js +0 -48
  629. package/lib/reducers/user-reducer.js.map +0 -1
  630. package/lib/reducers/vertices-reducer.js +0 -26
  631. package/lib/reducers/vertices-reducer.js.map +0 -1
  632. package/lib/reducers/viewer2d-reducer.js +0 -83
  633. package/lib/reducers/viewer2d-reducer.js.map +0 -1
  634. package/lib/reducers/viewer3d-reducer.js +0 -64
  635. package/lib/reducers/viewer3d-reducer.js.map +0 -1
  636. package/lib/shared-style.js +0 -73
  637. package/lib/shared-style.js.map +0 -1
  638. package/lib/styles/export.js +0 -14
  639. package/lib/styles/export.js.map +0 -1
  640. package/lib/translator/en.js +0 -111
  641. package/lib/translator/en.js.map +0 -1
  642. package/lib/translator/it.js +0 -86
  643. package/lib/translator/it.js.map +0 -1
  644. package/lib/translator/ru.js +0 -86
  645. package/lib/translator/ru.js.map +0 -1
  646. package/lib/translator/translator.js +0 -91
  647. package/lib/translator/translator.js.map +0 -1
  648. package/lib/utils/browser.js +0 -41
  649. package/lib/utils/browser.js.map +0 -1
  650. package/lib/utils/email-validator.js +0 -11
  651. package/lib/utils/email-validator.js.map +0 -1
  652. package/lib/utils/export.js +0 -57
  653. package/lib/utils/export.js.map +0 -1
  654. package/lib/utils/geometry.js +0 -2329
  655. package/lib/utils/geometry.js.map +0 -1
  656. package/lib/utils/get-edges-of-subgraphs.js +0 -29
  657. package/lib/utils/get-edges-of-subgraphs.js.map +0 -1
  658. package/lib/utils/graph-cycles.js +0 -241
  659. package/lib/utils/graph-cycles.js.map +0 -1
  660. package/lib/utils/graph-inner-cycles.js +0 -55
  661. package/lib/utils/graph-inner-cycles.js.map +0 -1
  662. package/lib/utils/graph.js +0 -152
  663. package/lib/utils/graph.js.map +0 -1
  664. package/lib/utils/helper.js +0 -360
  665. package/lib/utils/helper.js.map +0 -1
  666. package/lib/utils/history.js +0 -37
  667. package/lib/utils/history.js.map +0 -1
  668. package/lib/utils/id-broker.js +0 -26
  669. package/lib/utils/id-broker.js.map +0 -1
  670. package/lib/utils/logger.js +0 -15
  671. package/lib/utils/logger.js.map +0 -1
  672. package/lib/utils/math.js +0 -58
  673. package/lib/utils/math.js.map +0 -1
  674. package/lib/utils/molding.js +0 -864
  675. package/lib/utils/molding.js.map +0 -1
  676. package/lib/utils/name-generator.js +0 -24
  677. package/lib/utils/name-generator.js.map +0 -1
  678. package/lib/utils/objects-utils.js +0 -61
  679. package/lib/utils/objects-utils.js.map +0 -1
  680. package/lib/utils/phone-validator.js +0 -11
  681. package/lib/utils/phone-validator.js.map +0 -1
  682. package/lib/utils/process-black-list.js +0 -25
  683. package/lib/utils/process-black-list.js.map +0 -1
  684. package/lib/utils/react-if.js +0 -25
  685. package/lib/utils/react-if.js.map +0 -1
  686. package/lib/utils/snap-scene.js +0 -106
  687. package/lib/utils/snap-scene.js.map +0 -1
  688. package/lib/utils/snap.js +0 -250
  689. package/lib/utils/snap.js.map +0 -1
  690. package/lib/utils/threeCSG.es6.js +0 -504
  691. package/lib/utils/threeCSG.es6.js.map +0 -1
  692. package/lib/version.js +0 -8
  693. package/lib/version.js.map +0 -1
  694. package/src/@history.js +0 -3
  695. package/src/AppContext.js +0 -5
  696. package/src/KitchenConfigurator.jsx +0 -1517
  697. package/src/KitchenConfiguratorApp.jsx +0 -443
  698. package/src/actions/area-actions.js +0 -15
  699. package/src/actions/export.js +0 -38
  700. package/src/actions/groups-actions.js +0 -102
  701. package/src/actions/holes-actions.js +0 -152
  702. package/src/actions/items-actions.js +0 -393
  703. package/src/actions/lines-actions.js +0 -103
  704. package/src/actions/project-actions.js +0 -391
  705. package/src/actions/scene-actions.js +0 -44
  706. package/src/actions/user-actions.js +0 -75
  707. package/src/actions/vertices-actions.js +0 -34
  708. package/src/actions/viewer2d-actions.js +0 -79
  709. package/src/actions/viewer3d-actions.js +0 -32
  710. package/src/catalog/areas/area/planner-element.jsx +0 -43
  711. package/src/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  712. package/src/catalog/areas/area/textures/grass.jpg +0 -0
  713. package/src/catalog/areas/area/textures/parquet.jpg +0 -0
  714. package/src/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  715. package/src/catalog/areas/area/textures/tile1.jpg +0 -0
  716. package/src/catalog/back.png +0 -0
  717. package/src/catalog/catalog.js +0 -258
  718. package/src/catalog/doors.png +0 -0
  719. package/src/catalog/doorways.png +0 -0
  720. package/src/catalog/envMap/nx.hdr +0 -0
  721. package/src/catalog/envMap/ny.hdr +0 -0
  722. package/src/catalog/envMap/nz.hdr +0 -0
  723. package/src/catalog/envMap/px.hdr +0 -0
  724. package/src/catalog/envMap/py.hdr +0 -0
  725. package/src/catalog/envMap/pz.hdr +0 -0
  726. package/src/catalog/factories/area-factory-3d.js +0 -252
  727. package/src/catalog/factories/area-factory.jsx +0 -102
  728. package/src/catalog/factories/export.js +0 -9
  729. package/src/catalog/factories/wall-factory-3d.js +0 -296
  730. package/src/catalog/factories/wall-factory.jsx +0 -321
  731. package/src/catalog/holes/door-closet/planner-element.jsx +0 -251
  732. package/src/catalog/holes/door-double/door_double.png +0 -0
  733. package/src/catalog/holes/door-double/planner-element.jsx +0 -391
  734. package/src/catalog/holes/door-exterior/planner-element.jsx +0 -245
  735. package/src/catalog/holes/door-interior/planner-element.jsx +0 -256
  736. package/src/catalog/holes/door-panic/panicDoor.png +0 -0
  737. package/src/catalog/holes/door-panic/planner-element.jsx +0 -594
  738. package/src/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  739. package/src/catalog/holes/door-panic-double/planner-element.jsx +0 -574
  740. package/src/catalog/holes/door-sliding/planner-element.jsx +0 -256
  741. package/src/catalog/holes/doorway-framed/planner-element.jsx +0 -169
  742. package/src/catalog/holes/doorway-frameless/planner-element.jsx +0 -116
  743. package/src/catalog/holes/gate/gate.jpg +0 -0
  744. package/src/catalog/holes/window-clear/planner-element.jsx +0 -181
  745. package/src/catalog/holes/window-clear/texture.png +0 -0
  746. package/src/catalog/holes/window-cross/planner-element.jsx +0 -180
  747. package/src/catalog/holes/window-cross/texture.png +0 -0
  748. package/src/catalog/holes/window-double-hung/planner-element.jsx +0 -366
  749. package/src/catalog/holes/window-double-hung/texture.png +0 -0
  750. package/src/catalog/holes/window-vertical/planner-element.jsx +0 -290
  751. package/src/catalog/holes/window-vertical/texture.png +0 -0
  752. package/src/catalog/lines/wall/planner-element.jsx +0 -73
  753. package/src/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  754. package/src/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  755. package/src/catalog/lines/wall/textures/bricks.jpg +0 -0
  756. package/src/catalog/lines/wall/textures/bricks2.jpg +0 -0
  757. package/src/catalog/lines/wall/textures/bricks3.jpg +0 -0
  758. package/src/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  759. package/src/catalog/lines/wall/textures/morden.jpg +0 -0
  760. package/src/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  761. package/src/catalog/lines/wall/textures/painted.jpg +0 -0
  762. package/src/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  763. package/src/catalog/lines/wall/textures/plaster.jpg +0 -0
  764. package/src/catalog/lines/wall/wall.png +0 -0
  765. package/src/catalog/molding/molding-dcm/planner-element.jsx +0 -35
  766. package/src/catalog/molding/molding-dcm/texture.png +0 -0
  767. package/src/catalog/molding/molding-fbm/planner-element.jsx +0 -35
  768. package/src/catalog/molding/molding-fbm/texture.png +0 -0
  769. package/src/catalog/molding/molding-lrm/planner-element.jsx +0 -35
  770. package/src/catalog/molding/molding-lrm/texture.png +0 -0
  771. package/src/catalog/properties/export.js +0 -33
  772. package/src/catalog/properties/property-checkbox.jsx +0 -123
  773. package/src/catalog/properties/property-color.jsx +0 -52
  774. package/src/catalog/properties/property-enum.jsx +0 -87
  775. package/src/catalog/properties/property-hidden.jsx +0 -22
  776. package/src/catalog/properties/property-lenght-measure.jsx +0 -113
  777. package/src/catalog/properties/property-length-measure.jsx +0 -129
  778. package/src/catalog/properties/property-length-measure_hole.jsx +0 -110
  779. package/src/catalog/properties/property-number.jsx +0 -63
  780. package/src/catalog/properties/property-read-only.jsx +0 -37
  781. package/src/catalog/properties/property-string.jsx +0 -59
  782. package/src/catalog/properties/property-toggle.jsx +0 -51
  783. package/src/catalog/properties/shared-property-style.js +0 -13
  784. package/src/catalog/utils/FuseUtils.js +0 -61
  785. package/src/catalog/utils/exporter.js +0 -173
  786. package/src/catalog/utils/geom-utils.js +0 -301
  787. package/src/catalog/utils/item-loader.jsx +0 -2122
  788. package/src/catalog/utils/load-obj.js +0 -113
  789. package/src/catalog/utils/mtl-loader.js +0 -462
  790. package/src/catalog/utils/obj-loader.js +0 -544
  791. package/src/catalog/windows.png +0 -0
  792. package/src/class/FuseUtils.js +0 -61
  793. package/src/class/area.js +0 -159
  794. package/src/class/export.js +0 -37
  795. package/src/class/group.js +0 -565
  796. package/src/class/guide.js +0 -44
  797. package/src/class/hole.js +0 -1359
  798. package/src/class/item.js +0 -2050
  799. package/src/class/layer.js +0 -926
  800. package/src/class/line.js +0 -1780
  801. package/src/class/project.js +0 -875
  802. package/src/class/vertex.js +0 -409
  803. package/src/components/atoms/Snackbar/index.jsx +0 -43
  804. package/src/components/atoms/radio-button/index.jsx +0 -20
  805. package/src/components/atoms/radio-button/styles.js +0 -56
  806. package/src/components/button/MainButton.jsx +0 -157
  807. package/src/components/button/ToggleMeasureButton.jsx +0 -65
  808. package/src/components/catalog-view/catalog-breadcrumb.jsx +0 -53
  809. package/src/components/catalog-view/catalog-item.jsx +0 -229
  810. package/src/components/catalog-view/catalog-list.jsx +0 -173
  811. package/src/components/catalog-view/catalog-page-item.jsx +0 -110
  812. package/src/components/catalog-view/catalog-turn-back-page-item.jsx +0 -80
  813. package/src/components/configurator/custom-configurator.jsx +0 -77
  814. package/src/components/configurator/project-configurator.jsx +0 -120
  815. package/src/components/content.jsx +0 -136
  816. package/src/components/export.js +0 -36
  817. package/src/components/firstsetting/button/styles.js +0 -223
  818. package/src/components/firstsetting/export.js +0 -9
  819. package/src/components/firstsetting/firstsetting-content-button.jsx +0 -198
  820. package/src/components/firstsetting/firstsetting-toggle-button.jsx +0 -101
  821. package/src/components/firstsetting/firstsetting.jsx +0 -814
  822. package/src/components/footerbar/button/ControlButton.jsx +0 -43
  823. package/src/components/footerbar/button/DirectionButton.jsx +0 -54
  824. package/src/components/footerbar/button/DirectionPanSpinButton.jsx +0 -36
  825. package/src/components/footerbar/button/ToggleButton.jsx +0 -58
  826. package/src/components/footerbar/button/ToggleConvertButton.jsx +0 -48
  827. package/src/components/footerbar/button/ToggleMeasureButton.jsx +0 -33
  828. package/src/components/footerbar/button/styles.js +0 -217
  829. package/src/components/footerbar/export.js +0 -9
  830. package/src/components/footerbar/footer-content-button.jsx +0 -198
  831. package/src/components/footerbar/footer-toggle-button.jsx +0 -101
  832. package/src/components/footerbar/footerbar.jsx +0 -1103
  833. package/src/components/footerbar/styles.js +0 -263
  834. package/src/components/header/button/MenuButton.jsx +0 -46
  835. package/src/components/header/button/SaveButton.jsx +0 -54
  836. package/src/components/header/button/styles.js +0 -181
  837. package/src/components/header/export.js +0 -5
  838. package/src/components/header/header.jsx +0 -631
  839. package/src/components/header/header.style.css +0 -47
  840. package/src/components/header/styles.js +0 -320
  841. package/src/components/login/Login.js +0 -77
  842. package/src/components/login/LoginForm/index.js +0 -108
  843. package/src/components/login/Register.js +0 -83
  844. package/src/components/login/RegisterForm/index.js +0 -171
  845. package/src/components/login/jwtService.js +0 -201
  846. package/src/components/login/style.css +0 -158
  847. package/src/components/login/style.scss +0 -260
  848. package/src/components/molecules/slider/index.jsx +0 -15
  849. package/src/components/molecules/slider/styles.js +0 -0
  850. package/src/components/molecules/slider/styles.scss +0 -3
  851. package/src/components/myprojects/export.js +0 -5
  852. package/src/components/myprojects/index.jsx +0 -445
  853. package/src/components/myprojects/styles.js +0 -241
  854. package/src/components/sidebar/custom-accordion.jsx +0 -48
  855. package/src/components/sidebar/export.js +0 -15
  856. package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +0 -73
  857. package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +0 -101
  858. package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +0 -149
  859. package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +0 -316
  860. package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +0 -108
  861. package/src/components/sidebar/panel-element-editor/element-editor.jsx +0 -1070
  862. package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
  863. package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +0 -104
  864. package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +0 -155
  865. package/src/components/sidebar/panel-group-editor.jsx +0 -272
  866. package/src/components/sidebar/panel-groups.jsx +0 -310
  867. package/src/components/sidebar/panel-guides.jsx +0 -192
  868. package/src/components/sidebar/panel-layer-elements.jsx +0 -298
  869. package/src/components/sidebar/panel-layers.jsx +0 -381
  870. package/src/components/sidebar/panel.jsx +0 -71
  871. package/src/components/sidebar/sidebar.jsx +0 -106
  872. package/src/components/sidebar/toolbar-panel.jsx +0 -139
  873. package/src/components/sign/export.js +0 -7
  874. package/src/components/sign/main/index.jsx +0 -523
  875. package/src/components/sign/main/styles.js +0 -163
  876. package/src/components/style/button.jsx +0 -95
  877. package/src/components/style/cancel-button.jsx +0 -20
  878. package/src/components/style/content-container.jsx +0 -29
  879. package/src/components/style/content-title.jsx +0 -20
  880. package/src/components/style/delete-button.jsx +0 -23
  881. package/src/components/style/export.jsx +0 -48
  882. package/src/components/style/form-block.jsx +0 -13
  883. package/src/components/style/form-color-input.jsx +0 -27
  884. package/src/components/style/form-label.jsx +0 -15
  885. package/src/components/style/form-number-input.jsx +0 -196
  886. package/src/components/style/form-number-input_2.jsx +0 -191
  887. package/src/components/style/form-select.jsx +0 -38
  888. package/src/components/style/form-slider.jsx +0 -36
  889. package/src/components/style/form-submit-button.jsx +0 -23
  890. package/src/components/style/form-text-input.jsx +0 -65
  891. package/src/components/toolbar/button/ControlButton.jsx +0 -41
  892. package/src/components/toolbar/button/DirectionButton.jsx +0 -34
  893. package/src/components/toolbar/button/RightButton.jsx +0 -103
  894. package/src/components/toolbar/button/ToggleButton.jsx +0 -41
  895. package/src/components/toolbar/button/index.jsx +0 -55
  896. package/src/components/toolbar/button/styles.js +0 -127
  897. package/src/components/toolbar/components/DoorStyleMenu.jsx +0 -103
  898. package/src/components/toolbar/components/Pricing.jsx +0 -126
  899. package/src/components/toolbar/components/ReviewForQuote.jsx +0 -635
  900. package/src/components/toolbar/export.js +0 -21
  901. package/src/components/toolbar/main/Alert.js +0 -122
  902. package/src/components/toolbar/main/TakePictureModal.jsx +0 -104
  903. package/src/components/toolbar/main/confirm-popup.jsx +0 -99
  904. package/src/components/toolbar/main/index.jsx +0 -5687
  905. package/src/components/toolbar/main/lShaped.json +0 -311
  906. package/src/components/toolbar/main/longNarrow.json +0 -238
  907. package/src/components/toolbar/main/myComponents.js +0 -123
  908. package/src/components/toolbar/main/oRectangle.json +0 -220
  909. package/src/components/toolbar/main/rectangle.json +0 -238
  910. package/src/components/toolbar/main/style.css +0 -107
  911. package/src/components/toolbar/main/styles.js +0 -696
  912. package/src/components/toolbar/plugin-item.jsx +0 -123
  913. package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +0 -73
  914. package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +0 -102
  915. package/src/components/toolbar/popup/appliance/index.jsx +0 -83
  916. package/src/components/toolbar/popup/autosaveprompt/index.jsx +0 -150
  917. package/src/components/toolbar/popup/autosaveprompt/styles.css +0 -64
  918. package/src/components/toolbar/popup/autosaveprompt/styles.js +0 -40
  919. package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +0 -73
  920. package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +0 -119
  921. package/src/components/toolbar/popup/cabinet/index.jsx +0 -85
  922. package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +0 -63
  923. package/src/components/toolbar/popup/doorStyle/index.jsx +0 -71
  924. package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +0 -139
  925. package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -2
  926. package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +0 -157
  927. package/src/components/toolbar/popup/downloadsummary/index.jsx +0 -643
  928. package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +0 -51
  929. package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +0 -175
  930. package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +0 -283
  931. package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +0 -2257
  932. package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -93
  933. package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +0 -132
  934. package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +0 -2198
  935. package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +0 -152
  936. package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +0 -149
  937. package/src/components/toolbar/popup/downloadsummary/styles.css +0 -177
  938. package/src/components/toolbar/popup/downloadsummary/styles.js +0 -453
  939. package/src/components/toolbar/popup/finishingtouch/category/index.jsx +0 -34
  940. package/src/components/toolbar/popup/finishingtouch/index.jsx +0 -58
  941. package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +0 -112
  942. package/src/components/toolbar/popup/finishingtouch/product/index.jsx +0 -116
  943. package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +0 -101
  944. package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +0 -254
  945. package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
  946. package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
  947. package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
  948. package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
  949. package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -86
  950. package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +0 -109
  951. package/src/components/toolbar/popup/floorplan/index.jsx +0 -60
  952. package/src/components/toolbar/popup/index.jsx +0 -241
  953. package/src/components/toolbar/popup/newproject/index.jsx +0 -59
  954. package/src/components/toolbar/popup/newproject/styles.css +0 -64
  955. package/src/components/toolbar/popup/newproject/styles.js +0 -41
  956. package/src/components/toolbar/popup/product/appliance.jsx +0 -54
  957. package/src/components/toolbar/popup/product/cabinetproduct.jsx +0 -15
  958. package/src/components/toolbar/popup/product/doorstyle.jsx +0 -58
  959. package/src/components/toolbar/popup/product/doorstyleproduct.jsx +0 -47
  960. package/src/components/toolbar/popup/product/floor.jsx +0 -36
  961. package/src/components/toolbar/popup/product/floorproduct.jsx +0 -42
  962. package/src/components/toolbar/popup/product/index.jsx +0 -36
  963. package/src/components/toolbar/popup/product/primary.jsx +0 -77
  964. package/src/components/toolbar/popup/product/productline.jsx +0 -93
  965. package/src/components/toolbar/popup/product/reviewItem.jsx +0 -427
  966. package/src/components/toolbar/popup/product/reviewMolding.jsx +0 -310
  967. package/src/components/toolbar/popup/product/style.css +0 -54
  968. package/src/components/toolbar/popup/product/styles.js +0 -260
  969. package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +0 -146
  970. package/src/components/toolbar/popup/savedesign/index.jsx +0 -495
  971. package/src/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
  972. package/src/components/toolbar/popup/savedesign/styles.js +0 -151
  973. package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +0 -87
  974. package/src/components/toolbar/popup/styles.js +0 -909
  975. package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +0 -192
  976. package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +0 -96
  977. package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +0 -54
  978. package/src/components/toolbar/popup/submitforquote/StepDots.jsx +0 -25
  979. package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +0 -116
  980. package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -38
  981. package/src/components/toolbar/popup/submitforquote/index.jsx +0 -698
  982. package/src/components/toolbar/popup/submitforquote/styles.css +0 -105
  983. package/src/components/toolbar/popup/submitforquote/styles.js +0 -294
  984. package/src/components/toolbar/popup/submitprompt/index.jsx +0 -89
  985. package/src/components/toolbar/popup/submitprompt/styles.css +0 -64
  986. package/src/components/toolbar/popup/submitprompt/styles.js +0 -42
  987. package/src/components/toolbar/toolbar-button.jsx +0 -90
  988. package/src/components/toolbar/toolbar-load-button.jsx +0 -36
  989. package/src/components/toolbar/toolbar-save-button.jsx +0 -32
  990. package/src/components/tutorial-view/Modal.jsx +0 -584
  991. package/src/components/tutorial-view/style.css +0 -111
  992. package/src/components/tutorial-view/styles.js +0 -65
  993. package/src/components/viewer2d/area.jsx +0 -98
  994. package/src/components/viewer2d/export.js +0 -48
  995. package/src/components/viewer2d/grids/grid-horizontal-streak.jsx +0 -40
  996. package/src/components/viewer2d/grids/grid-streak.jsx +0 -32
  997. package/src/components/viewer2d/grids/grid-vertical-streak.jsx +0 -41
  998. package/src/components/viewer2d/grids/grids.jsx +0 -30
  999. package/src/components/viewer2d/group.jsx +0 -57
  1000. package/src/components/viewer2d/item.jsx +0 -618
  1001. package/src/components/viewer2d/layer.jsx +0 -214
  1002. package/src/components/viewer2d/line.jsx +0 -1358
  1003. package/src/components/viewer2d/ruler.jsx +0 -136
  1004. package/src/components/viewer2d/rulerDist.jsx +0 -192
  1005. package/src/components/viewer2d/rulerX.jsx +0 -141
  1006. package/src/components/viewer2d/rulerY.jsx +0 -138
  1007. package/src/components/viewer2d/scene.jsx +0 -94
  1008. package/src/components/viewer2d/snap.jsx +0 -118
  1009. package/src/components/viewer2d/state.jsx +0 -77
  1010. package/src/components/viewer2d/utils.js +0 -195
  1011. package/src/components/viewer2d/vertex.jsx +0 -76
  1012. package/src/components/viewer2d/viewer2d.jsx +0 -1830
  1013. package/src/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -3078
  1014. package/src/components/viewer3d/dcm.js +0 -226
  1015. package/src/components/viewer3d/fbm.js +0 -383
  1016. package/src/components/viewer3d/front3D.jsx +0 -63
  1017. package/src/components/viewer3d/grid-creator.js +0 -25
  1018. package/src/components/viewer3d/grids/grid-horizontal-streak.js +0 -41
  1019. package/src/components/viewer3d/grids/grid-streak.js +0 -34
  1020. package/src/components/viewer3d/grids/grid-vertical-streak.js +0 -42
  1021. package/src/components/viewer3d/libs/first-person-controls.js +0 -70
  1022. package/src/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1265
  1023. package/src/components/viewer3d/libs/mtl-loader.js +0 -462
  1024. package/src/components/viewer3d/libs/obj-loader.js +0 -653
  1025. package/src/components/viewer3d/libs/orbit-controls.js +0 -945
  1026. package/src/components/viewer3d/libs/pointer-lock-controls.js +0 -67
  1027. package/src/components/viewer3d/lrm.js +0 -358
  1028. package/src/components/viewer3d/model.js +0 -830
  1029. package/src/components/viewer3d/pointer-lock-navigation.js +0 -140
  1030. package/src/components/viewer3d/ruler-utils/itemRect.jsx +0 -91
  1031. package/src/components/viewer3d/ruler-utils/layer3D.jsx +0 -528
  1032. package/src/components/viewer3d/ruler-utils/ruler3D.jsx +0 -218
  1033. package/src/components/viewer3d/ruler-utils/scene3D.jsx +0 -87
  1034. package/src/components/viewer3d/ruler-utils/state3D.jsx +0 -25
  1035. package/src/components/viewer3d/scene-creator.js +0 -5172
  1036. package/src/components/viewer3d/three-memory-cleaner.js +0 -65
  1037. package/src/components/viewer3d/viewer3d-first-person.js +0 -395
  1038. package/src/components/viewer3d/viewer3d.js +0 -3376
  1039. package/src/components/wizardstep/button/styles.js +0 -677
  1040. package/src/components/wizardstep/export.js +0 -5
  1041. package/src/components/wizardstep/index.jsx +0 -1372
  1042. package/src/components/wizardstep/styles.js +0 -688
  1043. package/src/components/wizardstep/wizardstep-content-button.jsx +0 -198
  1044. package/src/components/wizardstep/wizardstep-toggle-button.jsx +0 -101
  1045. package/src/constants.js +0 -731
  1046. package/src/hooks/useCheckCart.js +0 -38
  1047. package/src/hooks/useGetPricesBySku.js +0 -59
  1048. package/src/hooks/useValidateToken.js +0 -181
  1049. package/src/index.js +0 -32
  1050. package/src/models.js +0 -541
  1051. package/src/plugins/SVGLoader.js +0 -1991
  1052. package/src/plugins/autosave.js +0 -39
  1053. package/src/plugins/console-debugger.js +0 -36
  1054. package/src/plugins/export.js +0 -11
  1055. package/src/plugins/keyboard.js +0 -194
  1056. package/src/reducers/areas-reducer.js +0 -13
  1057. package/src/reducers/export.js +0 -39
  1058. package/src/reducers/groups-reducer.js +0 -73
  1059. package/src/reducers/holes-reducer.js +0 -125
  1060. package/src/reducers/items-reducer.js +0 -286
  1061. package/src/reducers/lines-reducer.js +0 -96
  1062. package/src/reducers/project-reducer.js +0 -239
  1063. package/src/reducers/reducer.js +0 -59
  1064. package/src/reducers/scene-reducer.js +0 -41
  1065. package/src/reducers/user-reducer.js +0 -30
  1066. package/src/reducers/vertices-reducer.js +0 -34
  1067. package/src/reducers/viewer2d-reducer.js +0 -81
  1068. package/src/reducers/viewer3d-reducer.js +0 -65
  1069. package/src/shared-style.js +0 -72
  1070. package/src/styles/export.js +0 -7
  1071. package/src/styles/tabs.css +0 -40
  1072. package/src/translator/en.js +0 -106
  1073. package/src/translator/it.js +0 -80
  1074. package/src/translator/ru.js +0 -80
  1075. package/src/translator/translator.js +0 -81
  1076. package/src/utils/browser.js +0 -36
  1077. package/src/utils/email-validator.js +0 -5
  1078. package/src/utils/export.js +0 -39
  1079. package/src/utils/geometry.js +0 -2572
  1080. package/src/utils/get-edges-of-subgraphs.js +0 -29
  1081. package/src/utils/graph-cycles.js +0 -259
  1082. package/src/utils/graph-inner-cycles.js +0 -49
  1083. package/src/utils/graph.js +0 -147
  1084. package/src/utils/helper.js +0 -431
  1085. package/src/utils/history.js +0 -37
  1086. package/src/utils/id-broker.js +0 -9
  1087. package/src/utils/logger.js +0 -8
  1088. package/src/utils/math.js +0 -51
  1089. package/src/utils/molding.js +0 -973
  1090. package/src/utils/name-generator.js +0 -5
  1091. package/src/utils/objects-utils.js +0 -56
  1092. package/src/utils/phone-validator.js +0 -4
  1093. package/src/utils/process-black-list.js +0 -10
  1094. package/src/utils/react-if.jsx +0 -20
  1095. package/src/utils/snap-scene.js +0 -102
  1096. package/src/utils/snap.js +0 -184
  1097. package/src/utils/threeCSG.es6.js +0 -578
  1098. package/src/version.js +0 -1
@@ -1,2198 +0,0 @@
1
- 'use strict';
2
-
3
- import React from 'react';
4
- import PropTypes from 'prop-types';
5
- import ReactDOM from 'react-dom';
6
- import * as Three from 'three';
7
- import {
8
- parseData,
9
- updateScene,
10
- deleteSpecifiedMeshObjects,
11
- createBacksplash,
12
- checkCabinetOverlap
13
- } from '../../../../viewer3d/scene-creator';
14
- import { disposeScene } from '../../../../viewer3d/three-memory-cleaner';
15
- import { disposeObject } from '../../../../viewer3d/three-memory-cleaner';
16
- import diff from 'immutablediff';
17
- import * as SharedStyle from '../../../../../shared-style';
18
- import {
19
- MODE_DRAWING_ITEM_3D,
20
- UNIT_CENTIMETER,
21
- SECONDARY_PURPLE_COLOR,
22
- ARRAY_ELEVATION_VIEW_MODES,
23
- MODE_FRONT_ELEVATION_VIEW,
24
- MODE_RIGHT_ELEVATION_VIEW,
25
- MODE_LEFT_ELEVATION_VIEW,
26
- MODE_BACK_ELEVATION_VIEW,
27
- BASE_CABINET_LAYOUTPOS,
28
- WALL_CABINET_LAYOUTPOS,
29
- TALL_CABINET_LAYOUTPOS
30
- } from '../../../../../constants';
31
- import { isUndefined } from 'util';
32
- import { verticesDistance } from '../../../../../utils/geometry';
33
- import convert from 'convert-units';
34
- import { GeometryUtils } from '../../../../../utils/export';
35
- import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';
36
- import CameraControls from 'camera-controls';
37
- CameraControls.install({ THREE: Three });
38
- import { returnReplaceableDeepSearchType } from '../../../../viewer2d/utils';
39
- import { vectorIntersectWithMesh } from '../../../../../utils/objects-utils';
40
- import { almostEqual } from '../../../../../utils/geometry';
41
-
42
- export default class Viewer3DElevationDownload extends React.Component {
43
- constructor(props) {
44
- super(props);
45
- this.state = {
46
- isLoading: false,
47
- showflag: true,
48
- toolObj: null,
49
- angleObj: null,
50
- waitForRender: 0
51
- };
52
- this.lastMousePosition = {};
53
- this.width = props.width;
54
- this.height = props.height;
55
- this.renderingID = 0;
56
-
57
- let { mode } = props.state;
58
-
59
- if (!window.__elevationRendererDownload) {
60
- window.__elevationRendererDownload = {};
61
- }
62
-
63
- this.renderer =
64
- window.__threeRendererDownload ||
65
- window.__elevationRendererDownload[mode] ||
66
- new Three.WebGLRenderer({
67
- preserveDrawingBuffer: true,
68
- alpha: true,
69
- antialias: true
70
- });
71
-
72
- this.renderer.shadowMap.enabled = true;
73
- this.renderer.shadowMapSoft = true;
74
- if (mode == 'MODE_3D_VIEW') {
75
- window.__threeRendererDownload = this.renderer;
76
- } else {
77
- window.__elevationRendererDownload[mode] = this.renderer;
78
- }
79
-
80
- this.renderer.domElement.style.display = 'none';
81
- }
82
-
83
- componentDidMount(nextProps) {
84
- let scene3D, camera, pivot, cameraControls, clock;
85
-
86
- const actions = {
87
- areaActions: this.context.areaActions,
88
- holesActions: this.context.holesActions,
89
- itemsActions: this.context.itemsActions,
90
- sceneActions: this.context.sceneActions,
91
- linesActions: this.context.linesActions,
92
- projectActions: this.context.projectActions,
93
- catalog: this.context.catalog
94
- };
95
-
96
- const self = this;
97
- const { state } = this.props;
98
- const { mode, scene } = state;
99
-
100
- function setupLight(scene, inbBox) {
101
- if (ARRAY_ELEVATION_VIEW_MODES.includes(mode)) {
102
- const ambilight = new Three.AmbientLight('0xffffff', 3);
103
- scene.add(ambilight);
104
- } else {
105
- const shadowMapSize = 2048;
106
- const shadowCameraSize =
107
- Math.max(
108
- Math.abs(inbBox.min.x - inbBox.max.x),
109
- Math.abs(inbBox.min.y - inbBox.max.y),
110
- Math.abs(inbBox.min.z - inbBox.max.z)
111
- ) / 2;
112
- const shadowCameraFar = shadowCameraSize * 10;
113
- const bboxCenter = new Three.Vector3(
114
- (inbBox.min.x + inbBox.max.x) / 2,
115
- inbBox.min.y,
116
- (inbBox.min.z + inbBox.max.z) / 2
117
- );
118
-
119
- function addDirLight(inColor, inIntensity, inPosition) {
120
- const dirLight = new Three.DirectionalLight(inColor, inIntensity);
121
- dirLight.castShadow = true;
122
- dirLight.shadow.mapSize.x = shadowMapSize;
123
- dirLight.shadow.mapSize.y = shadowMapSize;
124
- dirLight.shadow.camera.near = 0;
125
- dirLight.shadow.camera.far = shadowCameraFar;
126
-
127
- dirLight.shadow.camera.top = shadowCameraSize * 1.5;
128
- dirLight.shadow.camera.bottom = -shadowCameraSize * 1.5;
129
- dirLight.shadow.camera.left = -shadowCameraSize * 1.5;
130
- dirLight.shadow.camera.right = shadowCameraSize * 1.5;
131
- dirLight.position.copy(inPosition);
132
-
133
- const targetObject = new Three.Object3D();
134
- targetObject.position.copy(bboxCenter);
135
- scene.add(targetObject);
136
-
137
- dirLight.target = targetObject;
138
- dirLight.target.updateMatrixWorld();
139
-
140
- scene.add(dirLight);
141
- }
142
-
143
- function addSpotLight(
144
- inColor,
145
- inIntensity,
146
- inPosition,
147
- inTarget,
148
- inDistance
149
- ) {
150
- const spotLight = new Three.SpotLight();
151
- spotLight.intensity = inIntensity;
152
- spotLight.color.setHex(inColor);
153
- spotLight.position.copy(inPosition);
154
- spotLight.angle = 1.3;
155
- spotLight.distance = inDistance;
156
- spotLight.penumbra = 1.8;
157
- spotLight.decay = 0.01;
158
-
159
- spotLight.castShadow = true;
160
- spotLight.shadow.intensity = 2;
161
- spotLight.shadow.mapSize.width = 4096;
162
- spotLight.shadow.mapSize.height = 4096;
163
-
164
- const targetObject = new Three.Object3D();
165
- targetObject.position.copy(
166
- new Three.Vector3(inTarget.x, 0, inTarget.z)
167
- );
168
- scene.add(targetObject);
169
-
170
- spotLight.target = targetObject;
171
- spotLight.target.updateMatrixWorld();
172
- scene.add(spotLight);
173
- }
174
-
175
- const dirLightPos = new Three.Vector3(
176
- inbBox.max.x,
177
- inbBox.max.y + 1.8 * Math.abs(inbBox.max.y - inbBox.min.y),
178
- inbBox.min.z - 0.5 * Math.abs(inbBox.max.z - inbBox.min.z)
179
- );
180
-
181
- addDirLight('white', 1.5, dirLightPos);
182
-
183
- const ceiling = scene3D.getObjectByName('ceil');
184
- if (ceiling) {
185
- const ceilBBox = new Three.Box3().setFromObject(ceiling);
186
-
187
- const spot1 = new Three.Vector3(
188
- ceilBBox.min.x + Math.abs(ceilBBox.min.x - ceilBBox.max.x) / 4,
189
- ceilBBox.max.y - 0.5,
190
- ceilBBox.min.z + Math.abs(ceilBBox.min.z - inbBox.max.z) / 4
191
- );
192
- const spot2 = new Three.Vector3(
193
- ceilBBox.min.x + Math.abs(ceilBBox.min.x - ceilBBox.max.x) / 4,
194
- ceilBBox.max.y - 0.5,
195
- ceilBBox.max.z - Math.abs(ceilBBox.min.z - ceilBBox.max.z) / 4
196
- );
197
-
198
- const spot3 = new Three.Vector3(
199
- ceilBBox.max.x - Math.abs(ceilBBox.min.x - ceilBBox.max.x) / 4,
200
- ceilBBox.max.y - 0.5,
201
- ceilBBox.min.z + Math.abs(ceilBBox.min.z - ceilBBox.max.z) / 4
202
- );
203
- const spot4 = new Three.Vector3(
204
- ceilBBox.max.x - Math.abs(ceilBBox.min.x - ceilBBox.max.x) / 4,
205
- ceilBBox.max.y - 0.5,
206
- ceilBBox.max.z - Math.abs(ceilBBox.min.z - ceilBBox.max.z) / 4
207
- );
208
-
209
- const spotlightDis = 1.5 * Math.abs(inbBox.min.y - inbBox.max.y);
210
-
211
- // check if spotlight is inside the room
212
- vectorIntersectWithMesh(spot1, scene3D.getObjectByName('floor')) &&
213
- addSpotLight('0xffffff', 0.8, spot1, spot1, spotlightDis);
214
- vectorIntersectWithMesh(spot2, scene3D.getObjectByName('floor')) &&
215
- addSpotLight('0xffffff', 0.8, spot2, spot2, spotlightDis);
216
- vectorIntersectWithMesh(spot3, scene3D.getObjectByName('floor')) &&
217
- addSpotLight('0xffffff', 0.8, spot3, spot3, spotlightDis);
218
- vectorIntersectWithMesh(spot4, scene3D.getObjectByName('floor')) &&
219
- addSpotLight('0xffffff', 0.8, spot4, spot4, spotlightDis);
220
- }
221
- }
222
- }
223
-
224
- // Load data
225
- this.setState({ isLoading: true, waitForRender: 0 });
226
- this.props.setIsLoading3D(true);
227
- const { promise, planData } = parseData(
228
- scene,
229
- actions,
230
- this.context.catalog,
231
- camera,
232
- this.renderer,
233
- state.mode
234
- );
235
-
236
- promise.then(() => {
237
- let objToRemove = [];
238
- planData.plan.traverse(obj => {
239
- if (obj.geometry === null) {
240
- objToRemove.push(obj);
241
- }
242
- });
243
- objToRemove.forEach(obj => {
244
- obj.removeFromParent();
245
- });
246
- const bbox = new Three.Box3().setFromObject(planData.plan);
247
- if (!ARRAY_ELEVATION_VIEW_MODES.includes(state.mode)) {
248
- //cameraControls.fitToBox(bbox, true);
249
- if (cameraControls) {
250
- const radius = 400; // Distance from target
251
- const angleInDegrees = 5;
252
- const angleInRadians = (angleInDegrees * Math.PI) / 180;
253
-
254
- // Calculate a position angleInDegrees to the right on the horizontal circle
255
- const eyeX = Math.sin(angleInRadians) * radius;
256
- const eyeZ = Math.cos(angleInRadians) * radius;
257
-
258
- cameraControls.setLookAt(eyeX, 0, eyeZ, 0, 0, 0); // Set camera with Y elevation
259
- }
260
- }
261
- setupLight(scene3D, planData.boundingBox);
262
-
263
- self.setState({ waitForRender: 1 });
264
- });
265
-
266
- const area = scene.getIn(['layers', scene.selectedLayer, 'areas']);
267
- const layer = scene.getIn(['layers', scene.selectedLayer]);
268
- const areas = [],
269
- lights = [];
270
-
271
- let snapBox = null;
272
-
273
- // Check for data
274
- let msg = '';
275
- scene.layers.forEach(layer => {
276
- if (layer.id === scene.selectedLayer || layer.visible) {
277
- layer.items.forEach(item => {
278
- if (item.doorStyle === null) {
279
- if (!msg.includes(item.name + "'s doorStyle is null."))
280
- msg += item.name + "'s doorStyle is null.\n";
281
- }
282
- });
283
- }
284
- });
285
- if (msg !== '') {
286
- confirm(msg);
287
- }
288
-
289
- init();
290
- render();
291
-
292
- area.forEach(data => {
293
- areas.push(data);
294
- });
295
- for (let i = 0; i < areas.length; i++) {
296
- let aVertices = [];
297
- let lines = [];
298
- let height = 100;
299
- areas[i].vertices.forEach(data => {
300
- aVertices.push(data);
301
- });
302
- layer.lines.forEach(data => {
303
- lines.push(data);
304
- });
305
- for (let i = 0; i < lines.length; i++) {
306
- let data = lines[i];
307
- let realVec = [];
308
- data.vertices.forEach(vec => {
309
- realVec.push(vec);
310
- });
311
- if (aVertices.includes(realVec[0]) && aVertices.includes(realVec[1])) {
312
- height = convert(layer.ceilHeight)
313
- .from(layer.unit)
314
- .to(UNIT_CENTIMETER);
315
- // height = data.properties.getIn(['height', 'length']);
316
- break;
317
- }
318
- }
319
- let vertices = [];
320
- areas[i].vertices.forEach(datas => {
321
- let vertex = scene.getIn([
322
- 'layers',
323
- scene.selectedLayer,
324
- 'vertices',
325
- datas
326
- ]);
327
- vertices.push(vertex);
328
- });
329
- vertices.push(vertices[0]);
330
- let fLen = vertices.length - 1;
331
- for (let i = 0; i < fLen; i++) {
332
- let sX = vertices[i].x;
333
- let sY = vertices[i].y;
334
- let eX = vertices[i + 1].x;
335
- let eY = vertices[i + 1].y;
336
- let len = Math.sqrt((eX - sX) * (eX - sX) + (eY - sY) * (eY - sY));
337
- for (let cLen = 200; cLen < len; cLen += 200) {
338
- let cX = sX + ((eX - sX) * cLen) / len;
339
- let cY = sY + ((eY - sY) * cLen) / len;
340
- let endLen = Math.sqrt((eX - cX) * (eX - cX) + (eY - cY) * (eY - cY));
341
- if (endLen <= 100) continue;
342
- let vec2 = new Three.Vector2(cX - sX, cY - sY);
343
- let angle = vec2.angle() + Math.PI / 2;
344
- cX = Math.cos(angle) * 30 + cX;
345
- cY = Math.sin(angle) * 30 + cY;
346
- let spotLight = new Three.SpotLight(0xeeeeee, 1.7);
347
- spotLight.angle = 0.76;
348
- spotLight.castShadow = true;
349
- spotLight.penumbra = 1;
350
- spotLight.decay = 1.7;
351
- spotLight.distance = height - 20;
352
- let target = new Three.Object3D();
353
- spotLight.target = target;
354
- lights.push({
355
- light: spotLight,
356
- target: target,
357
- x: cX,
358
- y: cY,
359
- height: height
360
- });
361
- }
362
- }
363
- }
364
- // //////////////////////////
365
-
366
- // OBJECT PICKING
367
- let toIntersect = [planData.plan];
368
- let mouse = new Three.Vector2();
369
- let gridPlane = planData.grid;
370
- let raycaster = new Three.Raycaster();
371
- let selectedObject = {};
372
- let currentObject = null;
373
- let isSelected = false;
374
- let bRotate = false;
375
- let bMove = false;
376
- let bMoveUP = false;
377
- /** Transformation matrix of grid */
378
- const gridMatrix = new Three.Matrix4();
379
- let rayDirection = new Three.Vector3();
380
- /** World position of grid plane */
381
- let gridPlanOrigin = new Three.Vector3();
382
- let Point = new Three.Vector2();
383
- let sPoint = new Three.Vector2();
384
-
385
- // SNAP FUNCTION VARIABLE
386
- let snapFlag = false;
387
- let snapAnimI = 0;
388
- let snapDelta = 6;
389
- let t_i = 0;
390
- let targetPoint = new Three.Vector3();
391
- let targetRot = 0;
392
- let targetUVec = new Three.Vector3();
393
- let targetCRotation = 0;
394
- let targetObj = null;
395
- let targetNumber = 0;
396
-
397
- let allItemRect;
398
- let allItemSnap;
399
- let allLines;
400
- let allLineRects;
401
- let allLineSnap;
402
- let allRect;
403
- let allArea;
404
-
405
- // end snap function variable///////////////////////
406
- let backsplashVisible = false;
407
- let holeItems = GeometryUtils.getHoleItems(layer);
408
-
409
- let removeSnapBox = () => {
410
- if (snapBox != null) {
411
- planData.plan.remove(snapBox);
412
- disposeObject(snapBox);
413
- snapBox = null;
414
- targetObj = null;
415
- snapFlag = false;
416
- }
417
- };
418
-
419
- const camToGrid = new Three.Vector3();
420
- let camPos = camera.position;
421
-
422
- const mapCursorPosition = (e, altitude) => {
423
- camToGrid.subVectors(gridPlanOrigin, camPos);
424
-
425
- let camD = camToGrid.y + (altitude ? altitude : 0);
426
- let rayD = rayDirection.y;
427
-
428
- const intersectPt = rayDirection.multiplyScalar(camD / rayD).add(camPos);
429
- intersectPt.y = gridPlanOrigin.y;
430
- intersectPt.applyMatrix4(gridMatrix);
431
-
432
- return { x: intersectPt.x, y: -intersectPt.z };
433
- };
434
-
435
- /* for Snap Functions*/
436
-
437
- let pointLineDistance = function (point, line) {
438
- // return distance from point to line and directional point of line
439
- let pX = point.x;
440
- let pY = point.y;
441
- let l1x = line[0].x;
442
- let l1y = line[0].y;
443
- let l2x = line[1].x;
444
- let l2y = line[1].y;
445
- let pLine = new Three.Vector2(l1x - pX, l1y - pY);
446
- let Line = new Three.Vector2(l1x - l2x, l1y - l2y);
447
- let pAngle = pLine.angle();
448
- let lAngle = Line.angle();
449
- let pDistance = pLine.length();
450
- let oDistance = Line.length();
451
- let directDistance = Math.sin(pAngle - lAngle) * pDistance;
452
- let lineDistance = Math.cos(pAngle - lAngle) * pDistance;
453
- let dX = l1x + ((l2x - l1x) * lineDistance) / oDistance;
454
- let dY = l1y + ((l2y - l1y) * lineDistance) / oDistance;
455
- let dPoint = { x: dX, y: dY };
456
- return { distance: directDistance, point: dPoint };
457
- };
458
- let getInterSect = function (shape1, shape2) {
459
- // return result of intersect of two shape
460
- let count = 0;
461
- for (let i = 0; i < shape1.length - 1; i++) {
462
- let sl1 = { x: shape1[i].x, y: shape1[i].y };
463
- let sl2 = { x: shape1[i + 1].x, y: shape1[i + 1].y };
464
- for (let j = 0; j < shape2.length - 1; j++) {
465
- let el1 = { x: shape2[j].x, y: shape2[j].y };
466
- let el2 = { x: shape2[j + 1].x, y: shape2[j + 1].y };
467
- let flag = GeometryUtils.getLineInterSect(
468
- sl1.x,
469
- sl1.y,
470
- sl2.x,
471
- sl2.y,
472
- el1.x,
473
- el1.y,
474
- el2.x,
475
- el2.y
476
- );
477
- if (flag) {
478
- count++;
479
- if (count > 1) return true;
480
- }
481
- }
482
- }
483
- return false;
484
- };
485
-
486
- this.getRectPoints = function (width, height, pos, rot) {
487
- // return 4 points from it's position, width, height, and rotation info
488
- let rX = width / 2;
489
- let rY = height / 2;
490
- let vertices = [];
491
- let cRot = rot;
492
- let pX = pos.x + Math.cos(cRot) * rX + Math.cos(cRot + Math.PI / 2) * rY;
493
- let pY = pos.y + Math.sin(cRot) * rX + Math.sin(cRot + Math.PI / 2) * rY;
494
- vertices.push({ x: Math.floor(pX + 0.5), y: Math.floor(pY + 0.5) });
495
- rX = -rX;
496
- pX = pos.x + Math.cos(cRot) * rX + Math.cos(cRot + Math.PI / 2) * rY;
497
- pY = pos.y + Math.sin(cRot) * rX + Math.sin(cRot + Math.PI / 2) * rY;
498
- vertices.push({ x: Math.floor(pX + 0.5), y: Math.floor(pY + 0.5) });
499
- rY = -rY;
500
- pX = pos.x + Math.cos(cRot) * rX + Math.cos(cRot + Math.PI / 2) * rY;
501
- pY = pos.y + Math.sin(cRot) * rX + Math.sin(cRot + Math.PI / 2) * rY;
502
- vertices.push({ x: Math.floor(pX + 0.5), y: Math.floor(pY + 0.5) });
503
- rX = -rX;
504
- pX = pos.x + Math.cos(cRot) * rX + Math.cos(cRot + Math.PI / 2) * rY;
505
- pY = pos.y + Math.sin(cRot) * rX + Math.sin(cRot + Math.PI / 2) * rY;
506
- vertices.push({ x: Math.floor(pX + 0.5), y: Math.floor(pY + 0.5) });
507
- vertices.push(vertices[0]);
508
- vertices.push(vertices[2]);
509
- return vertices;
510
- };
511
-
512
- const prepareSnap = layer => {
513
- allLines = GeometryUtils.getAllLines(layer);
514
- allLineRects = GeometryUtils.buildRectFromLines(layer, allLines);
515
- allItemRect = GeometryUtils.getAllItems(
516
- this.props.state.scene,
517
- actions.catalog,
518
- allLineRects
519
- );
520
- allItemSnap = GeometryUtils.getAllItemSnap(allItemRect);
521
- allLineSnap = GeometryUtils.getAllLineSnap(allLineRects, allItemRect.cur);
522
- allRect = allItemRect.others.concat(allLineRects);
523
- allItemSnap = GeometryUtils.validateSnaps(allItemSnap, allRect);
524
- allLineSnap = GeometryUtils.validateSnaps(allLineSnap, allRect);
525
- allArea = GeometryUtils.getAllArea(layer);
526
- };
527
-
528
- // prepareSnapSpec(layer);
529
- let lineRect = layer => {
530
- let areainfo = [];
531
- layer.areas.forEach(area => {
532
- let sz = area.vertices.size;
533
- for (var i = 0; i < sz; i++) {
534
- areainfo.push(area.vertices.get(i));
535
- }
536
- });
537
- let rect = [];
538
- areainfo.forEach(area => {
539
- let vert = layer.vertices.get(area);
540
- rect.push(vert.x, vert.y);
541
- });
542
- return rect;
543
- };
544
-
545
- this.collisionCheck = function (obj, pos, rot, tObj, item = null, catalog) {
546
- //collision check from one object to every other object excpet target object
547
- let layer = this.props.state.scene.getIn([
548
- 'layers',
549
- obj.userData.layerId
550
- ]);
551
- let layoutpos = 'utype';
552
- if (item !== null) {
553
- let catid = item.type;
554
- let cat = catalog.elements[catid];
555
- layoutpos = cat.info.layoutpos;
556
- }
557
- let oPos = new Three.Vector2(pos.clone().x, pos.clone().y);
558
- let sBounding = obj.children[0].userData;
559
- let width = sBounding.max.x - sBounding.min.x;
560
- let depth = sBounding.max.z - sBounding.min.z;
561
- let oVertices = this.getRectPoints(
562
- width,
563
- depth,
564
- oPos.clone(),
565
- ((rot % 360) / 180) * Math.PI
566
- );
567
- let datas = [];
568
- layer.items.forEach(data => {
569
- datas.push(data);
570
- });
571
- for (let i = 0; i < datas.length; i++) {
572
- let data = datas[i];
573
- if (data.id == obj.userData.itemId || data.id == tObj.userData.itemId)
574
- continue;
575
- let target =
576
- planData.sceneGraph.layers[obj.userData.layerId].items[data.id];
577
- if (target === undefined) {
578
- console.log(
579
- data.id +
580
- ' does not exist in viewer3d/viewer3d.js collisionCheck function'
581
- );
582
- return false;
583
- }
584
- let item = layer.items.getIn([data.id]);
585
- let ocatid = item.type;
586
- let ocat = catalog.elements[ocatid];
587
- let olayoutpos = ocat.info.layoutpos;
588
- if (
589
- !(
590
- (layoutpos === BASE_CABINET_LAYOUTPOS &&
591
- olayoutpos === WALL_CABINET_LAYOUTPOS) ||
592
- (layoutpos === WALL_CABINET_LAYOUTPOS &&
593
- olayoutpos === BASE_CABINET_LAYOUTPOS)
594
- )
595
- ) {
596
- let tRot = item.rotation;
597
- let tPos = new Three.Vector2(item.x, item.y);
598
- let tBounding = target.children[0].userData;
599
- let twidth = tBounding.max.x - tBounding.min.x;
600
- let tdepth = tBounding.max.z - tBounding.min.z;
601
- let tVertices = this.getRectPoints(
602
- twidth,
603
- tdepth,
604
- tPos.clone(),
605
- ((tRot % 360) / 180) * Math.PI
606
- );
607
- if (getInterSect(oVertices, tVertices)) {
608
- return false;
609
- }
610
- }
611
- }
612
- datas = [];
613
- layer.lines.forEach(data => {
614
- datas.push(data);
615
- });
616
- for (let i = 0; i < datas.length; i++) {
617
- let data = datas[i];
618
- if (data.id == obj.userData.itemId || data.id == tObj.userData.itemId)
619
- continue;
620
- let item = layer.lines.getIn([data.id]);
621
- // let llayoutpos = catalog.elements[item.type].info.layoutpos;
622
- let vertices = [];
623
- item.vertices.forEach(data => {
624
- let vertex = layer.vertices.get(data);
625
- vertices.push({ x: vertex.x, y: vertex.y });
626
- });
627
- let vec = new Three.Vector2(
628
- vertices[1].x - vertices[0].x,
629
- vertices[1].y - vertices[0].y
630
- );
631
- let tRot = vec.angle();
632
- let tPos = new Three.Vector2(
633
- (vertices[0].x + vertices[1].x) / 2,
634
- (vertices[0].y + vertices[1].y) / 2
635
- );
636
- let tdepth = item.properties.getIn(['thickness', 'length']);
637
- let twidth = Math.sqrt(vec.x * vec.x + vec.y * vec.y);
638
- let tVertices = this.getRectPoints(twidth, tdepth, tPos.clone(), tRot);
639
- if (getInterSect(oVertices, tVertices)) {
640
- return false;
641
- }
642
- }
643
- return true;
644
- };
645
-
646
- this.collisionHoleCheck = function (
647
- obj,
648
- pos,
649
- rot,
650
- tObj,
651
- item = null,
652
- catalog
653
- ) {
654
- let layer = this.props.state.scene.getIn([
655
- 'layers',
656
- obj.userData.layerId
657
- ]);
658
- let currentItem;
659
- if (item !== null) {
660
- let catid = item.type;
661
- let cat = catalog.elements[catid];
662
- currentItem = {
663
- selectedItem: item,
664
- cat
665
- };
666
- }
667
- let oPos = new Three.Vector2(pos.clone().x, pos.clone().y);
668
- let sBounding = obj.children[0].userData;
669
- let width = sBounding.max.x - sBounding.min.x;
670
- let depth = sBounding.max.z - sBounding.min.z;
671
- let oVertices = this.getRectPoints(
672
- width,
673
- depth,
674
- oPos.clone(),
675
- ((rot % 360) / 180) * Math.PI
676
- );
677
-
678
- let datas = [];
679
- layer.items.forEach(data => {
680
- datas.push(data);
681
- });
682
- for (let i = 0; i < datas.length; i++) {
683
- let data = datas[i];
684
- if (data.id == obj.userData.itemId || data.id == tObj.userData.itemId)
685
- continue;
686
- let target =
687
- planData.sceneGraph.layers[obj.userData.layerId].items[data.id];
688
- if (target === undefined) {
689
- console.log(
690
- data.id +
691
- ' does not exist in viewer3d/viewer3d.js collisionCheck function'
692
- );
693
- return false;
694
- }
695
- let item = layer.items.getIn([data.id]);
696
- let ocatid = item.type;
697
- let ocat = catalog.elements[ocatid];
698
- if (!ocat)
699
- ocat = catalog.elements[returnReplaceableDeepSearchType(ocatid)];
700
- let otherItem = {
701
- item,
702
- cat: ocat
703
- };
704
-
705
- if (
706
- GeometryUtils.needSnap(currentItem, otherItem) &&
707
- otherItem.cat.type != 'cabinet'
708
- ) {
709
- let tRot = item.rotation;
710
- let tPos = new Three.Vector2(item.x, item.y);
711
- let tBounding = target.children[0].userData;
712
- let twidth = tBounding.max.x - tBounding.min.x;
713
- let tdepth = tBounding.max.z - tBounding.min.z;
714
- let tVertices = this.getRectPoints(
715
- twidth,
716
- tdepth,
717
- tPos.clone(),
718
- ((tRot % 360) / 180) * Math.PI
719
- );
720
- if (getInterSect(oVertices, tVertices)) {
721
- return false;
722
- }
723
- }
724
- }
725
-
726
- let holes = [];
727
- layer.lines.forEach(line => {
728
- line.holes.forEach(holeID => {
729
- let hole = layer.holes.get(holeID);
730
- holes.push(hole);
731
- });
732
- });
733
- let i = 0;
734
- for (; i < holes.length; i++) {
735
- let tPos = new Three.Vector2(holes[i].x, holes[i].y);
736
- let twidth = holes[i].properties.getIn(['width', 'length']);
737
- let theight = holes[i].properties.getIn(['thickness', 'length']);
738
- let trot = holes[i].rotation;
739
- let tVertices = this.getRectPoints(twidth, theight, tPos.clone(), trot);
740
- if (getInterSect(oVertices, tVertices)) {
741
- return false;
742
- }
743
- }
744
- return true;
745
- };
746
-
747
- this.collisionSlide = function (
748
- item3D,
749
- originPos,
750
- layer,
751
- sVertices,
752
- tPos,
753
- item
754
- ) {
755
- let items = [];
756
-
757
- let cur_category = '';
758
- let catalog = actions.catalog;
759
- if (layer.selected.items.size > 0) {
760
- let selectedItem = layer.getIn(['items', layer.selected.items.get(0)]);
761
- let catid = selectedItem.type;
762
- let cat = catalog.elements[catid];
763
- if (cat === undefined || cat === null)
764
- cat = catalog.getIn(['elements', catid]);
765
- cur_category = cat.obj.category;
766
- }
767
-
768
- layer.items.forEach(data => {
769
- if (data.id == selectedObject.itemID) {
770
- return;
771
- }
772
-
773
- items.push(data.toJS());
774
- });
775
- let oPos = new Three.Vector2(originPos.x, -originPos.z);
776
-
777
- // sort from distance
778
- for (let i = 0; i < items.length - 1; i++) {
779
- for (let j = i + 1; j < items.length; j++) {
780
- if (
781
- verticesDistance(oPos, new Three.Vector2(items[i].x, items[i].y)) >
782
- verticesDistance(oPos, new Three.Vector2(items[j].x, items[j].y))
783
- ) {
784
- let exchange = items[j];
785
- items[j] = items[i];
786
- items[i] = exchange;
787
- }
788
- }
789
- }
790
- let i = 0;
791
-
792
- for (; i < items.length; i++) {
793
- if (!items[i]) return;
794
- let target =
795
- planData.sceneGraph.layers[selectedObject.layerID].items[items[i].id];
796
- if (target === undefined) {
797
- return false;
798
- }
799
- let targetData = layer.items.getIn([items[i].id]);
800
- let tRot = targetData.rotation;
801
- let tPos = new Three.Vector2(targetData.x, targetData.y);
802
- let tBounding = target.children[0].userData;
803
- let twidth = tBounding.max.x - tBounding.min.x;
804
- let tdepth = tBounding.max.z - tBounding.min.z;
805
- let tVertices = this.getRectPoints(
806
- twidth,
807
- tdepth,
808
- tPos.clone(),
809
- ((tRot % 360) / 180) * Math.PI
810
- );
811
- if (getInterSect(sVertices, tVertices)) {
812
- break;
813
- }
814
- }
815
- if (items.length == 0 || !items[i]) return;
816
- let target =
817
- planData.sceneGraph.layers[selectedObject.layerID].items[items[i].id];
818
- let targetData = layer.items.getIn([items[i].id]);
819
- let targetPos = new Three.Vector2(targetData.x, targetData.y);
820
- let tRot = targetData.rotation;
821
- let tBounding = target.children[0].userData;
822
- let twidth = tBounding.max.x - tBounding.min.x;
823
- let tdepth = tBounding.max.z - tBounding.min.z;
824
- let tVertices = this.getRectPoints(
825
- twidth,
826
- tdepth,
827
- targetPos.clone(),
828
- ((tRot % 360) / 180) * Math.PI
829
- );
830
- // ////////////////////////
831
- let vArray = [];
832
- let dteArray = [];
833
- let lineArray = [];
834
- let vdistanceArray = [];
835
- let cVecArray = [];
836
- let inFlag = false;
837
- for (let i = 0; i < 4; i++) {
838
- let v1 = tVertices[i];
839
- let v2 = tVertices[i + 1];
840
- let data = pointLineDistance({ x: tPos.x, y: tPos.y }, [
841
- { x: v1.x, y: v1.y },
842
- { x: v2.x, y: v2.y }
843
- ]);
844
- dteArray.push(data.distance);
845
- vArray.push(data.point);
846
- lineArray.push([v1, v2]);
847
- }
848
- // if tPos in target object
849
- let tPosDistance =
850
- Math.abs(pointLineDistance(tPos, lineArray[0]).distance) +
851
- Math.abs(pointLineDistance(tPos, lineArray[2]).distance);
852
- let realDistance = new Three.Vector2(
853
- lineArray[1][0].x - lineArray[1][1].x,
854
- lineArray[1][0].y - lineArray[1][1].y
855
- ).length();
856
- let tPosDistance1 =
857
- Math.abs(pointLineDistance(tPos, lineArray[1]).distance) +
858
- Math.abs(pointLineDistance(tPos, lineArray[3]).distance);
859
- let realDistance1 = new Three.Vector2(
860
- lineArray[0][0].x - lineArray[0][1].x,
861
- lineArray[0][0].y - lineArray[0][1].y
862
- ).length();
863
- if (
864
- Math.abs(Math.abs(tPosDistance) - Math.abs(realDistance)) < 0.01 &&
865
- Math.abs(Math.abs(tPosDistance1) - Math.abs(realDistance1)) < 0.01
866
- )
867
- inFlag = true;
868
- // ////////////////////
869
- let key = 0;
870
- // sort distance from origin point
871
- for (let j = 0; j < dteArray.length - 1; j++) {
872
- for (let k = j + 1; k < dteArray.length; k++) {
873
- if (Math.abs(dteArray[j]) > Math.abs(dteArray[k])) {
874
- let temp = dteArray[k];
875
- dteArray[j] = dteArray[k];
876
- dteArray[k] = temp;
877
- let temp1 = vArray[k];
878
- vArray[j] = vArray[k];
879
- vArray[k] = temp1;
880
- let temp2 = lineArray[k];
881
- lineArray[j] = lineArray[k];
882
- lineArray[k] = temp2;
883
- }
884
- }
885
- }
886
- // //////////////////////////////
887
- for (let i = 0; i < 4; i++) {
888
- let data = pointLineDistance(sVertices[i], lineArray[key]);
889
- vdistanceArray.push(data.distance);
890
- cVecArray.push({
891
- x: data.point.x - sVertices[i].x,
892
- y: data.point.y - sVertices[i].y
893
- });
894
- }
895
-
896
- for (let j = 0; j < vdistanceArray.length; j++) {
897
- let tX = tPos.x + cVecArray[j].x;
898
- let tY = tPos.y + cVecArray[j].y;
899
- if (
900
- this.collisionCheck(
901
- item3D,
902
- new Three.Vector2(tX, tY),
903
- item.rotation,
904
- {
905
- userData: { itemId: null }
906
- },
907
- item,
908
- this.context.catalog
909
- )
910
- ) {
911
- item3D.position.set(tX, originPos.y, -tY);
912
- sPoint.set(tX, tY);
913
- break;
914
- }
915
- }
916
- };
917
-
918
- this.snap = function (obj, layer) {
919
- // snap operation
920
- let target = obj.userData.target;
921
- for (; target.parent != null; ) {
922
- if (target.name == 'pivot') break;
923
- target = target.parent;
924
- }
925
- let source = obj.parent.parent.parent;
926
- if (target.userData.type == 'item') {
927
- let sRot = layer.getIn(['items', source.userData.itemId]).rotation;
928
- let tRot = layer.getIn(['items', target.userData.itemId])
929
- ? layer.getIn(['items', target.userData.itemId]).rotation
930
- : 0;
931
- let item = layer.getIn(['items', source.userData.itemId]);
932
- let layoutType = item.layoutpos;
933
- let altitudeLength = convert(
934
- item.properties.getIn(['altitude', '_length'])
935
- )
936
- .from('in')
937
- .to('cm');
938
- let sBounding = source.children[0].userData;
939
- let tBounding = target.children[0].userData;
940
- let tPos = target.position.clone();
941
- let width = sBounding.max.x - sBounding.min.x;
942
- let height = sBounding.max.y - sBounding.min.y;
943
- let depth = sBounding.max.z - sBounding.min.z;
944
- let snapBoxGeom = new Three.BoxGeometry(width, height, depth);
945
- let snapBoxObj = new Three.Mesh(
946
- snapBoxGeom,
947
- new Three.MeshBasicMaterial({
948
- // color: 0x2cde6b,
949
- // opacity: 0.7,
950
- transparent: true,
951
- blending: Three.MultiplyBlending
952
- })
953
- );
954
- let removeSnapBoxObj = () => {
955
- if (snapBoxObj) {
956
- planData.plan.remove(snapBoxObj);
957
- disposeObject(snapBoxObj);
958
- }
959
- snapFlag = false;
960
- };
961
- let box = new Three.BoxHelper(snapBoxObj, 0xffffff);
962
- box.material.linewidth = 2;
963
- box.material.depthTest = false;
964
- box.renderOrder = 200;
965
- snapBoxObj.add(box);
966
- snapBoxObj.position.set(
967
- source.position.x,
968
- layoutType === WALL_CABINET_LAYOUTPOS
969
- ? altitudeLength + source.position.y + height / 2
970
- : source.position.y + height / 2,
971
- source.position.z
972
- );
973
- snapBoxObj.rotation.set(
974
- source.rotation.x,
975
- source.rotation.y,
976
- source.rotation.z
977
- );
978
- snapBoxObj.name = 'TransformBox';
979
- planData.plan.add(snapBoxObj);
980
- let deltaX =
981
- (tBounding.max.x - tBounding.min.x) / 2 +
982
- (sBounding.max.x - sBounding.min.x) / 2;
983
- let deltaZ =
984
- (tBounding.max.z - tBounding.min.z) / 2 -
985
- (sBounding.max.z - sBounding.min.z) / 2;
986
- let sPos = snapBoxObj.position.clone();
987
- // avaliable snap place///////////////
988
- let tPoses = [];
989
- let pX =
990
- tPos.x +
991
- deltaX * Math.cos((tRot / 180) * Math.PI) +
992
- deltaZ * Math.sin((tRot / 180) * Math.PI);
993
- let pZ =
994
- tPos.z -
995
- deltaX * Math.sin((tRot / 180) * Math.PI) +
996
- deltaZ * Math.cos((tRot / 180) * Math.PI);
997
- tPoses.push(new Three.Vector3(pX, 0, pZ));
998
- deltaX = -deltaX;
999
- pX =
1000
- tPos.x +
1001
- deltaX * Math.cos((tRot / 180) * Math.PI) +
1002
- deltaZ * Math.sin((tRot / 180) * Math.PI);
1003
- pZ =
1004
- tPos.z -
1005
- deltaX * Math.sin((tRot / 180) * Math.PI) +
1006
- deltaZ * Math.cos((tRot / 180) * Math.PI);
1007
- tPoses.push(new Three.Vector3(pX, 0, pZ));
1008
- deltaX =
1009
- (tBounding.max.x - tBounding.min.x) / 2 -
1010
- (sBounding.max.x - sBounding.min.x) / 2;
1011
- deltaZ =
1012
- -(tBounding.max.z - tBounding.min.z) / 2 -
1013
- (sBounding.max.z - sBounding.min.z) / 2;
1014
- pX =
1015
- tPos.x +
1016
- deltaX * Math.cos((tRot / 180) * Math.PI) +
1017
- deltaZ * Math.sin((tRot / 180) * Math.PI);
1018
- pZ =
1019
- tPos.z -
1020
- deltaX * Math.sin((tRot / 180) * Math.PI) +
1021
- deltaZ * Math.cos((tRot / 180) * Math.PI);
1022
- tPoses.push(new Three.Vector3(pX, 0, pZ));
1023
- deltaX = -deltaX;
1024
- pX =
1025
- tPos.x +
1026
- deltaX * Math.cos((tRot / 180) * Math.PI) +
1027
- deltaZ * Math.sin((tRot / 180) * Math.PI);
1028
- pZ =
1029
- tPos.z -
1030
- deltaX * Math.sin((tRot / 180) * Math.PI) +
1031
- deltaZ * Math.cos((tRot / 180) * Math.PI);
1032
- tPoses.push(new Three.Vector3(pX, 0, pZ));
1033
- let distance = Math.sqrt(
1034
- (sPos.x - tPoses[0].x) * (sPos.x - tPoses[0].x) +
1035
- (sPos.z - tPoses[0].z) * (sPos.z - tPoses[0].z)
1036
- );
1037
- let tNum = 1;
1038
- tPos = tPoses[0].clone();
1039
- for (let i = 1; i < tPoses.length; i++) {
1040
- let curDis = Math.sqrt(
1041
- (sPos.x - tPoses[i].x) * (sPos.x - tPoses[i].x) +
1042
- (sPos.z - tPoses[i].z) * (sPos.z - tPoses[i].z)
1043
- );
1044
- if (curDis < distance) {
1045
- distance = curDis;
1046
- tNum = i + 1;
1047
- tPos = tPoses[i].clone();
1048
- }
1049
- }
1050
- // //////////////////////////////////
1051
- if (
1052
- targetObj != null &&
1053
- targetObj.userData.itemId == target.userData.itemId &&
1054
- tNum == targetNumber
1055
- ) {
1056
- removeSnapBoxObj();
1057
- return;
1058
- } else {
1059
- removeSnapBox();
1060
- }
1061
- // //////////////////////////////////
1062
- if (tNum >= 3) tRot += 180;
1063
-
1064
- snapAnimI = 0;
1065
- t_i = 0;
1066
- targetObj = target;
1067
- targetNumber = tNum;
1068
- targetRot = tRot;
1069
- targetPoint = tPos;
1070
- snapBox = snapBoxObj;
1071
- let cx = sPos.x - tPos.x;
1072
- let cz = sPos.z - tPos.z;
1073
- targetUVec = new Three.Vector3(cx, 0, cz);
1074
- targetCRotation = (((tRot - sRot) % 360) / 180) * Math.PI;
1075
- } else {
1076
- let item = layer.getIn(['items', source.userData.itemId]);
1077
- if (holeItems.length) {
1078
- let i;
1079
- for (i = 0; i < holeItems.length; i++) {
1080
- let hole = holeItems[i];
1081
- if (Math.abs(Math.sin(selectedObj.rotRad)) === 1) {
1082
- if (
1083
- item.y + selectedObj.size.width / 2 >=
1084
- hole.y - hole.width / 2 &&
1085
- item.y - selectedObj.size.width / 2 <=
1086
- hole.y + hole.width / 2 &&
1087
- (selectedObj.rotRad == 0 || selectedObj.rotRad == -Math.PI / 2
1088
- ? item.x <= hole.x &&
1089
- item.x + selectedObj.size.height >= hole.x
1090
- : item.x >= hole.x &&
1091
- item.x - selectedObj.size.height <= hole.x)
1092
- )
1093
- break;
1094
- } else {
1095
- if (
1096
- item.x + selectedObj.size.width / 2 >=
1097
- hole.x - hole.width / 2 &&
1098
- item.x - selectedObj.size.width / 2 <=
1099
- hole.x + hole.width / 2 &&
1100
- (selectedObj.rotRad == 0 || selectedObj.rotRad == -Math.PI / 2
1101
- ? item.y <= hole.y &&
1102
- item.y + selectedObj.size.height >= hole.y
1103
- : item.y >= hole.y &&
1104
- item.y - selectedObj.size.height <= hole.y)
1105
- )
1106
- break;
1107
- }
1108
- }
1109
- if (i != holeItems.length) return;
1110
- }
1111
- if (target.userData.type == 'hole') {
1112
- snapFlag = false;
1113
- return;
1114
- } else {
1115
- let layoutType = item.layoutpos;
1116
- let altitudeLength = convert(
1117
- item.properties.getIn(['altitude', '_length'])
1118
- )
1119
- .from('in')
1120
- .to('cm');
1121
- let sBounding = source.children[0].userData;
1122
- let width = sBounding.max.x - sBounding.min.x;
1123
- let height = sBounding.max.y - sBounding.min.y;
1124
- let depth = sBounding.max.z - sBounding.min.z;
1125
- let snapBoxGeom = new Three.BoxGeometry(width, height, depth);
1126
- let snapBoxObj = new Three.Mesh(
1127
- snapBoxGeom,
1128
- new Three.MeshBasicMaterial({
1129
- // color: 0x2cde6b,
1130
- // opacity: 0.7,
1131
- transparent: true,
1132
- blending: Three.MultiplyBlending
1133
- })
1134
- );
1135
- let removeSnapBoxObj = () => {
1136
- if (snapBoxObj) {
1137
- planData.plan.remove(snapBoxObj);
1138
- disposeObject(snapBoxObj);
1139
- }
1140
- snapFlag = false;
1141
- };
1142
- let box = new Three.BoxHelper(snapBoxObj, 0xffffff);
1143
- box.material.linewidth = 2;
1144
- box.material.depthTest = false;
1145
- box.renderOrder = 100;
1146
- snapBoxObj.add(box);
1147
-
1148
- snapBoxObj.position.set(
1149
- source.position.x,
1150
- layoutType === WALL_CABINET_LAYOUTPOS
1151
- ? altitudeLength + source.position.y + height / 2
1152
- : source.position.y + height / 2,
1153
- source.position.z
1154
- );
1155
- snapBoxObj.rotation.set(
1156
- source.rotation.x,
1157
- source.rotation.y,
1158
- source.rotation.z
1159
- );
1160
- snapBoxObj.name = 'TransformBox';
1161
- planData.plan.add(snapBoxObj);
1162
-
1163
- let snapLine = layer.getIn(['lines', target.userData.lineId]);
1164
- // let snapLineThickness = snapLine.properties.getIn([
1165
- // 'thickness',
1166
- // 'length'
1167
- // ]);
1168
- let snapLineThickness = 10.64;
1169
- let vertices = [];
1170
- if (snapLine === undefined) return;
1171
- snapLine.vertices.forEach(data => {
1172
- let vec = layer.getIn(['vertices', data]);
1173
- vertices.push(vec);
1174
- });
1175
- let iX = source.position.clone().x;
1176
- let iY = -source.position.clone().z;
1177
- let lineVec = new Three.Vector2(
1178
- vertices[1].x - vertices[0].x,
1179
- vertices[1].y - vertices[0].y
1180
- );
1181
- let oLength = Math.sqrt(
1182
- lineVec.x * lineVec.x + lineVec.y * lineVec.y
1183
- );
1184
- lineVec.normalize();
1185
- let vec2 = new Three.Vector2(iX - vertices[0].x, iY - vertices[0].y);
1186
- let vec2Legnth = Math.sqrt(vec2.x * vec2.x + vec2.y * vec2.y);
1187
- let angle = Math.abs(lineVec.angle() - vec2.angle());
1188
- angle = angle > Math.PI ? 2 * Math.PI - angle : angle;
1189
- let lineLength = Math.cos(angle) * vec2Legnth;
1190
- let transLength = 0;
1191
- if (lineLength < 100) {
1192
- transLength = -lineLength + (snapLineThickness + width) / 2;
1193
- }
1194
- if (lineLength > oLength - 100) {
1195
- transLength =
1196
- -lineLength - (snapLineThickness + width) / 2 + oLength;
1197
- }
1198
- let directPoint = new Three.Vector2(
1199
- lineVec.x * lineLength + vertices[0].x,
1200
- lineVec.y * lineLength + vertices[0].y
1201
- );
1202
- let directLine = new Three.Vector2(
1203
- directPoint.x - iX,
1204
- directPoint.y - iY
1205
- );
1206
- let dLength = Math.sqrt(
1207
- (iX - directPoint.x) * (iX - directPoint.x) +
1208
- (iY - directPoint.y) * (iY - directPoint.y)
1209
- );
1210
- let reduceLen = (snapLineThickness + depth) / 2;
1211
- let scale = (dLength - reduceLen) / dLength;
1212
- let tPos = new Three.Vector2(
1213
- iX + (directPoint.x - iX) * scale + lineVec.x * transLength,
1214
- iY + (directPoint.y - iY) * scale + lineVec.y * transLength
1215
- );
1216
- let realAngle = directLine.angle() - Math.PI / 2;
1217
- let tRot = (realAngle * 180) / Math.PI;
1218
- let sPos = new Three.Vector2(iX, iY);
1219
- let sRot = item.rotation;
1220
- let tNum = 0;
1221
- // //////////////////////////////////////
1222
- // check part////
1223
- let result = this.collisionCheck(
1224
- source,
1225
- tPos,
1226
- tRot,
1227
- target,
1228
- item,
1229
- this.context.catalog
1230
- );
1231
- // console.log('result', result);
1232
- if (result == false) {
1233
- removeSnapBoxObj();
1234
- removeSnapBox();
1235
- return;
1236
- }
1237
- // ////////////////
1238
- if (targetObj === target && snapBox !== null) {
1239
- removeSnapBoxObj();
1240
- snapAnimI = 20;
1241
- targetPoint = new Three.Vector3(tPos.x, 0, -tPos.y);
1242
- let sourcePos = snapBox.position.clone();
1243
- let cx = sourcePos.x - targetPoint.x;
1244
- let cz = sourcePos.z - targetPoint.z;
1245
- targetUVec = new Three.Vector3(cx, 0, cz);
1246
- targetRot = tRot;
1247
- targetCRotation = (((tRot - sRot) % 360) / 180) * Math.PI;
1248
- snapFlag = false;
1249
- return;
1250
- } else {
1251
- removeSnapBox();
1252
- }
1253
- // //////////////////////////////////////
1254
- snapAnimI = 0;
1255
- t_i = 0;
1256
- targetObj = target;
1257
- targetNumber = tNum;
1258
- targetRot = tRot;
1259
- targetPoint = new Three.Vector3(tPos.x, 0, -tPos.y);
1260
- snapBox = snapBoxObj;
1261
- let sourcePos = snapBox.position.clone();
1262
- let cx = sourcePos.x - targetPoint.x;
1263
- let cz = sourcePos.z - targetPoint.z;
1264
- targetUVec = new Three.Vector3(cx, 0, cz);
1265
- targetRot = tRot;
1266
- targetCRotation = (((tRot - sRot) % 360) / 180) * Math.PI;
1267
- }
1268
- }
1269
- };
1270
-
1271
- /*end of snap functions*/
1272
- let selectedObj = null;
1273
- let firstMove = false;
1274
- let prevX, prevY;
1275
-
1276
- let selObj = null;
1277
-
1278
- let createToolObject = () => {
1279
- const canvas = document.createElement('canvas');
1280
- canvas.width = 100;
1281
- canvas.height = 200;
1282
- canvas.style.width = 50 + 'px';
1283
- canvas.style.height = 100 + 'px';
1284
- const ctx = canvas.getContext('2d');
1285
- ctx.fillStyle = '#FFFFFF';
1286
- ctx.strokeStyle = '#000000';
1287
- ctx.beginPath();
1288
- ctx.arc(50, 50, 40, 0, 4 * Math.PI);
1289
- ctx.fill();
1290
- ctx.stroke();
1291
- let img1 = new Image();
1292
- img1.crossOrigin = 'anonymous';
1293
- img1.src = '/assets/img/svg/3d_item_rotation.svg';
1294
- img1.onload = function () {
1295
- ctx.drawImage(img1, 16, 16, 68, 68);
1296
- };
1297
-
1298
- ctx.beginPath();
1299
- ctx.arc(50, 150, 40, 0, 4 * Math.PI);
1300
- ctx.fill();
1301
- ctx.stroke();
1302
- let img2 = new Image();
1303
- img2.crossOrigin = 'anonymous';
1304
- img2.src = '/assets/img/svg/3d_item_move.svg';
1305
- img2.onload = function () {
1306
- ctx.drawImage(img2, 16, 116, 68, 68);
1307
- };
1308
-
1309
- return canvas;
1310
- };
1311
-
1312
- let clockWise = true;
1313
- let lastAngle = 0;
1314
-
1315
- let createAngleObject = rotate => {
1316
- const canvas = document.createElement('canvas');
1317
- canvas.width = 100;
1318
- canvas.height = 100;
1319
- canvas.style.width = 100 + 'px';
1320
- canvas.style.height = 100 + 'px';
1321
- const ctx = canvas.getContext('2d');
1322
- ctx.strokeStyle = '#FFFFFF';
1323
- ctx.lineWidth = 10;
1324
- ctx.beginPath();
1325
- ctx.arc(50, 50, 45, 0, 2 * Math.PI);
1326
- ctx.stroke();
1327
-
1328
- ctx.strokeStyle = SECONDARY_PURPLE_COLOR;
1329
- ctx.lineWidth = 6;
1330
- ctx.beginPath();
1331
- if (lastAngle < 15 && lastAngle > -15) {
1332
- if (rotate >= 0) {
1333
- clockWise = false;
1334
- } else {
1335
- clockWise = true;
1336
- }
1337
- if (lastAngle === 0) {
1338
- if (rotate > -180) {
1339
- clockWise = true;
1340
- } else {
1341
- clockWise = false;
1342
- }
1343
- }
1344
- }
1345
-
1346
- ctx.arc(50, 50, 45, 0, (rotate / 180.0) * Math.PI, clockWise);
1347
- ctx.stroke();
1348
-
1349
- lastAngle = rotate;
1350
-
1351
- return canvas;
1352
- };
1353
-
1354
- let toolTexture = new Three.Texture(createToolObject());
1355
- toolTexture.needsUpdate = true;
1356
-
1357
- let toolObj = new Three.Sprite(
1358
- new Three.SpriteMaterial({ map: toolTexture, sizeAttenuation: true })
1359
- );
1360
- toolObj.material.transparent = true;
1361
- toolObj.material.depthTest = false;
1362
- toolObj.scale.set(20, 40, 20);
1363
- toolObj.renderOrder = 3;
1364
- toolObj.name = 'toolObj';
1365
-
1366
- let angleTexture = new Three.Texture(createAngleObject(0));
1367
- angleTexture.needsUpdate = true;
1368
-
1369
- let angleObj = new Three.Sprite(
1370
- new Three.SpriteMaterial({ map: angleTexture, sizeAttenuation: false })
1371
- );
1372
-
1373
- angleObj.scale.set(0.075, 0.075, 0.075);
1374
- angleObj.material.transparent = true;
1375
- angleObj.material.depthTest = false;
1376
- angleObj.renderOrder = 3;
1377
- angleObj.name = 'angleObj';
1378
-
1379
- /**
1380
- * Calculate plane point of mouse with `event` & `altitude`
1381
- * * Calculate mouse.x & mouse.y
1382
- * * Set raycaster from camera & Set raycaster direction
1383
- * * Calculate Point & dispatch an action
1384
- */
1385
- const getPoint = (e, alti) => {
1386
- mouse.x = (e.offsetX / this.width) * 2 - 1;
1387
- mouse.y = (-e.offsetY / this.height) * 2 + 1;
1388
-
1389
- raycaster.setFromCamera(mouse, camera);
1390
- rayDirection = raycaster.ray.direction;
1391
-
1392
- Point = mapCursorPosition(e, alti);
1393
- this.context.projectActions.updateMouseCoord(Point);
1394
- };
1395
-
1396
- const getIntersectWallPoint = e => {
1397
- mouse.x = (e.offsetX / this.width) * 2 - 1;
1398
- mouse.y = (-e.offsetY / this.height) * 2 + 1;
1399
-
1400
- raycaster.setFromCamera(mouse, camera);
1401
- rayDirection = raycaster.ray.direction;
1402
-
1403
- let lines = planData.sceneGraph.layers[scene.selectedLayer].lines;
1404
- let keys = Object.keys(lines);
1405
- let arrMesh = [];
1406
- keys.forEach(key => {
1407
- lines[key].children[0].children.forEach(mesh => {
1408
- if (mesh.name == 'soul' && mesh.visible) arrMesh.push(mesh);
1409
- });
1410
- });
1411
- if (arrMesh.length > 0) {
1412
- const intersects = raycaster.intersectObjects(arrMesh);
1413
- if (intersects.length > 0) {
1414
- let intersectPt = intersects[0].point;
1415
- intersectPt.applyMatrix4(gridMatrix);
1416
-
1417
- Point = { x: intersectPt.x, y: -intersectPt.z };
1418
- this.context.projectActions.updateMouseCoord(Point);
1419
- return true;
1420
- }
1421
- }
1422
-
1423
- return false;
1424
- };
1425
-
1426
- this.mouseDownEvent = event => {
1427
- gridPlanOrigin = gridPlane.position;
1428
- gridMatrix.copy(gridPlane.matrixWorld).invert();
1429
- let altitude = 0;
1430
- if (
1431
- allItemRect &&
1432
- allItemRect.cur &&
1433
- allItemRect.cur.itemInfo !== undefined
1434
- ) {
1435
- let properties = allItemRect.cur.itemInfo.properties;
1436
- altitude = properties.getIn(['altitude', '_length']);
1437
- let unit = properties.getIn(['altitude', '_unit']) || 'in';
1438
- altitude = convert(altitude).from(unit).to(this.props.state.scene.unit);
1439
- }
1440
- getPoint(event, altitude);
1441
-
1442
- const state = this.props.state;
1443
-
1444
- this.lastMousePosition.x = mouse.x;
1445
- this.lastMousePosition.y = mouse.y;
1446
-
1447
- const layer = state.scene.getIn(['layers', state.scene.selectedLayer]);
1448
- const sCount =
1449
- layer.selected.areas.size +
1450
- layer.selected.holes.size +
1451
- layer.selected.items.size +
1452
- layer.selected.lines.size;
1453
-
1454
- if (sCount <= 0) {
1455
- isSelected = false;
1456
- } else if (sCount >= 0 && selectedObject && 'holeID' in selectedObject) {
1457
- isSelected = true;
1458
- }
1459
-
1460
- prevX = Point.x;
1461
- prevY = Point.y;
1462
-
1463
- /**
1464
- * 0 - rotate
1465
- * 1 - move up/down
1466
- * 2 - move x/y
1467
- * 3 - camera rotate
1468
- */
1469
- let transflag = 3;
1470
- raycaster.setFromCamera(mouse, camera);
1471
- const meshes = [];
1472
- toIntersect.forEach(object => {
1473
- if (!object) return;
1474
- object.traverse(o => {
1475
- if (o.isMesh) meshes.push(o);
1476
- });
1477
- });
1478
- let intersects = raycaster.intersectObjects(meshes, true);
1479
-
1480
- let toolIntersects = raycaster.intersectObjects([toolObj], true);
1481
-
1482
- if (toolIntersects.length > 0) {
1483
- let distance = Math.sqrt(
1484
- Math.pow((toolIntersects[0].uv.x - 0.5) * 50, 2) +
1485
- Math.pow((toolIntersects[0].uv.y - 0.25) * 100, 2)
1486
- );
1487
- if (distance <= 20) {
1488
- transflag = 2;
1489
- } else {
1490
- distance = Math.sqrt(
1491
- Math.pow((toolIntersects[0].uv.x - 0.5) * 50, 2) +
1492
- Math.pow((toolIntersects[0].uv.y - 0.75) * 100, 2)
1493
- );
1494
- if (distance <= 20) {
1495
- transflag = 0;
1496
- }
1497
- }
1498
- }
1499
-
1500
- if (intersects.length > 0) {
1501
- let i = 0,
1502
- length = intersects.length;
1503
- for (i = 0; i < length; i++) {
1504
- if (
1505
- intersects[i].object.type !== 'BoxHelper' &&
1506
- // intersects[i].object.type === OBJTYPE_MESH &&
1507
- intersects[i].object.name !== 'lineText' &&
1508
- intersects[i].object.name !== 'soul' &&
1509
- !intersects[i].object.name.includes('WarningBox')
1510
- )
1511
- break;
1512
- }
1513
-
1514
- if (intersects[i] !== undefined) {
1515
- if (intersects[i].object.name.indexOf('transUp') != -1) transflag = 1;
1516
- if (intersects[i].object.name.indexOf('transHole') != -1)
1517
- transflag = 2;
1518
- } else {
1519
- console.log('intersects[i] is undefined in viewer3d/viewer3d.js');
1520
- }
1521
- }
1522
-
1523
- if (this.props.state.mode == MODE_DRAWING_ITEM_3D) return;
1524
-
1525
- if (isSelected) {
1526
- if (intersects.length > 0 && !isNaN(intersects[0].distance)) {
1527
- let i;
1528
- for (i = 0; i < intersects.length; i++) {
1529
- if (
1530
- intersects[i].object instanceof Three.Mesh &&
1531
- intersects[i].object.name != 'TransformBox' &&
1532
- intersects[i].object.type != 'Line' &&
1533
- intersects[i].object.name != 'lineText' &&
1534
- intersects[i].object.name != 'countertops' &&
1535
- intersects[i].object.type != 'BoxHelper' &&
1536
- intersects[i].object.name != 'floor' &&
1537
- intersects[i].object.name != 'backFace' &&
1538
- intersects[i].object.name != 'soul' &&
1539
- !intersects[i].object.name.includes('backsplash') &&
1540
- !intersects[i].object.name.includes('WarningBox')
1541
- )
1542
- break;
1543
- }
1544
- if (intersects[i] === undefined) {
1545
- if (transflag !== 0 && transflag !== 2) {
1546
- isSelected = false;
1547
- this.context.projectActions.unselectAll();
1548
- scene3D.remove(toolObj);
1549
- this.context.itemsActions.removeReplacingSupport();
1550
- // orbitController.enableRotate = true;
1551
- return;
1552
- }
1553
- }
1554
- if (selectedObject !== undefined) {
1555
- sPoint.set(Point.x, Point.y);
1556
- if (transflag == 0) {
1557
- scene3D.remove(toolObj);
1558
- let alti = 0;
1559
- if (
1560
- allItemRect &&
1561
- allItemRect.cur &&
1562
- allItemRect.cur.itemInfo !== undefined
1563
- ) {
1564
- let properties = allItemRect.cur.itemInfo.properties;
1565
- alti = properties.getIn(['altitude', '_length']);
1566
- let unit = properties.getIn(['altitude', '_unit']) || 'in';
1567
- alti = convert(alti).from(unit).to(this.props.state.scene.unit);
1568
- }
1569
- getPoint(
1570
- { offsetX: event.offsetX - 50, offsetY: event.offsetY },
1571
- alti
1572
- );
1573
- let selectedItem =
1574
- planData.sceneGraph.layers[selectedObject.layerID].items[
1575
- selectedObject.itemID
1576
- ];
1577
- if (isUndefined(selectedItem)) return;
1578
- const selItem = this.props.state.scene.layers
1579
- .get(selectedObject.layerID)
1580
- .items.get(selectedObject.itemID);
1581
-
1582
- lastAngle = 0;
1583
-
1584
- angleObj.position.set(
1585
- planData.plan.position.x + Point.x,
1586
- selItem.category === 'lighting'
1587
- ? -planData.plan.position.y -
1588
- selItem.properties.get('height').get('length')
1589
- : selItem.properties.get('altitude').get('length') +
1590
- planData.plan.position.y,
1591
- planData.plan.position.z - Point.y
1592
- );
1593
-
1594
- angleTexture.image = createAngleObject(0);
1595
- angleTexture.needsUpdate = true;
1596
-
1597
- scene3D.add(angleObj);
1598
- this.setState({ angleObj: angleObj });
1599
- let centerPos = Point;
1600
- getPoint(event, alti);
1601
-
1602
- this.context.itemsActions.beginRotatingItem3D(
1603
- selectedObject.layerID,
1604
- selectedObject.itemID,
1605
- Point.x,
1606
- Point.y,
1607
- centerPos.x,
1608
- centerPos.y
1609
- );
1610
- bRotate = true;
1611
- } else if (transflag == 1) {
1612
- bMoveUP = true;
1613
- } else if (transflag == 2) {
1614
- switch (true) {
1615
- case 'holeID' in selectedObject:
1616
- this.context.holesActions.beginDraggingHole3D(
1617
- selectedObject.layerID,
1618
- selectedObject.holeID,
1619
- Point.x,
1620
- Point.y
1621
- );
1622
- break;
1623
- default:
1624
- this.context.itemsActions.beginDraggingItem3D(
1625
- selectedObject.layerID,
1626
- selectedObject.itemID,
1627
- Point.x,
1628
- Point.y
1629
- );
1630
- break;
1631
- }
1632
- bMove = true;
1633
- scene3D.remove(toolObj);
1634
- }
1635
- if (!ARRAY_ELEVATION_VIEW_MODES.includes(mode))
1636
- cameraControls.mouseButtons.left = CameraControls.ACTION.NONE;
1637
- }
1638
- } else {
1639
- isSelected = false;
1640
- this.context.projectActions.unselectAll();
1641
- scene3D.remove(toolObj);
1642
- this.context.itemsActions.removeReplacingSupport();
1643
- // orbitController.enableRotate = true;
1644
- return;
1645
- }
1646
- }
1647
- };
1648
-
1649
- this.renderer.setClearColor(new Three.Color(SharedStyle.COLORS.white)); // 3D background color
1650
- this.renderer.setSize(this.width, this.height);
1651
-
1652
- // Add the output of the renderer to the html element
1653
- const canvasWrapper = ReactDOM.findDOMNode(this.refs.canvasWrapper);
1654
- canvasWrapper.appendChild(this.renderer.domElement);
1655
-
1656
- //
1657
-
1658
- if (
1659
- scene.getIn(['layers', scene.selectedLayer, 'selected', 'items']).size !=
1660
- 0
1661
- ) {
1662
- // if selected Object
1663
- isSelected = true;
1664
- selectedObject.layerID = scene.selectedLayer;
1665
- selectedObject.itemID = scene
1666
- .getIn(['layers', scene.selectedLayer, 'selected', 'items'])
1667
- .toJS()[0];
1668
- setTimeout(() => {
1669
- try {
1670
- currentObject =
1671
- planData.sceneGraph.layers[selectedObject.layerID].items[
1672
- selectedObject.itemID
1673
- ];
1674
- if (isUndefined(currentObject)) return;
1675
- const selItem = this.props.state.scene.layers
1676
- .get(selectedObject.layerID)
1677
- .items.get(selectedObject.itemID);
1678
- let itemPos = currentObject.position.clone();
1679
- toolObj.position.set(
1680
- planData.plan.position.x + itemPos.x,
1681
- selItem.category === 'lighting'
1682
- ? -planData.plan.position.y -
1683
- selItem.properties.get('height').get('length')
1684
- : planData.plan.position.y + currentObject.children[0].position.y,
1685
- planData.plan.position.z + itemPos.z
1686
- );
1687
-
1688
- scene3D.add(toolObj);
1689
- this.setState({ toolObj: toolObj });
1690
- } catch (err) {
1691
- console.log(
1692
- 'selectedObject : ' +
1693
- JSON.stringify(selectedObject) +
1694
- '\nError: ' +
1695
- err
1696
- );
1697
- }
1698
- }, 2000);
1699
- }
1700
-
1701
- // Scene functions
1702
-
1703
- function init() {
1704
- clock = new Three.Clock();
1705
- scene3D = new Three.Scene();
1706
- scene3D.background = new Three.Color(0xc3cadc); // change color about v1: 0x8791AB, v2: 0xC2C2C2, v3: 0xC3CADC
1707
- // scene3D.fog = new Three.Fog(0xC3CADC, 2000, 3500);
1708
- window.scene3D = scene3D;
1709
- // Camera
1710
- if (ARRAY_ELEVATION_VIEW_MODES.includes(state.mode)) {
1711
- let { layers } = scene;
1712
- let selectedLayer = layers.get(scene.selectedLayer);
1713
- let ceilHeight = convert(selectedLayer.ceilHeight)
1714
- .from(scene.rulerUnit)
1715
- .to(scene.unit);
1716
- let vertices = selectedLayer.vertices.toJS();
1717
- let maxX = 0,
1718
- maxY = 0,
1719
- minX = 0,
1720
- minY = 0;
1721
- let lines = [];
1722
- selectedLayer.lines.toArray().forEach(line => {
1723
- let vertex0 = selectedLayer.vertices.get(line.vertices.get(0));
1724
- let vertex1 = selectedLayer.vertices.get(line.vertices.get(1));
1725
- let { x: x1, y: y1 } = vertex0;
1726
- let { x: x2, y: y2 } = vertex1;
1727
- let data = line.toJS();
1728
- data = { ...data, l0: { x: x1, y: y1 }, l1: { x: x2, y: y2 } };
1729
- switch (mode) {
1730
- case MODE_FRONT_ELEVATION_VIEW:
1731
- if (almostEqual(y1, y2) && x1 < x2) {
1732
- lines.push(data);
1733
- }
1734
- break;
1735
- case MODE_BACK_ELEVATION_VIEW:
1736
- if (almostEqual(y1, y2) && x1 > x2) {
1737
- lines.push(data);
1738
- }
1739
- break;
1740
- case MODE_LEFT_ELEVATION_VIEW:
1741
- if (almostEqual(x1, x2) && y1 < y2) {
1742
- lines.push(data);
1743
- }
1744
- break;
1745
- case MODE_RIGHT_ELEVATION_VIEW:
1746
- if (almostEqual(x1, x2) && y1 > y2) {
1747
- lines.push(data);
1748
- }
1749
- break;
1750
- default:
1751
- break;
1752
- }
1753
- });
1754
- vertices.toArray().forEach(vertex => {
1755
- if (lines.filter(line => line.vertices.includes(vertex.id)).length) {
1756
- maxX = Math.max(vertex.x, maxX);
1757
- maxY = Math.max(vertex.y, maxY);
1758
- if (minX === 0) minX = vertex.x;
1759
- if (minY === 0) minY = vertex.y;
1760
- minX = Math.min(vertex.x, minX);
1761
- minY = Math.min(vertex.y, minY);
1762
- }
1763
- });
1764
- let line_length, angle, posX, posY;
1765
- switch (state.mode) {
1766
- case MODE_FRONT_ELEVATION_VIEW:
1767
- line_length = maxX - minX;
1768
- posY = minY - 100;
1769
- posX = (minX + maxX) / 2;
1770
- angle = 0;
1771
- break;
1772
- case MODE_RIGHT_ELEVATION_VIEW:
1773
- line_length = maxY - minY;
1774
- posX = minX - 100;
1775
- posY = (minY + maxY) / 2;
1776
- angle = -Math.PI / 2;
1777
- break;
1778
- case MODE_LEFT_ELEVATION_VIEW:
1779
- line_length = maxY - minY;
1780
- posX = maxX + 100;
1781
- posY = (minY + maxY) / 2;
1782
- angle = Math.PI / 2;
1783
- break;
1784
- case MODE_BACK_ELEVATION_VIEW:
1785
- line_length = maxX - minX;
1786
- posY = maxY + 100;
1787
- posX = (minX + maxX) / 2;
1788
- angle = Math.PI;
1789
- break;
1790
- }
1791
- let scale = Math.min(
1792
- (self.width * 0.85) / line_length,
1793
- (self.height * 0.85) / ceilHeight
1794
- );
1795
- // let frontRect = {width: line_length * scale, height: ceilHeight * scale};
1796
- let cameraRect = {
1797
- width: self.width / scale,
1798
- height: self.height / scale
1799
- };
1800
- camera = new Three.OrthographicCamera(
1801
- -cameraRect.width / 2,
1802
- cameraRect.width / 2,
1803
- cameraRect.height / 2,
1804
- -cameraRect.height / 2,
1805
- 1,
1806
- 10000
1807
- );
1808
- camera.position.set(posX, ceilHeight / 2, -posY);
1809
- camera.rotation.set(0, angle, 0);
1810
- } else {
1811
- const aspectRatio = self.width / self.height;
1812
- camera = new Three.PerspectiveCamera(45, aspectRatio, 1, 300000);
1813
- camera.position.set(0, 0, 1);
1814
- }
1815
- camera.layers.enable(1);
1816
-
1817
- function loadENV() {
1818
- new RGBELoader().load(
1819
- '/assets/brown_photostudio_02_1k.hdr',
1820
- function (texture) {
1821
- texture.mapping = Three.EquirectangularReflectionMapping;
1822
- scene3D.environment = texture;
1823
- texture.dispose();
1824
- }
1825
- );
1826
- }
1827
-
1828
- // Camera Controls
1829
- if (!ARRAY_ELEVATION_VIEW_MODES.includes(state.mode)) {
1830
- cameraControls = new CameraControls(camera, self.renderer.domElement);
1831
- cameraControls.dollyToCursor = true;
1832
- cameraControls.infinityDolly = true;
1833
- cameraControls.minDistance = 50;
1834
- cameraControls.maxDistance = Infinity;
1835
- cameraControls.zoomSpeed = 1;
1836
-
1837
- loadENV();
1838
- }
1839
-
1840
- scene3D.add(planData.plan);
1841
- scene3D.add(planData.grid);
1842
- scene3D.add(camera);
1843
- if (ARRAY_ELEVATION_VIEW_MODES.includes(state.mode)) {
1844
- planData.cam.add(camera);
1845
- scene3D.add(planData.cam);
1846
- } else {
1847
- pivot = new Three.Object3D();
1848
- pivot.add(camera);
1849
- scene3D.add(pivot);
1850
- }
1851
-
1852
- // LIGHT
1853
-
1854
- let light = new Three.AmbientLight(0xbfbfbf, 0.9); // soft white light
1855
- }
1856
-
1857
- function render() {
1858
- const delta = clock.getDelta(); // Get time delta for smooth updates
1859
- if (!ARRAY_ELEVATION_VIEW_MODES.includes(state.mode))
1860
- cameraControls.update(delta);
1861
- for (let i = 0; i < lights.length; i++) {
1862
- lights[i].light.position.set(
1863
- planData.plan.position.x + lights[i].x,
1864
- planData.plan.position.y + lights[i].height - 10,
1865
- planData.plan.position.z - lights[i].y
1866
- );
1867
- lights[i].target.position.set(
1868
- planData.plan.position.x + lights[i].x,
1869
- planData.plan.position.y,
1870
- planData.plan.position.z - lights[i].y
1871
- );
1872
- }
1873
-
1874
- camera.updateMatrix();
1875
- camera.updateMatrixWorld();
1876
-
1877
- for (let elemID in planData.sceneGraph.LODs) {
1878
- planData.sceneGraph.LODs[elemID].update(camera);
1879
- }
1880
- if (snapBox !== null) {
1881
- if (snapAnimI >= 15) {
1882
- if ('x' in targetPoint)
1883
- snapBox.position.set(
1884
- targetPoint.x,
1885
- snapBox.position.y,
1886
- targetPoint.z
1887
- );
1888
- snapFlag = false;
1889
- t_i++;
1890
- } else {
1891
- if (snapAnimI == 0) {
1892
- targetCRotation =
1893
- ((((targetRot / 180) * Math.PI - snapBox.rotation.y + Math.PI) *
1894
- 180) /
1895
- Math.PI) %
1896
- 360;
1897
- if (targetCRotation > 180) targetCRotation -= 360;
1898
- if (targetCRotation < -180) targetCRotation += 360;
1899
- targetCRotation = (targetCRotation / 180) * Math.PI;
1900
- }
1901
- if (snapAnimI < 10) {
1902
- snapBox.rotateY(targetCRotation / 10);
1903
- } else {
1904
- snapBox.position.set(
1905
- snapBox.position.clone().x - targetUVec.x / 10,
1906
- snapBox.position.clone().y - targetUVec.y / 10,
1907
- snapBox.position.clone().z - targetUVec.z / 10
1908
- );
1909
- }
1910
- snapAnimI++;
1911
- }
1912
- }
1913
-
1914
- if (t_i === 20) {
1915
- //stop snap after 5s
1916
- removeSnapBox();
1917
- }
1918
-
1919
- // hide hole if wall is not visible
1920
- let layerID = self.props.state.scene.selectedLayer;
1921
- let layer = self.props.state.scene.layers.get(layerID);
1922
- layer.holes.forEach(data => {
1923
- let line = planData.sceneGraph.layers[layerID].lines[data.line];
1924
- let hole = planData.sceneGraph.layers[layerID].holes[data.id];
1925
- if (line instanceof Three.Object3D && !line.isMesh) {
1926
- line = line.children[0].children[0];
1927
- // index(faces) of the line
1928
- const indexAttribute = line.geometry.getIndex();
1929
- const firstFaceIndices = [
1930
- indexAttribute.getX(0),
1931
- indexAttribute.getX(1),
1932
- indexAttribute.getX(2)
1933
- ];
1934
-
1935
- if (firstFaceIndices == undefined) return;
1936
- // normal vector of the line
1937
- const normalAttribute = line.geometry.attributes.normal;
1938
- let normal = new Three.Vector3()
1939
- .fromBufferAttribute(normalAttribute, 0)
1940
- .clone();
1941
- normal = normal
1942
- .applyMatrix4(line.matrixWorld)
1943
- .sub(new Three.Vector3(0, 0, 0).applyMatrix4(line.matrixWorld))
1944
- .normalize();
1945
- let vertices = layer.lines.get(data.line).vertices.toJS();
1946
- let vertex1 = layer.vertices.get(vertices[0]);
1947
- let vertex2 = layer.vertices.get(vertices[1]);
1948
- let cX = (vertex1.x + vertex2.x) / 2;
1949
- let cY = (vertex1.y + vertex2.y) / 2;
1950
- let posVec = new Three.Vector3(cX, 150, -cY);
1951
- posVec = posVec.add(planData.plan.position.clone());
1952
- let cameraLine = camera.position.clone().sub(posVec);
1953
- if (hole) {
1954
- hole.traverse(child => {
1955
- if (child.isMesh) {
1956
- child.material.opacity = cameraLine.dot(normal) > 0 ? 1 : 0;
1957
- child.material.transparent =
1958
- cameraLine.dot(normal) > 0 ? false : true;
1959
- child.material.needsUpdate = true;
1960
- }
1961
- });
1962
- }
1963
- }
1964
- // /////////////////////////////////////
1965
- });
1966
-
1967
- self.renderer.render(scene3D, camera);
1968
- self.renderingID = requestAnimationFrame(render);
1969
-
1970
- if (self.state.waitForRender > 0) {
1971
- self.state.waitForRender++;
1972
- if (self.state.waitForRender > 2) {
1973
- self.setState({ isLoading: false, waitForRender: 0 });
1974
- setTimeout(() => self.props.setIsLoading3D(false), 100);
1975
- console.log('257 line: false');
1976
- self.renderer.domElement.style.display = 'block';
1977
- }
1978
- }
1979
- }
1980
-
1981
- //
1982
-
1983
- window.planData = planData;
1984
- this.planData = planData;
1985
- this.camera = camera;
1986
- this.cameraControls = cameraControls;
1987
- this.scene3D = scene3D;
1988
-
1989
- //
1990
-
1991
- prepareSnap(layer);
1992
- }
1993
-
1994
- componentWillUnmount() {
1995
- cancelAnimationFrame(this.renderingID);
1996
-
1997
- if (!ARRAY_ELEVATION_VIEW_MODES.includes(this.props.state.mode)) {
1998
- if (this.cameraControls !== undefined) this.cameraControls.dispose();
1999
- }
2000
-
2001
- disposeScene(this.scene3D);
2002
- this.scene3D.remove(this.planData.plan);
2003
- this.scene3D.remove(this.planData.grid);
2004
-
2005
- this.scene3D = null;
2006
- this.planData = null;
2007
- this.camera = null;
2008
- this.cameraControls = null;
2009
- this.renderer.renderLists.dispose();
2010
- }
2011
-
2012
- componentWillReceiveProps(nextProps) {
2013
- let { width, height } = nextProps;
2014
- let actions = {
2015
- areaActions: this.context.areaActions,
2016
- holesActions: this.context.holesActions,
2017
- itemsActions: this.context.itemsActions,
2018
- sceneActions: this.context.sceneActions,
2019
- linesActions: this.context.linesActions,
2020
- projectActions: this.context.projectActions,
2021
- catalog: this.context.catalog
2022
- };
2023
-
2024
- this.width = width;
2025
- this.height = height;
2026
-
2027
- this.renderer.setSize(width, height);
2028
-
2029
- let allLines;
2030
- let allLineRects;
2031
- let allItemRect;
2032
-
2033
- this.camera.aspect = width / height;
2034
- this.camera.updateProjectionMatrix();
2035
-
2036
- let data = nextProps.state.scene;
2037
- let layer = data.getIn(['layers', data.selectedLayer]);
2038
- const self = this;
2039
-
2040
- function implementBacksplash() {
2041
- let allItems = GeometryUtils.getAllItemSpecified(
2042
- nextProps.state.scene,
2043
- actions.catalog,
2044
- BASE_CABINET_LAYOUTPOS
2045
- );
2046
- let i,
2047
- items = [];
2048
- for (i = 0; i < allItems.others.length; i++)
2049
- items.push(allItems.others[i]);
2050
- if (allItems.cur) items.push(allItems.cur);
2051
-
2052
- for (i = 0; i < items.length; i++) {
2053
- let calcRect = GeometryUtils.getCalcRectFromItem3D(items[i]);
2054
- let visible = GeometryUtils.isSnappedLine(calcRect, allLineRects);
2055
- actions.itemsActions.setBacksplashVisible(
2056
- items[i].itemInfo.id,
2057
- visible
2058
- );
2059
-
2060
- createBacksplash(
2061
- items[i],
2062
- nextProps.state.scene.getIn([
2063
- 'layers',
2064
- nextProps.state.scene.selectedLayer
2065
- ]),
2066
- planData,
2067
- nextProps.state.scene
2068
- );
2069
- }
2070
- }
2071
-
2072
- function implementWarningBox() {
2073
- let holeItems = GeometryUtils.getHoleItems(layer);
2074
- let i,
2075
- items = [];
2076
- for (i = 0; i < allItemRect.others.length; i++)
2077
- items.push(allItemRect.others[i]);
2078
- if (allItemRect.cur) items.push(allItemRect.cur);
2079
-
2080
- for (i = 0; i < items.length; i++)
2081
- checkCabinetOverlap(
2082
- { x: items[i].pos.x, y: items[i].pos.y },
2083
- items[i],
2084
- holeItems,
2085
- planData
2086
- );
2087
- }
2088
-
2089
- let prepareSnapSpec = layer => {
2090
- allLines = GeometryUtils.getAllLines(layer);
2091
- allLineRects = GeometryUtils.buildRectFromLines(layer, allLines);
2092
- allItemRect = GeometryUtils.getAllItemSpecified(
2093
- this.props.state.scene,
2094
- actions.catalog,
2095
- [WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS]
2096
- );
2097
- };
2098
-
2099
- let layer1 = this.props.state.scene.getIn(['layers', data.selectedLayer]);
2100
-
2101
- if (this.state.showflag) {
2102
- prepareSnapSpec(layer);
2103
- implementBacksplash();
2104
- implementWarningBox();
2105
- this.setState({ showflag: false });
2106
- }
2107
- if (
2108
- nextProps.state.scene !== this.props.state.scene ||
2109
- (nextProps.state.doorStyle &&
2110
- nextProps.state.doorStyle.get('name') !==
2111
- this.props.state.doorStyle.get('name'))
2112
- ) {
2113
- let changedValues = diff(this.props.state.scene, nextProps.state.scene);
2114
- prepareSnapSpec(layer);
2115
- if (
2116
- nextProps.state.doorStyle &&
2117
- nextProps.state.doorStyle.get('name') ===
2118
- this.props.state.doorStyle.get('name')
2119
- ) {
2120
- self.setState({ isLoading: true, waitForRender: 0 });
2121
- this.props.setIsLoading3D(true);
2122
- self.renderer.domElement.style.display = 'none';
2123
- }
2124
- if (nextProps.state.scene.showfg == true) {
2125
- implementBacksplash();
2126
- implementWarningBox();
2127
- } else {
2128
- deleteSpecifiedMeshObjects('TransformBox');
2129
- }
2130
- let { toolObj, angleObj } = this.state;
2131
- var { promise } = updateScene(
2132
- this.planData,
2133
- nextProps.state.scene,
2134
- this.props.state.scene,
2135
- changedValues.toJS(),
2136
- actions,
2137
- this.context.catalog,
2138
- nextProps.state.mode,
2139
- toolObj,
2140
- angleObj
2141
- );
2142
- promise.then(p1Value => {
2143
- self.setState({ waitForRender: 1 });
2144
- });
2145
- }
2146
- }
2147
-
2148
- render() {
2149
- const { isLoading } = this.state;
2150
- if (isLoading) {
2151
- // document.getElementById('elevation') && (document.getElementById('elevation').style.display = 'none');
2152
- this.renderer.domElement.style.display = 'none';
2153
- return (
2154
- <div
2155
- style={{
2156
- alignItems: ' center',
2157
- width: this.props.width,
2158
- height: this.props.height,
2159
- display: 'inline-flex',
2160
- justifyContent: 'center'
2161
- }}
2162
- >
2163
- <img
2164
- style={{
2165
- width: '70px',
2166
- height: '70px',
2167
- animation: 'spin 2s linear infinite'
2168
- }}
2169
- src={'/assets/img/loading_large.gif'}
2170
- alt="img"
2171
- />
2172
- </div>
2173
- );
2174
- } else {
2175
- this.renderer.domElement.style.pointerEvents = 'auto';
2176
- this.renderer.domElement.style.opacity = '1';
2177
- // document.getElementById('elevation') && (document.getElementById('elevation').style.display = 'block');
2178
- return React.createElement('div', { ref: 'canvasWrapper' });
2179
- }
2180
- }
2181
- }
2182
-
2183
- Viewer3DElevationDownload.propTypes = {
2184
- state: PropTypes.object.isRequired,
2185
- width: PropTypes.number.isRequired,
2186
- height: PropTypes.number.isRequired,
2187
- replaceCabinet: PropTypes.func.isRequired
2188
- };
2189
-
2190
- Viewer3DElevationDownload.contextTypes = {
2191
- areaActions: PropTypes.object.isRequired,
2192
- holesActions: PropTypes.object.isRequired,
2193
- itemsActions: PropTypes.object.isRequired,
2194
- linesActions: PropTypes.object.isRequired,
2195
- sceneActions: PropTypes.object.isRequired,
2196
- projectActions: PropTypes.object.isRequired,
2197
- catalog: PropTypes.object
2198
- };