kitchen-simulator 5.10.1-react.18 → 5.10.2-react.18

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 (579) hide show
  1. package/es/index.js +3 -627
  2. package/es/index.js.LICENSE.txt +45 -0
  3. package/es/index.js.map +1 -0
  4. package/package.json +9 -5
  5. package/es/@history.js +0 -2
  6. package/es/AppContext.js +0 -6
  7. package/es/LiteKitchenConfigurator.js +0 -474
  8. package/es/LiteRenderer.js +0 -363
  9. package/es/WorkSpace.js +0 -851
  10. package/es/actions/area-actions.js +0 -14
  11. package/es/actions/export.js +0 -23
  12. package/es/actions/groups-actions.js +0 -89
  13. package/es/actions/holes-actions.js +0 -119
  14. package/es/actions/items-actions.js +0 -316
  15. package/es/actions/lines-actions.js +0 -83
  16. package/es/actions/project-actions.js +0 -298
  17. package/es/actions/scene-actions.js +0 -33
  18. package/es/actions/vertices-actions.js +0 -27
  19. package/es/actions/viewer2d-actions.js +0 -58
  20. package/es/actions/viewer3d-actions.js +0 -23
  21. package/es/assets/brown_photostudio_02_1k.hdr +0 -0
  22. package/es/assets/fonts/Rene Bieder Milliard Black Italic.woff +0 -0
  23. package/es/assets/fonts/Rene Bieder Milliard Black.woff +0 -0
  24. package/es/assets/fonts/Rene Bieder Milliard Bold Italic.woff +0 -0
  25. package/es/assets/fonts/Rene Bieder Milliard Bold.woff +0 -0
  26. package/es/assets/fonts/Rene Bieder Milliard Book Italic.woff +0 -0
  27. package/es/assets/fonts/Rene Bieder Milliard Book.woff +0 -0
  28. package/es/assets/fonts/Rene Bieder Milliard ExtraBold Italic.woff +0 -0
  29. package/es/assets/fonts/Rene Bieder Milliard ExtraBold.woff +0 -0
  30. package/es/assets/fonts/Rene Bieder Milliard ExtraLight Italic.woff +0 -0
  31. package/es/assets/fonts/Rene Bieder Milliard ExtraLight.woff +0 -0
  32. package/es/assets/fonts/Rene Bieder Milliard Hairline Italic.woff +0 -0
  33. package/es/assets/fonts/Rene Bieder Milliard Hairline.woff +0 -0
  34. package/es/assets/fonts/Rene Bieder Milliard Heavy Italic.woff +0 -0
  35. package/es/assets/fonts/Rene Bieder Milliard Heavy.woff +0 -0
  36. package/es/assets/fonts/Rene Bieder Milliard Light Italic.woff +0 -0
  37. package/es/assets/fonts/Rene Bieder Milliard Light.woff +0 -0
  38. package/es/assets/fonts/Rene Bieder Milliard Medium Italic.woff +0 -0
  39. package/es/assets/fonts/Rene Bieder Milliard Medium.woff +0 -0
  40. package/es/assets/fonts/Rene Bieder Milliard SemiBold Italic.woff +0 -0
  41. package/es/assets/fonts/Rene Bieder Milliard SemiBold.woff +0 -0
  42. package/es/assets/fonts/Rene Bieder Milliard Thin Italic.woff +0 -0
  43. package/es/assets/fonts/Rene Bieder Milliard Thin.woff +0 -0
  44. package/es/assets/fonts/style.css +0 -177
  45. package/es/assets/gltf/door_closet.bin +0 -0
  46. package/es/assets/gltf/door_closet.fbx +0 -0
  47. package/es/assets/gltf/door_closet.gltf +0 -1
  48. package/es/assets/gltf/door_exterior.bin +0 -0
  49. package/es/assets/gltf/door_exterior.fbx +0 -0
  50. package/es/assets/gltf/door_exterior.gltf +0 -1
  51. package/es/assets/gltf/door_interior.bin +0 -0
  52. package/es/assets/gltf/door_interior.fbx +0 -0
  53. package/es/assets/gltf/door_interior.gltf +0 -1
  54. package/es/assets/gltf/door_sliding.bin +0 -0
  55. package/es/assets/gltf/door_sliding.fbx +0 -0
  56. package/es/assets/gltf/door_sliding.gltf +0 -1
  57. package/es/assets/gltf/doorway_framed.bin +0 -0
  58. package/es/assets/gltf/doorway_framed.fbx +0 -0
  59. package/es/assets/gltf/doorway_framed.gltf +0 -1
  60. package/es/assets/gltf/window_clear.bin +0 -0
  61. package/es/assets/gltf/window_clear.fbx +0 -0
  62. package/es/assets/gltf/window_clear.gltf +0 -1
  63. package/es/assets/gltf/window_cross.bin +0 -0
  64. package/es/assets/gltf/window_cross.fbx +0 -0
  65. package/es/assets/gltf/window_cross.gltf +0 -1
  66. package/es/assets/gltf/window_double_hung.bin +0 -0
  67. package/es/assets/gltf/window_double_hung.fbx +0 -0
  68. package/es/assets/gltf/window_double_hung.gltf +0 -1
  69. package/es/assets/gltf/window_vertical.bin +0 -0
  70. package/es/assets/gltf/window_vertical.fbx +0 -0
  71. package/es/assets/gltf/window_vertical.gltf +0 -1
  72. package/es/assets/img/TKC_thumbnail.png +0 -0
  73. package/es/assets/img/Toggle.png +0 -0
  74. package/es/assets/img/loading/loading.gif +0 -0
  75. package/es/assets/img/loading/loading_1.svg +0 -11
  76. package/es/assets/img/loading_large.gif +0 -0
  77. package/es/assets/img/png/door/closet.png +0 -0
  78. package/es/assets/img/png/door/doorwaysframed.png +0 -0
  79. package/es/assets/img/png/door/doorwaysframeles.png +0 -0
  80. package/es/assets/img/png/door/doorwaysframeless.png +0 -0
  81. package/es/assets/img/png/door/exterior.png +0 -0
  82. package/es/assets/img/png/door/interior.png +0 -0
  83. package/es/assets/img/png/door/sliding.png +0 -0
  84. package/es/assets/img/png/helper/outcome.png +0 -0
  85. package/es/assets/img/png/helper/video_preview_3d.png +0 -0
  86. package/es/assets/img/png/helper/video_preview_start.png +0 -0
  87. package/es/assets/img/project_img.png +0 -0
  88. package/es/assets/img/rta/rta_logo_box_blue.jpg +0 -0
  89. package/es/assets/img/rta/rta_logo_box_blue_ico.jpg +0 -0
  90. package/es/assets/img/rta/rta_logo_box_blue_ico.svg +0 -55
  91. package/es/assets/img/rta/rta_logo_box_darkGray.jpg +0 -0
  92. package/es/assets/img/rta/rta_logo_box_lightblue.png +0 -0
  93. package/es/assets/img/rta/rta_logo_box_lightmaroon.png +0 -0
  94. package/es/assets/img/rta/rta_logo_box_maroon.png +0 -0
  95. package/es/assets/img/rta/rta_logo_box_white.png +0 -0
  96. package/es/assets/img/rta_menu.png +0 -0
  97. package/es/assets/img/step2.jpg +0 -0
  98. package/es/assets/img/step3.jpg +0 -0
  99. package/es/assets/img/step4.jpg +0 -0
  100. package/es/assets/img/step5.jpg +0 -0
  101. package/es/assets/img/step6.jpg +0 -0
  102. package/es/assets/img/step7.jpg +0 -0
  103. package/es/assets/img/step8.jpg +0 -0
  104. package/es/assets/img/svg/2d_delete_object.svg +0 -33
  105. package/es/assets/img/svg/2d_delete_object1.svg +0 -33
  106. package/es/assets/img/svg/2d_lock_object.svg +0 -33
  107. package/es/assets/img/svg/3d_item_move.svg +0 -106
  108. package/es/assets/img/svg/3d_item_rotation.svg +0 -76
  109. package/es/assets/img/svg/3d_item_warning_edit.svg +0 -77
  110. package/es/assets/img/svg/3d_item_warning_info.svg +0 -81
  111. package/es/assets/img/svg/accessories.svg +0 -4
  112. package/es/assets/img/svg/angle_icon.svg +0 -39
  113. package/es/assets/img/svg/blank_div.svg +0 -14
  114. package/es/assets/img/svg/bottombar/2d3d_button.svg +0 -3
  115. package/es/assets/img/svg/bottombar/2d3d_button_active.svg +0 -3
  116. package/es/assets/img/svg/bottombar/2d3d_toggle.svg +0 -4
  117. package/es/assets/img/svg/bottombar/2d3d_toggle_active.svg +0 -4
  118. package/es/assets/img/svg/bottombar/arrow-down.svg +0 -3
  119. package/es/assets/img/svg/bottombar/arrow-left.svg +0 -3
  120. package/es/assets/img/svg/bottombar/arrow-minus.svg +0 -3
  121. package/es/assets/img/svg/bottombar/arrow-plus.svg +0 -11
  122. package/es/assets/img/svg/bottombar/arrow-right.svg +0 -3
  123. package/es/assets/img/svg/bottombar/arrow-up.svg +0 -3
  124. package/es/assets/img/svg/bottombar/collapse.svg +0 -3
  125. package/es/assets/img/svg/bottombar/elevation-back.svg +0 -6
  126. package/es/assets/img/svg/bottombar/elevation-front.svg +0 -6
  127. package/es/assets/img/svg/bottombar/elevation-left.svg +0 -6
  128. package/es/assets/img/svg/bottombar/elevation-right.svg +0 -7
  129. package/es/assets/img/svg/bottombar/elevation.svg +0 -13
  130. package/es/assets/img/svg/bottombar/expand.svg +0 -3
  131. package/es/assets/img/svg/bottombar/help.svg +0 -72
  132. package/es/assets/img/svg/bottombar/incm_toggle.svg +0 -39
  133. package/es/assets/img/svg/bottombar/pan_1.svg +0 -57
  134. package/es/assets/img/svg/bottombar/pan_2.svg +0 -27
  135. package/es/assets/img/svg/bottombar/pan_3.svg +0 -27
  136. package/es/assets/img/svg/bottombar/pan_4.svg +0 -27
  137. package/es/assets/img/svg/bottombar/pan_5.svg +0 -27
  138. package/es/assets/img/svg/bottombar/settings.svg +0 -23
  139. package/es/assets/img/svg/bottombar/spin-down.svg +0 -76
  140. package/es/assets/img/svg/bottombar/spin-left.svg +0 -75
  141. package/es/assets/img/svg/bottombar/spin-right.svg +0 -75
  142. package/es/assets/img/svg/bottombar/spin-up.svg +0 -76
  143. package/es/assets/img/svg/bottombar/spin_1.svg +0 -48
  144. package/es/assets/img/svg/bottombar/spin_2.svg +0 -31
  145. package/es/assets/img/svg/bottombar/spin_3.svg +0 -31
  146. package/es/assets/img/svg/bottombar/spin_4.svg +0 -31
  147. package/es/assets/img/svg/bottombar/spin_5.svg +0 -31
  148. package/es/assets/img/svg/bottombar/zoomin.svg +0 -29
  149. package/es/assets/img/svg/bottombar/zoomout.svg +0 -26
  150. package/es/assets/img/svg/check.svg +0 -10
  151. package/es/assets/img/svg/close.svg +0 -11
  152. package/es/assets/img/svg/color/Black.svg +0 -3
  153. package/es/assets/img/svg/color/Blue.svg +0 -3
  154. package/es/assets/img/svg/color/Brown.svg +0 -9
  155. package/es/assets/img/svg/color/Cream.svg +0 -3
  156. package/es/assets/img/svg/color/Dark.svg +0 -9
  157. package/es/assets/img/svg/color/Gray.svg +0 -3
  158. package/es/assets/img/svg/color/Green.svg +0 -3
  159. package/es/assets/img/svg/color/Light.svg +0 -9
  160. package/es/assets/img/svg/color/Medium.svg +0 -9
  161. package/es/assets/img/svg/color/Unfinished.svg +0 -9
  162. package/es/assets/img/svg/color/White.svg +0 -3
  163. package/es/assets/img/svg/color/White.svg.bak +0 -3
  164. package/es/assets/img/svg/color/stone2.jpg +0 -0
  165. package/es/assets/img/svg/color/wood2.jpg +0 -0
  166. package/es/assets/img/svg/copy.svg +0 -11
  167. package/es/assets/img/svg/delete.svg +0 -3
  168. package/es/assets/img/svg/detail.svg +0 -77
  169. package/es/assets/img/svg/disclaimer/background.svg +0 -758
  170. package/es/assets/img/svg/disclaimer/logo-dots.svg +0 -11
  171. package/es/assets/img/svg/door/Closet.svg +0 -11
  172. package/es/assets/img/svg/door/Exterior.svg +0 -5
  173. package/es/assets/img/svg/door/Framed_dorway.svg +0 -5
  174. package/es/assets/img/svg/door/Frameless_dorway.svg +0 -5
  175. package/es/assets/img/svg/door/Interior.svg +0 -7
  176. package/es/assets/img/svg/door/Sliding.svg +0 -5
  177. package/es/assets/img/svg/doors_closet.svg +0 -47
  178. package/es/assets/img/svg/doors_exterior.svg +0 -25
  179. package/es/assets/img/svg/doors_interior.svg +0 -29
  180. package/es/assets/img/svg/doors_patio.svg +0 -26
  181. package/es/assets/img/svg/duplicate.svg +0 -11
  182. package/es/assets/img/svg/duplicate_object_left.svg +0 -32
  183. package/es/assets/img/svg/duplicate_object_right.svg +0 -32
  184. package/es/assets/img/svg/filtersActive.svg +0 -19
  185. package/es/assets/img/svg/firstsetting/L.svg +0 -3
  186. package/es/assets/img/svg/firstsetting/L2.svg +0 -3
  187. package/es/assets/img/svg/firstsetting/Open.svg +0 -3
  188. package/es/assets/img/svg/firstsetting/Square.svg +0 -3
  189. package/es/assets/img/svg/firstsetting/bar-active.svg +0 -9
  190. package/es/assets/img/svg/firstsetting/bar-normal.svg +0 -3
  191. package/es/assets/img/svg/firstsetting/bullet-current.svg +0 -3
  192. package/es/assets/img/svg/firstsetting/bullet-done.svg +0 -3
  193. package/es/assets/img/svg/firstsetting/bullet-not-done.svg +0 -3
  194. package/es/assets/img/svg/firstsetting/check-active.svg +0 -3
  195. package/es/assets/img/svg/firstsetting/check-normal.svg +0 -3
  196. package/es/assets/img/svg/firstsetting/pencil.svg +0 -11
  197. package/es/assets/img/svg/green_checkmark.svg +0 -27
  198. package/es/assets/img/svg/headerbar/assist.svg +0 -3
  199. package/es/assets/img/svg/headerbar/cart.svg +0 -3
  200. package/es/assets/img/svg/headerbar/check.svg +0 -10
  201. package/es/assets/img/svg/headerbar/consult_designer.svg +0 -45
  202. package/es/assets/img/svg/headerbar/edit_name.svg +0 -26
  203. package/es/assets/img/svg/headerbar/file-dollar.svg +0 -13
  204. package/es/assets/img/svg/headerbar/hamburger_menu.svg +0 -32
  205. package/es/assets/img/svg/headerbar/plus.svg +0 -11
  206. package/es/assets/img/svg/headerbar/review_quote.svg +0 -44
  207. package/es/assets/img/svg/headerbar/ruler-measure.svg +0 -11
  208. package/es/assets/img/svg/headerbar/save.svg +0 -3
  209. package/es/assets/img/svg/headerbar/setting.svg +0 -75
  210. package/es/assets/img/svg/help/check.svg +0 -10
  211. package/es/assets/img/svg/help/search.svg +0 -76
  212. package/es/assets/img/svg/intro/1-start-with-floorplan-whole.svg +0 -27
  213. package/es/assets/img/svg/intro/1-start-with-floorplan.svg +0 -26
  214. package/es/assets/img/svg/intro/2-start-from-scratch-whole.svg +0 -28
  215. package/es/assets/img/svg/intro/2-start-from-scratch.svg +0 -27
  216. package/es/assets/img/svg/intro/3-retrieve-project-whole.svg +0 -19
  217. package/es/assets/img/svg/intro/3-retrieve-project.svg +0 -18
  218. package/es/assets/img/svg/invert.svg +0 -127
  219. package/es/assets/img/svg/lefttoolbar/appliance-active.svg +0 -13
  220. package/es/assets/img/svg/lefttoolbar/appliance.svg +0 -13
  221. package/es/assets/img/svg/lefttoolbar/cabinet-active.svg +0 -10
  222. package/es/assets/img/svg/lefttoolbar/cabinet-category.svg +0 -3
  223. package/es/assets/img/svg/lefttoolbar/cabinet-one.svg +0 -3
  224. package/es/assets/img/svg/lefttoolbar/cabinet.svg +0 -10
  225. package/es/assets/img/svg/lefttoolbar/disigner_assistance.svg +0 -89
  226. package/es/assets/img/svg/lefttoolbar/door-style-active.svg +0 -20
  227. package/es/assets/img/svg/lefttoolbar/door-style.svg +0 -20
  228. package/es/assets/img/svg/lefttoolbar/door.svg +0 -12
  229. package/es/assets/img/svg/lefttoolbar/error_icon.svg +0 -81
  230. package/es/assets/img/svg/lefttoolbar/finishing-active.svg +0 -13
  231. package/es/assets/img/svg/lefttoolbar/finishing.svg +0 -13
  232. package/es/assets/img/svg/lefttoolbar/reviewforquote-active.svg +0 -86
  233. package/es/assets/img/svg/lefttoolbar/reviewforquote.svg +0 -12
  234. package/es/assets/img/svg/lefttoolbar/room-shape-L.svg +0 -3
  235. package/es/assets/img/svg/lefttoolbar/room-shape-active.svg +0 -18
  236. package/es/assets/img/svg/lefttoolbar/room-shape-custom.svg +0 -12
  237. package/es/assets/img/svg/lefttoolbar/room-shape-irregular.svg +0 -3
  238. package/es/assets/img/svg/lefttoolbar/room-shape-open.svg +0 -3
  239. package/es/assets/img/svg/lefttoolbar/room-shape-square.svg +0 -3
  240. package/es/assets/img/svg/lefttoolbar/room-shape.svg +0 -18
  241. package/es/assets/img/svg/lefttoolbar/search.svg +0 -76
  242. package/es/assets/img/svg/lefttoolbar/view_more.svg +0 -86
  243. package/es/assets/img/svg/lefttoolbar/warning_icon.svg +0 -81
  244. package/es/assets/img/svg/lefttoolbar/window.svg +0 -12
  245. package/es/assets/img/svg/logo.svg +0 -11
  246. package/es/assets/img/svg/logo_with_text.svg +0 -25
  247. package/es/assets/img/svg/menubar/login.svg +0 -84
  248. package/es/assets/img/svg/menubar/my_projects.svg +0 -85
  249. package/es/assets/img/svg/menubar/new_project.svg +0 -110
  250. package/es/assets/img/svg/menubar/save_project.svg +0 -84
  251. package/es/assets/img/svg/options.svg +0 -3
  252. package/es/assets/img/svg/positioning.svg +0 -3
  253. package/es/assets/img/svg/rotate.png +0 -0
  254. package/es/assets/img/svg/rotate.svg +0 -17
  255. package/es/assets/img/svg/rotate_object_clockwise.svg +0 -26
  256. package/es/assets/img/svg/rotate_object_counterclockwise.svg +0 -26
  257. package/es/assets/img/svg/toggleFilters.svg +0 -19
  258. package/es/assets/img/svg/toolbar/add_appliances_active.svg +0 -64
  259. package/es/assets/img/svg/toolbar/add_appliances_inactive.svg +0 -52
  260. package/es/assets/img/svg/toolbar/add_button.svg +0 -36
  261. package/es/assets/img/svg/toolbar/add_cabinets_active.svg +0 -59
  262. package/es/assets/img/svg/toolbar/add_cabinets_inactive.svg +0 -49
  263. package/es/assets/img/svg/toolbar/add_items_doors.svg +0 -25
  264. package/es/assets/img/svg/toolbar/add_items_doorways.svg +0 -24
  265. package/es/assets/img/svg/toolbar/add_items_refrigerator.svg +0 -32
  266. package/es/assets/img/svg/toolbar/add_items_windows.svg +0 -28
  267. package/es/assets/img/svg/toolbar/apply_button.svg +0 -38
  268. package/es/assets/img/svg/toolbar/arrow-plus.svg +0 -11
  269. package/es/assets/img/svg/toolbar/backsplash.svg +0 -8
  270. package/es/assets/img/svg/toolbar/cancel_button.svg +0 -37
  271. package/es/assets/img/svg/toolbar/consult_a_designer_button.svg +0 -47
  272. package/es/assets/img/svg/toolbar/countertop.svg +0 -7
  273. package/es/assets/img/svg/toolbar/dcm.png +0 -0
  274. package/es/assets/img/svg/toolbar/dcm_off.svg +0 -12
  275. package/es/assets/img/svg/toolbar/dcm_on.svg +0 -474
  276. package/es/assets/img/svg/toolbar/delete_button.svg +0 -37
  277. package/es/assets/img/svg/toolbar/download.svg +0 -77
  278. package/es/assets/img/svg/toolbar/draw_custom_floor.svg +0 -31
  279. package/es/assets/img/svg/toolbar/edit_button.svg +0 -75
  280. package/es/assets/img/svg/toolbar/email_quote_button.svg +0 -44
  281. package/es/assets/img/svg/toolbar/fbm.png +0 -0
  282. package/es/assets/img/svg/toolbar/finishing_touches_active.svg +0 -54
  283. package/es/assets/img/svg/toolbar/finishing_touches_inactive.svg +0 -42
  284. package/es/assets/img/svg/toolbar/floorstyle.svg +0 -9
  285. package/es/assets/img/svg/toolbar/fmb.png +0 -0
  286. package/es/assets/img/svg/toolbar/fmb_off.svg +0 -12
  287. package/es/assets/img/svg/toolbar/fmb_on.svg +0 -489
  288. package/es/assets/img/svg/toolbar/furnishings_icon.svg +0 -6
  289. package/es/assets/img/svg/toolbar/get_started_button.svg +0 -41
  290. package/es/assets/img/svg/toolbar/handles.svg +0 -5
  291. package/es/assets/img/svg/toolbar/lighting.svg +0 -7
  292. package/es/assets/img/svg/toolbar/lrm.png +0 -0
  293. package/es/assets/img/svg/toolbar/lrm_off.svg +0 -12
  294. package/es/assets/img/svg/toolbar/lrm_on.svg +0 -470
  295. package/es/assets/img/svg/toolbar/make_floorplan_active.svg +0 -66
  296. package/es/assets/img/svg/toolbar/make_floorplan_inactive.svg +0 -52
  297. package/es/assets/img/svg/toolbar/predefined_room_l_shaped.svg +0 -20
  298. package/es/assets/img/svg/toolbar/predefined_room_layout.svg +0 -20
  299. package/es/assets/img/svg/toolbar/predefined_room_long_narrow.svg +0 -20
  300. package/es/assets/img/svg/toolbar/predefined_room_open_l_shape.svg +0 -20
  301. package/es/assets/img/svg/toolbar/predefined_room_open_pentagon.svg +0 -20
  302. package/es/assets/img/svg/toolbar/predefined_room_open_rectangle.svg +0 -20
  303. package/es/assets/img/svg/toolbar/predefined_room_open_rectangle_2.svg +0 -20
  304. package/es/assets/img/svg/toolbar/predefined_room_pentagon.svg +0 -20
  305. package/es/assets/img/svg/toolbar/predefined_room_rectangle.svg +0 -20
  306. package/es/assets/img/svg/toolbar/predefined_room_rectangle_with_alcove.svg +0 -20
  307. package/es/assets/img/svg/toolbar/redo_button.svg +0 -75
  308. package/es/assets/img/svg/toolbar/redo_button1.svg +0 -75
  309. package/es/assets/img/svg/toolbar/review_quote_active.svg +0 -14
  310. package/es/assets/img/svg/toolbar/review_quote_inactive.svg +0 -44
  311. package/es/assets/img/svg/toolbar/save_project_button.svg +0 -44
  312. package/es/assets/img/svg/toolbar/select_doorstyle_active.svg +0 -67
  313. package/es/assets/img/svg/toolbar/select_doorstyle_inactive.svg +0 -57
  314. package/es/assets/img/svg/toolbar/shopping-cart.svg +0 -13
  315. package/es/assets/img/svg/toolbar/style_change_button.svg +0 -47
  316. package/es/assets/img/svg/toolbar/take_picture.svg +0 -75
  317. package/es/assets/img/svg/toolbar/undo_button.svg +0 -76
  318. package/es/assets/img/svg/toolbar/undo_button1.svg +0 -76
  319. package/es/assets/img/svg/toolbar/use_button.svg +0 -37
  320. package/es/assets/img/svg/toolbar/wall_color_icon.svg +0 -6
  321. package/es/assets/img/svg/topbar/edit_active.svg +0 -10
  322. package/es/assets/img/svg/topbar/edit_inactive.svg +0 -10
  323. package/es/assets/img/svg/topbar/redo_active.svg +0 -42
  324. package/es/assets/img/svg/topbar/redo_inactive.svg +0 -23
  325. package/es/assets/img/svg/topbar/select_all_active.svg +0 -50
  326. package/es/assets/img/svg/topbar/select_all_inactive.svg +0 -32
  327. package/es/assets/img/svg/topbar/take_picture_active.svg +0 -51
  328. package/es/assets/img/svg/topbar/take_picture_inactive.svg +0 -26
  329. package/es/assets/img/svg/topbar/undo_active.svg +0 -42
  330. package/es/assets/img/svg/topbar/undo_inactive.svg +0 -23
  331. package/es/assets/img/svg/warning_info_2d.svg +0 -81
  332. package/es/assets/img/svg/window/Clear.svg +0 -3
  333. package/es/assets/img/svg/window/Cross.svg +0 -5
  334. package/es/assets/img/svg/window/Double_hung.svg +0 -4
  335. package/es/assets/img/svg/window/Vertical.svg +0 -4
  336. package/es/assets/img/svg/windows_clear.svg +0 -23
  337. package/es/assets/img/svg/windows_cross.svg +0 -28
  338. package/es/assets/img/svg/windows_double_hung.svg +0 -24
  339. package/es/assets/img/svg/windows_vertical.svg +0 -24
  340. package/es/assets/img/svg/wizardstep/Custom.svg +0 -3
  341. package/es/assets/img/svg/wizardstep/Dashed_line.svg +0 -3
  342. package/es/assets/img/svg/wizardstep/L.svg +0 -3
  343. package/es/assets/img/svg/wizardstep/L2.svg +0 -3
  344. package/es/assets/img/svg/wizardstep/Open.svg +0 -3
  345. package/es/assets/img/svg/wizardstep/Square.svg +0 -3
  346. package/es/assets/img/svg/wizardstep/bar-active.svg +0 -9
  347. package/es/assets/img/svg/wizardstep/bar-normal.svg +0 -3
  348. package/es/assets/img/svg/wizardstep/bullet-current.svg +0 -3
  349. package/es/assets/img/svg/wizardstep/bullet-done.svg +0 -3
  350. package/es/assets/img/svg/wizardstep/bullet-not-done.svg +0 -3
  351. package/es/assets/img/svg/wizardstep/check-active.svg +0 -3
  352. package/es/assets/img/svg/wizardstep/check-normal.svg +0 -3
  353. package/es/assets/img/svg/wizardstep/detail_view.svg +0 -87
  354. package/es/assets/img/svg/wizardstep/pencil.svg +0 -11
  355. package/es/assets/img/svg/wizardstep/tile_view.svg +0 -95
  356. package/es/assets/img/texture/glass.jpg +0 -0
  357. package/es/assets/img/texture/steel.jpg +0 -0
  358. package/es/assets/img/texture/white1px.jpg +0 -0
  359. package/es/assets/img/texture/wood.jpg +0 -0
  360. package/es/assets/model/DCM.bin +0 -0
  361. package/es/assets/model/DCM.fbx +0 -0
  362. package/es/assets/model/DCM.gltf +0 -1
  363. package/es/assets/model/FBM.bin +0 -0
  364. package/es/assets/model/FBM.fbx +0 -0
  365. package/es/assets/model/FBM.gltf +0 -1
  366. package/es/assets/model/LRM.bin +0 -0
  367. package/es/assets/model/LRM.fbx +0 -0
  368. package/es/assets/model/LRM.gltf +0 -1
  369. package/es/assets/rtastore_logo.png +0 -0
  370. package/es/catalog/areas/area/planner-element.js +0 -45
  371. package/es/catalog/back.png +0 -0
  372. package/es/catalog/catalog.js +0 -265
  373. package/es/catalog/doors.png +0 -0
  374. package/es/catalog/doorways.png +0 -0
  375. package/es/catalog/envMap/nx.hdr +0 -0
  376. package/es/catalog/envMap/ny.hdr +0 -0
  377. package/es/catalog/envMap/nz.hdr +0 -0
  378. package/es/catalog/envMap/px.hdr +0 -0
  379. package/es/catalog/envMap/py.hdr +0 -0
  380. package/es/catalog/envMap/pz.hdr +0 -0
  381. package/es/catalog/export.js +0 -0
  382. package/es/catalog/factories/area-factory-3d.js +0 -182
  383. package/es/catalog/factories/area-factory.js +0 -78
  384. package/es/catalog/factories/export.js +0 -7
  385. package/es/catalog/factories/wall-factory-3d.js +0 -202
  386. package/es/catalog/factories/wall-factory.js +0 -267
  387. package/es/catalog/holes/door-closet/planner-element.js +0 -222
  388. package/es/catalog/holes/door-double/door_double.png +0 -0
  389. package/es/catalog/holes/door-double/planner-element.js +0 -315
  390. package/es/catalog/holes/door-exterior/planner-element.js +0 -215
  391. package/es/catalog/holes/door-interior/planner-element.js +0 -227
  392. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  393. package/es/catalog/holes/door-panic/planner-element.js +0 -503
  394. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  395. package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
  396. package/es/catalog/holes/door-sliding/planner-element.js +0 -225
  397. package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
  398. package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
  399. package/es/catalog/holes/export.js +0 -13
  400. package/es/catalog/holes/gate/gate.jpg +0 -0
  401. package/es/catalog/holes/window-clear/planner-element.js +0 -166
  402. package/es/catalog/holes/window-clear/texture.png +0 -0
  403. package/es/catalog/holes/window-cross/planner-element.js +0 -165
  404. package/es/catalog/holes/window-cross/texture.png +0 -0
  405. package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
  406. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  407. package/es/catalog/holes/window-vertical/planner-element.js +0 -276
  408. package/es/catalog/holes/window-vertical/texture.png +0 -0
  409. package/es/catalog/lines/wall/planner-element.js +0 -79
  410. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  411. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  412. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  413. package/es/catalog/molding/molding-dcm/planner-element.js +0 -26
  414. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  415. package/es/catalog/molding/molding-fbm/planner-element.js +0 -26
  416. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  417. package/es/catalog/molding/molding-lrm/planner-element.js +0 -26
  418. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  419. package/es/catalog/properties/export.js +0 -21
  420. package/es/catalog/properties/property-checkbox.js +0 -68
  421. package/es/catalog/properties/property-color.js +0 -39
  422. package/es/catalog/properties/property-enum.js +0 -50
  423. package/es/catalog/properties/property-hidden.js +0 -19
  424. package/es/catalog/properties/property-lenght-measure.js +0 -96
  425. package/es/catalog/properties/property-length-measure.js +0 -80
  426. package/es/catalog/properties/property-length-measure_hole.js +0 -96
  427. package/es/catalog/properties/property-number.js +0 -48
  428. package/es/catalog/properties/property-read-only.js +0 -26
  429. package/es/catalog/properties/property-string.js +0 -48
  430. package/es/catalog/properties/property-toggle.js +0 -39
  431. package/es/catalog/properties/shared-property-style.js +0 -14
  432. package/es/catalog/utils/FuseUtils.js +0 -79
  433. package/es/catalog/utils/exporter.js +0 -161
  434. package/es/catalog/utils/geom-utils.js +0 -189
  435. package/es/catalog/utils/item-loader.js +0 -1602
  436. package/es/catalog/utils/load-obj.js +0 -91
  437. package/es/catalog/utils/mtl-loader.js +0 -357
  438. package/es/catalog/utils/obj-loader.js +0 -476
  439. package/es/catalog/windows.png +0 -0
  440. package/es/class/FuseUtils.js +0 -79
  441. package/es/class/area.js +0 -141
  442. package/es/class/export.js +0 -24
  443. package/es/class/group.js +0 -431
  444. package/es/class/guide.js +0 -58
  445. package/es/class/hole.js +0 -924
  446. package/es/class/item.js +0 -1884
  447. package/es/class/layer.js +0 -663
  448. package/es/class/line.js +0 -1229
  449. package/es/class/project.js +0 -937
  450. package/es/class/vertex.js +0 -198
  451. package/es/components/content.js +0 -135
  452. package/es/components/export.js +0 -9
  453. package/es/components/style/button.js +0 -106
  454. package/es/components/style/cancel-button.js +0 -21
  455. package/es/components/style/content-container.js +0 -30
  456. package/es/components/style/content-title.js +0 -25
  457. package/es/components/style/delete-button.js +0 -24
  458. package/es/components/style/export.js +0 -31
  459. package/es/components/style/form-block.js +0 -20
  460. package/es/components/style/form-color-input.js +0 -26
  461. package/es/components/style/form-label.js +0 -22
  462. package/es/components/style/form-number-input.js +0 -192
  463. package/es/components/style/form-number-input_2.js +0 -238
  464. package/es/components/style/form-select.js +0 -19
  465. package/es/components/style/form-slider.js +0 -60
  466. package/es/components/style/form-submit-button.js +0 -25
  467. package/es/components/style/form-text-input.js +0 -69
  468. package/es/components/viewer2d/area.js +0 -81
  469. package/es/components/viewer2d/export.js +0 -31
  470. package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -36
  471. package/es/components/viewer2d/grids/grid-streak.js +0 -36
  472. package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -36
  473. package/es/components/viewer2d/grids/grids.js +0 -30
  474. package/es/components/viewer2d/group.js +0 -48
  475. package/es/components/viewer2d/item.js +0 -242
  476. package/es/components/viewer2d/layer.js +0 -164
  477. package/es/components/viewer2d/line.js +0 -997
  478. package/es/components/viewer2d/ruler.js +0 -84
  479. package/es/components/viewer2d/rulerDist.js +0 -102
  480. package/es/components/viewer2d/rulerX.js +0 -142
  481. package/es/components/viewer2d/rulerY.js +0 -144
  482. package/es/components/viewer2d/scene.js +0 -108
  483. package/es/components/viewer2d/snap.js +0 -74
  484. package/es/components/viewer2d/state.js +0 -73
  485. package/es/components/viewer2d/utils.js +0 -193
  486. package/es/components/viewer2d/vertex.js +0 -66
  487. package/es/components/viewer2d/viewer2d.js +0 -1405
  488. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2585
  489. package/es/components/viewer3d/dcm.js +0 -401
  490. package/es/components/viewer3d/fbm.js +0 -414
  491. package/es/components/viewer3d/front3D.js +0 -62
  492. package/es/components/viewer3d/grid-creator.js +0 -25
  493. package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
  494. package/es/components/viewer3d/grids/grid-streak.js +0 -27
  495. package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
  496. package/es/components/viewer3d/libs/first-person-controls.js +0 -67
  497. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
  498. package/es/components/viewer3d/libs/mtl-loader.js +0 -357
  499. package/es/components/viewer3d/libs/obj-loader.js +0 -462
  500. package/es/components/viewer3d/libs/orbit-controls.js +0 -697
  501. package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -44
  502. package/es/components/viewer3d/lrm.js +0 -305
  503. package/es/components/viewer3d/model.js +0 -708
  504. package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
  505. package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
  506. package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
  507. package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -224
  508. package/es/components/viewer3d/ruler-utils/scene3D.js +0 -59
  509. package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
  510. package/es/components/viewer3d/scene-creator.js +0 -3818
  511. package/es/components/viewer3d/three-memory-cleaner.js +0 -51
  512. package/es/components/viewer3d/viewer3d-first-person.js +0 -311
  513. package/es/components/viewer3d/viewer3d.js +0 -2654
  514. package/es/constants.js +0 -769
  515. package/es/index.html.ejs +0 -264
  516. package/es/models.js +0 -512
  517. package/es/plugins/SVGLoader.js +0 -1414
  518. package/es/plugins/console-debugger.js +0 -34
  519. package/es/plugins/export.js +0 -7
  520. package/es/plugins/keyboard.js +0 -110
  521. package/es/reducers/areas-reducer.js +0 -12
  522. package/es/reducers/export.js +0 -25
  523. package/es/reducers/groups-reducer.js +0 -38
  524. package/es/reducers/holes-reducer.js +0 -62
  525. package/es/reducers/items-reducer.js +0 -143
  526. package/es/reducers/lines-reducer.js +0 -45
  527. package/es/reducers/project-reducer.js +0 -136
  528. package/es/reducers/reducer.js +0 -19
  529. package/es/reducers/scene-reducer.js +0 -28
  530. package/es/reducers/user-reducer.js +0 -41
  531. package/es/reducers/vertices-reducer.js +0 -19
  532. package/es/reducers/viewer2d-reducer.js +0 -77
  533. package/es/reducers/viewer3d-reducer.js +0 -58
  534. package/es/shared-style.js +0 -66
  535. package/es/translator/en.js +0 -104
  536. package/es/translator/it.js +0 -79
  537. package/es/translator/ru.js +0 -79
  538. package/es/translator/translator.js +0 -80
  539. package/es/utils/browser.js +0 -33
  540. package/es/utils/convert-units-lite.js +0 -29
  541. package/es/utils/email-validator.js +0 -4
  542. package/es/utils/export.js +0 -25
  543. package/es/utils/geometry.js +0 -2609
  544. package/es/utils/get-edges-of-subgraphs.js +0 -26
  545. package/es/utils/graph-cycles.js +0 -238
  546. package/es/utils/graph-inner-cycles.js +0 -46
  547. package/es/utils/graph.js +0 -145
  548. package/es/utils/helper.js +0 -436
  549. package/es/utils/history.js +0 -29
  550. package/es/utils/id-broker.js +0 -15
  551. package/es/utils/isolate-event-handler.js +0 -1622
  552. package/es/utils/logger.js +0 -8
  553. package/es/utils/math.js +0 -50
  554. package/es/utils/molding.js +0 -1347
  555. package/es/utils/name-generator.js +0 -17
  556. package/es/utils/objects-utils.js +0 -50
  557. package/es/utils/phone-validator.js +0 -4
  558. package/es/utils/process-black-list.js +0 -15
  559. package/es/utils/react-if.js +0 -18
  560. package/es/utils/ruler.js +0 -58
  561. package/es/utils/snap-scene.js +0 -94
  562. package/es/utils/snap.js +0 -231
  563. package/es/utils/summarizeCart.js +0 -24
  564. package/es/utils/threeCSG.es6.js +0 -494
  565. package/es/version.js +0 -1
  566. /package/es/{catalog/lines/wall/textures/plaster-normal.jpg → 1fc74a85baa030dbc913.jpg} +0 -0
  567. /package/es/{catalog/lines/wall/wall.png → 30a49a74d9bd10068b65.png} +0 -0
  568. /package/es/{catalog/lines/wall/textures/bricks-normal2.jpg → 340a84d3930143a53545.jpg} +0 -0
  569. /package/es/{catalog/lines/wall/textures/morden-normal.jpg → 5c8d36b3e7223934f447.jpg} +0 -0
  570. /package/es/{catalog/lines/wall/textures/bricks-normal.jpg → 81e7a7e6edf162e88b44.jpg} +0 -0
  571. /package/es/{catalog/lines/wall/textures/morden.jpg → 8fe0f1210d8ba435a790.jpg} +0 -0
  572. /package/es/{catalog/lines/wall/textures/bricks.jpg → a07d30a04bda8ee03491.jpg} +0 -0
  573. /package/es/{catalog/lines/wall/textures/painted.jpg → bee3f62687a97bcc3d9f.jpg} +0 -0
  574. /package/es/{catalog/areas/area/textures/strand-porcelain.jpg → c232d250fd899392b1b7.jpg} +0 -0
  575. /package/es/{catalog/areas/area/textures/tile1.jpg → c7ae6f4de09134ebe588.jpg} +0 -0
  576. /package/es/{catalog/lines/wall/textures/plaster.jpg → dad5ee758630256ee702.jpg} +0 -0
  577. /package/es/{catalog/areas/area/textures/grass.jpg → e470a2ce76062955fa98.jpg} +0 -0
  578. /package/es/{catalog/areas/area/textures/parquet.jpg → e5ae13166775e7d071e4.jpg} +0 -0
  579. /package/es/{catalog/areas/area/textures/ceramic-tile.jpg → e8e5de0892f5375460bd.jpg} +0 -0
package/es/class/hole.js DELETED
@@ -1,924 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import { Map, List, fromJS } from 'immutable';
4
- import { Layer, Group } from "./export";
5
- import { IDBroker, NameGenerator } from "../utils/export";
6
- import { nearestSnap, addLineSegmentSnap } from "../utils/snap";
7
- import { MODE_IDLE, MODE_IDLE_3D, MODE_DRAWING_HOLE, MODE_DRAWING_HOLE_3D, MODE_DRAGGING_HOLE, MODE_DRAGGING_HOLE_3D } from "../constants";
8
- import { GeometryUtils } from "../utils/export";
9
- var Hole = /*#__PURE__*/function () {
10
- function Hole() {
11
- _classCallCheck(this, Hole);
12
- }
13
- return _createClass(Hole, null, [{
14
- key: "create",
15
- value: function create(state, layerID, type, lineID, offset, properties, holeX, holeY) {
16
- var holeID = IDBroker.acquireID();
17
- var hole = state.catalog.factoryElement(type, {
18
- id: holeID,
19
- url: state.catalog.getIn(['elements', type, 'info', 'url']),
20
- type: type,
21
- offset: offset,
22
- line: lineID,
23
- x: holeX,
24
- y: holeY
25
- }, properties);
26
- state = state.setIn(['scene', 'layers', layerID, 'holes', holeID], hole);
27
- state = state.updateIn(['scene', 'layers', layerID, 'lines', lineID, 'holes'], function (holes) {
28
- return holes.push(holeID);
29
- });
30
- // get vertex order/////
31
- var element = state.scene.layers.getIn([layerID, 'lines', lineID]);
32
- var layer = state.getIn(['scene', 'layers', layerID]);
33
- var vetName0 = element.vertices.get(0);
34
- var vetName1 = element.vertices.get(1);
35
- var verticesArray = [];
36
- layer.areas.forEach(function (data) {
37
- verticesArray.push(data.vertices.toJS());
38
- });
39
- for (var i = 0; i < verticesArray.length; i++) {
40
- var vertices = verticesArray[i];
41
- if (vertices.includes(vetName0) && vertices.includes(vetName1)) {
42
- var index0 = vertices.indexOf(vetName0);
43
- var index1 = vertices.indexOf(vetName1);
44
- // if vertex order chanege//
45
- if (index1 + 1 == index0) {
46
- return {
47
- updatedState: state,
48
- hole: hole
49
- };
50
- }
51
- if (index0 == 0 && index1 == vertices.length - 1) {
52
- return {
53
- updatedState: state,
54
- hole: hole
55
- };
56
- }
57
- // ////////////////////////
58
- }
59
- }
60
- // ///////////////////////////
61
- properties = hole.properties.toJS();
62
- if (properties.hasOwnProperty('flip_orizzontal')) {
63
- properties['flip_orizzontal'] = true;
64
- }
65
- if (properties.hasOwnProperty('flip_horizontal')) {
66
- properties['flip_horizontal'] = true;
67
- }
68
- state = this.setJsProperties(state, layerID, holeID, properties).updatedState;
69
- return {
70
- updatedState: state,
71
- hole: hole
72
- };
73
- }
74
- }, {
75
- key: "select",
76
- value: function select(state, layerID, holeID) {
77
- state = Layer.select(state, layerID).updatedState;
78
- state = Layer.selectElement(state, layerID, 'holes', holeID).updatedState;
79
- return {
80
- updatedState: state
81
- };
82
- }
83
- }, {
84
- key: "remove",
85
- value: function remove(state, layerID, holeID) {
86
- var hole = state.getIn(['scene', 'layers', layerID, 'holes', holeID]);
87
- state = this.unselect(state, layerID, holeID).updatedState;
88
- state = Layer.removeElement(state, layerID, 'holes', holeID).updatedState;
89
- state = state.updateIn(['scene', 'layers', layerID, 'lines', hole.line, 'holes'], function (holes) {
90
- var index = holes.findIndex(function (ID) {
91
- return holeID === ID;
92
- });
93
- return index !== -1 ? holes.remove(index) : holes;
94
- });
95
- state.getIn(['scene', 'groups']).forEach(function (group) {
96
- return state = Group.removeElement(state, group.id, layerID, 'holes', holeID).updatedState;
97
- });
98
- return {
99
- updatedState: state
100
- };
101
- }
102
- }, {
103
- key: "unselect",
104
- value: function unselect(state, layerID, holeID) {
105
- state = Layer.unselect(state, layerID, 'holes', holeID).updatedState;
106
- return {
107
- updatedState: state
108
- };
109
- }
110
- }, {
111
- key: "selectToolDrawingHole",
112
- value: function selectToolDrawingHole(state, sceneComponentType) {
113
- var snapElements = new List().withMutations(function (snapElements) {
114
- var _state$getIn = state.getIn(['scene', 'layers', state.scene.selectedLayer]),
115
- lines = _state$getIn.lines,
116
- vertices = _state$getIn.vertices;
117
- lines.forEach(function (line) {
118
- var _vertices$get = vertices.get(line.vertices.get(0)),
119
- x1 = _vertices$get.x,
120
- y1 = _vertices$get.y;
121
- var _vertices$get2 = vertices.get(line.vertices.get(1)),
122
- x2 = _vertices$get2.x,
123
- y2 = _vertices$get2.y;
124
- addLineSegmentSnap(snapElements, x1, y1, x2, y2, 20, 1, line.id);
125
- });
126
- });
127
- state = state.merge({
128
- mode: MODE_DRAWING_HOLE,
129
- snapElements: snapElements,
130
- drawingSupport: Map({
131
- type: sceneComponentType
132
- })
133
- });
134
- return {
135
- updatedState: state
136
- };
137
- }
138
- }, {
139
- key: "selectToolDrawingHole3D",
140
- value: function selectToolDrawingHole3D(state, sceneComponentType) {
141
- var snapElements = new List().withMutations(function (snapElements) {
142
- var _state$getIn2 = state.getIn(['scene', 'layers', state.scene.selectedLayer]),
143
- lines = _state$getIn2.lines,
144
- vertices = _state$getIn2.vertices;
145
- lines.forEach(function (line) {
146
- var _vertices$get3 = vertices.get(line.vertices.get(0)),
147
- x1 = _vertices$get3.x,
148
- y1 = _vertices$get3.y;
149
- var _vertices$get4 = vertices.get(line.vertices.get(1)),
150
- x2 = _vertices$get4.x,
151
- y2 = _vertices$get4.y;
152
- addLineSegmentSnap(snapElements, x1, y1, x2, y2, 20, 1, line.id);
153
- });
154
- });
155
- state = state.merge({
156
- mode: MODE_DRAWING_HOLE_3D,
157
- snapElements: snapElements,
158
- drawingSupport: Map({
159
- type: sceneComponentType
160
- })
161
- });
162
- state = state.mergeIn(['scene', 'loadFlag'], false);
163
- return {
164
- updatedState: state
165
- };
166
- }
167
- }, {
168
- key: "updateDrawingHole",
169
- value: function updateDrawingHole(state, layerID, x, y) {
170
- var catalog = state.catalog;
171
- //calculate snap and overwrite coords if needed
172
- //force snap to segment
173
- var snap = nearestSnap(state.snapElements, x, y, state.snapMask.merge({
174
- SNAP_SEGMENT: true
175
- }));
176
- if (snap) {
177
- var _snap$point = snap.point;
178
- x = _snap$point.x;
179
- y = _snap$point.y;
180
- }
181
- var selectedHole = state.getIn(['scene', 'layers', layerID, 'selected', 'holes']).first();
182
- if (snap) {
183
- var lineID = snap.snap.related.get(0);
184
- var vertices = state.getIn(['scene', 'layers', layerID, 'lines', lineID, 'vertices']);
185
- var _state$getIn3 = state.getIn(['scene', 'layers', layerID, 'vertices', vertices.get(0)]),
186
- x1 = _state$getIn3.x,
187
- y1 = _state$getIn3.y;
188
- var _state$getIn4 = state.getIn(['scene', 'layers', layerID, 'vertices', vertices.get(1)]),
189
- x2 = _state$getIn4.x,
190
- y2 = _state$getIn4.y;
191
-
192
- // // I need min and max vertices on this line segment
193
- var minVertex = GeometryUtils.minVertex({
194
- x: x1,
195
- y: y1
196
- }, {
197
- x: x2,
198
- y: y2
199
- });
200
- var maxVertex = GeometryUtils.maxVertex({
201
- x: x1,
202
- y: y1
203
- }, {
204
- x: x2,
205
- y: y2
206
- });
207
- var width = catalog.factoryElement(state.drawingSupport.get('type')).properties.getIn(['width', 'length']);
208
-
209
- // // Now I need min and max possible coordinates for the hole on the line. They depend on the width of the hole
210
- var lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
211
- var alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
212
- var cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
213
- var sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
214
- var minLeftVertexHole = {
215
- x: minVertex.x + (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * cosAlpha,
216
- y: minVertex.y + (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * sinAlpha
217
- };
218
- var maxRightVertexHole = {
219
- x: minVertex.x + lineLength * cosAlpha - (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * cosAlpha,
220
- y: minVertex.y + lineLength * sinAlpha - (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * sinAlpha
221
- };
222
- var offset;
223
- if (x < minLeftVertexHole.x) {
224
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
225
- offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
226
- } else {
227
- if (x > maxRightVertexHole.x) {
228
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
229
- offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
230
- } else if (x === minLeftVertexHole.x && x === maxRightVertexHole.x) {
231
- if (y < minLeftVertexHole.y) {
232
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
233
- offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
234
- } else if (y > maxRightVertexHole.y) {
235
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
236
- offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
237
- } else {
238
- offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
239
- }
240
- } else {
241
- offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
242
- // offset =
243
- // minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
244
- }
245
- }
246
- if (this.checkHoleCollide(state.getIn(['scene', 'layers', layerID]), lineID, selectedHole, x, y, width)) {
247
- return {
248
- updatedState: state
249
- };
250
- }
251
-
252
- //if hole does exist, update
253
- if (state.getIn(['drawingSupport', 'currentID'])) {
254
- var hole = state.getIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID'])]);
255
- hole = hole.merge({
256
- offset: offset,
257
- line: lineID,
258
- x: x,
259
- y: y,
260
- rotation: alpha
261
- });
262
- state = state.mergeIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID'])], hole);
263
- //remove from old line ( if present )
264
- var index = state.getIn(['scene', 'layers', layerID, 'lines']).findEntry(function (line) {
265
- return line.id !== lineID && line.get('holes').contains(state.getIn(['drawingSupport', 'currentID']));
266
- });
267
- if (index) {
268
- var removed = index[1].get('holes').filter(function (hl) {
269
- return hl !== state.getIn(['drawingSupport', 'currentID']);
270
- });
271
- state = state.setIn(['scene', 'layers', layerID, 'lines', index[0], 'holes'], removed);
272
- }
273
-
274
- // //add to line
275
- var line_holes = state.getIn(['scene', 'layers', layerID, 'lines', lineID, 'holes']);
276
- if (!line_holes.contains(state.getIn(['drawingSupport', 'currentID']))) {
277
- state = state.setIn(['scene', 'layers', layerID, 'lines', lineID, 'holes'], line_holes.push(state.getIn(['drawingSupport', 'currentID'])));
278
- }
279
- // get vertex order/////
280
- var element = state.scene.layers.getIn([layerID, 'lines', lineID]);
281
- var layer = state.getIn(['scene', 'layers', layerID]);
282
- var vetName0 = element.vertices.get(0);
283
- var vetName1 = element.vertices.get(1);
284
- var verticesArray = [];
285
- layer.areas.forEach(function (data) {
286
- verticesArray.push(data.vertices.toJS());
287
- });
288
- for (var i = 0; i < verticesArray.length; i++) {
289
- var _vertices = verticesArray[i];
290
- if (_vertices.includes(vetName0) && _vertices.includes(vetName1)) {
291
- var index0 = _vertices.indexOf(vetName0);
292
- var index1 = _vertices.indexOf(vetName1);
293
- // if vertex order chanege//
294
- if (index1 + 1 == index0) {
295
- if (hole != undefined) {
296
- var properties = hole.properties.toJS();
297
- if (properties.hasOwnProperty('flip_orizzontal')) {
298
- properties['flip_orizzontal'] = false;
299
- }
300
- if (properties.hasOwnProperty('flip_horizontal')) {
301
- properties['flip_horizontal'] = false;
302
- }
303
- state = this.setJsProperties(state, layerID, state.getIn(['drawingSupport', 'currentID']), properties).updatedState;
304
- }
305
- return {
306
- updatedState: state
307
- };
308
- }
309
- if (index0 == 0 && index1 == _vertices.length - 1) {
310
- if (hole != undefined) {
311
- var _properties = hole.properties.toJS();
312
- if (_properties.hasOwnProperty('flip_orizzontal')) {
313
- _properties['flip_orizzontal'] = false;
314
- }
315
- if (_properties.hasOwnProperty('flip_horizontal')) {
316
- _properties['flip_horizontal'] = false;
317
- }
318
- state = this.setJsProperties(state, layerID, state.getIn(['drawingSupport', 'currentID']), _properties).updatedState;
319
- }
320
- return {
321
- updatedState: state
322
- };
323
- }
324
- // ////////////////////////
325
- }
326
- }
327
- // ///////////////////////////
328
- if (hole != undefined) {
329
- var _properties2 = hole.properties.toJS();
330
- if (_properties2.hasOwnProperty('flip_orizzontal')) {
331
- _properties2['flip_orizzontal'] = true;
332
- }
333
- if (_properties2.hasOwnProperty('flip_horizontal')) {
334
- _properties2['flip_horizontal'] = true;
335
- }
336
- state = this.setJsProperties(state, layerID, state.getIn(['drawingSupport', 'currentID']), _properties2).updatedState;
337
- }
338
- } else {
339
- //if hole does not exist, create
340
- var _this$create = this.create(state, layerID, state.drawingSupport.get('type'), lineID, offset),
341
- stateH = _this$create.updatedState,
342
- _hole = _this$create.hole;
343
- state = Hole.select(stateH, layerID, _hole.id).updatedState;
344
- state = state.setIn(['drawingSupport', 'currentID'], _hole.id);
345
- }
346
- }
347
- //i've lost the snap while trying to drop the hole
348
- else if (false && selectedHole) {
349
- //think if enable
350
- state = Hole.remove(state, layerID, selectedHole).updatedState;
351
- }
352
- return {
353
- updatedState: state
354
- };
355
- }
356
- }, {
357
- key: "updateDrawingHole3D",
358
- value: function updateDrawingHole3D(state, layerID, x, y) {
359
- var catalog = state.catalog;
360
- //calculate snap and overwrite coords if needed
361
- //force snap to segment
362
- var snap = nearestSnap(state.snapElements, x, y, state.snapMask.merge({
363
- SNAP_SEGMENT: true
364
- }));
365
- if (snap) {
366
- var _snap$point2 = snap.point;
367
- x = _snap$point2.x;
368
- y = _snap$point2.y;
369
- }
370
- var selectedHole = state.getIn(['scene', 'layers', layerID, 'selected', 'holes']).first();
371
- if (snap) {
372
- var lineID = snap.snap.related.get(0);
373
- var vertices = state.getIn(['scene', 'layers', layerID, 'lines', lineID, 'vertices']);
374
- var _state$getIn5 = state.getIn(['scene', 'layers', layerID, 'vertices', vertices.get(0)]),
375
- x1 = _state$getIn5.x,
376
- y1 = _state$getIn5.y;
377
- var _state$getIn6 = state.getIn(['scene', 'layers', layerID, 'vertices', vertices.get(1)]),
378
- x2 = _state$getIn6.x,
379
- y2 = _state$getIn6.y;
380
-
381
- // // I need min and max vertices on this line segment
382
- var minVertex = GeometryUtils.minVertex({
383
- x: x1,
384
- y: y1
385
- }, {
386
- x: x2,
387
- y: y2
388
- });
389
- var maxVertex = GeometryUtils.maxVertex({
390
- x: x1,
391
- y: y1
392
- }, {
393
- x: x2,
394
- y: y2
395
- });
396
- var width = catalog.factoryElement(state.drawingSupport.get('type')).properties.getIn(['width', 'length']);
397
-
398
- // // Now I need min and max possible coordinates for the hole on the line. They depend on the width of the hole
399
- var lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
400
- var alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
401
- var cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
402
- var sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
403
- var minLeftVertexHole = {
404
- x: minVertex.x + (state.mode.includes('ING_HOLE_3D') ? width + 1 : width) / 2 * cosAlpha,
405
- y: minVertex.y + (state.mode.includes('ING_HOLE_3D') ? width + 1 : width) / 2 * sinAlpha
406
- };
407
- var maxRightVertexHole = {
408
- x: minVertex.x + lineLength * cosAlpha - (state.mode.includes('ING_HOLE_3D') ? width + 1 : width) / 2 * cosAlpha,
409
- y: minVertex.y + lineLength * sinAlpha - (state.mode.includes('ING_HOLE_3D') ? width + 1 : width) / 2 * sinAlpha
410
- };
411
- var offset;
412
- if (x < minLeftVertexHole.x) {
413
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
414
- } else if (x > maxRightVertexHole.x) {
415
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
416
- } else {
417
- if (x === minLeftVertexHole.x && x === maxRightVertexHole.x) {
418
- if (y < minLeftVertexHole.y) {
419
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
420
- /*
421
- offset =
422
- minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
423
- */
424
- } else if (y > maxRightVertexHole.y) {
425
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
426
- /*
427
- offset =
428
- minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
429
- */
430
- } else {
431
- offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
432
- }
433
- } else {
434
- offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
435
- }
436
- }
437
- if (this.checkHoleCollide(state.getIn(['scene', 'layers', layerID]), lineID, selectedHole, x, y, width)) {
438
- return {
439
- updatedState: state
440
- };
441
- }
442
-
443
- //if hole does exist, update
444
- if (state.getIn(['drawingSupport', 'currentID'])) {
445
- var hole = state.getIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID'])]);
446
- hole = hole.merge({
447
- offset: offset,
448
- line: lineID,
449
- x: x,
450
- y: y,
451
- rotation: alpha
452
- });
453
- state = state.mergeIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID'])], hole);
454
-
455
- //remove from old line ( if present )
456
- var index = state.getIn(['scene', 'layers', layerID, 'lines']).findEntry(function (line) {
457
- return line.id !== lineID && line.get('holes').contains(state.getIn(['drawingSupport', 'currentID']));
458
- });
459
- if (index && state.mode !== 'MODE_DRAWING_HOLE_3D') {
460
- var removed = index[1].get('holes').filter(function (hl) {
461
- return hl !== state.getIn(['drawingSupport', 'currentID']);
462
- });
463
- state = state.setIn(['scene', 'layers', layerID, 'lines', index[0], 'holes'], removed);
464
- }
465
-
466
- //add to line
467
- var line_holes = state.getIn(['scene', 'layers', layerID, 'lines', lineID, 'holes']);
468
- if (!line_holes.contains(state.getIn(['drawingSupport', 'currentID'])) && state.mode !== 'MODE_DRAWING_HOLE_3D') {
469
- state = state.setIn(['scene', 'layers', layerID, 'lines', lineID, 'holes'], line_holes.push(state.getIn(['drawingSupport', 'currentID'])));
470
- }
471
-
472
- // get vertex order/////
473
- var element = state.scene.layers.getIn([layerID, 'lines', lineID]);
474
- var layer = state.getIn(['scene', 'layers', layerID]);
475
- var vetName0 = element.vertices.get(0);
476
- var vetName1 = element.vertices.get(1);
477
- var verticesArray = [];
478
- layer.areas.forEach(function (data) {
479
- verticesArray.push(data.vertices.toJS());
480
- });
481
- for (var i = 0; i < verticesArray.length; i++) {
482
- var _vertices2 = verticesArray[i];
483
- if (_vertices2.includes(vetName0) && _vertices2.includes(vetName1)) {
484
- var index0 = _vertices2.indexOf(vetName0);
485
- var index1 = _vertices2.indexOf(vetName1);
486
- // if vertex order chanege//
487
- if (index1 + 1 == index0) {
488
- if (hole != undefined) {
489
- var properties = hole.properties.toJS();
490
- if (properties.hasOwnProperty('flip_orizzontal')) {
491
- properties['flip_orizzontal'] = false;
492
- }
493
- if (properties.hasOwnProperty('flip_horizontal')) {
494
- properties['flip_horizontal'] = false;
495
- }
496
- state = this.setJsProperties(state, layerID, state.getIn(['drawingSupport', 'currentID']), properties).updatedState;
497
- if (state.mode === 'MODE_DRAWING_HOLE_3D') {
498
- state = state.setIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID']), 'visible'], false);
499
- } else {
500
- state = state.setIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID']), 'visible'], true);
501
- }
502
- }
503
- return {
504
- updatedState: state
505
- };
506
- }
507
- if (index0 == 0 && index1 == _vertices2.length - 1) {
508
- if (hole != undefined) {
509
- var _properties3 = hole.properties.toJS();
510
- if (_properties3.hasOwnProperty('flip_orizzontal')) {
511
- _properties3['flip_orizzontal'] = false;
512
- }
513
- if (_properties3.hasOwnProperty('flip_horizontal')) {
514
- _properties3['flip_horizontal'] = false;
515
- }
516
- state = this.setJsProperties(state, layerID, state.getIn(['drawingSupport', 'currentID']), _properties3).updatedState;
517
- if (state.mode === 'MODE_DRAWING_HOLE_3D') {
518
- state = state.setIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID']), 'visible'], false);
519
- } else {
520
- state = state.setIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID']), 'visible'], true);
521
- }
522
- }
523
- return {
524
- updatedState: state
525
- };
526
- }
527
- // ////////////////////////
528
- }
529
- }
530
- // ///////////////////////////
531
- if (hole != undefined) {
532
- var _properties4 = hole.properties.toJS();
533
- if (_properties4.hasOwnProperty('flip_orizzontal')) {
534
- _properties4['flip_orizzontal'] = true;
535
- }
536
- if (_properties4.hasOwnProperty('flip_horizontal')) {
537
- _properties4['flip_horizontal'] = true;
538
- }
539
- state = this.setJsProperties(state, layerID, state.getIn(['drawingSupport', 'currentID']), _properties4).updatedState;
540
- if (state.mode === 'MODE_DRAWING_HOLE_3D') {
541
- state = state.setIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID']), 'visible'], false);
542
- } else {
543
- state = state.setIn(['scene', 'layers', layerID, 'holes', state.getIn(['drawingSupport', 'currentID']), 'visible'], true);
544
- }
545
- }
546
- } else {
547
- //if hole does not exist, create
548
- var _this$create2 = this.create(state, layerID, state.drawingSupport.get('type'), lineID, offset),
549
- stateH = _this$create2.updatedState,
550
- _hole2 = _this$create2.hole;
551
- state = Hole.select(stateH, layerID, _hole2.id).updatedState;
552
- state = state.setIn(['drawingSupport', 'currentID'], _hole2.id);
553
- }
554
- }
555
- if (state.mode !== 'MODE_DRAWING_HOLE_3D') {
556
- state = state.getIn(['scene', 'layers', layerID, 'holes']).reduce(function (oldReduceState, element) {
557
- oldReduceState = oldReduceState.setIn(['scene', 'layers', layerID, 'holes', element.id, 'visible'], true);
558
- return oldReduceState;
559
- }, state);
560
- }
561
- return {
562
- updatedState: state
563
- };
564
- }
565
- }, {
566
- key: "endCreatingHole",
567
- value: function endCreatingHole(state) {
568
- state = state.merge({
569
- isOpen: false,
570
- openedType: 0
571
- });
572
- return {
573
- updatedState: state
574
- };
575
- }
576
- }, {
577
- key: "updatePopupOpen",
578
- value: function updatePopupOpen(state, value) {
579
- state = state.merge({
580
- openedType: value
581
- });
582
- return {
583
- updatedState: state
584
- };
585
- }
586
- }, {
587
- key: "endDrawingHole",
588
- value: function endDrawingHole(state, layerID, x, y) {
589
- state = this.updateDrawingHole(state, layerID, x, y).updatedState;
590
- state = Layer.unselectAll(state, layerID).updatedState;
591
- var popup = state.get('popup');
592
- state = state.merge({
593
- drawingSupport: Map({
594
- type: state.drawingSupport.get('type')
595
- }),
596
- isOpen: !popup,
597
- mode: MODE_IDLE
598
- });
599
- state = Layer.unselectAll(state, layerID).updatedState;
600
- return {
601
- updatedState: state
602
- };
603
- }
604
- }, {
605
- key: "endDrawingHole3D",
606
- value: function endDrawingHole3D(state, layerID, x, y) {
607
- state = state.merge({
608
- mode: MODE_IDLE_3D
609
- });
610
- state = this.updateDrawingHole3D(state, layerID, x, y).updatedState;
611
- state = Layer.unselectAll(state, layerID).updatedState;
612
- var popup = state.get('popup');
613
- state = state.merge({
614
- drawingSupport: Map({
615
- type: state.drawingSupport.get('type')
616
- }),
617
- isOpen: !popup,
618
- mode: MODE_IDLE_3D
619
- });
620
- return {
621
- updatedState: state
622
- };
623
- }
624
- }, {
625
- key: "beginDraggingHole",
626
- value: function beginDraggingHole(state, layerID, holeID, x, y) {
627
- var layer = state.getIn(['scene', 'layers', layerID]);
628
- var hole = layer.getIn(['holes', holeID]);
629
- var line = layer.getIn(['lines', hole.line]);
630
- var v0 = layer.getIn(['vertices', line.vertices.get(0)]);
631
- var v1 = layer.getIn(['vertices', line.vertices.get(1)]);
632
- var snapElements = addLineSegmentSnap(List(), v0.x, v0.y, v1.x, v1.y, 9999999, 1, null);
633
- state = state.merge({
634
- mode: MODE_DRAGGING_HOLE,
635
- snapElements: snapElements,
636
- draggingSupport: Map({
637
- layerID: layerID,
638
- holeID: holeID,
639
- startPointX: x,
640
- startPointY: y
641
- })
642
- });
643
- return {
644
- updatedState: state
645
- };
646
- }
647
- }, {
648
- key: "beginDraggingHole3D",
649
- value: function beginDraggingHole3D(state, layerID, holeID, x, y) {
650
- var layer = state.getIn(['scene', 'layers', layerID]);
651
- var hole = layer.getIn(['holes', holeID]);
652
- var line = layer.getIn(['lines', hole.line]);
653
- var v0 = layer.getIn(['vertices', line.vertices.get(0)]);
654
- var v1 = layer.getIn(['vertices', line.vertices.get(1)]);
655
- var snapElements = addLineSegmentSnap(List(), v0.x, v0.y, v1.x, v1.y, 9999999, 1, null);
656
- state = state.updateIn(['scene', 'layers', layerID, 'lines', hole.line, 'holes'], function (holes) {
657
- var index = holes.findIndex(function (ID) {
658
- return holeID === ID;
659
- });
660
- return index !== -1 ? holes.remove(index) : holes;
661
- });
662
- state = state.merge({
663
- mode: MODE_DRAGGING_HOLE_3D,
664
- snapElements: snapElements,
665
- draggingSupport: Map({
666
- layerID: layerID,
667
- holeID: holeID,
668
- startPointX: x,
669
- startPointY: y
670
- })
671
- });
672
- return {
673
- updatedState: state
674
- };
675
- }
676
- }, {
677
- key: "updateDraggingHole",
678
- value: function updateDraggingHole(state, x, y) {
679
- //calculate snap and overwrite coords if needed
680
- //force snap to segment
681
- var snap = nearestSnap(state.snapElements, x, y, state.snapMask.merge({
682
- SNAP_SEGMENT: true
683
- }));
684
- if (!snap) return state;
685
- var _state = state,
686
- draggingSupport = _state.draggingSupport,
687
- scene = _state.scene;
688
- var layerID = draggingSupport.get('layerID');
689
- var holeID = draggingSupport.get('holeID');
690
- var startPointX = draggingSupport.get('startPointX');
691
- var startPointY = draggingSupport.get('startPointY');
692
- var layer = state.getIn(['scene', 'layers', layerID]);
693
- var hole = layer.getIn(['holes', holeID]);
694
- var line = layer.getIn(['lines', hole.line]);
695
- var v0 = layer.getIn(['vertices', line.vertices.get(0)]);
696
- var v1 = layer.getIn(['vertices', line.vertices.get(1)]);
697
- // I need min and max vertices on this line segment
698
- var _snap$point3 = snap.point;
699
- x = _snap$point3.x;
700
- y = _snap$point3.y;
701
- var minVertex = GeometryUtils.minVertex(v0, v1);
702
- var maxVertex = GeometryUtils.maxVertex(v0, v1);
703
-
704
- // Now I need min and max possible coordinates for the hole on the line. They depend on the width of the hole
705
-
706
- var width = hole.properties.get('width').get('length');
707
- var lineLength = GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
708
- var alpha = Math.atan2(v1.y - v0.y, Math.abs(v1.x - v0.x));
709
- var alpha1 = Math.atan2(v1.y - v0.y, v1.x - v0.x);
710
- var angle_temp;
711
- if (180 * alpha1 / Math.PI < 0) {
712
- angle_temp = 180 * alpha1 / Math.PI + 360;
713
- } else {
714
- angle_temp = 180 * alpha1 / Math.PI;
715
- }
716
- var cosWithThreshold = function cosWithThreshold(alpha) {
717
- var cos = Math.cos(Math.abs(alpha));
718
- return cos < 0.0000001 ? 0 : cos;
719
- };
720
- var sinWithThreshold = function sinWithThreshold(alpha) {
721
- var sin = Math.sin(Math.abs(alpha));
722
- return sin < 0.0000001 ? 0 : sin;
723
- };
724
- var cosAlpha = cosWithThreshold(Math.abs(alpha));
725
- var sinAlpha = sinWithThreshold(Math.abs(alpha));
726
- var minLeftVertexHole = {
727
- x: minVertex.x + (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * cosAlpha,
728
- y: minVertex.y + (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * sinAlpha
729
- };
730
- var maxRightVertexHole = {
731
- x: minVertex.x + lineLength * cosAlpha - (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * cosAlpha,
732
- y: minVertex.y + lineLength * sinAlpha - (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * sinAlpha
733
- };
734
- // Now I need to verify if the snap vertex (with coordinates x and y) is on the line segment
735
-
736
- var offset;
737
- if (x < minLeftVertexHole.x) {
738
- // Snap point is previous the the line
739
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
740
- offset = minVertex === v0 ? offset : 1 - offset;
741
- } else {
742
- // Snap point is after the line or on the line
743
- if (x > maxRightVertexHole.x) {
744
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
745
- offset = minVertex === v0 ? offset : 1 - offset;
746
- } else if (x === minLeftVertexHole.x && x === maxRightVertexHole.x) {
747
- // I am on a vertical line, I need to check y coordinates
748
- if (y < minLeftVertexHole.y) {
749
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
750
- offset = minVertex === v0 ? offset : 1 - offset;
751
- } else if (y > maxRightVertexHole.y) {
752
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
753
- offset = minVertex === v0 ? offset : 1 - offset;
754
- } else {
755
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, x, y);
756
- offset = minVertex === v0 ? offset : 1 - offset;
757
- }
758
- } else {
759
- offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, x, y);
760
- if (angle_temp > 90 && angle_temp < 270) {
761
- offset = 1 - offset;
762
- }
763
- }
764
- }
765
- if (this.checkHoleCollide(layer, hole.line, holeID, x, y, width)) {
766
- return {
767
- updatedState: state
768
- };
769
- }
770
- hole = hole.set('offset', offset);
771
- hole = hole.merge({
772
- x: x,
773
- y: y,
774
- rotation: alpha
775
- });
776
- state = state.merge({
777
- scene: scene.mergeIn(['layers', layerID, 'holes', holeID], hole)
778
- });
779
- state = state.updateIn(['scene', 'layers', layerID, 'lines', hole.line, 'holes'], function (holes) {
780
- var index = holes.findIndex(function (ID) {
781
- return holeID === ID;
782
- });
783
- return index === -1 ? holes.push(holeID) : holes;
784
- });
785
- return {
786
- updatedState: state
787
- };
788
- }
789
- }, {
790
- key: "updateDraggingHoleChanged",
791
- value: function updateDraggingHoleChanged(state, x, y, layerID, holeID) {
792
- var _state2 = state,
793
- scene = _state2.scene;
794
- var hole = scene.getIn(['layers', layerID, 'holes', holeID]);
795
- hole = hole.merge({
796
- x: x,
797
- y: y
798
- });
799
- state = state.merge({
800
- scene: scene.mergeIn(['layers', layerID, 'holes', holeID], hole)
801
- });
802
- return {
803
- updatedState: state
804
- };
805
- }
806
- }, {
807
- key: "updateDraggingHoleRulerChanged",
808
- value: function updateDraggingHoleRulerChanged(state, width, layerID, holeID) {
809
- var _state3 = state,
810
- scene = _state3.scene;
811
- state = state.mergeIn(['scene', 'layers', layerID, 'holes', holeID, 'properties', 'width', 'length'], width);
812
- return {
813
- updatedState: state
814
- };
815
- }
816
- }, {
817
- key: "endDraggingHole3D",
818
- value: function endDraggingHole3D(state, x, y) {
819
- if (state === undefined) return;
820
- state = this.updateDraggingHole(state, x, y).updatedState;
821
- var _ref = state.draggingSupport !== undefined ? state : null,
822
- draggingSupport = _ref.draggingSupport;
823
- if (draggingSupport && draggingSupport.size === 0 && draggingSupport === null) return {
824
- updatedState: state
825
- };
826
- var layerID = draggingSupport.get('layerID');
827
- var holeID = draggingSupport.get('holeID');
828
- var layer = state.getIn(['scene', 'layers', layerID]);
829
- var hole = layer.getIn(['holes', holeID]);
830
- state = state.updateIn(['scene', 'layers', layerID, 'lines', hole.line, 'holes'], function (holes) {
831
- var index = holes.findIndex(function (ID) {
832
- return holeID === ID;
833
- });
834
- return index === -1 ? holes.push(holeID) : holes;
835
- });
836
- state = state.merge({
837
- mode: MODE_IDLE_3D,
838
- draggingSupport: Map({})
839
- });
840
- return {
841
- updatedState: state
842
- };
843
- }
844
- }, {
845
- key: "checkHoleCollide",
846
- value: function checkHoleCollide(layer, lineID, selectedHoleID, hx, hy, hw) {
847
- var line = layer.getIn(['lines', lineID]);
848
- var holes = line.getIn(['holes']);
849
- var bCollide = holes.some(function (holeID) {
850
- if (holeID == selectedHoleID) return false;
851
- var hole = layer.getIn(['holes', holeID]);
852
- var dx = hole.get('x') - hx;
853
- var dy = hole.get('y') - hy;
854
- var dw = (hole.properties.get('width').get('length') + hw) / 2;
855
- if (dx * dx + dy * dy < dw * dw) {
856
- return true;
857
- }
858
- });
859
- return bCollide;
860
- }
861
- }, {
862
- key: "endDraggingHole",
863
- value: function endDraggingHole(state, x, y) {
864
- state = this.updateDraggingHole(state, x, y).updatedState;
865
- state = state.merge({
866
- mode: MODE_IDLE
867
- });
868
- return {
869
- updatedState: state
870
- };
871
- }
872
- }, {
873
- key: "setProperties",
874
- value: function setProperties(state, layerID, holeID, properties) {
875
- state = state.setIn(['scene', 'layers', layerID, 'holes', holeID, 'properties'], properties);
876
- return {
877
- updatedState: state
878
- };
879
- }
880
- }, {
881
- key: "setJsProperties",
882
- value: function setJsProperties(state, layerID, holeID, properties) {
883
- return this.setProperties(state, layerID, holeID, fromJS(properties));
884
- }
885
- }, {
886
- key: "updateProperties",
887
- value: function updateProperties(state, layerID, holeID, properties) {
888
- properties.forEach(function (v, k) {
889
- if (state.hasIn(['scene', 'layers', layerID, 'holes', holeID, 'properties', k])) state = state.mergeIn(['scene', 'layers', layerID, 'holes', holeID, 'properties', k], v);
890
- });
891
- return {
892
- updatedState: state
893
- };
894
- }
895
- }, {
896
- key: "updateJsProperties",
897
- value: function updateJsProperties(state, layerID, holeID, properties) {
898
- return this.updateProperties(state, layerID, holeID, fromJS(properties));
899
- }
900
- }, {
901
- key: "setAttributes",
902
- value: function setAttributes(state, layerID, holeID, holesAttributes) {
903
- var hAttr = holesAttributes.toJS();
904
- var offsetA = hAttr.offsetA,
905
- offsetB = hAttr.offsetB,
906
- offset = hAttr.offset;
907
- delete hAttr['offsetA'];
908
- delete hAttr['offsetB'];
909
- delete hAttr['offset'];
910
- var misc = new Map({
911
- _unitA: offsetA._unit,
912
- _unitB: offsetB._unit
913
- });
914
- state = state.mergeIn(['scene', 'layers', layerID, 'holes', holeID], fromJS(hAttr)).mergeDeepIn(['scene', 'layers', layerID, 'holes', holeID], new Map({
915
- offset: offset,
916
- misc: misc
917
- }));
918
- return {
919
- updatedState: state
920
- };
921
- }
922
- }]);
923
- }();
924
- export { Hole as default };