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.
- package/es/KitchenConfigurator.js +1 -1
- package/es/KitchenConfigurator.js.map +1 -1
- package/package.json +8 -13
- package/lib/@history.js +0 -11
- package/lib/@history.js.map +0 -1
- package/lib/AppContext.js +0 -11
- package/lib/AppContext.js.map +0 -1
- package/lib/KitchenConfigurator.js +0 -1353
- package/lib/KitchenConfigurator.js.map +0 -1
- package/lib/KitchenConfiguratorApp.js +0 -539
- package/lib/KitchenConfiguratorApp.js.map +0 -1
- package/lib/actions/area-actions.js +0 -22
- package/lib/actions/area-actions.js.map +0 -1
- package/lib/actions/export.js +0 -44
- package/lib/actions/export.js.map +0 -1
- package/lib/actions/groups-actions.js +0 -108
- package/lib/actions/groups-actions.js.map +0 -1
- package/lib/actions/holes-actions.js +0 -141
- package/lib/actions/holes-actions.js.map +0 -1
- package/lib/actions/items-actions.js +0 -365
- package/lib/actions/items-actions.js.map +0 -1
- package/lib/actions/lines-actions.js +0 -98
- package/lib/actions/lines-actions.js.map +0 -1
- package/lib/actions/project-actions.js +0 -333
- package/lib/actions/project-actions.js.map +0 -1
- package/lib/actions/scene-actions.js +0 -44
- package/lib/actions/scene-actions.js.map +0 -1
- package/lib/actions/user-actions.js +0 -69
- package/lib/actions/user-actions.js.map +0 -1
- package/lib/actions/vertices-actions.js +0 -36
- package/lib/actions/vertices-actions.js.map +0 -1
- package/lib/actions/viewer2d-actions.js +0 -74
- package/lib/actions/viewer2d-actions.js.map +0 -1
- package/lib/actions/viewer3d-actions.js +0 -33
- package/lib/actions/viewer3d-actions.js.map +0 -1
- package/lib/catalog/areas/area/planner-element.js +0 -47
- package/lib/catalog/areas/area/planner-element.js.map +0 -1
- package/lib/catalog/catalog.js +0 -283
- package/lib/catalog/catalog.js.map +0 -1
- package/lib/catalog/factories/area-factory-3d.js +0 -192
- package/lib/catalog/factories/area-factory-3d.js.map +0 -1
- package/lib/catalog/factories/area-factory.js +0 -90
- package/lib/catalog/factories/area-factory.js.map +0 -1
- package/lib/catalog/factories/export.js +0 -26
- package/lib/catalog/factories/export.js.map +0 -1
- package/lib/catalog/factories/wall-factory-3d.js +0 -213
- package/lib/catalog/factories/wall-factory-3d.js.map +0 -1
- package/lib/catalog/factories/wall-factory.js +0 -279
- package/lib/catalog/factories/wall-factory.js.map +0 -1
- package/lib/catalog/holes/door-closet/planner-element.js +0 -232
- package/lib/catalog/holes/door-closet/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-double/planner-element.js +0 -325
- package/lib/catalog/holes/door-double/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-exterior/planner-element.js +0 -225
- package/lib/catalog/holes/door-exterior/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-interior/planner-element.js +0 -237
- package/lib/catalog/holes/door-interior/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-panic/planner-element.js +0 -513
- package/lib/catalog/holes/door-panic/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-panic-double/planner-element.js +0 -473
- package/lib/catalog/holes/door-panic-double/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-sliding/planner-element.js +0 -235
- package/lib/catalog/holes/door-sliding/planner-element.js.map +0 -1
- package/lib/catalog/holes/doorway-framed/planner-element.js +0 -155
- package/lib/catalog/holes/doorway-framed/planner-element.js.map +0 -1
- package/lib/catalog/holes/doorway-frameless/planner-element.js +0 -114
- package/lib/catalog/holes/doorway-frameless/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-clear/planner-element.js +0 -176
- package/lib/catalog/holes/window-clear/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-cross/planner-element.js +0 -175
- package/lib/catalog/holes/window-cross/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-double-hung/planner-element.js +0 -313
- package/lib/catalog/holes/window-double-hung/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-vertical/planner-element.js +0 -286
- package/lib/catalog/holes/window-vertical/planner-element.js.map +0 -1
- package/lib/catalog/lines/wall/planner-element.js +0 -77
- package/lib/catalog/lines/wall/planner-element.js.map +0 -1
- package/lib/catalog/molding/molding-dcm/planner-element.js +0 -39
- package/lib/catalog/molding/molding-dcm/planner-element.js.map +0 -1
- package/lib/catalog/molding/molding-fbm/planner-element.js +0 -39
- package/lib/catalog/molding/molding-fbm/planner-element.js.map +0 -1
- package/lib/catalog/molding/molding-lrm/planner-element.js +0 -39
- package/lib/catalog/molding/molding-lrm/planner-element.js.map +0 -1
- package/lib/catalog/properties/export.js +0 -82
- package/lib/catalog/properties/export.js.map +0 -1
- package/lib/catalog/properties/property-checkbox.js +0 -79
- package/lib/catalog/properties/property-checkbox.js.map +0 -1
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-color.js.map +0 -1
- package/lib/catalog/properties/property-enum.js +0 -63
- package/lib/catalog/properties/property-enum.js.map +0 -1
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-hidden.js.map +0 -1
- package/lib/catalog/properties/property-lenght-measure.js +0 -109
- package/lib/catalog/properties/property-lenght-measure.js.map +0 -1
- package/lib/catalog/properties/property-length-measure.js +0 -93
- package/lib/catalog/properties/property-length-measure.js.map +0 -1
- package/lib/catalog/properties/property-length-measure_hole.js +0 -109
- package/lib/catalog/properties/property-length-measure_hole.js.map +0 -1
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-number.js.map +0 -1
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-read-only.js.map +0 -1
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-string.js.map +0 -1
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/property-toggle.js.map +0 -1
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/properties/shared-property-style.js.map +0 -1
- package/lib/catalog/utils/FuseUtils.js +0 -89
- package/lib/catalog/utils/FuseUtils.js.map +0 -1
- package/lib/catalog/utils/exporter.js +0 -156
- package/lib/catalog/utils/exporter.js.map +0 -1
- package/lib/catalog/utils/geom-utils.js +0 -206
- package/lib/catalog/utils/geom-utils.js.map +0 -1
- package/lib/catalog/utils/item-loader.js +0 -1534
- package/lib/catalog/utils/item-loader.js.map +0 -1
- package/lib/catalog/utils/load-obj.js +0 -100
- package/lib/catalog/utils/load-obj.js.map +0 -1
- package/lib/catalog/utils/mtl-loader.js +0 -360
- package/lib/catalog/utils/mtl-loader.js.map +0 -1
- package/lib/catalog/utils/obj-loader.js +0 -479
- package/lib/catalog/utils/obj-loader.js.map +0 -1
- package/lib/class/FuseUtils.js +0 -89
- package/lib/class/FuseUtils.js.map +0 -1
- package/lib/class/area.js +0 -151
- package/lib/class/area.js.map +0 -1
- package/lib/class/export.js +0 -97
- package/lib/class/export.js.map +0 -1
- package/lib/class/group.js +0 -446
- package/lib/class/group.js.map +0 -1
- package/lib/class/guide.js +0 -68
- package/lib/class/guide.js.map +0 -1
- package/lib/class/hole.js +0 -935
- package/lib/class/hole.js.map +0 -1
- package/lib/class/item.js +0 -1894
- package/lib/class/item.js.map +0 -1
- package/lib/class/layer.js +0 -673
- package/lib/class/layer.js.map +0 -1
- package/lib/class/line.js +0 -1296
- package/lib/class/line.js.map +0 -1
- package/lib/class/project.js +0 -829
- package/lib/class/project.js.map +0 -1
- package/lib/class/vertex.js +0 -272
- package/lib/class/vertex.js.map +0 -1
- package/lib/components/atoms/Snackbar/index.js +0 -57
- package/lib/components/atoms/Snackbar/index.js.map +0 -1
- package/lib/components/atoms/radio-button/index.js +0 -33
- package/lib/components/atoms/radio-button/index.js.map +0 -1
- package/lib/components/atoms/radio-button/styles.js +0 -12
- package/lib/components/atoms/radio-button/styles.js.map +0 -1
- package/lib/components/button/MainButton.js +0 -98
- package/lib/components/button/MainButton.js.map +0 -1
- package/lib/components/button/ToggleMeasureButton.js +0 -63
- package/lib/components/button/ToggleMeasureButton.js.map +0 -1
- package/lib/components/catalog-view/catalog-breadcrumb.js +0 -61
- package/lib/components/catalog-view/catalog-breadcrumb.js.map +0 -1
- package/lib/components/catalog-view/catalog-item.js +0 -233
- package/lib/components/catalog-view/catalog-item.js.map +0 -1
- package/lib/components/catalog-view/catalog-list.js +0 -189
- package/lib/components/catalog-view/catalog-list.js.map +0 -1
- package/lib/components/catalog-view/catalog-page-item.js +0 -137
- package/lib/components/catalog-view/catalog-page-item.js.map +0 -1
- package/lib/components/catalog-view/catalog-turn-back-page-item.js +0 -113
- package/lib/components/catalog-view/catalog-turn-back-page-item.js.map +0 -1
- package/lib/components/configurator/custom-configurator.js +0 -101
- package/lib/components/configurator/custom-configurator.js.map +0 -1
- package/lib/components/configurator/project-configurator.js +0 -138
- package/lib/components/configurator/project-configurator.js.map +0 -1
- package/lib/components/content.js +0 -132
- package/lib/components/content.js.map +0 -1
- package/lib/components/export.js +0 -90
- package/lib/components/export.js.map +0 -1
- package/lib/components/firstsetting/button/styles.js +0 -34
- package/lib/components/firstsetting/button/styles.js.map +0 -1
- package/lib/components/firstsetting/export.js +0 -16
- package/lib/components/firstsetting/export.js.map +0 -1
- package/lib/components/firstsetting/firstsetting-content-button.js +0 -224
- package/lib/components/firstsetting/firstsetting-content-button.js.map +0 -1
- package/lib/components/firstsetting/firstsetting-toggle-button.js +0 -133
- package/lib/components/firstsetting/firstsetting-toggle-button.js.map +0 -1
- package/lib/components/firstsetting/firstsetting.js +0 -633
- package/lib/components/firstsetting/firstsetting.js.map +0 -1
- package/lib/components/footerbar/button/ControlButton.js +0 -79
- package/lib/components/footerbar/button/ControlButton.js.map +0 -1
- package/lib/components/footerbar/button/DirectionButton.js +0 -76
- package/lib/components/footerbar/button/DirectionButton.js.map +0 -1
- package/lib/components/footerbar/button/DirectionPanSpinButton.js +0 -57
- package/lib/components/footerbar/button/DirectionPanSpinButton.js.map +0 -1
- package/lib/components/footerbar/button/ToggleButton.js +0 -83
- package/lib/components/footerbar/button/ToggleButton.js.map +0 -1
- package/lib/components/footerbar/button/ToggleConvertButton.js +0 -80
- package/lib/components/footerbar/button/ToggleConvertButton.js.map +0 -1
- package/lib/components/footerbar/button/ToggleMeasureButton.js +0 -59
- package/lib/components/footerbar/button/ToggleMeasureButton.js.map +0 -1
- package/lib/components/footerbar/button/styles.js +0 -29
- package/lib/components/footerbar/button/styles.js.map +0 -1
- package/lib/components/footerbar/export.js +0 -16
- package/lib/components/footerbar/export.js.map +0 -1
- package/lib/components/footerbar/footer-content-button.js +0 -224
- package/lib/components/footerbar/footer-content-button.js.map +0 -1
- package/lib/components/footerbar/footer-toggle-button.js +0 -133
- package/lib/components/footerbar/footer-toggle-button.js.map +0 -1
- package/lib/components/footerbar/footerbar.js +0 -808
- package/lib/components/footerbar/footerbar.js.map +0 -1
- package/lib/components/footerbar/styles.js +0 -41
- package/lib/components/footerbar/styles.js.map +0 -1
- package/lib/components/header/button/MenuButton.js +0 -77
- package/lib/components/header/button/MenuButton.js.map +0 -1
- package/lib/components/header/button/SaveButton.js +0 -57
- package/lib/components/header/button/SaveButton.js.map +0 -1
- package/lib/components/header/button/styles.js +0 -68
- package/lib/components/header/button/styles.js.map +0 -1
- package/lib/components/header/export.js +0 -12
- package/lib/components/header/export.js.map +0 -1
- package/lib/components/header/header.js +0 -556
- package/lib/components/header/header.js.map +0 -1
- package/lib/components/header/styles.js +0 -47
- package/lib/components/header/styles.js.map +0 -1
- package/lib/components/login/Login.js +0 -94
- package/lib/components/login/Login.js.map +0 -1
- package/lib/components/login/LoginForm/index.js +0 -140
- package/lib/components/login/LoginForm/index.js.map +0 -1
- package/lib/components/login/Register.js +0 -104
- package/lib/components/login/Register.js.map +0 -1
- package/lib/components/login/RegisterForm/index.js +0 -237
- package/lib/components/login/RegisterForm/index.js.map +0 -1
- package/lib/components/login/jwtService.js +0 -239
- package/lib/components/login/jwtService.js.map +0 -1
- package/lib/components/molecules/slider/index.js +0 -22
- package/lib/components/molecules/slider/index.js.map +0 -1
- package/lib/components/molecules/slider/styles.js +0 -2
- package/lib/components/molecules/slider/styles.js.map +0 -1
- package/lib/components/myprojects/export.js +0 -12
- package/lib/components/myprojects/export.js.map +0 -1
- package/lib/components/myprojects/index.js +0 -453
- package/lib/components/myprojects/index.js.map +0 -1
- package/lib/components/myprojects/styles.js +0 -31
- package/lib/components/myprojects/styles.js.map +0 -1
- package/lib/components/sidebar/custom-accordion.js +0 -45
- package/lib/components/sidebar/custom-accordion.js.map +0 -1
- package/lib/components/sidebar/export.js +0 -50
- package/lib/components/sidebar/export.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js +0 -74
- package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js +0 -124
- package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js +0 -135
- package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js +0 -260
- package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js +0 -84
- package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/element-editor.js +0 -884
- package/lib/components/sidebar/panel-element-editor/element-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js +0 -2
- package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/panel-element-editor.js +0 -56
- package/lib/components/sidebar/panel-element-editor/panel-element-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js +0 -125
- package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js.map +0 -1
- package/lib/components/sidebar/panel-group-editor.js +0 -218
- package/lib/components/sidebar/panel-group-editor.js.map +0 -1
- package/lib/components/sidebar/panel-groups.js +0 -274
- package/lib/components/sidebar/panel-groups.js.map +0 -1
- package/lib/components/sidebar/panel-guides.js +0 -192
- package/lib/components/sidebar/panel-guides.js.map +0 -1
- package/lib/components/sidebar/panel-layer-elements.js +0 -258
- package/lib/components/sidebar/panel-layer-elements.js.map +0 -1
- package/lib/components/sidebar/panel-layers.js +0 -347
- package/lib/components/sidebar/panel-layers.js.map +0 -1
- package/lib/components/sidebar/panel.js +0 -110
- package/lib/components/sidebar/panel.js.map +0 -1
- package/lib/components/sidebar/sidebar.js +0 -117
- package/lib/components/sidebar/sidebar.js.map +0 -1
- package/lib/components/sidebar/toolbar-panel.js +0 -171
- package/lib/components/sidebar/toolbar-panel.js.map +0 -1
- package/lib/components/sign/export.js +0 -18
- package/lib/components/sign/export.js.map +0 -1
- package/lib/components/sign/main/index.js +0 -567
- package/lib/components/sign/main/index.js.map +0 -1
- package/lib/components/sign/main/styles.js +0 -27
- package/lib/components/sign/main/styles.js.map +0 -1
- package/lib/components/style/button.js +0 -121
- package/lib/components/style/button.js.map +0 -1
- package/lib/components/style/cancel-button.js +0 -30
- package/lib/components/style/cancel-button.js.map +0 -1
- package/lib/components/style/content-container.js +0 -41
- package/lib/components/style/content-container.js.map +0 -1
- package/lib/components/style/content-title.js +0 -38
- package/lib/components/style/content-title.js.map +0 -1
- package/lib/components/style/delete-button.js +0 -35
- package/lib/components/style/delete-button.js.map +0 -1
- package/lib/components/style/export.js +0 -122
- package/lib/components/style/export.js.map +0 -1
- package/lib/components/style/form-block.js +0 -32
- package/lib/components/style/form-block.js.map +0 -1
- package/lib/components/style/form-color-input.js +0 -35
- package/lib/components/style/form-color-input.js.map +0 -1
- package/lib/components/style/form-label.js +0 -34
- package/lib/components/style/form-label.js.map +0 -1
- package/lib/components/style/form-number-input.js +0 -197
- package/lib/components/style/form-number-input.js.map +0 -1
- package/lib/components/style/form-number-input_2.js +0 -214
- package/lib/components/style/form-number-input_2.js.map +0 -1
- package/lib/components/style/form-select.js +0 -30
- package/lib/components/style/form-select.js.map +0 -1
- package/lib/components/style/form-slider.js +0 -53
- package/lib/components/style/form-slider.js.map +0 -1
- package/lib/components/style/form-submit-button.js +0 -36
- package/lib/components/style/form-submit-button.js.map +0 -1
- package/lib/components/style/form-text-input.js +0 -84
- package/lib/components/style/form-text-input.js.map +0 -1
- package/lib/components/toolbar/button/ControlButton.js +0 -76
- package/lib/components/toolbar/button/ControlButton.js.map +0 -1
- package/lib/components/toolbar/button/DirectionButton.js +0 -57
- package/lib/components/toolbar/button/DirectionButton.js.map +0 -1
- package/lib/components/toolbar/button/RightButton.js +0 -140
- package/lib/components/toolbar/button/RightButton.js.map +0 -1
- package/lib/components/toolbar/button/ToggleButton.js +0 -66
- package/lib/components/toolbar/button/ToggleButton.js.map +0 -1
- package/lib/components/toolbar/button/index.js +0 -94
- package/lib/components/toolbar/button/index.js.map +0 -1
- package/lib/components/toolbar/button/styles.js +0 -21
- package/lib/components/toolbar/button/styles.js.map +0 -1
- package/lib/components/toolbar/components/DoorStyleMenu.js +0 -112
- package/lib/components/toolbar/components/DoorStyleMenu.js.map +0 -1
- package/lib/components/toolbar/components/Pricing.js +0 -110
- package/lib/components/toolbar/components/Pricing.js.map +0 -1
- package/lib/components/toolbar/components/ReviewForQuote.js +0 -485
- package/lib/components/toolbar/components/ReviewForQuote.js.map +0 -1
- package/lib/components/toolbar/export.js +0 -50
- package/lib/components/toolbar/export.js.map +0 -1
- package/lib/components/toolbar/main/Alert.js +0 -132
- package/lib/components/toolbar/main/Alert.js.map +0 -1
- package/lib/components/toolbar/main/TakePictureModal.js +0 -109
- package/lib/components/toolbar/main/TakePictureModal.js.map +0 -1
- package/lib/components/toolbar/main/confirm-popup.js +0 -95
- package/lib/components/toolbar/main/confirm-popup.js.map +0 -1
- package/lib/components/toolbar/main/index.js +0 -4619
- package/lib/components/toolbar/main/index.js.map +0 -1
- package/lib/components/toolbar/main/myComponents.js +0 -125
- package/lib/components/toolbar/main/myComponents.js.map +0 -1
- package/lib/components/toolbar/main/styles.js +0 -73
- package/lib/components/toolbar/main/styles.js.map +0 -1
- package/lib/components/toolbar/plugin-item.js +0 -156
- package/lib/components/toolbar/plugin-item.js.map +0 -1
- package/lib/components/toolbar/popup/appliance/appliance-category/index.js +0 -86
- package/lib/components/toolbar/popup/appliance/appliance-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/appliance/choose-appliance/index.js +0 -85
- package/lib/components/toolbar/popup/appliance/choose-appliance/index.js.map +0 -1
- package/lib/components/toolbar/popup/appliance/index.js +0 -89
- package/lib/components/toolbar/popup/appliance/index.js.map +0 -1
- package/lib/components/toolbar/popup/autosaveprompt/index.js +0 -99
- package/lib/components/toolbar/popup/autosaveprompt/index.js.map +0 -1
- package/lib/components/toolbar/popup/autosaveprompt/styles.js +0 -16
- package/lib/components/toolbar/popup/autosaveprompt/styles.js.map +0 -1
- package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js +0 -86
- package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/cabinet/choose-product/index.js +0 -107
- package/lib/components/toolbar/popup/cabinet/choose-product/index.js.map +0 -1
- package/lib/components/toolbar/popup/cabinet/index.js +0 -91
- package/lib/components/toolbar/popup/cabinet/index.js.map +0 -1
- package/lib/components/toolbar/popup/doorStyle/choose-style/index.js +0 -59
- package/lib/components/toolbar/popup/doorStyle/choose-style/index.js.map +0 -1
- package/lib/components/toolbar/popup/doorStyle/index.js +0 -68
- package/lib/components/toolbar/popup/doorStyle/index.js.map +0 -1
- package/lib/components/toolbar/popup/doorStyle/style-category/index.js +0 -152
- package/lib/components/toolbar/popup/doorStyle/style-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -9
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js +0 -128
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/index.js +0 -572
- package/lib/components/toolbar/popup/downloadsummary/index.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js +0 -60
- package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js +0 -200
- package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js +0 -254
- package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js +0 -1762
- package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -96
- package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js +0 -125
- package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js +0 -1713
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js +0 -184
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showWarranty.js +0 -115
- package/lib/components/toolbar/popup/downloadsummary/showWarranty.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/styles.js +0 -47
- package/lib/components/toolbar/popup/downloadsummary/styles.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/category/index.js +0 -44
- package/lib/components/toolbar/popup/finishingtouch/category/index.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/index.js +0 -54
- package/lib/components/toolbar/popup/finishingtouch/index.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/material-edit.js +0 -163
- package/lib/components/toolbar/popup/finishingtouch/material-edit.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/product/index.js +0 -65
- package/lib/components/toolbar/popup/finishingtouch/product/index.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js +0 -124
- package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/choose-floor/index.js +0 -255
- package/lib/components/toolbar/popup/floorplan/choose-floor/index.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -20
- package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/floor-category/index.js +0 -99
- package/lib/components/toolbar/popup/floorplan/floor-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/index.js +0 -56
- package/lib/components/toolbar/popup/floorplan/index.js.map +0 -1
- package/lib/components/toolbar/popup/index.js +0 -195
- package/lib/components/toolbar/popup/index.js.map +0 -1
- package/lib/components/toolbar/popup/newproject/index.js +0 -75
- package/lib/components/toolbar/popup/newproject/index.js.map +0 -1
- package/lib/components/toolbar/popup/newproject/styles.js +0 -16
- package/lib/components/toolbar/popup/newproject/styles.js.map +0 -1
- package/lib/components/toolbar/popup/product/appliance.js +0 -73
- package/lib/components/toolbar/popup/product/appliance.js.map +0 -1
- package/lib/components/toolbar/popup/product/cabinetproduct.js +0 -33
- package/lib/components/toolbar/popup/product/cabinetproduct.js.map +0 -1
- package/lib/components/toolbar/popup/product/doorstyle.js +0 -59
- package/lib/components/toolbar/popup/product/doorstyle.js.map +0 -1
- package/lib/components/toolbar/popup/product/doorstyleproduct.js +0 -59
- package/lib/components/toolbar/popup/product/doorstyleproduct.js.map +0 -1
- package/lib/components/toolbar/popup/product/floor.js +0 -59
- package/lib/components/toolbar/popup/product/floor.js.map +0 -1
- package/lib/components/toolbar/popup/product/floorproduct.js +0 -68
- package/lib/components/toolbar/popup/product/floorproduct.js.map +0 -1
- package/lib/components/toolbar/popup/product/index.js +0 -59
- package/lib/components/toolbar/popup/product/index.js.map +0 -1
- package/lib/components/toolbar/popup/product/primary.js +0 -71
- package/lib/components/toolbar/popup/product/primary.js.map +0 -1
- package/lib/components/toolbar/popup/product/productline.js +0 -128
- package/lib/components/toolbar/popup/product/productline.js.map +0 -1
- package/lib/components/toolbar/popup/product/reviewItem.js +0 -346
- package/lib/components/toolbar/popup/product/reviewItem.js.map +0 -1
- package/lib/components/toolbar/popup/product/reviewMolding.js +0 -291
- package/lib/components/toolbar/popup/product/reviewMolding.js.map +0 -1
- package/lib/components/toolbar/popup/product/styles.js +0 -79
- package/lib/components/toolbar/popup/product/styles.js.map +0 -1
- package/lib/components/toolbar/popup/savedesign/FullPictureForm.js +0 -169
- package/lib/components/toolbar/popup/savedesign/FullPictureForm.js.map +0 -1
- package/lib/components/toolbar/popup/savedesign/index.js +0 -516
- package/lib/components/toolbar/popup/savedesign/index.js.map +0 -1
- package/lib/components/toolbar/popup/savedesign/styles.js +0 -26
- package/lib/components/toolbar/popup/savedesign/styles.js.map +0 -1
- package/lib/components/toolbar/popup/setDoorStyleOption/index.js +0 -64
- package/lib/components/toolbar/popup/setDoorStyleOption/index.js.map +0 -1
- package/lib/components/toolbar/popup/styles.js +0 -104
- package/lib/components/toolbar/popup/styles.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js +0 -166
- package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js +0 -93
- package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js +0 -45
- package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/StepDots.js +0 -40
- package/lib/components/toolbar/popup/submitforquote/StepDots.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/cart-choice.js +0 -141
- package/lib/components/toolbar/popup/submitforquote/cart-choice.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -50
- package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/index.js +0 -698
- package/lib/components/toolbar/popup/submitforquote/index.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/styles.js +0 -38
- package/lib/components/toolbar/popup/submitforquote/styles.js.map +0 -1
- package/lib/components/toolbar/popup/submitprompt/index.js +0 -79
- package/lib/components/toolbar/popup/submitprompt/index.js.map +0 -1
- package/lib/components/toolbar/popup/submitprompt/styles.js +0 -16
- package/lib/components/toolbar/popup/submitprompt/styles.js.map +0 -1
- package/lib/components/toolbar/toolbar-button.js +0 -111
- package/lib/components/toolbar/toolbar-button.js.map +0 -1
- package/lib/components/toolbar/toolbar-load-button.js +0 -36
- package/lib/components/toolbar/toolbar-load-button.js.map +0 -1
- package/lib/components/toolbar/toolbar-save-button.js +0 -34
- package/lib/components/toolbar/toolbar-save-button.js.map +0 -1
- package/lib/components/tutorial-view/Modal.js +0 -503
- package/lib/components/tutorial-view/Modal.js.map +0 -1
- package/lib/components/tutorial-view/styles.js +0 -13
- package/lib/components/tutorial-view/styles.js.map +0 -1
- package/lib/components/viewer2d/area.js +0 -90
- package/lib/components/viewer2d/area.js.map +0 -1
- package/lib/components/viewer2d/export.js +0 -122
- package/lib/components/viewer2d/export.js.map +0 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -45
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js.map +0 -1
- package/lib/components/viewer2d/grids/grid-streak.js +0 -45
- package/lib/components/viewer2d/grids/grid-streak.js.map +0 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -45
- package/lib/components/viewer2d/grids/grid-vertical-streak.js.map +0 -1
- package/lib/components/viewer2d/grids/grids.js +0 -45
- package/lib/components/viewer2d/grids/grids.js.map +0 -1
- package/lib/components/viewer2d/group.js +0 -63
- package/lib/components/viewer2d/group.js.map +0 -1
- package/lib/components/viewer2d/item.js +0 -522
- package/lib/components/viewer2d/item.js.map +0 -1
- package/lib/components/viewer2d/layer.js +0 -172
- package/lib/components/viewer2d/layer.js.map +0 -1
- package/lib/components/viewer2d/line.js +0 -899
- package/lib/components/viewer2d/line.js.map +0 -1
- package/lib/components/viewer2d/ruler.js +0 -108
- package/lib/components/viewer2d/ruler.js.map +0 -1
- package/lib/components/viewer2d/rulerDist.js +0 -154
- package/lib/components/viewer2d/rulerDist.js.map +0 -1
- package/lib/components/viewer2d/rulerX.js +0 -159
- package/lib/components/viewer2d/rulerX.js.map +0 -1
- package/lib/components/viewer2d/rulerY.js +0 -161
- package/lib/components/viewer2d/rulerY.js.map +0 -1
- package/lib/components/viewer2d/scene.js +0 -148
- package/lib/components/viewer2d/scene.js.map +0 -1
- package/lib/components/viewer2d/snap.js +0 -84
- package/lib/components/viewer2d/snap.js.map +0 -1
- package/lib/components/viewer2d/state.js +0 -88
- package/lib/components/viewer2d/state.js.map +0 -1
- package/lib/components/viewer2d/utils.js +0 -174
- package/lib/components/viewer2d/utils.js.map +0 -1
- package/lib/components/viewer2d/vertex.js +0 -76
- package/lib/components/viewer2d/vertex.js.map +0 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1409
- package/lib/components/viewer2d/viewer2d.js.map +0 -1
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2598
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js.map +0 -1
- package/lib/components/viewer3d/dcm.js +0 -408
- package/lib/components/viewer3d/dcm.js.map +0 -1
- package/lib/components/viewer3d/fbm.js +0 -421
- package/lib/components/viewer3d/fbm.js.map +0 -1
- package/lib/components/viewer3d/front3D.js +0 -76
- package/lib/components/viewer3d/front3D.js.map +0 -1
- package/lib/components/viewer3d/grid-creator.js +0 -35
- package/lib/components/viewer3d/grid-creator.js.map +0 -1
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -45
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js.map +0 -1
- package/lib/components/viewer3d/grids/grid-streak.js +0 -36
- package/lib/components/viewer3d/grids/grid-streak.js.map +0 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -45
- package/lib/components/viewer3d/grids/grid-vertical-streak.js.map +0 -1
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -75
- package/lib/components/viewer3d/libs/first-person-controls.js.map +0 -1
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1288
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js.map +0 -1
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -360
- package/lib/components/viewer3d/libs/mtl-loader.js.map +0 -1
- package/lib/components/viewer3d/libs/obj-loader.js +0 -465
- package/lib/components/viewer3d/libs/obj-loader.js.map +0 -1
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -701
- package/lib/components/viewer3d/libs/orbit-controls.js.map +0 -1
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -48
- package/lib/components/viewer3d/libs/pointer-lock-controls.js.map +0 -1
- package/lib/components/viewer3d/lrm.js +0 -312
- package/lib/components/viewer3d/lrm.js.map +0 -1
- package/lib/components/viewer3d/model.js +0 -715
- package/lib/components/viewer3d/model.js.map +0 -1
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -123
- package/lib/components/viewer3d/pointer-lock-navigation.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -69
- package/lib/components/viewer3d/ruler-utils/itemRect.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -503
- package/lib/components/viewer3d/ruler-utils/layer3D.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -235
- package/lib/components/viewer3d/ruler-utils/ruler3D.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -70
- package/lib/components/viewer3d/ruler-utils/scene3D.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -26
- package/lib/components/viewer3d/ruler-utils/state3D.js.map +0 -1
- package/lib/components/viewer3d/scene-creator.js +0 -3641
- package/lib/components/viewer3d/scene-creator.js.map +0 -1
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -61
- package/lib/components/viewer3d/three-memory-cleaner.js.map +0 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -321
- package/lib/components/viewer3d/viewer3d-first-person.js.map +0 -1
- package/lib/components/viewer3d/viewer3d.js +0 -2508
- package/lib/components/viewer3d/viewer3d.js.map +0 -1
- package/lib/components/wizardstep/button/styles.js +0 -67
- package/lib/components/wizardstep/button/styles.js.map +0 -1
- package/lib/components/wizardstep/export.js +0 -12
- package/lib/components/wizardstep/export.js.map +0 -1
- package/lib/components/wizardstep/index.js +0 -978
- package/lib/components/wizardstep/index.js.map +0 -1
- package/lib/components/wizardstep/styles.js +0 -68
- package/lib/components/wizardstep/styles.js.map +0 -1
- package/lib/components/wizardstep/wizardstep-content-button.js +0 -224
- package/lib/components/wizardstep/wizardstep-content-button.js.map +0 -1
- package/lib/components/wizardstep/wizardstep-toggle-button.js +0 -133
- package/lib/components/wizardstep/wizardstep-toggle-button.js.map +0 -1
- package/lib/constants.js +0 -646
- package/lib/constants.js.map +0 -1
- package/lib/hooks/useCheckCart.js +0 -60
- package/lib/hooks/useCheckCart.js.map +0 -1
- package/lib/hooks/useGetPricesBySku.js +0 -81
- package/lib/hooks/useGetPricesBySku.js.map +0 -1
- package/lib/hooks/useValidateToken.js +0 -207
- package/lib/hooks/useValidateToken.js.map +0 -1
- package/lib/index.js +0 -102
- package/lib/index.js.map +0 -1
- package/lib/models.js +0 -518
- package/lib/models.js.map +0 -1
- package/lib/plugins/SVGLoader.js +0 -1418
- package/lib/plugins/SVGLoader.js.map +0 -1
- package/lib/plugins/autosave.js +0 -40
- package/lib/plugins/autosave.js.map +0 -1
- package/lib/plugins/console-debugger.js +0 -45
- package/lib/plugins/console-debugger.js.map +0 -1
- package/lib/plugins/export.js +0 -34
- package/lib/plugins/export.js.map +0 -1
- package/lib/plugins/keyboard.js +0 -108
- package/lib/plugins/keyboard.js.map +0 -1
- package/lib/reducers/areas-reducer.js +0 -19
- package/lib/reducers/areas-reducer.js.map +0 -1
- package/lib/reducers/export.js +0 -98
- package/lib/reducers/export.js.map +0 -1
- package/lib/reducers/groups-reducer.js +0 -45
- package/lib/reducers/groups-reducer.js.map +0 -1
- package/lib/reducers/holes-reducer.js +0 -69
- package/lib/reducers/holes-reducer.js.map +0 -1
- package/lib/reducers/items-reducer.js +0 -147
- package/lib/reducers/items-reducer.js.map +0 -1
- package/lib/reducers/lines-reducer.js +0 -52
- package/lib/reducers/lines-reducer.js.map +0 -1
- package/lib/reducers/project-reducer.js +0 -136
- package/lib/reducers/project-reducer.js.map +0 -1
- package/lib/reducers/reducer.js +0 -27
- package/lib/reducers/reducer.js.map +0 -1
- package/lib/reducers/scene-reducer.js +0 -35
- package/lib/reducers/scene-reducer.js.map +0 -1
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/reducers/user-reducer.js.map +0 -1
- package/lib/reducers/vertices-reducer.js +0 -26
- package/lib/reducers/vertices-reducer.js.map +0 -1
- package/lib/reducers/viewer2d-reducer.js +0 -83
- package/lib/reducers/viewer2d-reducer.js.map +0 -1
- package/lib/reducers/viewer3d-reducer.js +0 -64
- package/lib/reducers/viewer3d-reducer.js.map +0 -1
- package/lib/shared-style.js +0 -73
- package/lib/shared-style.js.map +0 -1
- package/lib/styles/export.js +0 -14
- package/lib/styles/export.js.map +0 -1
- package/lib/translator/en.js +0 -111
- package/lib/translator/en.js.map +0 -1
- package/lib/translator/it.js +0 -86
- package/lib/translator/it.js.map +0 -1
- package/lib/translator/ru.js +0 -86
- package/lib/translator/ru.js.map +0 -1
- package/lib/translator/translator.js +0 -91
- package/lib/translator/translator.js.map +0 -1
- package/lib/utils/browser.js +0 -41
- package/lib/utils/browser.js.map +0 -1
- package/lib/utils/email-validator.js +0 -11
- package/lib/utils/email-validator.js.map +0 -1
- package/lib/utils/export.js +0 -57
- package/lib/utils/export.js.map +0 -1
- package/lib/utils/geometry.js +0 -2329
- package/lib/utils/geometry.js.map +0 -1
- package/lib/utils/get-edges-of-subgraphs.js +0 -29
- package/lib/utils/get-edges-of-subgraphs.js.map +0 -1
- package/lib/utils/graph-cycles.js +0 -241
- package/lib/utils/graph-cycles.js.map +0 -1
- package/lib/utils/graph-inner-cycles.js +0 -55
- package/lib/utils/graph-inner-cycles.js.map +0 -1
- package/lib/utils/graph.js +0 -152
- package/lib/utils/graph.js.map +0 -1
- package/lib/utils/helper.js +0 -360
- package/lib/utils/helper.js.map +0 -1
- package/lib/utils/history.js +0 -37
- package/lib/utils/history.js.map +0 -1
- package/lib/utils/id-broker.js +0 -26
- package/lib/utils/id-broker.js.map +0 -1
- package/lib/utils/logger.js +0 -15
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/math.js +0 -58
- package/lib/utils/math.js.map +0 -1
- package/lib/utils/molding.js +0 -864
- package/lib/utils/molding.js.map +0 -1
- package/lib/utils/name-generator.js +0 -24
- package/lib/utils/name-generator.js.map +0 -1
- package/lib/utils/objects-utils.js +0 -61
- package/lib/utils/objects-utils.js.map +0 -1
- package/lib/utils/phone-validator.js +0 -11
- package/lib/utils/phone-validator.js.map +0 -1
- package/lib/utils/process-black-list.js +0 -25
- package/lib/utils/process-black-list.js.map +0 -1
- package/lib/utils/react-if.js +0 -25
- package/lib/utils/react-if.js.map +0 -1
- package/lib/utils/snap-scene.js +0 -106
- package/lib/utils/snap-scene.js.map +0 -1
- package/lib/utils/snap.js +0 -250
- package/lib/utils/snap.js.map +0 -1
- package/lib/utils/threeCSG.es6.js +0 -504
- package/lib/utils/threeCSG.es6.js.map +0 -1
- package/lib/version.js +0 -8
- package/lib/version.js.map +0 -1
- package/src/@history.js +0 -3
- package/src/AppContext.js +0 -5
- package/src/KitchenConfigurator.jsx +0 -1517
- package/src/KitchenConfiguratorApp.jsx +0 -443
- package/src/actions/area-actions.js +0 -15
- package/src/actions/export.js +0 -38
- package/src/actions/groups-actions.js +0 -102
- package/src/actions/holes-actions.js +0 -152
- package/src/actions/items-actions.js +0 -393
- package/src/actions/lines-actions.js +0 -103
- package/src/actions/project-actions.js +0 -391
- package/src/actions/scene-actions.js +0 -44
- package/src/actions/user-actions.js +0 -75
- package/src/actions/vertices-actions.js +0 -34
- package/src/actions/viewer2d-actions.js +0 -79
- package/src/actions/viewer3d-actions.js +0 -32
- package/src/catalog/areas/area/planner-element.jsx +0 -43
- package/src/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/src/catalog/areas/area/textures/grass.jpg +0 -0
- package/src/catalog/areas/area/textures/parquet.jpg +0 -0
- package/src/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/src/catalog/areas/area/textures/tile1.jpg +0 -0
- package/src/catalog/back.png +0 -0
- package/src/catalog/catalog.js +0 -258
- package/src/catalog/doors.png +0 -0
- package/src/catalog/doorways.png +0 -0
- package/src/catalog/envMap/nx.hdr +0 -0
- package/src/catalog/envMap/ny.hdr +0 -0
- package/src/catalog/envMap/nz.hdr +0 -0
- package/src/catalog/envMap/px.hdr +0 -0
- package/src/catalog/envMap/py.hdr +0 -0
- package/src/catalog/envMap/pz.hdr +0 -0
- package/src/catalog/factories/area-factory-3d.js +0 -252
- package/src/catalog/factories/area-factory.jsx +0 -102
- package/src/catalog/factories/export.js +0 -9
- package/src/catalog/factories/wall-factory-3d.js +0 -296
- package/src/catalog/factories/wall-factory.jsx +0 -321
- package/src/catalog/holes/door-closet/planner-element.jsx +0 -251
- package/src/catalog/holes/door-double/door_double.png +0 -0
- package/src/catalog/holes/door-double/planner-element.jsx +0 -391
- package/src/catalog/holes/door-exterior/planner-element.jsx +0 -245
- package/src/catalog/holes/door-interior/planner-element.jsx +0 -256
- package/src/catalog/holes/door-panic/panicDoor.png +0 -0
- package/src/catalog/holes/door-panic/planner-element.jsx +0 -594
- package/src/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/src/catalog/holes/door-panic-double/planner-element.jsx +0 -574
- package/src/catalog/holes/door-sliding/planner-element.jsx +0 -256
- package/src/catalog/holes/doorway-framed/planner-element.jsx +0 -169
- package/src/catalog/holes/doorway-frameless/planner-element.jsx +0 -116
- package/src/catalog/holes/gate/gate.jpg +0 -0
- package/src/catalog/holes/window-clear/planner-element.jsx +0 -181
- package/src/catalog/holes/window-clear/texture.png +0 -0
- package/src/catalog/holes/window-cross/planner-element.jsx +0 -180
- package/src/catalog/holes/window-cross/texture.png +0 -0
- package/src/catalog/holes/window-double-hung/planner-element.jsx +0 -366
- package/src/catalog/holes/window-double-hung/texture.png +0 -0
- package/src/catalog/holes/window-vertical/planner-element.jsx +0 -290
- package/src/catalog/holes/window-vertical/texture.png +0 -0
- package/src/catalog/lines/wall/planner-element.jsx +0 -73
- package/src/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/src/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/morden.jpg +0 -0
- package/src/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/painted.jpg +0 -0
- package/src/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/src/catalog/lines/wall/wall.png +0 -0
- package/src/catalog/molding/molding-dcm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-dcm/texture.png +0 -0
- package/src/catalog/molding/molding-fbm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-fbm/texture.png +0 -0
- package/src/catalog/molding/molding-lrm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-lrm/texture.png +0 -0
- package/src/catalog/properties/export.js +0 -33
- package/src/catalog/properties/property-checkbox.jsx +0 -123
- package/src/catalog/properties/property-color.jsx +0 -52
- package/src/catalog/properties/property-enum.jsx +0 -87
- package/src/catalog/properties/property-hidden.jsx +0 -22
- package/src/catalog/properties/property-lenght-measure.jsx +0 -113
- package/src/catalog/properties/property-length-measure.jsx +0 -129
- package/src/catalog/properties/property-length-measure_hole.jsx +0 -110
- package/src/catalog/properties/property-number.jsx +0 -63
- package/src/catalog/properties/property-read-only.jsx +0 -37
- package/src/catalog/properties/property-string.jsx +0 -59
- package/src/catalog/properties/property-toggle.jsx +0 -51
- package/src/catalog/properties/shared-property-style.js +0 -13
- package/src/catalog/utils/FuseUtils.js +0 -61
- package/src/catalog/utils/exporter.js +0 -173
- package/src/catalog/utils/geom-utils.js +0 -301
- package/src/catalog/utils/item-loader.jsx +0 -2122
- package/src/catalog/utils/load-obj.js +0 -113
- package/src/catalog/utils/mtl-loader.js +0 -462
- package/src/catalog/utils/obj-loader.js +0 -544
- package/src/catalog/windows.png +0 -0
- package/src/class/FuseUtils.js +0 -61
- package/src/class/area.js +0 -159
- package/src/class/export.js +0 -37
- package/src/class/group.js +0 -565
- package/src/class/guide.js +0 -44
- package/src/class/hole.js +0 -1359
- package/src/class/item.js +0 -2050
- package/src/class/layer.js +0 -926
- package/src/class/line.js +0 -1780
- package/src/class/project.js +0 -875
- package/src/class/vertex.js +0 -409
- package/src/components/atoms/Snackbar/index.jsx +0 -43
- package/src/components/atoms/radio-button/index.jsx +0 -20
- package/src/components/atoms/radio-button/styles.js +0 -56
- package/src/components/button/MainButton.jsx +0 -157
- package/src/components/button/ToggleMeasureButton.jsx +0 -65
- package/src/components/catalog-view/catalog-breadcrumb.jsx +0 -53
- package/src/components/catalog-view/catalog-item.jsx +0 -229
- package/src/components/catalog-view/catalog-list.jsx +0 -173
- package/src/components/catalog-view/catalog-page-item.jsx +0 -110
- package/src/components/catalog-view/catalog-turn-back-page-item.jsx +0 -80
- package/src/components/configurator/custom-configurator.jsx +0 -77
- package/src/components/configurator/project-configurator.jsx +0 -120
- package/src/components/content.jsx +0 -136
- package/src/components/export.js +0 -36
- package/src/components/firstsetting/button/styles.js +0 -223
- package/src/components/firstsetting/export.js +0 -9
- package/src/components/firstsetting/firstsetting-content-button.jsx +0 -198
- package/src/components/firstsetting/firstsetting-toggle-button.jsx +0 -101
- package/src/components/firstsetting/firstsetting.jsx +0 -814
- package/src/components/footerbar/button/ControlButton.jsx +0 -43
- package/src/components/footerbar/button/DirectionButton.jsx +0 -54
- package/src/components/footerbar/button/DirectionPanSpinButton.jsx +0 -36
- package/src/components/footerbar/button/ToggleButton.jsx +0 -58
- package/src/components/footerbar/button/ToggleConvertButton.jsx +0 -48
- package/src/components/footerbar/button/ToggleMeasureButton.jsx +0 -33
- package/src/components/footerbar/button/styles.js +0 -217
- package/src/components/footerbar/export.js +0 -9
- package/src/components/footerbar/footer-content-button.jsx +0 -198
- package/src/components/footerbar/footer-toggle-button.jsx +0 -101
- package/src/components/footerbar/footerbar.jsx +0 -1103
- package/src/components/footerbar/styles.js +0 -263
- package/src/components/header/button/MenuButton.jsx +0 -46
- package/src/components/header/button/SaveButton.jsx +0 -54
- package/src/components/header/button/styles.js +0 -181
- package/src/components/header/export.js +0 -5
- package/src/components/header/header.jsx +0 -631
- package/src/components/header/header.style.css +0 -47
- package/src/components/header/styles.js +0 -320
- package/src/components/login/Login.js +0 -77
- package/src/components/login/LoginForm/index.js +0 -108
- package/src/components/login/Register.js +0 -83
- package/src/components/login/RegisterForm/index.js +0 -171
- package/src/components/login/jwtService.js +0 -201
- package/src/components/login/style.css +0 -158
- package/src/components/login/style.scss +0 -260
- package/src/components/molecules/slider/index.jsx +0 -15
- package/src/components/molecules/slider/styles.js +0 -0
- package/src/components/molecules/slider/styles.scss +0 -3
- package/src/components/myprojects/export.js +0 -5
- package/src/components/myprojects/index.jsx +0 -445
- package/src/components/myprojects/styles.js +0 -241
- package/src/components/sidebar/custom-accordion.jsx +0 -48
- package/src/components/sidebar/export.js +0 -15
- package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +0 -73
- package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +0 -101
- package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +0 -149
- package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +0 -316
- package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +0 -108
- package/src/components/sidebar/panel-element-editor/element-editor.jsx +0 -1070
- package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
- package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +0 -104
- package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +0 -155
- package/src/components/sidebar/panel-group-editor.jsx +0 -272
- package/src/components/sidebar/panel-groups.jsx +0 -310
- package/src/components/sidebar/panel-guides.jsx +0 -192
- package/src/components/sidebar/panel-layer-elements.jsx +0 -298
- package/src/components/sidebar/panel-layers.jsx +0 -381
- package/src/components/sidebar/panel.jsx +0 -71
- package/src/components/sidebar/sidebar.jsx +0 -106
- package/src/components/sidebar/toolbar-panel.jsx +0 -139
- package/src/components/sign/export.js +0 -7
- package/src/components/sign/main/index.jsx +0 -523
- package/src/components/sign/main/styles.js +0 -163
- package/src/components/style/button.jsx +0 -95
- package/src/components/style/cancel-button.jsx +0 -20
- package/src/components/style/content-container.jsx +0 -29
- package/src/components/style/content-title.jsx +0 -20
- package/src/components/style/delete-button.jsx +0 -23
- package/src/components/style/export.jsx +0 -48
- package/src/components/style/form-block.jsx +0 -13
- package/src/components/style/form-color-input.jsx +0 -27
- package/src/components/style/form-label.jsx +0 -15
- package/src/components/style/form-number-input.jsx +0 -196
- package/src/components/style/form-number-input_2.jsx +0 -191
- package/src/components/style/form-select.jsx +0 -38
- package/src/components/style/form-slider.jsx +0 -36
- package/src/components/style/form-submit-button.jsx +0 -23
- package/src/components/style/form-text-input.jsx +0 -65
- package/src/components/toolbar/button/ControlButton.jsx +0 -41
- package/src/components/toolbar/button/DirectionButton.jsx +0 -34
- package/src/components/toolbar/button/RightButton.jsx +0 -103
- package/src/components/toolbar/button/ToggleButton.jsx +0 -41
- package/src/components/toolbar/button/index.jsx +0 -55
- package/src/components/toolbar/button/styles.js +0 -127
- package/src/components/toolbar/components/DoorStyleMenu.jsx +0 -103
- package/src/components/toolbar/components/Pricing.jsx +0 -126
- package/src/components/toolbar/components/ReviewForQuote.jsx +0 -635
- package/src/components/toolbar/export.js +0 -21
- package/src/components/toolbar/main/Alert.js +0 -122
- package/src/components/toolbar/main/TakePictureModal.jsx +0 -104
- package/src/components/toolbar/main/confirm-popup.jsx +0 -99
- package/src/components/toolbar/main/index.jsx +0 -5687
- package/src/components/toolbar/main/lShaped.json +0 -311
- package/src/components/toolbar/main/longNarrow.json +0 -238
- package/src/components/toolbar/main/myComponents.js +0 -123
- package/src/components/toolbar/main/oRectangle.json +0 -220
- package/src/components/toolbar/main/rectangle.json +0 -238
- package/src/components/toolbar/main/style.css +0 -107
- package/src/components/toolbar/main/styles.js +0 -696
- package/src/components/toolbar/plugin-item.jsx +0 -123
- package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +0 -73
- package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +0 -102
- package/src/components/toolbar/popup/appliance/index.jsx +0 -83
- package/src/components/toolbar/popup/autosaveprompt/index.jsx +0 -150
- package/src/components/toolbar/popup/autosaveprompt/styles.css +0 -64
- package/src/components/toolbar/popup/autosaveprompt/styles.js +0 -40
- package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +0 -73
- package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +0 -119
- package/src/components/toolbar/popup/cabinet/index.jsx +0 -85
- package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +0 -63
- package/src/components/toolbar/popup/doorStyle/index.jsx +0 -71
- package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +0 -139
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -2
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +0 -157
- package/src/components/toolbar/popup/downloadsummary/index.jsx +0 -643
- package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +0 -51
- package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +0 -175
- package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +0 -283
- package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +0 -2257
- package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -93
- package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +0 -132
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +0 -2198
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +0 -152
- package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +0 -149
- package/src/components/toolbar/popup/downloadsummary/styles.css +0 -177
- package/src/components/toolbar/popup/downloadsummary/styles.js +0 -453
- package/src/components/toolbar/popup/finishingtouch/category/index.jsx +0 -34
- package/src/components/toolbar/popup/finishingtouch/index.jsx +0 -58
- package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +0 -112
- package/src/components/toolbar/popup/finishingtouch/product/index.jsx +0 -116
- package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +0 -101
- package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +0 -254
- package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
- package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
- package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -86
- package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +0 -109
- package/src/components/toolbar/popup/floorplan/index.jsx +0 -60
- package/src/components/toolbar/popup/index.jsx +0 -241
- package/src/components/toolbar/popup/newproject/index.jsx +0 -59
- package/src/components/toolbar/popup/newproject/styles.css +0 -64
- package/src/components/toolbar/popup/newproject/styles.js +0 -41
- package/src/components/toolbar/popup/product/appliance.jsx +0 -54
- package/src/components/toolbar/popup/product/cabinetproduct.jsx +0 -15
- package/src/components/toolbar/popup/product/doorstyle.jsx +0 -58
- package/src/components/toolbar/popup/product/doorstyleproduct.jsx +0 -47
- package/src/components/toolbar/popup/product/floor.jsx +0 -36
- package/src/components/toolbar/popup/product/floorproduct.jsx +0 -42
- package/src/components/toolbar/popup/product/index.jsx +0 -36
- package/src/components/toolbar/popup/product/primary.jsx +0 -77
- package/src/components/toolbar/popup/product/productline.jsx +0 -93
- package/src/components/toolbar/popup/product/reviewItem.jsx +0 -427
- package/src/components/toolbar/popup/product/reviewMolding.jsx +0 -310
- package/src/components/toolbar/popup/product/style.css +0 -54
- package/src/components/toolbar/popup/product/styles.js +0 -260
- package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +0 -146
- package/src/components/toolbar/popup/savedesign/index.jsx +0 -495
- package/src/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
- package/src/components/toolbar/popup/savedesign/styles.js +0 -151
- package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +0 -87
- package/src/components/toolbar/popup/styles.js +0 -909
- package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +0 -192
- package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +0 -96
- package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +0 -54
- package/src/components/toolbar/popup/submitforquote/StepDots.jsx +0 -25
- package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +0 -116
- package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -38
- package/src/components/toolbar/popup/submitforquote/index.jsx +0 -698
- package/src/components/toolbar/popup/submitforquote/styles.css +0 -105
- package/src/components/toolbar/popup/submitforquote/styles.js +0 -294
- package/src/components/toolbar/popup/submitprompt/index.jsx +0 -89
- package/src/components/toolbar/popup/submitprompt/styles.css +0 -64
- package/src/components/toolbar/popup/submitprompt/styles.js +0 -42
- package/src/components/toolbar/toolbar-button.jsx +0 -90
- package/src/components/toolbar/toolbar-load-button.jsx +0 -36
- package/src/components/toolbar/toolbar-save-button.jsx +0 -32
- package/src/components/tutorial-view/Modal.jsx +0 -584
- package/src/components/tutorial-view/style.css +0 -111
- package/src/components/tutorial-view/styles.js +0 -65
- package/src/components/viewer2d/area.jsx +0 -98
- package/src/components/viewer2d/export.js +0 -48
- package/src/components/viewer2d/grids/grid-horizontal-streak.jsx +0 -40
- package/src/components/viewer2d/grids/grid-streak.jsx +0 -32
- package/src/components/viewer2d/grids/grid-vertical-streak.jsx +0 -41
- package/src/components/viewer2d/grids/grids.jsx +0 -30
- package/src/components/viewer2d/group.jsx +0 -57
- package/src/components/viewer2d/item.jsx +0 -618
- package/src/components/viewer2d/layer.jsx +0 -214
- package/src/components/viewer2d/line.jsx +0 -1358
- package/src/components/viewer2d/ruler.jsx +0 -136
- package/src/components/viewer2d/rulerDist.jsx +0 -192
- package/src/components/viewer2d/rulerX.jsx +0 -141
- package/src/components/viewer2d/rulerY.jsx +0 -138
- package/src/components/viewer2d/scene.jsx +0 -94
- package/src/components/viewer2d/snap.jsx +0 -118
- package/src/components/viewer2d/state.jsx +0 -77
- package/src/components/viewer2d/utils.js +0 -195
- package/src/components/viewer2d/vertex.jsx +0 -76
- package/src/components/viewer2d/viewer2d.jsx +0 -1830
- package/src/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -3078
- package/src/components/viewer3d/dcm.js +0 -226
- package/src/components/viewer3d/fbm.js +0 -383
- package/src/components/viewer3d/front3D.jsx +0 -63
- package/src/components/viewer3d/grid-creator.js +0 -25
- package/src/components/viewer3d/grids/grid-horizontal-streak.js +0 -41
- package/src/components/viewer3d/grids/grid-streak.js +0 -34
- package/src/components/viewer3d/grids/grid-vertical-streak.js +0 -42
- package/src/components/viewer3d/libs/first-person-controls.js +0 -70
- package/src/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1265
- package/src/components/viewer3d/libs/mtl-loader.js +0 -462
- package/src/components/viewer3d/libs/obj-loader.js +0 -653
- package/src/components/viewer3d/libs/orbit-controls.js +0 -945
- package/src/components/viewer3d/libs/pointer-lock-controls.js +0 -67
- package/src/components/viewer3d/lrm.js +0 -358
- package/src/components/viewer3d/model.js +0 -830
- package/src/components/viewer3d/pointer-lock-navigation.js +0 -140
- package/src/components/viewer3d/ruler-utils/itemRect.jsx +0 -91
- package/src/components/viewer3d/ruler-utils/layer3D.jsx +0 -528
- package/src/components/viewer3d/ruler-utils/ruler3D.jsx +0 -218
- package/src/components/viewer3d/ruler-utils/scene3D.jsx +0 -87
- package/src/components/viewer3d/ruler-utils/state3D.jsx +0 -25
- package/src/components/viewer3d/scene-creator.js +0 -5172
- package/src/components/viewer3d/three-memory-cleaner.js +0 -65
- package/src/components/viewer3d/viewer3d-first-person.js +0 -395
- package/src/components/viewer3d/viewer3d.js +0 -3376
- package/src/components/wizardstep/button/styles.js +0 -677
- package/src/components/wizardstep/export.js +0 -5
- package/src/components/wizardstep/index.jsx +0 -1372
- package/src/components/wizardstep/styles.js +0 -688
- package/src/components/wizardstep/wizardstep-content-button.jsx +0 -198
- package/src/components/wizardstep/wizardstep-toggle-button.jsx +0 -101
- package/src/constants.js +0 -731
- package/src/hooks/useCheckCart.js +0 -38
- package/src/hooks/useGetPricesBySku.js +0 -59
- package/src/hooks/useValidateToken.js +0 -181
- package/src/index.js +0 -32
- package/src/models.js +0 -541
- package/src/plugins/SVGLoader.js +0 -1991
- package/src/plugins/autosave.js +0 -39
- package/src/plugins/console-debugger.js +0 -36
- package/src/plugins/export.js +0 -11
- package/src/plugins/keyboard.js +0 -194
- package/src/reducers/areas-reducer.js +0 -13
- package/src/reducers/export.js +0 -39
- package/src/reducers/groups-reducer.js +0 -73
- package/src/reducers/holes-reducer.js +0 -125
- package/src/reducers/items-reducer.js +0 -286
- package/src/reducers/lines-reducer.js +0 -96
- package/src/reducers/project-reducer.js +0 -239
- package/src/reducers/reducer.js +0 -59
- package/src/reducers/scene-reducer.js +0 -41
- package/src/reducers/user-reducer.js +0 -30
- package/src/reducers/vertices-reducer.js +0 -34
- package/src/reducers/viewer2d-reducer.js +0 -81
- package/src/reducers/viewer3d-reducer.js +0 -65
- package/src/shared-style.js +0 -72
- package/src/styles/export.js +0 -7
- package/src/styles/tabs.css +0 -40
- package/src/translator/en.js +0 -106
- package/src/translator/it.js +0 -80
- package/src/translator/ru.js +0 -80
- package/src/translator/translator.js +0 -81
- package/src/utils/browser.js +0 -36
- package/src/utils/email-validator.js +0 -5
- package/src/utils/export.js +0 -39
- package/src/utils/geometry.js +0 -2572
- package/src/utils/get-edges-of-subgraphs.js +0 -29
- package/src/utils/graph-cycles.js +0 -259
- package/src/utils/graph-inner-cycles.js +0 -49
- package/src/utils/graph.js +0 -147
- package/src/utils/helper.js +0 -431
- package/src/utils/history.js +0 -37
- package/src/utils/id-broker.js +0 -9
- package/src/utils/logger.js +0 -8
- package/src/utils/math.js +0 -51
- package/src/utils/molding.js +0 -973
- package/src/utils/name-generator.js +0 -5
- package/src/utils/objects-utils.js +0 -56
- package/src/utils/phone-validator.js +0 -4
- package/src/utils/process-black-list.js +0 -10
- package/src/utils/react-if.jsx +0 -20
- package/src/utils/snap-scene.js +0 -102
- package/src/utils/snap.js +0 -184
- package/src/utils/threeCSG.es6.js +0 -578
- package/src/version.js +0 -1
package/src/class/line.js
DELETED
|
@@ -1,1780 +0,0 @@
|
|
|
1
|
-
import { Map, List, fromJS } from 'immutable';
|
|
2
|
-
import { Group, Layer, Hole, Vertex } from './export';
|
|
3
|
-
import {
|
|
4
|
-
IDBroker,
|
|
5
|
-
NameGenerator,
|
|
6
|
-
GeometryUtils,
|
|
7
|
-
history,
|
|
8
|
-
SnapUtils,
|
|
9
|
-
SnapSceneUtils
|
|
10
|
-
} from '../utils/export';
|
|
11
|
-
import * as Three from 'three';
|
|
12
|
-
import {
|
|
13
|
-
MODE_IDLE,
|
|
14
|
-
MODE_WAITING_DRAWING_LINE,
|
|
15
|
-
MODE_DRAWING_LINE,
|
|
16
|
-
MODE_DRAGGING_LINE,
|
|
17
|
-
MIN_ANGLE_DISALLOW_DRAW_WALL,
|
|
18
|
-
UNIT_ANGLE
|
|
19
|
-
} from '../constants';
|
|
20
|
-
import { getRelatedLines } from '../../src/utils/geometry';
|
|
21
|
-
import { isEmpty } from '../../src/utils/helper';
|
|
22
|
-
|
|
23
|
-
let timeGlobal = 0;
|
|
24
|
-
|
|
25
|
-
class TimeRecorder {
|
|
26
|
-
constructor(name) {
|
|
27
|
-
this.name = name;
|
|
28
|
-
|
|
29
|
-
if (name === "beginDrawingLine") {
|
|
30
|
-
console.log("time__ Start Drawing");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
start() {
|
|
35
|
-
this.first = Date.now();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
end() {
|
|
39
|
-
this.second = Date.now();
|
|
40
|
-
const elapsed = this.second - this.first;
|
|
41
|
-
console.log("time__ ", this.name, " : ", elapsed, "ms");
|
|
42
|
-
|
|
43
|
-
if (["beginDrawingLine", "updateDrawingLine", "endDrawingLine"].includes(this.name))
|
|
44
|
-
timeGlobal += elapsed;
|
|
45
|
-
|
|
46
|
-
if (this.name === "endDrawingLine") {
|
|
47
|
-
console.log("time__ Drawing Ended. Passed Time : ", timeGlobal, "ms");
|
|
48
|
-
timeGlobal = 0;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
class Line {
|
|
54
|
-
static create(
|
|
55
|
-
state,
|
|
56
|
-
layerID,
|
|
57
|
-
type,
|
|
58
|
-
x0,
|
|
59
|
-
y0,
|
|
60
|
-
x1,
|
|
61
|
-
y1,
|
|
62
|
-
properties,
|
|
63
|
-
lineCreatedDateTime = new Date().getTime()
|
|
64
|
-
) {
|
|
65
|
-
// if end drawing by created area
|
|
66
|
-
// if (state.mode == MODE_IDLE) {
|
|
67
|
-
// return { updatedState: state };
|
|
68
|
-
// }
|
|
69
|
-
// ///////////////
|
|
70
|
-
let lineID = IDBroker.acquireID();
|
|
71
|
-
let { updatedState: stateV0, vertex: v0 } = Vertex.add(
|
|
72
|
-
state,
|
|
73
|
-
layerID,
|
|
74
|
-
x0,
|
|
75
|
-
y0,
|
|
76
|
-
'lines',
|
|
77
|
-
lineID
|
|
78
|
-
);
|
|
79
|
-
let { updatedState: stateV1, vertex: v1 } = Vertex.add(
|
|
80
|
-
stateV0,
|
|
81
|
-
layerID,
|
|
82
|
-
x1,
|
|
83
|
-
y1,
|
|
84
|
-
'lines',
|
|
85
|
-
lineID
|
|
86
|
-
);
|
|
87
|
-
state = stateV1;
|
|
88
|
-
|
|
89
|
-
let line = state.catalog.factoryElement(
|
|
90
|
-
type,
|
|
91
|
-
{
|
|
92
|
-
id: lineID,
|
|
93
|
-
name: NameGenerator.generateName(
|
|
94
|
-
'lines',
|
|
95
|
-
state.catalog.getIn(['elements', type, 'info', 'title'])
|
|
96
|
-
),
|
|
97
|
-
vertices: new List([v0.id, v1.id]),
|
|
98
|
-
type
|
|
99
|
-
},
|
|
100
|
-
properties
|
|
101
|
-
);
|
|
102
|
-
line = line.set(
|
|
103
|
-
'createdDateTime',
|
|
104
|
-
lineCreatedDateTime !== undefined
|
|
105
|
-
? lineCreatedDateTime
|
|
106
|
-
: new Date().getTime()
|
|
107
|
-
);
|
|
108
|
-
state = state.setIn(['scene', 'layers', layerID, 'lines', lineID], line);
|
|
109
|
-
// set default texture//
|
|
110
|
-
let defaultTexture = {
|
|
111
|
-
textureA: 'plaster',
|
|
112
|
-
textureB: 'plaster'
|
|
113
|
-
};
|
|
114
|
-
state = this.setJsProperties(
|
|
115
|
-
state,
|
|
116
|
-
layerID,
|
|
117
|
-
lineID,
|
|
118
|
-
defaultTexture
|
|
119
|
-
).updatedState;
|
|
120
|
-
// /////////////////////
|
|
121
|
-
return { updatedState: state, line };
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
static select(state, layerID, lineID) {
|
|
125
|
-
// Try selecting the layer first
|
|
126
|
-
const layerResult = Layer.select(state, layerID);
|
|
127
|
-
if (!layerResult || !layerResult.updatedState) {
|
|
128
|
-
return { updatedState: state }; // no update if layer not found
|
|
129
|
-
}
|
|
130
|
-
state = layerResult.updatedState;
|
|
131
|
-
|
|
132
|
-
// Try getting the line
|
|
133
|
-
const line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
134
|
-
if (!line) {
|
|
135
|
-
return { updatedState: state }; // no update if line not found
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Select the line element
|
|
139
|
-
const lineSelectResult = Layer.selectElement(
|
|
140
|
-
state,
|
|
141
|
-
layerID,
|
|
142
|
-
'lines',
|
|
143
|
-
lineID
|
|
144
|
-
);
|
|
145
|
-
if (lineSelectResult?.updatedState) {
|
|
146
|
-
state = lineSelectResult.updatedState;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Select the first vertex (if available)
|
|
150
|
-
const firstVertex = line.vertices?.get?.(0);
|
|
151
|
-
if (firstVertex !== undefined) {
|
|
152
|
-
const v1Result = Layer.selectElement(
|
|
153
|
-
state,
|
|
154
|
-
layerID,
|
|
155
|
-
'vertices',
|
|
156
|
-
firstVertex
|
|
157
|
-
);
|
|
158
|
-
if (v1Result?.updatedState) {
|
|
159
|
-
state = v1Result.updatedState;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Select the second vertex (if available)
|
|
164
|
-
const secondVertex = line.vertices?.get?.(1);
|
|
165
|
-
if (secondVertex !== undefined) {
|
|
166
|
-
const v2Result = Layer.selectElement(
|
|
167
|
-
state,
|
|
168
|
-
layerID,
|
|
169
|
-
'vertices',
|
|
170
|
-
secondVertex
|
|
171
|
-
);
|
|
172
|
-
if (v2Result?.updatedState) {
|
|
173
|
-
state = v2Result.updatedState;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return { updatedState: state };
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
static remove(state, layerID, lineID) {
|
|
181
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
182
|
-
|
|
183
|
-
if (line) {
|
|
184
|
-
state = this.unselect(state, layerID, lineID).updatedState;
|
|
185
|
-
line.holes.forEach(
|
|
186
|
-
holeID => (state = Hole.remove(state, layerID, holeID).updatedState)
|
|
187
|
-
);
|
|
188
|
-
state = Layer.removeElement(state, layerID, 'lines', lineID).updatedState;
|
|
189
|
-
|
|
190
|
-
line.vertices.forEach(
|
|
191
|
-
vertexID =>
|
|
192
|
-
(state = Vertex.remove(
|
|
193
|
-
state,
|
|
194
|
-
layerID,
|
|
195
|
-
vertexID,
|
|
196
|
-
'lines',
|
|
197
|
-
lineID
|
|
198
|
-
).updatedState)
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
state
|
|
202
|
-
.getIn(['scene', 'groups'])
|
|
203
|
-
.forEach(
|
|
204
|
-
group =>
|
|
205
|
-
(state = Group.removeElement(
|
|
206
|
-
state,
|
|
207
|
-
group.id,
|
|
208
|
-
layerID,
|
|
209
|
-
'lines',
|
|
210
|
-
lineID
|
|
211
|
-
).updatedState)
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return { updatedState: state };
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
static setRelatedLine(state, layerID, lineID, intersection) {
|
|
219
|
-
let curIntersection = state.getIn([
|
|
220
|
-
'scene',
|
|
221
|
-
'layers',
|
|
222
|
-
layerID,
|
|
223
|
-
'lines',
|
|
224
|
-
lineID,
|
|
225
|
-
'relatedVertices'
|
|
226
|
-
]);
|
|
227
|
-
if (curIntersection == undefined) return { updatedState: state };
|
|
228
|
-
|
|
229
|
-
let isEqualIntersection = (a, b) => {
|
|
230
|
-
return (
|
|
231
|
-
a.index == b.index && a.point.x == b.point.x && a.point.y == b.point.y
|
|
232
|
-
);
|
|
233
|
-
};
|
|
234
|
-
let equal =
|
|
235
|
-
curIntersection.size == intersection.length &&
|
|
236
|
-
curIntersection.every((curint, index) => {
|
|
237
|
-
return isEqualIntersection(curint, intersection[index]);
|
|
238
|
-
});
|
|
239
|
-
if (!equal)
|
|
240
|
-
state = state.mergeIn(
|
|
241
|
-
['scene', 'layers', layerID, 'lines', lineID, 'relatedVertices'],
|
|
242
|
-
intersection
|
|
243
|
-
);
|
|
244
|
-
return { updatedState: state };
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
static unselect(state, layerID, lineID) {
|
|
248
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
249
|
-
if (line) {
|
|
250
|
-
state = Layer.unselect(
|
|
251
|
-
state,
|
|
252
|
-
layerID,
|
|
253
|
-
'vertices',
|
|
254
|
-
line.vertices.get(0)
|
|
255
|
-
).updatedState;
|
|
256
|
-
state = Layer.unselect(
|
|
257
|
-
state,
|
|
258
|
-
layerID,
|
|
259
|
-
'vertices',
|
|
260
|
-
line.vertices.get(1)
|
|
261
|
-
).updatedState;
|
|
262
|
-
state = Layer.unselect(state, layerID, 'lines', lineID).updatedState;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return { updatedState: state };
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
static split(state, layerID, lineID, x, y) {
|
|
269
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
270
|
-
let v0 = state.getIn([
|
|
271
|
-
'scene',
|
|
272
|
-
'layers',
|
|
273
|
-
layerID,
|
|
274
|
-
'vertices',
|
|
275
|
-
line.vertices.get(0)
|
|
276
|
-
]);
|
|
277
|
-
let v1 = state.getIn([
|
|
278
|
-
'scene',
|
|
279
|
-
'layers',
|
|
280
|
-
layerID,
|
|
281
|
-
'vertices',
|
|
282
|
-
line.vertices.get(1)
|
|
283
|
-
]);
|
|
284
|
-
let { x: x0, y: y0 } = v0;
|
|
285
|
-
let { x: x1, y: y1 } = v1;
|
|
286
|
-
|
|
287
|
-
let { updatedState: stateL1, line: line0 } = Line.create(
|
|
288
|
-
state,
|
|
289
|
-
layerID,
|
|
290
|
-
line.type,
|
|
291
|
-
x0,
|
|
292
|
-
y0,
|
|
293
|
-
x,
|
|
294
|
-
y,
|
|
295
|
-
line.get('properties'),
|
|
296
|
-
line.createdDateTime !== undefined
|
|
297
|
-
? line.createdDateTime - 2
|
|
298
|
-
: new Date().getTime()
|
|
299
|
-
);
|
|
300
|
-
let { updatedState: stateL2, line: line1 } = Line.create(
|
|
301
|
-
stateL1,
|
|
302
|
-
layerID,
|
|
303
|
-
line.type,
|
|
304
|
-
x1,
|
|
305
|
-
y1,
|
|
306
|
-
x,
|
|
307
|
-
y,
|
|
308
|
-
line.get('properties'),
|
|
309
|
-
line.createdDateTime !== undefined
|
|
310
|
-
? line.createdDateTime - 1
|
|
311
|
-
: new Date().getTime()
|
|
312
|
-
);
|
|
313
|
-
state = stateL2;
|
|
314
|
-
|
|
315
|
-
let splitPointOffset = GeometryUtils.pointPositionOnLineSegment(
|
|
316
|
-
x0,
|
|
317
|
-
y0,
|
|
318
|
-
x1,
|
|
319
|
-
y1,
|
|
320
|
-
x,
|
|
321
|
-
y
|
|
322
|
-
);
|
|
323
|
-
let minVertex = GeometryUtils.minVertex(v0, v1);
|
|
324
|
-
|
|
325
|
-
line.holes.forEach(holeID => {
|
|
326
|
-
let hole = state.getIn(['scene', 'layers', layerID, 'holes', holeID]);
|
|
327
|
-
|
|
328
|
-
let holeOffset = hole.offset;
|
|
329
|
-
if (minVertex.x === x1 && minVertex.y === y1) {
|
|
330
|
-
splitPointOffset = 1 - splitPointOffset;
|
|
331
|
-
holeOffset = 1 - hole.offset;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (holeOffset < splitPointOffset) {
|
|
335
|
-
let offset = holeOffset / splitPointOffset;
|
|
336
|
-
/*
|
|
337
|
-
if (minVertex.x === x1 && minVertex.y === y1) {
|
|
338
|
-
offset = 1 - offset;
|
|
339
|
-
}
|
|
340
|
-
*/
|
|
341
|
-
state = Hole.create(
|
|
342
|
-
state,
|
|
343
|
-
layerID,
|
|
344
|
-
hole.type,
|
|
345
|
-
line0.id,
|
|
346
|
-
offset,
|
|
347
|
-
hole.properties
|
|
348
|
-
).updatedState;
|
|
349
|
-
} else {
|
|
350
|
-
let offset = (holeOffset - splitPointOffset) / (1 - splitPointOffset);
|
|
351
|
-
/*
|
|
352
|
-
if (minVertex.x === x1 && minVertex.y === y1) {
|
|
353
|
-
offset = 1 - offset;
|
|
354
|
-
}
|
|
355
|
-
*/
|
|
356
|
-
state = Hole.create(
|
|
357
|
-
state,
|
|
358
|
-
layerID,
|
|
359
|
-
hole.type,
|
|
360
|
-
line1.id,
|
|
361
|
-
offset,
|
|
362
|
-
hole.properties
|
|
363
|
-
).updatedState;
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
//add splitted lines to the original line's group
|
|
368
|
-
let lineGroups = state.getIn(['scene', 'groups']).filter(group => {
|
|
369
|
-
const lines = group.getIn(['elements', layerID, 'lines']);
|
|
370
|
-
return lines && lines.contains(lineID);
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
lineGroups.forEach(group => {
|
|
374
|
-
state = Group.addElement(
|
|
375
|
-
state,
|
|
376
|
-
group.id,
|
|
377
|
-
layerID,
|
|
378
|
-
'lines',
|
|
379
|
-
line0.id
|
|
380
|
-
).updatedState;
|
|
381
|
-
state = Group.addElement(
|
|
382
|
-
state,
|
|
383
|
-
group.id,
|
|
384
|
-
layerID,
|
|
385
|
-
'lines',
|
|
386
|
-
line1.id
|
|
387
|
-
).updatedState;
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
state = Line.remove(state, layerID, lineID).updatedState;
|
|
391
|
-
|
|
392
|
-
return { updatedState: state, lines: new List([line0, line1]) };
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
static addFromPoints(
|
|
396
|
-
state,
|
|
397
|
-
layerID,
|
|
398
|
-
type,
|
|
399
|
-
points,
|
|
400
|
-
properties,
|
|
401
|
-
holes,
|
|
402
|
-
lineCreatedDateTime = new Date().getTime()
|
|
403
|
-
) {
|
|
404
|
-
points = new List(points);
|
|
405
|
-
//.sort(({ x: x1, y: y1 }, { x: x2, y: y2 }) => x1 === x2 ? y1 - y2 : x1 - x2);
|
|
406
|
-
|
|
407
|
-
let pointsPair = points
|
|
408
|
-
.zip(points.skip(1))
|
|
409
|
-
.filterNot(
|
|
410
|
-
([{ x: x1, y: y1 }, { x: x2, y: y2 }]) => x1 === x2 && y1 === y2
|
|
411
|
-
);
|
|
412
|
-
|
|
413
|
-
let usedObjects = {};
|
|
414
|
-
let objectsArray = pointsPair;
|
|
415
|
-
pointsPair = objectsArray.filter(element => {
|
|
416
|
-
let so = JSON.stringify(element[0]);
|
|
417
|
-
let so1 = JSON.stringify(element[1]);
|
|
418
|
-
if (!usedObjects[so] && !usedObjects[so1]) {
|
|
419
|
-
usedObjects[so] = true;
|
|
420
|
-
usedObjects[so1] = true;
|
|
421
|
-
return element;
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
let lines = [];
|
|
426
|
-
let newLine;
|
|
427
|
-
|
|
428
|
-
pointsPair.forEach(([{ x: x1, y: y1 }, { x: x2, y: y2 }]) => {
|
|
429
|
-
let { updatedState: stateL, line } = this.create(
|
|
430
|
-
state,
|
|
431
|
-
layerID,
|
|
432
|
-
type,
|
|
433
|
-
x1,
|
|
434
|
-
y1,
|
|
435
|
-
x2,
|
|
436
|
-
y2,
|
|
437
|
-
properties,
|
|
438
|
-
lineCreatedDateTime
|
|
439
|
-
);
|
|
440
|
-
state = stateL;
|
|
441
|
-
let lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
|
|
442
|
-
let alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
|
|
443
|
-
let cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
|
|
444
|
-
let sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
|
|
445
|
-
|
|
446
|
-
if (holes) {
|
|
447
|
-
holes.forEach(holeWithOffsetPoint => {
|
|
448
|
-
let offset = holeWithOffsetPoint.hole.toJS().offset;
|
|
449
|
-
// if (invert) offset = 1 - offset;
|
|
450
|
-
let { x: xp, y: yp } = holeWithOffsetPoint.offsetPosition;
|
|
451
|
-
|
|
452
|
-
if (GeometryUtils.isPointOnLineSegment(x1, y1, x2, y2, xp, yp)) {
|
|
453
|
-
let newOffset = GeometryUtils.pointPositionOnLineSegment(
|
|
454
|
-
x1,
|
|
455
|
-
y1,
|
|
456
|
-
x2,
|
|
457
|
-
y2,
|
|
458
|
-
xp,
|
|
459
|
-
yp
|
|
460
|
-
);
|
|
461
|
-
|
|
462
|
-
if (newOffset >= 0 && newOffset <= 1) {
|
|
463
|
-
//add the position of hole
|
|
464
|
-
let temp = Hole.create(
|
|
465
|
-
state,
|
|
466
|
-
layerID,
|
|
467
|
-
holeWithOffsetPoint.hole.type,
|
|
468
|
-
line.id,
|
|
469
|
-
newOffset,
|
|
470
|
-
holeWithOffsetPoint.hole.properties,
|
|
471
|
-
xp,
|
|
472
|
-
yp
|
|
473
|
-
);
|
|
474
|
-
state = temp.updatedState;
|
|
475
|
-
let holeX = 0,
|
|
476
|
-
holeY = 0,
|
|
477
|
-
holeID = temp.hole.id;
|
|
478
|
-
|
|
479
|
-
if (GeometryUtils.almostEqual(y1, y2)) {
|
|
480
|
-
if (x1 > x2) {
|
|
481
|
-
holeX = x1 - lineLength * newOffset;
|
|
482
|
-
holeY = y1;
|
|
483
|
-
} else {
|
|
484
|
-
holeX = x1 + lineLength * newOffset;
|
|
485
|
-
holeY = y1;
|
|
486
|
-
}
|
|
487
|
-
} else if (GeometryUtils.almostEqual(x1, x2)) {
|
|
488
|
-
if (y1 > y2) {
|
|
489
|
-
holeX = x1;
|
|
490
|
-
holeY = y1 - lineLength * newOffset;
|
|
491
|
-
} else {
|
|
492
|
-
holeX = x1;
|
|
493
|
-
holeY = y1 + lineLength * newOffset;
|
|
494
|
-
}
|
|
495
|
-
} else if (x1 > x2) {
|
|
496
|
-
if (y1 > y2) {
|
|
497
|
-
holeX = x1 - lineLength * newOffset * cosAlpha;
|
|
498
|
-
holeY = y1 - lineLength * newOffset * sinAlpha;
|
|
499
|
-
} else if (y1 < y2) {
|
|
500
|
-
holeX = x1 - lineLength * newOffset * cosAlpha;
|
|
501
|
-
holeY = y1 + lineLength * newOffset * sinAlpha;
|
|
502
|
-
}
|
|
503
|
-
} else if (x1 < x2) {
|
|
504
|
-
if (y1 > y2) {
|
|
505
|
-
holeX = x1 + lineLength * newOffset * cosAlpha;
|
|
506
|
-
holeY = y1 - lineLength * newOffset * sinAlpha;
|
|
507
|
-
} else if (y1 < y2) {
|
|
508
|
-
holeX = x1 + lineLength * newOffset * cosAlpha;
|
|
509
|
-
holeY = y1 + lineLength * newOffset * sinAlpha;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
state = state.setIn(
|
|
513
|
-
['scene', 'layers', layerID, 'holes', holeID, 'x'],
|
|
514
|
-
holeX
|
|
515
|
-
);
|
|
516
|
-
state = state.setIn(
|
|
517
|
-
['scene', 'layers', layerID, 'holes', holeID, 'y'],
|
|
518
|
-
holeY
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
lines.push(line);
|
|
526
|
-
newLine = line;
|
|
527
|
-
});
|
|
528
|
-
|
|
529
|
-
return { updatedState: state, lines: new List(lines), newline: newLine };
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
static createAvoidingIntersections(
|
|
533
|
-
state,
|
|
534
|
-
layerID,
|
|
535
|
-
type,
|
|
536
|
-
x0,
|
|
537
|
-
y0,
|
|
538
|
-
x1,
|
|
539
|
-
y1,
|
|
540
|
-
oldProperties,
|
|
541
|
-
oldHoles,
|
|
542
|
-
lineCreatedDateTime = new Date().getTime()
|
|
543
|
-
) {
|
|
544
|
-
let points = [
|
|
545
|
-
{ x: x0, y: y0 },
|
|
546
|
-
{ x: x1, y: y1 }
|
|
547
|
-
];
|
|
548
|
-
|
|
549
|
-
state = state
|
|
550
|
-
.getIn(['scene', 'layers', layerID, 'lines'])
|
|
551
|
-
.reduce((reducedState, line) => {
|
|
552
|
-
let [v0, v1] = line.vertices
|
|
553
|
-
.map(vertexID =>
|
|
554
|
-
reducedState
|
|
555
|
-
.getIn(['scene', 'layers', layerID, 'vertices'])
|
|
556
|
-
.get(vertexID)
|
|
557
|
-
)
|
|
558
|
-
.toArray();
|
|
559
|
-
|
|
560
|
-
let hasCommonEndpoint =
|
|
561
|
-
GeometryUtils.samePoints(v0, points[0]) ||
|
|
562
|
-
GeometryUtils.samePoints(v0, points[1]) ||
|
|
563
|
-
GeometryUtils.samePoints(v1, points[0]) ||
|
|
564
|
-
GeometryUtils.samePoints(v1, points[1]);
|
|
565
|
-
|
|
566
|
-
let intersection = GeometryUtils.twoLineSegmentsIntersection(
|
|
567
|
-
points[0],
|
|
568
|
-
points[1],
|
|
569
|
-
v0,
|
|
570
|
-
v1
|
|
571
|
-
);
|
|
572
|
-
|
|
573
|
-
if (intersection.type === 'colinear' && !hasCommonEndpoint) {
|
|
574
|
-
if (!oldHoles) {
|
|
575
|
-
oldHoles = [];
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
let orderedVertices = GeometryUtils.orderVertices(points);
|
|
579
|
-
|
|
580
|
-
reducedState
|
|
581
|
-
.getIn(['scene', 'layers', layerID, 'lines', line.id, 'holes'])
|
|
582
|
-
.forEach(holeID => {
|
|
583
|
-
let hole = reducedState.getIn([
|
|
584
|
-
'scene',
|
|
585
|
-
'layers',
|
|
586
|
-
layerID,
|
|
587
|
-
'holes',
|
|
588
|
-
holeID
|
|
589
|
-
]);
|
|
590
|
-
let oldLineLength = GeometryUtils.pointsDistance(
|
|
591
|
-
v0.x,
|
|
592
|
-
v0.y,
|
|
593
|
-
v1.x,
|
|
594
|
-
v1.y
|
|
595
|
-
);
|
|
596
|
-
let offset = GeometryUtils.samePoints(
|
|
597
|
-
orderedVertices[1],
|
|
598
|
-
line.vertices.get(1)
|
|
599
|
-
)
|
|
600
|
-
? 1 - hole.offset
|
|
601
|
-
: hole.offset;
|
|
602
|
-
let offsetPosition = GeometryUtils.extendLine(
|
|
603
|
-
v0.x,
|
|
604
|
-
v0.y,
|
|
605
|
-
v1.x,
|
|
606
|
-
v1.y,
|
|
607
|
-
oldLineLength * offset
|
|
608
|
-
);
|
|
609
|
-
|
|
610
|
-
oldHoles.push({ hole, offsetPosition });
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
reducedState = this.remove(
|
|
614
|
-
reducedState,
|
|
615
|
-
layerID,
|
|
616
|
-
line.id
|
|
617
|
-
).updatedState;
|
|
618
|
-
|
|
619
|
-
points.push(v0, v1);
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
if (intersection.type === 'intersecting' && !hasCommonEndpoint) {
|
|
623
|
-
reducedState = this.split(
|
|
624
|
-
reducedState,
|
|
625
|
-
layerID,
|
|
626
|
-
line.id,
|
|
627
|
-
intersection.point.x,
|
|
628
|
-
intersection.point.y
|
|
629
|
-
).updatedState;
|
|
630
|
-
points.push(intersection.point);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
return reducedState;
|
|
634
|
-
}, state);
|
|
635
|
-
|
|
636
|
-
let { updatedState, lines, newline } = Line.addFromPoints(
|
|
637
|
-
state,
|
|
638
|
-
layerID,
|
|
639
|
-
type,
|
|
640
|
-
points,
|
|
641
|
-
oldProperties,
|
|
642
|
-
oldHoles,
|
|
643
|
-
lineCreatedDateTime
|
|
644
|
-
);
|
|
645
|
-
|
|
646
|
-
return { updatedState, lines, newline };
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
static replaceVertex(state, layerID, lineID, vertexIndex, x, y) {
|
|
650
|
-
let vertexID = state.getIn([
|
|
651
|
-
'scene',
|
|
652
|
-
'layers',
|
|
653
|
-
layerID,
|
|
654
|
-
'lines',
|
|
655
|
-
lineID,
|
|
656
|
-
'vertices',
|
|
657
|
-
vertexIndex
|
|
658
|
-
]);
|
|
659
|
-
|
|
660
|
-
state = Vertex.remove(
|
|
661
|
-
state,
|
|
662
|
-
layerID,
|
|
663
|
-
vertexID,
|
|
664
|
-
'lines',
|
|
665
|
-
lineID
|
|
666
|
-
).updatedState;
|
|
667
|
-
let { updatedState: stateV, vertex } = Vertex.add(
|
|
668
|
-
state,
|
|
669
|
-
layerID,
|
|
670
|
-
x,
|
|
671
|
-
y,
|
|
672
|
-
'lines',
|
|
673
|
-
lineID
|
|
674
|
-
);
|
|
675
|
-
state = stateV;
|
|
676
|
-
|
|
677
|
-
state = state.setIn(
|
|
678
|
-
['scene', 'layers', layerID, 'lines', lineID, 'vertices', vertexIndex],
|
|
679
|
-
vertex.id
|
|
680
|
-
);
|
|
681
|
-
state = state.setIn(
|
|
682
|
-
['scene', 'layers', layerID, 'lines', lineID],
|
|
683
|
-
state.getIn(['scene', 'layers', layerID, 'lines', lineID])
|
|
684
|
-
);
|
|
685
|
-
|
|
686
|
-
return {
|
|
687
|
-
updatedState: state,
|
|
688
|
-
line: state.getIn(['scene', 'layers', layerID, 'lines', lineID]),
|
|
689
|
-
vertex
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
static selectToolDrawingLine(state, sceneComponentType) {
|
|
694
|
-
state = state.merge({
|
|
695
|
-
mode: MODE_WAITING_DRAWING_LINE,
|
|
696
|
-
drawingSupport: new Map({
|
|
697
|
-
type: sceneComponentType
|
|
698
|
-
})
|
|
699
|
-
});
|
|
700
|
-
|
|
701
|
-
return { updatedState: state };
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
static beginDrawingLine(state, layerID, x, y) {
|
|
705
|
-
// if end drawing by created area
|
|
706
|
-
if (state.mode == MODE_IDLE) {
|
|
707
|
-
return { updatedState: state };
|
|
708
|
-
}
|
|
709
|
-
// ///////////////
|
|
710
|
-
let snapElements = SnapSceneUtils.sceneSnapElements(
|
|
711
|
-
state.scene,
|
|
712
|
-
new List(),
|
|
713
|
-
state.snapMask
|
|
714
|
-
);
|
|
715
|
-
let snap = null;
|
|
716
|
-
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
717
|
-
snap = SnapUtils.nearestSnap(snapElements, x, y, state.snapMask);
|
|
718
|
-
if (snap) ({ x, y } = snap.point);
|
|
719
|
-
|
|
720
|
-
snapElements = snapElements.withMutations(snapElements => {
|
|
721
|
-
let a, b, c;
|
|
722
|
-
({ a, b, c } = GeometryUtils.horizontalLine(y));
|
|
723
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
724
|
-
({ a, b, c } = GeometryUtils.verticalLine(x));
|
|
725
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
726
|
-
({ a, b, c } = GeometryUtils.upcrossLine(x, y));
|
|
727
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
728
|
-
({ a, b, c } = GeometryUtils.downcrossLine(x, y));
|
|
729
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
let drawingSupport = state.get('drawingSupport').set('layerID', layerID);
|
|
734
|
-
|
|
735
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
736
|
-
|
|
737
|
-
let { updatedState: stateL, line } = Line.create(
|
|
738
|
-
state,
|
|
739
|
-
layerID,
|
|
740
|
-
drawingSupport.get('type'),
|
|
741
|
-
x,
|
|
742
|
-
y,
|
|
743
|
-
x,
|
|
744
|
-
y
|
|
745
|
-
);
|
|
746
|
-
state = Line.select(stateL, layerID, line.id).updatedState;
|
|
747
|
-
|
|
748
|
-
state = state.merge({
|
|
749
|
-
mode: MODE_DRAWING_LINE,
|
|
750
|
-
snapElements,
|
|
751
|
-
activeSnapElement: snap ? snap.snap : null,
|
|
752
|
-
drawingSupport
|
|
753
|
-
});
|
|
754
|
-
|
|
755
|
-
return { updatedState: state };
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
static updateDrawingLine(state, x, y, relatedLines) {
|
|
759
|
-
let snap = null;
|
|
760
|
-
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
761
|
-
snap = SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
|
|
762
|
-
if (snap) ({ x, y } = snap.point);
|
|
763
|
-
}
|
|
764
|
-
let layerID = state.getIn(['drawingSupport', 'layerID']);
|
|
765
|
-
let lineID = state
|
|
766
|
-
.getIn(['scene', 'layers', layerID, 'selected', 'lines'])
|
|
767
|
-
.first();
|
|
768
|
-
|
|
769
|
-
// let relatedLines = [];
|
|
770
|
-
let vertices = state.getIn(['scene', 'layers', layerID, 'vertices']).toJS();
|
|
771
|
-
let drawingLine = state
|
|
772
|
-
.getIn(['scene', 'layers', layerID, 'lines', lineID])
|
|
773
|
-
.toJS();
|
|
774
|
-
let moveFlag = true;
|
|
775
|
-
let tx = vertices[drawingLine.vertices[1]].x;
|
|
776
|
-
let ty = vertices[drawingLine.vertices[1]].y;
|
|
777
|
-
|
|
778
|
-
if (!isEmpty(relatedLines)) {
|
|
779
|
-
vertices[drawingLine.vertices[1]].x = x;
|
|
780
|
-
vertices[drawingLine.vertices[1]].y = y;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
let absAngle, lineAngle;
|
|
784
|
-
|
|
785
|
-
// get the angle of two lines and check the angle
|
|
786
|
-
if (drawingLine.vertices[0] !== drawingLine.vertices[1]) {
|
|
787
|
-
relatedLines.forEach(line => {
|
|
788
|
-
// get the points of two lines(drawing line and related line)
|
|
789
|
-
if (!isEmpty(line)) {
|
|
790
|
-
// the angle between two lines(line, drawingLine)
|
|
791
|
-
lineAngle = GeometryUtils.angleBetweenTwoLines(
|
|
792
|
-
line,
|
|
793
|
-
drawingLine,
|
|
794
|
-
vertices
|
|
795
|
-
);
|
|
796
|
-
// check whether the angle is less than or bigger than specific value.
|
|
797
|
-
absAngle = Math.abs(lineAngle);
|
|
798
|
-
if (
|
|
799
|
-
absAngle < MIN_ANGLE_DISALLOW_DRAW_WALL ||
|
|
800
|
-
absAngle > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL
|
|
801
|
-
) {
|
|
802
|
-
moveFlag = false;
|
|
803
|
-
} else moveFlag = true;
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
// if the angle is bigger or less than specific value, the wall mustn't be drawn at new position
|
|
809
|
-
if (moveFlag) {
|
|
810
|
-
tx = x;
|
|
811
|
-
ty = y;
|
|
812
|
-
} else {
|
|
813
|
-
let rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
|
|
814
|
-
// the origin point of rotation(snapping)
|
|
815
|
-
let ox = vertices[drawingLine.vertices[0]].x;
|
|
816
|
-
let oy = vertices[drawingLine.vertices[0]].y;
|
|
817
|
-
// determine the direction of rotation.
|
|
818
|
-
rest = lineAngle > 0 ? -rest : rest;
|
|
819
|
-
// rotate the current point to last point around the first point of drawing line.
|
|
820
|
-
let res = GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
|
|
821
|
-
tx = res.x;
|
|
822
|
-
ty = res.y;
|
|
823
|
-
}
|
|
824
|
-
// angle snapping as a value of UNIT_ANGLE
|
|
825
|
-
if (moveFlag && !isEmpty(absAngle) && absAngle % UNIT_ANGLE !== 0) {
|
|
826
|
-
let result = GeometryUtils.snapAngleByUnit(
|
|
827
|
-
lineAngle,
|
|
828
|
-
vertices,
|
|
829
|
-
drawingLine,
|
|
830
|
-
tx,
|
|
831
|
-
ty,
|
|
832
|
-
drawingLine.vertices[1]
|
|
833
|
-
);
|
|
834
|
-
tx = result.x;
|
|
835
|
-
ty = result.y;
|
|
836
|
-
}
|
|
837
|
-
let { updatedState: stateLV, vertex } = Line.replaceVertex(
|
|
838
|
-
state,
|
|
839
|
-
layerID,
|
|
840
|
-
lineID,
|
|
841
|
-
1,
|
|
842
|
-
tx,
|
|
843
|
-
ty
|
|
844
|
-
);
|
|
845
|
-
state = stateLV;
|
|
846
|
-
state = this.select(state, layerID, lineID).updatedState;
|
|
847
|
-
state = state.merge({ activeSnapElement: snap ? snap.snap : null });
|
|
848
|
-
state = state.setIn(['scene', 'setLineAttributes'], false);
|
|
849
|
-
return { updatedState: state };
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
static drawLineByAttributes(state, layerID, lineID, lineAttributes) {
|
|
853
|
-
let lAttr = lineAttributes.toJS();
|
|
854
|
-
let { vertexOne, vertexTwo } = lAttr;
|
|
855
|
-
// state = state.mergeIn(
|
|
856
|
-
// ['scene', 'layers', layerID, 'lines', lineID],
|
|
857
|
-
// fromJS(lAttr)
|
|
858
|
-
// );
|
|
859
|
-
|
|
860
|
-
let layer = state.getIn(['scene', 'layers', layerID]);
|
|
861
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
862
|
-
|
|
863
|
-
// let relatedLines = layer.lines.toArray().filter(line => {
|
|
864
|
-
// return line.vertices.includes(vertexOne.id) && line.id != lineID;
|
|
865
|
-
// });
|
|
866
|
-
let lines = state.getIn(['scene', 'layers', layerID, 'lines']).toJS();
|
|
867
|
-
let vertices = state.getIn(['scene', 'layers', layerID, 'vertices']).toJS();
|
|
868
|
-
let relatedLines = [];
|
|
869
|
-
let drawingLine = line.toJS();
|
|
870
|
-
getRelatedLines(relatedLines, drawingLine, vertices, lines);
|
|
871
|
-
|
|
872
|
-
//if lineAngle is 180 degree between two lines
|
|
873
|
-
let lineAngle;
|
|
874
|
-
let holesWithOffsetPosition = [];
|
|
875
|
-
let v0;
|
|
876
|
-
for (let i = 0; i < relatedLines.length; i++) {
|
|
877
|
-
// A variable j, k is the number of points in the line
|
|
878
|
-
for (let j = 0; j < 2; j++) {
|
|
879
|
-
for (let k = 0; k < 2; k++) {
|
|
880
|
-
// lineAngle is that angle between the two lines
|
|
881
|
-
lineAngle = Math.abs(
|
|
882
|
-
GeometryUtils.angleBetweenTwoLines(
|
|
883
|
-
relatedLines[i],
|
|
884
|
-
drawingLine,
|
|
885
|
-
vertices
|
|
886
|
-
)
|
|
887
|
-
);
|
|
888
|
-
//when the related line is one, drawing a new line
|
|
889
|
-
if (lineAngle === 180 && relatedLines.length === 1) {
|
|
890
|
-
if (relatedLines[i].vertices[j] !== drawingLine.vertices[k]) {
|
|
891
|
-
continue;
|
|
892
|
-
} else {
|
|
893
|
-
v0 = layer.vertices.get(relatedLines[i].vertices[1 - j]);
|
|
894
|
-
let v1 = layer.vertices.get(relatedLines[i].vertices[j]);
|
|
895
|
-
//remove the drawing line and related line
|
|
896
|
-
state = Line.remove(
|
|
897
|
-
state,
|
|
898
|
-
layerID,
|
|
899
|
-
relatedLines[i].id
|
|
900
|
-
).updatedState;
|
|
901
|
-
//get the data of hole included in the related line
|
|
902
|
-
layer.lines.get(relatedLines[i].id).holes.forEach(holeID => {
|
|
903
|
-
let lineLength = GeometryUtils.pointsDistance(
|
|
904
|
-
v0.x,
|
|
905
|
-
v0.y,
|
|
906
|
-
v1.x,
|
|
907
|
-
v1.y
|
|
908
|
-
);
|
|
909
|
-
let minV = GeometryUtils.minVertex(v0, v1);
|
|
910
|
-
let maxV = GeometryUtils.maxVertex(v0, v1);
|
|
911
|
-
let alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
|
|
912
|
-
let hole = layer.holes.get(holeID);
|
|
913
|
-
let pointOnLine = lineLength * hole.offset;
|
|
914
|
-
// Calculate the hole position
|
|
915
|
-
let offsetPosition = {
|
|
916
|
-
x: pointOnLine * Math.cos(alpha) + minV.x,
|
|
917
|
-
y: pointOnLine * Math.sin(alpha) + minV.y
|
|
918
|
-
};
|
|
919
|
-
|
|
920
|
-
holesWithOffsetPosition.push({ hole, offsetPosition });
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
// state = state.mergeIn(
|
|
928
|
-
// ['scene', 'layers', layerID, 'lines', lineID, 'focus'],
|
|
929
|
-
// true
|
|
930
|
-
// );
|
|
931
|
-
let v2 = layer.vertices.get(line.vertices.get(0));
|
|
932
|
-
let v3 = layer.vertices.get(line.vertices.get(1));
|
|
933
|
-
state = this.select(state, layerID, lineID).updatedState;
|
|
934
|
-
state = Line.remove(state, layerID, lineID).updatedState;
|
|
935
|
-
let minV = GeometryUtils.minVertex(v2, v3);
|
|
936
|
-
let maxV = GeometryUtils.maxVertex(v2, v3);
|
|
937
|
-
let alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
|
|
938
|
-
layer.lines.get(lineID).holes.forEach(holeID => {
|
|
939
|
-
let lineLength = GeometryUtils.pointsDistance(v2.x, v2.y, v3.x, v3.y);
|
|
940
|
-
let hole = layer.holes.get(holeID);
|
|
941
|
-
let pointOnLine = lineLength * hole.offset;
|
|
942
|
-
|
|
943
|
-
let offsetPosition = {
|
|
944
|
-
x: pointOnLine * Math.cos(alpha) + minV.x,
|
|
945
|
-
y: pointOnLine * Math.sin(alpha) + minV.y
|
|
946
|
-
};
|
|
947
|
-
|
|
948
|
-
holesWithOffsetPosition.push({ hole, offsetPosition });
|
|
949
|
-
});
|
|
950
|
-
let checkVertex = lineAngle === 180 && relatedLines.length === 1 ? v0 : v2;
|
|
951
|
-
if (
|
|
952
|
-
!GeometryUtils.samePoints(checkVertex, {
|
|
953
|
-
x: vertexTwo.x,
|
|
954
|
-
y: vertexTwo.y
|
|
955
|
-
})
|
|
956
|
-
) {
|
|
957
|
-
let ret = Line.createAvoidingIntersections(
|
|
958
|
-
state,
|
|
959
|
-
layerID,
|
|
960
|
-
line.type,
|
|
961
|
-
checkVertex.x,
|
|
962
|
-
checkVertex.y,
|
|
963
|
-
vertexTwo.x,
|
|
964
|
-
vertexTwo.y,
|
|
965
|
-
line.properties,
|
|
966
|
-
holesWithOffsetPosition,
|
|
967
|
-
line.createdDateTime
|
|
968
|
-
);
|
|
969
|
-
state = ret.updatedState;
|
|
970
|
-
}
|
|
971
|
-
// state = Line.createAvoidingIntersections(state, layerID, line.type, v0.x, v0.y, x, y).updatedState;
|
|
972
|
-
|
|
973
|
-
// origin area count
|
|
974
|
-
let areaCount = layer.areas.size;
|
|
975
|
-
|
|
976
|
-
state = Layer.detectAndUpdateAreas(state, layerID).updatedState;
|
|
977
|
-
|
|
978
|
-
state = state.merge({
|
|
979
|
-
sceneHistory: history.historyPush(state.sceneHistory, state.scene)
|
|
980
|
-
});
|
|
981
|
-
|
|
982
|
-
// state = state.merge({
|
|
983
|
-
// mode: MODE_WAITING_DRAWING_LINE,
|
|
984
|
-
// snapElements: new List(),
|
|
985
|
-
// activeSnapElement: null
|
|
986
|
-
// });
|
|
987
|
-
|
|
988
|
-
if (state.mode.endsWith('_LINE')) {
|
|
989
|
-
state = state.setIn(['scene', 'setLineAttributes'], true);
|
|
990
|
-
state = this.beginDrawingLine(
|
|
991
|
-
state,
|
|
992
|
-
layerID,
|
|
993
|
-
vertexTwo.x,
|
|
994
|
-
vertexTwo.y
|
|
995
|
-
).updatedState;
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
// update area//
|
|
999
|
-
layer = state.getIn(['scene', 'layers', layerID]);
|
|
1000
|
-
// if new area created
|
|
1001
|
-
// this.interiorsurfacedetect(state);
|
|
1002
|
-
|
|
1003
|
-
return { updatedState: state };
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
static stopDrawingLine(state) {
|
|
1007
|
-
console.log('line aCtion');
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
/**
|
|
1011
|
-
* check the [curVertId] point
|
|
1012
|
-
* @param {*} state scene state
|
|
1013
|
-
* @param {*} curVertId id of vertex
|
|
1014
|
-
* returns colinear two line array - [line1, line2]
|
|
1015
|
-
* if there is no colinear lines or the count of colinear lines more than
|
|
1016
|
-
*/
|
|
1017
|
-
static hasColinearTwoLines(state, curVertId, layerID) {
|
|
1018
|
-
let lineGroup = [];
|
|
1019
|
-
let layer = state.getIn(['scene', 'layers', layerID]);
|
|
1020
|
-
let vertices = state.getIn(['scene', 'layers', layerID, 'vertices']).toJS();
|
|
1021
|
-
|
|
1022
|
-
layer.lines.forEach(line => {
|
|
1023
|
-
if (line.vertices.some(v => v === curVertId)) lineGroup.push(line.toJS());
|
|
1024
|
-
});
|
|
1025
|
-
if (lineGroup.length !== 2) return null;
|
|
1026
|
-
|
|
1027
|
-
let lineAngle = Math.abs(
|
|
1028
|
-
GeometryUtils.angleBetweenTwoLines(lineGroup[0], lineGroup[1], vertices)
|
|
1029
|
-
);
|
|
1030
|
-
if (lineAngle === 180) return lineGroup;
|
|
1031
|
-
|
|
1032
|
-
return null;
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
static mergeTwoColinearLines(state, line1, line2, layerID, lineProperties) {
|
|
1036
|
-
let nv0, nv1, nv2;
|
|
1037
|
-
let layer = state.getIn(['scene', 'layers', layerID]);
|
|
1038
|
-
|
|
1039
|
-
let holesWithOffsetPosition = [];
|
|
1040
|
-
|
|
1041
|
-
line1.vertices.forEach(v1 => {
|
|
1042
|
-
line2.vertices.forEach(v2 => {
|
|
1043
|
-
if (v2 === v1) {
|
|
1044
|
-
nv1 = layer.vertices.get(v1);
|
|
1045
|
-
}
|
|
1046
|
-
});
|
|
1047
|
-
});
|
|
1048
|
-
line1.vertices.forEach(v1 => {
|
|
1049
|
-
if (v1 !== nv1.id) nv0 = layer.vertices.get(v1);
|
|
1050
|
-
});
|
|
1051
|
-
line2.vertices.forEach(v2 => {
|
|
1052
|
-
if (v2 !== nv1.id) nv2 = layer.vertices.get(v2);
|
|
1053
|
-
});
|
|
1054
|
-
|
|
1055
|
-
state = Line.remove(state, layerID, line1.id).updatedState;
|
|
1056
|
-
//get the data of hole included in the related line
|
|
1057
|
-
layer.lines.get(line1.id).holes.forEach(holeID => {
|
|
1058
|
-
let lineLength = GeometryUtils.pointsDistance(nv0.x, nv0.y, nv1.x, nv1.y);
|
|
1059
|
-
let minV = GeometryUtils.minVertex(nv0, nv1);
|
|
1060
|
-
let maxV = GeometryUtils.maxVertex(nv0, nv1);
|
|
1061
|
-
let alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
|
|
1062
|
-
let hole = layer.holes.get(holeID);
|
|
1063
|
-
let pointOnLine = lineLength * hole.offset;
|
|
1064
|
-
// Calculate the hole position
|
|
1065
|
-
let offsetPosition = {
|
|
1066
|
-
x: pointOnLine * Math.cos(alpha) + minV.x,
|
|
1067
|
-
y: pointOnLine * Math.sin(alpha) + minV.y
|
|
1068
|
-
};
|
|
1069
|
-
|
|
1070
|
-
holesWithOffsetPosition.push({ hole, offsetPosition });
|
|
1071
|
-
});
|
|
1072
|
-
state = Line.remove(state, layerID, line2.id).updatedState;
|
|
1073
|
-
layer.lines.get(line2.id).holes.forEach(holeID => {
|
|
1074
|
-
let lineLength = GeometryUtils.pointsDistance(nv1.x, nv1.y, nv2.x, nv2.y);
|
|
1075
|
-
let minV = GeometryUtils.minVertex(nv1, nv2);
|
|
1076
|
-
let maxV = GeometryUtils.maxVertex(nv1, nv2);
|
|
1077
|
-
let alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
|
|
1078
|
-
let hole = layer.holes.get(holeID);
|
|
1079
|
-
let pointOnLine = lineLength * hole.offset;
|
|
1080
|
-
// Calculate the hole position
|
|
1081
|
-
let offsetPosition = {
|
|
1082
|
-
x: pointOnLine * Math.cos(alpha) + minV.x,
|
|
1083
|
-
y: pointOnLine * Math.sin(alpha) + minV.y
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
holesWithOffsetPosition.push({ hole, offsetPosition });
|
|
1087
|
-
});
|
|
1088
|
-
let ret = Line.createAvoidingIntersections(
|
|
1089
|
-
state,
|
|
1090
|
-
layerID,
|
|
1091
|
-
line1.type,
|
|
1092
|
-
nv0.x,
|
|
1093
|
-
nv0.y,
|
|
1094
|
-
nv2.x,
|
|
1095
|
-
nv2.y,
|
|
1096
|
-
lineProperties,
|
|
1097
|
-
holesWithOffsetPosition,
|
|
1098
|
-
line1.createdDateTime
|
|
1099
|
-
);
|
|
1100
|
-
state = ret.updatedState;
|
|
1101
|
-
|
|
1102
|
-
// origin area count
|
|
1103
|
-
let areaCount = layer.areas.size;
|
|
1104
|
-
|
|
1105
|
-
let drawingInfor = {
|
|
1106
|
-
drawingLine: ret.newline,
|
|
1107
|
-
vertices: layer.vertices
|
|
1108
|
-
};
|
|
1109
|
-
state = Layer.detectAndUpdateAreas(
|
|
1110
|
-
state,
|
|
1111
|
-
layerID,
|
|
1112
|
-
drawingInfor
|
|
1113
|
-
).updatedState;
|
|
1114
|
-
|
|
1115
|
-
//update area//
|
|
1116
|
-
layer = state.getIn(['scene', 'layers', layerID]);
|
|
1117
|
-
// if new area created
|
|
1118
|
-
// this.interiorsurfacedetect(state);
|
|
1119
|
-
|
|
1120
|
-
return { updatedState: state, drawingInfor };
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
static endDrawingLine(state, x, y, relatedLines) {
|
|
1124
|
-
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
1125
|
-
let snap = SnapUtils.nearestSnap(
|
|
1126
|
-
state.snapElements,
|
|
1127
|
-
x,
|
|
1128
|
-
y,
|
|
1129
|
-
state.snapMask
|
|
1130
|
-
);
|
|
1131
|
-
if (snap) ({ x, y } = snap.point);
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
let layerID = state.getIn(['drawingSupport', 'layerID']);
|
|
1135
|
-
let layer = state.getIn(['scene', 'layers', layerID]);
|
|
1136
|
-
let lineID = state
|
|
1137
|
-
.getIn(['scene', 'layers', layerID, 'selected', 'lines'])
|
|
1138
|
-
.first();
|
|
1139
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
1140
|
-
|
|
1141
|
-
let drawingLine = line.toJS();
|
|
1142
|
-
|
|
1143
|
-
if (drawingLine.vertices[0] === drawingLine.vertices[1]) {
|
|
1144
|
-
state = Line.remove(state, layerID, lineID).updatedState;
|
|
1145
|
-
state = state.merge({
|
|
1146
|
-
mode: MODE_IDLE,
|
|
1147
|
-
snapElements: new List(),
|
|
1148
|
-
activeSnapElement: null
|
|
1149
|
-
});
|
|
1150
|
-
return { updatedState: state };
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
/// 180 merge lines - start ////
|
|
1155
|
-
let vertexGroup = [];
|
|
1156
|
-
let drawingInfor = {};
|
|
1157
|
-
|
|
1158
|
-
line.vertices.forEach(vertexID => {
|
|
1159
|
-
let colinearLines = state.getIn([
|
|
1160
|
-
'scene',
|
|
1161
|
-
'layers',
|
|
1162
|
-
layerID,
|
|
1163
|
-
'vertices',
|
|
1164
|
-
vertexID,
|
|
1165
|
-
'lines'
|
|
1166
|
-
]);
|
|
1167
|
-
colinearLines.forEach(lineID => {
|
|
1168
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
1169
|
-
|
|
1170
|
-
line.vertices.forEach(vertex => {
|
|
1171
|
-
if (vertex !== vertexID) vertexGroup.push(vertex);
|
|
1172
|
-
});
|
|
1173
|
-
});
|
|
1174
|
-
});
|
|
1175
|
-
|
|
1176
|
-
vertexGroup.forEach(vertexId => {
|
|
1177
|
-
let lineGroup = [];
|
|
1178
|
-
|
|
1179
|
-
lineGroup = this.hasColinearTwoLines(state, vertexId, layerID);
|
|
1180
|
-
if (!isEmpty(lineGroup)) {
|
|
1181
|
-
let ret = this.mergeTwoColinearLines(
|
|
1182
|
-
state,
|
|
1183
|
-
lineGroup[0],
|
|
1184
|
-
lineGroup[1],
|
|
1185
|
-
layerID,
|
|
1186
|
-
line.properties
|
|
1187
|
-
);
|
|
1188
|
-
state = ret.updatedState;
|
|
1189
|
-
drawingInfor = ret.drawingInfor;
|
|
1190
|
-
}
|
|
1191
|
-
});
|
|
1192
|
-
|
|
1193
|
-
/// 180 merge lines - end ////
|
|
1194
|
-
|
|
1195
|
-
if (isEmpty(drawingInfor)) {
|
|
1196
|
-
drawingInfor = {
|
|
1197
|
-
drawingLine: line,
|
|
1198
|
-
vertices: layer.vertices
|
|
1199
|
-
};
|
|
1200
|
-
state = Layer.detectAndUpdateAreas(
|
|
1201
|
-
state,
|
|
1202
|
-
layerID,
|
|
1203
|
-
drawingInfor
|
|
1204
|
-
).updatedState;
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
//update area//
|
|
1208
|
-
layer = state.getIn(['scene', 'layers', layerID]);
|
|
1209
|
-
// if new area created
|
|
1210
|
-
// this.interiorsurfacedetect(state);
|
|
1211
|
-
|
|
1212
|
-
state = state.merge({
|
|
1213
|
-
mode: MODE_WAITING_DRAWING_LINE,
|
|
1214
|
-
snapElements: new List(),
|
|
1215
|
-
activeSnapElement: null
|
|
1216
|
-
});
|
|
1217
|
-
return { updatedState: state };
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
static beginDraggingLine(state, layerID, lineID, x, y) {
|
|
1221
|
-
let snapElements = SnapSceneUtils.sceneSnapElements(
|
|
1222
|
-
state.scene,
|
|
1223
|
-
new List(),
|
|
1224
|
-
state.snapMask
|
|
1225
|
-
);
|
|
1226
|
-
|
|
1227
|
-
let layer = state.scene.layers.get(layerID);
|
|
1228
|
-
let line = layer.lines.get(lineID);
|
|
1229
|
-
|
|
1230
|
-
let vertex0 = layer.vertices.get(line.vertices.get(0));
|
|
1231
|
-
let vertex1 = layer.vertices.get(line.vertices.get(1));
|
|
1232
|
-
|
|
1233
|
-
state = state.merge({
|
|
1234
|
-
mode: MODE_DRAGGING_LINE,
|
|
1235
|
-
snapElements,
|
|
1236
|
-
draggingSupport: Map({
|
|
1237
|
-
layerID,
|
|
1238
|
-
lineID,
|
|
1239
|
-
startPointX: x,
|
|
1240
|
-
startPointY: y,
|
|
1241
|
-
startVertex0X: vertex0.x,
|
|
1242
|
-
startVertex0Y: vertex0.y,
|
|
1243
|
-
startVertex1X: vertex1.x,
|
|
1244
|
-
startVertex1Y: vertex1.y
|
|
1245
|
-
})
|
|
1246
|
-
});
|
|
1247
|
-
|
|
1248
|
-
return { updatedState: state };
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
static getNewDraggedPoints(
|
|
1252
|
-
newPoints,
|
|
1253
|
-
allVertices,
|
|
1254
|
-
draggingLine,
|
|
1255
|
-
relatedLines
|
|
1256
|
-
) {
|
|
1257
|
-
if (
|
|
1258
|
-
!newPoints ||
|
|
1259
|
-
!allVertices ||
|
|
1260
|
-
!draggingLine ||
|
|
1261
|
-
!Array.isArray(relatedLines)
|
|
1262
|
-
) {
|
|
1263
|
-
return newPoints; // Invalid input, just return
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
const draggingVertices = Array.isArray(draggingLine.vertices)
|
|
1267
|
-
? draggingLine.vertices
|
|
1268
|
-
: [];
|
|
1269
|
-
const mvFlag = [];
|
|
1270
|
-
|
|
1271
|
-
relatedLines.forEach(relLine => {
|
|
1272
|
-
if (!relLine || !Array.isArray(relLine.vertices)) return;
|
|
1273
|
-
|
|
1274
|
-
relLine.vertices.forEach((vertexId, i) => {
|
|
1275
|
-
if (draggingVertices.includes(vertexId)) return; // skip shared vertices
|
|
1276
|
-
const vData = allVertices[vertexId];
|
|
1277
|
-
if (!vData) return; // guard: vertex missing
|
|
1278
|
-
|
|
1279
|
-
const center =
|
|
1280
|
-
i === 0
|
|
1281
|
-
? new Three.Vector2(
|
|
1282
|
-
newPoints?.newVertex0X ?? 0,
|
|
1283
|
-
newPoints?.newVertex0Y ?? 0
|
|
1284
|
-
)
|
|
1285
|
-
: new Three.Vector2(
|
|
1286
|
-
newPoints?.newVertex1X ?? 0,
|
|
1287
|
-
newPoints?.newVertex1Y ?? 0
|
|
1288
|
-
);
|
|
1289
|
-
|
|
1290
|
-
const pos1 = new Three.Vector2(vData.x ?? 0, vData.y ?? 0);
|
|
1291
|
-
const pos2 =
|
|
1292
|
-
i === 0
|
|
1293
|
-
? new Three.Vector2(
|
|
1294
|
-
newPoints?.newVertex1X ?? 0,
|
|
1295
|
-
newPoints?.newVertex1Y ?? 0
|
|
1296
|
-
)
|
|
1297
|
-
: new Three.Vector2(
|
|
1298
|
-
newPoints?.newVertex0X ?? 0,
|
|
1299
|
-
newPoints?.newVertex0Y ?? 0
|
|
1300
|
-
);
|
|
1301
|
-
|
|
1302
|
-
const cen = center.clone();
|
|
1303
|
-
const vec1 = pos1.clone().sub(cen).normalize();
|
|
1304
|
-
const vec2 = pos2.clone().sub(cen).normalize();
|
|
1305
|
-
|
|
1306
|
-
const angle = Math.floor(
|
|
1307
|
-
(vec1.angle() * 180) / Math.PI - (vec2.angle() * 180) / Math.PI + 0.5
|
|
1308
|
-
);
|
|
1309
|
-
|
|
1310
|
-
if (
|
|
1311
|
-
Math.abs(angle) < MIN_ANGLE_DISALLOW_DRAW_WALL ||
|
|
1312
|
-
Math.abs(angle) > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL
|
|
1313
|
-
) {
|
|
1314
|
-
mvFlag.push(false);
|
|
1315
|
-
} else {
|
|
1316
|
-
mvFlag.push(true);
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1319
|
-
});
|
|
1320
|
-
|
|
1321
|
-
// If any flag is false, revert newPoints to original dragging line positions
|
|
1322
|
-
if (mvFlag.includes(false) && draggingVertices.length >= 2) {
|
|
1323
|
-
const v0 = allVertices[draggingVertices[0]];
|
|
1324
|
-
const v1 = allVertices[draggingVertices[1]];
|
|
1325
|
-
if (v0 && v1) {
|
|
1326
|
-
newPoints.newVertex0X = v0.x;
|
|
1327
|
-
newPoints.newVertex0Y = v0.y;
|
|
1328
|
-
newPoints.newVertex1X = v1.x;
|
|
1329
|
-
newPoints.newVertex1Y = v1.y;
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
return newPoints;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
static updateDraggingLine(state, x, y, relatedLines) {
|
|
1337
|
-
let draggingSupport = state.draggingSupport;
|
|
1338
|
-
let snapElements = state.snapElements;
|
|
1339
|
-
|
|
1340
|
-
let layerID = draggingSupport.get('layerID');
|
|
1341
|
-
let lineID = draggingSupport.get('lineID');
|
|
1342
|
-
let diffX = x - draggingSupport.get('startPointX');
|
|
1343
|
-
let diffY = y - draggingSupport.get('startPointY');
|
|
1344
|
-
let newVertex0X = draggingSupport.get('startVertex0X') + diffX;
|
|
1345
|
-
let newVertex0Y = draggingSupport.get('startVertex0Y') + diffY;
|
|
1346
|
-
let newVertex1X = draggingSupport.get('startVertex1X') + diffX;
|
|
1347
|
-
let newVertex1Y = draggingSupport.get('startVertex1Y') + diffY;
|
|
1348
|
-
let drawingLine = state
|
|
1349
|
-
.getIn(['scene', 'layers', layerID, 'lines', lineID])
|
|
1350
|
-
.toJS();
|
|
1351
|
-
let allVertices = state
|
|
1352
|
-
.getIn(['scene', 'layers', layerID, 'vertices'])
|
|
1353
|
-
.toJS();
|
|
1354
|
-
|
|
1355
|
-
let activeSnapElement = null;
|
|
1356
|
-
let curSnap0 = null,
|
|
1357
|
-
curSnap1 = null;
|
|
1358
|
-
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
1359
|
-
curSnap0 = SnapUtils.nearestSnap(
|
|
1360
|
-
snapElements,
|
|
1361
|
-
newVertex0X,
|
|
1362
|
-
newVertex0Y,
|
|
1363
|
-
state.snapMask
|
|
1364
|
-
);
|
|
1365
|
-
curSnap1 = SnapUtils.nearestSnap(
|
|
1366
|
-
snapElements,
|
|
1367
|
-
newVertex1X,
|
|
1368
|
-
newVertex1Y,
|
|
1369
|
-
state.snapMask
|
|
1370
|
-
);
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
let deltaX = 0,
|
|
1374
|
-
deltaY = 0;
|
|
1375
|
-
if (curSnap0 && curSnap1) {
|
|
1376
|
-
if (curSnap0.point.distance < curSnap1.point.distance) {
|
|
1377
|
-
deltaX = curSnap0.point.x - newVertex0X;
|
|
1378
|
-
deltaY = curSnap0.point.y - newVertex0Y;
|
|
1379
|
-
activeSnapElement = curSnap0.snap;
|
|
1380
|
-
} else {
|
|
1381
|
-
deltaX = curSnap1.point.x - newVertex1X;
|
|
1382
|
-
deltaY = curSnap1.point.y - newVertex1Y;
|
|
1383
|
-
activeSnapElement = curSnap1.snap;
|
|
1384
|
-
}
|
|
1385
|
-
} else {
|
|
1386
|
-
if (curSnap0) {
|
|
1387
|
-
deltaX = curSnap0.point.x - newVertex0X;
|
|
1388
|
-
deltaY = curSnap0.point.y - newVertex0Y;
|
|
1389
|
-
activeSnapElement = curSnap0.snap;
|
|
1390
|
-
}
|
|
1391
|
-
if (curSnap1) {
|
|
1392
|
-
deltaX = curSnap1.point.x - newVertex1X;
|
|
1393
|
-
deltaY = curSnap1.point.y - newVertex1Y;
|
|
1394
|
-
activeSnapElement = curSnap1.snap;
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
newVertex0X += deltaX;
|
|
1399
|
-
newVertex0Y += deltaY;
|
|
1400
|
-
newVertex1X += deltaX;
|
|
1401
|
-
newVertex1Y += deltaY;
|
|
1402
|
-
let newPoints = {
|
|
1403
|
-
newVertex0X: newVertex0X,
|
|
1404
|
-
newVertex0Y: newVertex0Y,
|
|
1405
|
-
newVertex1X: newVertex1X,
|
|
1406
|
-
newVertex1Y: newVertex1Y
|
|
1407
|
-
};
|
|
1408
|
-
let newResult = this.getNewDraggedPoints(
|
|
1409
|
-
newPoints,
|
|
1410
|
-
allVertices,
|
|
1411
|
-
drawingLine,
|
|
1412
|
-
relatedLines
|
|
1413
|
-
);
|
|
1414
|
-
newVertex0X = newResult.newVertex0X;
|
|
1415
|
-
newVertex0Y = newResult.newVertex0Y;
|
|
1416
|
-
newVertex1X = newResult.newVertex1X;
|
|
1417
|
-
newVertex1Y = newResult.newVertex1Y;
|
|
1418
|
-
|
|
1419
|
-
state = state.merge({
|
|
1420
|
-
activeSnapElement,
|
|
1421
|
-
scene: state.scene.updateIn(['layers', layerID], layer =>
|
|
1422
|
-
layer.withMutations(layer => {
|
|
1423
|
-
let lineVertices = layer.getIn(['lines', lineID, 'vertices']);
|
|
1424
|
-
layer.updateIn(['vertices', lineVertices.get(0)], vertex =>
|
|
1425
|
-
vertex.merge({ x: newVertex0X, y: newVertex0Y })
|
|
1426
|
-
);
|
|
1427
|
-
layer.updateIn(['vertices', lineVertices.get(1)], vertex =>
|
|
1428
|
-
vertex.merge({ x: newVertex1X, y: newVertex1Y })
|
|
1429
|
-
);
|
|
1430
|
-
return layer;
|
|
1431
|
-
})
|
|
1432
|
-
)
|
|
1433
|
-
});
|
|
1434
|
-
|
|
1435
|
-
return { updatedState: state };
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
static endDraggingLine(state, x, y, relatedLines) {
|
|
1439
|
-
let { draggingSupport } = state;
|
|
1440
|
-
|
|
1441
|
-
let layerID = draggingSupport.get('layerID');
|
|
1442
|
-
let layer = state.scene.layers.get(layerID);
|
|
1443
|
-
let lineID = draggingSupport.get('lineID');
|
|
1444
|
-
let line = layer.lines.get(lineID);
|
|
1445
|
-
let drawedLine = line.toJS();
|
|
1446
|
-
let allVertices = state
|
|
1447
|
-
.getIn(['scene', 'layers', layerID, 'vertices'])
|
|
1448
|
-
.toJS();
|
|
1449
|
-
|
|
1450
|
-
let vertex0 = layer.vertices.get(line.vertices.get(0));
|
|
1451
|
-
let vertex1 = layer.vertices.get(line.vertices.get(1));
|
|
1452
|
-
let maxV = GeometryUtils.maxVertex(vertex0, vertex1);
|
|
1453
|
-
let minV = GeometryUtils.minVertex(vertex0, vertex1);
|
|
1454
|
-
let lineLength = GeometryUtils.verticesDistance(minV, maxV);
|
|
1455
|
-
let alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
|
|
1456
|
-
let holesWithOffsetPosition = [];
|
|
1457
|
-
layer.lines.get(lineID).holes.forEach(holeID => {
|
|
1458
|
-
let hole = layer.holes.get(holeID);
|
|
1459
|
-
let pointOnLine = lineLength * hole.offset;
|
|
1460
|
-
let offsetPosition = {
|
|
1461
|
-
x: pointOnLine * Math.cos(alpha) + minV.x,
|
|
1462
|
-
y: pointOnLine * Math.sin(alpha) + minV.y
|
|
1463
|
-
};
|
|
1464
|
-
holesWithOffsetPosition.push({ hole, offsetPosition });
|
|
1465
|
-
});
|
|
1466
|
-
|
|
1467
|
-
let diffX = x - draggingSupport.get('startPointX');
|
|
1468
|
-
let diffY = y - draggingSupport.get('startPointY');
|
|
1469
|
-
let newVertex0X = draggingSupport.get('startVertex0X') + diffX;
|
|
1470
|
-
let newVertex0Y = draggingSupport.get('startVertex0Y') + diffY;
|
|
1471
|
-
let newVertex1X = draggingSupport.get('startVertex1X') + diffX;
|
|
1472
|
-
let newVertex1Y = draggingSupport.get('startVertex1Y') + diffY;
|
|
1473
|
-
|
|
1474
|
-
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
1475
|
-
let curSnap0 = SnapUtils.nearestSnap(
|
|
1476
|
-
state.snapElements,
|
|
1477
|
-
newVertex0X,
|
|
1478
|
-
newVertex0Y,
|
|
1479
|
-
state.snapMask
|
|
1480
|
-
);
|
|
1481
|
-
let curSnap1 = SnapUtils.nearestSnap(
|
|
1482
|
-
state.snapElements,
|
|
1483
|
-
newVertex1X,
|
|
1484
|
-
newVertex1Y,
|
|
1485
|
-
state.snapMask
|
|
1486
|
-
);
|
|
1487
|
-
|
|
1488
|
-
let deltaX = 0,
|
|
1489
|
-
deltaY = 0;
|
|
1490
|
-
if (curSnap0 && curSnap1) {
|
|
1491
|
-
if (curSnap0.point.distance < curSnap1.point.distance) {
|
|
1492
|
-
deltaX = curSnap0.point.x - newVertex0X;
|
|
1493
|
-
deltaY = curSnap0.point.y - newVertex0Y;
|
|
1494
|
-
} else {
|
|
1495
|
-
deltaX = curSnap1.point.x - newVertex1X;
|
|
1496
|
-
deltaY = curSnap1.point.y - newVertex1Y;
|
|
1497
|
-
}
|
|
1498
|
-
} else {
|
|
1499
|
-
if (curSnap0) {
|
|
1500
|
-
deltaX = curSnap0.point.x - newVertex0X;
|
|
1501
|
-
deltaY = curSnap0.point.y - newVertex0Y;
|
|
1502
|
-
}
|
|
1503
|
-
if (curSnap1) {
|
|
1504
|
-
deltaX = curSnap1.point.x - newVertex1X;
|
|
1505
|
-
deltaY = curSnap1.point.y - newVertex1Y;
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
newVertex0X += deltaX;
|
|
1510
|
-
newVertex0Y += deltaY;
|
|
1511
|
-
newVertex1X += deltaX;
|
|
1512
|
-
newVertex1Y += deltaY;
|
|
1513
|
-
}
|
|
1514
|
-
let newPoints = {
|
|
1515
|
-
newVertex0X: newVertex0X,
|
|
1516
|
-
newVertex0Y: newVertex0Y,
|
|
1517
|
-
newVertex1X: newVertex1X,
|
|
1518
|
-
newVertex1Y: newVertex1Y
|
|
1519
|
-
};
|
|
1520
|
-
let newResult = this.getNewDraggedPoints(
|
|
1521
|
-
newPoints,
|
|
1522
|
-
allVertices,
|
|
1523
|
-
drawedLine,
|
|
1524
|
-
relatedLines
|
|
1525
|
-
);
|
|
1526
|
-
newVertex0X = newResult.newVertex0X;
|
|
1527
|
-
newVertex0Y = newResult.newVertex0Y;
|
|
1528
|
-
newVertex1X = newResult.newVertex1X;
|
|
1529
|
-
newVertex1Y = newResult.newVertex1Y;
|
|
1530
|
-
|
|
1531
|
-
let lineGroups = state //get groups membership if present
|
|
1532
|
-
.getIn(['scene', 'groups'])
|
|
1533
|
-
.filter(group => {
|
|
1534
|
-
const lines = group.getIn(['elements', layerID, 'lines']);
|
|
1535
|
-
return lines && lines.contains(lineID);
|
|
1536
|
-
});
|
|
1537
|
-
|
|
1538
|
-
state = Layer.mergeEqualsVertices(
|
|
1539
|
-
state,
|
|
1540
|
-
layerID,
|
|
1541
|
-
line.vertices.get(0)
|
|
1542
|
-
).updatedState;
|
|
1543
|
-
state = Layer.mergeEqualsVertices(
|
|
1544
|
-
state,
|
|
1545
|
-
layerID,
|
|
1546
|
-
line.vertices.get(1)
|
|
1547
|
-
).updatedState;
|
|
1548
|
-
state = Line.remove(state, layerID, lineID).updatedState;
|
|
1549
|
-
if (
|
|
1550
|
-
!GeometryUtils.samePoints(
|
|
1551
|
-
{ newVertex0X, newVertex0Y },
|
|
1552
|
-
{ newVertex1X, newVertex1Y }
|
|
1553
|
-
)
|
|
1554
|
-
) {
|
|
1555
|
-
let ret = Line.createAvoidingIntersections(
|
|
1556
|
-
state,
|
|
1557
|
-
layerID,
|
|
1558
|
-
line.type,
|
|
1559
|
-
newVertex0X,
|
|
1560
|
-
newVertex0Y,
|
|
1561
|
-
newVertex1X,
|
|
1562
|
-
newVertex1Y,
|
|
1563
|
-
line.properties,
|
|
1564
|
-
holesWithOffsetPosition,
|
|
1565
|
-
line.createdDateTime
|
|
1566
|
-
);
|
|
1567
|
-
|
|
1568
|
-
state = ret.updatedState;
|
|
1569
|
-
//re-add to old line's groups if present
|
|
1570
|
-
ret.lines.forEach(addedLine => {
|
|
1571
|
-
lineGroups.forEach(oldLineGroup => {
|
|
1572
|
-
state = Group.addElement(
|
|
1573
|
-
state,
|
|
1574
|
-
oldLineGroup.id,
|
|
1575
|
-
layerID,
|
|
1576
|
-
'lines',
|
|
1577
|
-
addedLine.id
|
|
1578
|
-
).updatedState;
|
|
1579
|
-
});
|
|
1580
|
-
});
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
/// merge line if line angle is 180 degree ----> start
|
|
1584
|
-
let draggingLineID = state.draggingSupport.get('lineID');
|
|
1585
|
-
let draggingLine = layer.lines.get(draggingLineID);
|
|
1586
|
-
let vertexGroup = [];
|
|
1587
|
-
|
|
1588
|
-
draggingLine.vertices.forEach(vertexID => {
|
|
1589
|
-
let colinearLines = state.getIn([
|
|
1590
|
-
'scene',
|
|
1591
|
-
'layers',
|
|
1592
|
-
layerID,
|
|
1593
|
-
'vertices',
|
|
1594
|
-
vertexID,
|
|
1595
|
-
'lines'
|
|
1596
|
-
]);
|
|
1597
|
-
if (!isEmpty(colinearLines)) {
|
|
1598
|
-
colinearLines.forEach(lineID => {
|
|
1599
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
1600
|
-
|
|
1601
|
-
line.vertices.forEach(vertex => {
|
|
1602
|
-
if (vertex !== vertexID) vertexGroup.push(vertex);
|
|
1603
|
-
});
|
|
1604
|
-
});
|
|
1605
|
-
}
|
|
1606
|
-
});
|
|
1607
|
-
|
|
1608
|
-
vertexGroup.forEach(vertexId => {
|
|
1609
|
-
let lineGroup = [];
|
|
1610
|
-
|
|
1611
|
-
lineGroup = this.hasColinearTwoLines(state, vertexId, layerID);
|
|
1612
|
-
if (!isEmpty(lineGroup)) {
|
|
1613
|
-
state = this.mergeTwoColinearLines(
|
|
1614
|
-
state,
|
|
1615
|
-
lineGroup[0],
|
|
1616
|
-
lineGroup[1],
|
|
1617
|
-
layerID,
|
|
1618
|
-
line.properties
|
|
1619
|
-
).updatedState;
|
|
1620
|
-
}
|
|
1621
|
-
});
|
|
1622
|
-
|
|
1623
|
-
/// ------> end
|
|
1624
|
-
state = Layer.detectAndUpdateAreas(state, layerID, {}).updatedState;
|
|
1625
|
-
|
|
1626
|
-
state = state.merge({
|
|
1627
|
-
mode: MODE_IDLE,
|
|
1628
|
-
draggingSupport: null,
|
|
1629
|
-
activeSnapElement: null,
|
|
1630
|
-
snapElements: new List()
|
|
1631
|
-
});
|
|
1632
|
-
|
|
1633
|
-
return { updatedState: state };
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
static setProperties(state, layerID, lineID, properties) {
|
|
1637
|
-
state = state.mergeIn(
|
|
1638
|
-
['scene', 'layers', layerID, 'lines', lineID, 'properties'],
|
|
1639
|
-
properties
|
|
1640
|
-
);
|
|
1641
|
-
|
|
1642
|
-
return { updatedState: state };
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
static setJsProperties(state, layerID, lineID, properties) {
|
|
1646
|
-
return this.setProperties(state, layerID, lineID, fromJS(properties));
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
static updateProperties(state, layerID, lineID, properties) {
|
|
1650
|
-
properties.forEach((v, k) => {
|
|
1651
|
-
if (
|
|
1652
|
-
state.hasIn([
|
|
1653
|
-
'scene',
|
|
1654
|
-
'layers',
|
|
1655
|
-
layerID,
|
|
1656
|
-
'lines',
|
|
1657
|
-
lineID,
|
|
1658
|
-
'properties',
|
|
1659
|
-
k
|
|
1660
|
-
])
|
|
1661
|
-
)
|
|
1662
|
-
state = state.mergeIn(
|
|
1663
|
-
['scene', 'layers', layerID, 'lines', lineID, 'properties', k],
|
|
1664
|
-
v
|
|
1665
|
-
);
|
|
1666
|
-
});
|
|
1667
|
-
|
|
1668
|
-
return { updatedState: state };
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
static updateJsProperties(state, layerID, lineID, properties) {
|
|
1672
|
-
return this.updateProperties(state, layerID, lineID, fromJS(properties));
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
static setAttributes(state, layerID, lineID, lineAttributes) {
|
|
1676
|
-
if (state.mode === MODE_WAITING_DRAWING_LINE)
|
|
1677
|
-
return this.drawLineByAttributes(state, layerID, lineID, lineAttributes);
|
|
1678
|
-
|
|
1679
|
-
let lAttr = lineAttributes.toJS();
|
|
1680
|
-
let {
|
|
1681
|
-
vertexOne,
|
|
1682
|
-
vertexTwo,
|
|
1683
|
-
vertexThree,
|
|
1684
|
-
vertexFour,
|
|
1685
|
-
lineLength,
|
|
1686
|
-
lineToExtend
|
|
1687
|
-
} = lAttr;
|
|
1688
|
-
delete lAttr['vertexOne'];
|
|
1689
|
-
delete lAttr['vertexTwo'];
|
|
1690
|
-
delete lAttr['vertexThree'];
|
|
1691
|
-
delete lAttr['vertexFour'];
|
|
1692
|
-
delete lAttr['lineToExtend'];
|
|
1693
|
-
delete lAttr['lineLength'];
|
|
1694
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
1695
|
-
state = state
|
|
1696
|
-
.mergeIn(['scene', 'layers', layerID, 'lines', lineID], fromJS(lAttr))
|
|
1697
|
-
.mergeIn(['scene', 'layers', layerID, 'vertices', vertexOne.id], {
|
|
1698
|
-
x: vertexOne.x,
|
|
1699
|
-
y: vertexOne.y
|
|
1700
|
-
})
|
|
1701
|
-
.mergeIn(['scene', 'layers', layerID, 'vertices', vertexTwo.id], {
|
|
1702
|
-
x: vertexTwo.x,
|
|
1703
|
-
y: vertexTwo.y
|
|
1704
|
-
})
|
|
1705
|
-
.mergeIn(
|
|
1706
|
-
['scene', 'layers', layerID, 'lines', lineID, 'misc'],
|
|
1707
|
-
new Map({ _unitLength: lineLength._unit })
|
|
1708
|
-
)
|
|
1709
|
-
.mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'focus'], true);
|
|
1710
|
-
if (lineToExtend) {
|
|
1711
|
-
state = state
|
|
1712
|
-
.mergeIn(
|
|
1713
|
-
['scene', 'layers', layerID, 'lines', lineToExtend.id],
|
|
1714
|
-
fromJS(lAttr)
|
|
1715
|
-
)
|
|
1716
|
-
.mergeIn(
|
|
1717
|
-
['scene', 'layers', layerID, 'lines', lineToExtend.id, 'misc'],
|
|
1718
|
-
new Map({ _unitLength: lineLength._unit })
|
|
1719
|
-
);
|
|
1720
|
-
}
|
|
1721
|
-
if (vertexThree) {
|
|
1722
|
-
state = state.mergeIn(
|
|
1723
|
-
['scene', 'layers', layerID, 'vertices', vertexThree.id],
|
|
1724
|
-
{ x: vertexThree.x, y: vertexThree.y }
|
|
1725
|
-
);
|
|
1726
|
-
}
|
|
1727
|
-
if (vertexFour) {
|
|
1728
|
-
state = state.mergeIn(
|
|
1729
|
-
['scene', 'layers', layerID, 'vertices', vertexFour.id],
|
|
1730
|
-
{ x: vertexFour.x, y: vertexFour.y }
|
|
1731
|
-
);
|
|
1732
|
-
}
|
|
1733
|
-
state = Layer.mergeEqualsVertices(
|
|
1734
|
-
state,
|
|
1735
|
-
layerID,
|
|
1736
|
-
vertexOne.id
|
|
1737
|
-
).updatedState;
|
|
1738
|
-
if (vertexOne.x != vertexTwo.x && vertexOne.y != vertexTwo.y) {
|
|
1739
|
-
state = Layer.mergeEqualsVertices(
|
|
1740
|
-
state,
|
|
1741
|
-
layerID,
|
|
1742
|
-
vertexTwo.id
|
|
1743
|
-
).updatedState;
|
|
1744
|
-
}
|
|
1745
|
-
state = Layer.detectAndUpdateAreas(state, layerID, {}).updatedState;
|
|
1746
|
-
state = state.merge({
|
|
1747
|
-
sceneHistory: history.historyPush(state.sceneHistory, state.scene)
|
|
1748
|
-
});
|
|
1749
|
-
if (state.mode.endsWith('_LINE')) {
|
|
1750
|
-
state = this.beginDrawingLine(
|
|
1751
|
-
state,
|
|
1752
|
-
layerID,
|
|
1753
|
-
vertexTwo.x,
|
|
1754
|
-
vertexTwo.y
|
|
1755
|
-
).updatedState;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
return { updatedState: state };
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
static setVerticesCoords(state, layerID, lineID, x1, y1, x2, y2) {
|
|
1762
|
-
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
1763
|
-
state = Vertex.setAttributes(
|
|
1764
|
-
state,
|
|
1765
|
-
layerID,
|
|
1766
|
-
line.vertices.get(0),
|
|
1767
|
-
new Map({ x: x1, y: y1 })
|
|
1768
|
-
).updatedState;
|
|
1769
|
-
state = Vertex.setAttributes(
|
|
1770
|
-
state,
|
|
1771
|
-
layerID,
|
|
1772
|
-
line.vertices.get(1),
|
|
1773
|
-
new Map({ x: x2, y: y2 })
|
|
1774
|
-
).updatedState;
|
|
1775
|
-
|
|
1776
|
-
return { updatedState: state };
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
export { Line as default };
|