kitchen-simulator 5.0.0-test.4 → 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/package.json +1 -2
- 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
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
function getEdgesOfSubgraphs(subgraphs, graph) {
|
|
2
|
-
let edges = [];
|
|
3
|
-
|
|
4
|
-
subgraphs.forEach(component => {
|
|
5
|
-
edges.push([]);
|
|
6
|
-
let vertices = getVerticesFromBiconnectedComponent(component);
|
|
7
|
-
let inserted = [];
|
|
8
|
-
vertices.forEach(vertex => {
|
|
9
|
-
let adjacents = graph.adj[vertex];
|
|
10
|
-
adjacents.forEach(adj => {
|
|
11
|
-
if (vertex <= adj && vertices.has(adj)) {
|
|
12
|
-
edges[edges.length - 1].push([vertex, adj]);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
return edges;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function getVerticesFromBiconnectedComponent(component) {
|
|
21
|
-
let vertices = new Set();
|
|
22
|
-
component.forEach(edge => {
|
|
23
|
-
vertices.add(edge.u);
|
|
24
|
-
vertices.add(edge.v);
|
|
25
|
-
});
|
|
26
|
-
return vertices;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = getEdgesOfSubgraphs;
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UTILS
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
function sub(v1, v2) {
|
|
6
|
-
return [v1[0] - v2[0], v1[1] - v2[1]];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function mod(n, m) {
|
|
10
|
-
return ((n % m) + m) % m;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* CYCLES
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
function compute_ev_mapping(EV) {
|
|
18
|
-
let ev_mapping = EV.map(function (ev) {
|
|
19
|
-
return {
|
|
20
|
-
ev: ev,
|
|
21
|
-
color: 0,
|
|
22
|
-
direction: -1
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return ev_mapping;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function compute_angle(P, V) {
|
|
30
|
-
let point = sub(V, P);
|
|
31
|
-
let angle = Math.atan2(point[1], point[0]);
|
|
32
|
-
return angle;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function compute_incidences(V, EV) {
|
|
36
|
-
let incidences = V.map(function (vertex, i) {
|
|
37
|
-
let incidence = [];
|
|
38
|
-
EV.forEach(function (edge, j) {
|
|
39
|
-
let endpoint;
|
|
40
|
-
let position;
|
|
41
|
-
|
|
42
|
-
if (edge[0] === i) {
|
|
43
|
-
endpoint = edge[1];
|
|
44
|
-
position = 1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (edge[1] === i) {
|
|
48
|
-
endpoint = edge[0];
|
|
49
|
-
position = 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
endpoint !== undefined &&
|
|
53
|
-
incidence.push({
|
|
54
|
-
index: j,
|
|
55
|
-
endpoint: endpoint,
|
|
56
|
-
angle: compute_angle(vertex, V[endpoint]),
|
|
57
|
-
edge: edge,
|
|
58
|
-
position: position
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
incidence.sort(function (i1, i2) {
|
|
63
|
-
return i2.angle - i1.angle;
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return incidence;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
return incidences;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function get_starting_edge(incidences, ev_mapping) {
|
|
73
|
-
let e;
|
|
74
|
-
let position;
|
|
75
|
-
let direction;
|
|
76
|
-
for (e = 0; e < ev_mapping.length; e += 1) {
|
|
77
|
-
if (ev_mapping[e].color < 2) {
|
|
78
|
-
direction = -1 * ev_mapping[e].direction;
|
|
79
|
-
color(ev_mapping, e, direction);
|
|
80
|
-
return {
|
|
81
|
-
edge: e,
|
|
82
|
-
direction: direction,
|
|
83
|
-
position: direction === -1 ? 0 : 1
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function get_next_edge(incidences, edge, position, EV) {
|
|
90
|
-
let items = incidences[EV[edge][position]];
|
|
91
|
-
//console.log(items, incidences, EV, edge, position);
|
|
92
|
-
let n_items = items.length;
|
|
93
|
-
let item;
|
|
94
|
-
let out;
|
|
95
|
-
let j;
|
|
96
|
-
for (j = 0; j < n_items; j += 1) {
|
|
97
|
-
item = items[j];
|
|
98
|
-
if (item.index === edge) {
|
|
99
|
-
out = items[mod(j + 1, items.length)];
|
|
100
|
-
return {
|
|
101
|
-
edge: out.index,
|
|
102
|
-
vertex: out.endpoint,
|
|
103
|
-
position: out.position,
|
|
104
|
-
direction: out.position ? 1 : -1
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function color(ev_mapping, index, direction) {
|
|
111
|
-
ev_mapping[index].color += 1;
|
|
112
|
-
ev_mapping[index].direction = direction;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function find_cycles(V, EV) {
|
|
116
|
-
let ev_mapping = compute_ev_mapping(EV);
|
|
117
|
-
let incidences = compute_incidences(V, EV);
|
|
118
|
-
let V_cycles = [];
|
|
119
|
-
let E_cycles = [];
|
|
120
|
-
let dir_E_cycles = [];
|
|
121
|
-
let V_cycle;
|
|
122
|
-
let E_cycle;
|
|
123
|
-
let dir_E_cycle;
|
|
124
|
-
let next;
|
|
125
|
-
let counter = 0;
|
|
126
|
-
let start = get_starting_edge(incidences, ev_mapping);
|
|
127
|
-
|
|
128
|
-
while (start !== undefined) {
|
|
129
|
-
V_cycle = [
|
|
130
|
-
EV[start.edge][mod(start.position + 1, 2)],
|
|
131
|
-
EV[start.edge][start.position]
|
|
132
|
-
];
|
|
133
|
-
E_cycle = [start.edge];
|
|
134
|
-
dir_E_cycle = [start.direction];
|
|
135
|
-
next = get_next_edge(incidences, start.edge, start.position, EV);
|
|
136
|
-
while (next.edge !== start.edge) {
|
|
137
|
-
V_cycle.push(next.vertex);
|
|
138
|
-
E_cycle.push(next.edge);
|
|
139
|
-
dir_E_cycle.push(next.direction);
|
|
140
|
-
color(ev_mapping, next.edge, next.direction);
|
|
141
|
-
next = get_next_edge(incidences, next.edge, next.position, EV);
|
|
142
|
-
}
|
|
143
|
-
E_cycles.push(E_cycle);
|
|
144
|
-
V_cycles.push(V_cycle);
|
|
145
|
-
dir_E_cycles.push(dir_E_cycle);
|
|
146
|
-
|
|
147
|
-
//console.log('############## CYCLE ', ++counter)
|
|
148
|
-
//console.log('EDGES:', E_cycle)
|
|
149
|
-
//console.log('VERTICES:', V_cycle)
|
|
150
|
-
//console.log('START', 'edge:', start.edge, 'position:', start.position)
|
|
151
|
-
//console.log('COUNTER:', ev_mapping.map(e => e.color), ev_mapping.map(e => e.color).reduce((a, b) => a + b));
|
|
152
|
-
//console.log('\n')
|
|
153
|
-
|
|
154
|
-
start = get_starting_edge(incidences, ev_mapping);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return {
|
|
158
|
-
v_cycles: V_cycles,
|
|
159
|
-
e_cycles: E_cycles,
|
|
160
|
-
dir_e_cycles: dir_E_cycles,
|
|
161
|
-
ev_mapping: ev_mapping
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function find_short_cycles_indexes(v_cycles, e_cycles) {
|
|
166
|
-
let indexes = [];
|
|
167
|
-
let e_cycle;
|
|
168
|
-
let v_cycle;
|
|
169
|
-
let i;
|
|
170
|
-
|
|
171
|
-
for (i = 0; i < e_cycles.length; i += 1) {
|
|
172
|
-
e_cycle = e_cycles[i];
|
|
173
|
-
v_cycle = v_cycles[i];
|
|
174
|
-
if (e_cycle.length < 3 || v_cycle[0] !== v_cycle[v_cycle.length - 1]) {
|
|
175
|
-
indexes.push(i);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return indexes;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function find_inner_cycles(V, EV) {
|
|
183
|
-
let cycles = find_cycles(V, EV);
|
|
184
|
-
let v_cycles = cycles.v_cycles;
|
|
185
|
-
let e_cycles = cycles.e_cycles;
|
|
186
|
-
let short_cycles_indexes = find_short_cycles_indexes(v_cycles, e_cycles);
|
|
187
|
-
short_cycles_indexes.forEach(indx => {
|
|
188
|
-
v_cycles.splice(indx, 1);
|
|
189
|
-
e_cycles.splice(indx, 1);
|
|
190
|
-
});
|
|
191
|
-
let dir_e_cycles = cycles.dir_e_cycles;
|
|
192
|
-
let rooms_values = cycles.e_cycles.map((cycle, i) =>
|
|
193
|
-
cycle.map(function (edge, j) {
|
|
194
|
-
let v1;
|
|
195
|
-
let v2;
|
|
196
|
-
|
|
197
|
-
let dir = dir_e_cycles[i][j] > 0;
|
|
198
|
-
|
|
199
|
-
if (dir > 0) {
|
|
200
|
-
v1 = EV[edge][0];
|
|
201
|
-
v2 = EV[edge][1];
|
|
202
|
-
} else {
|
|
203
|
-
v1 = EV[edge][1];
|
|
204
|
-
v2 = EV[edge][0];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return (V[v2][0] - V[v1][0]) * (V[v2][1] + V[v1][1]);
|
|
208
|
-
})
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
let rooms_sums = rooms_values.map(room => room.reduce((a, b) => a + b));
|
|
212
|
-
|
|
213
|
-
let positive_count = rooms_sums.filter(sum => sum > 0).length;
|
|
214
|
-
let negative_count = rooms_sums.length - positive_count;
|
|
215
|
-
|
|
216
|
-
let rm_neg = positive_count >= negative_count ? 1 : -1;
|
|
217
|
-
|
|
218
|
-
return {
|
|
219
|
-
v_cycles: cycles.v_cycles.filter((v, i) => rm_neg * rooms_sums[i] > 0),
|
|
220
|
-
e_cycles: cycles.e_cycles.filter((v, i) => rm_neg * rooms_sums[i] > 0),
|
|
221
|
-
ev_mapping: cycles.ev_mapping
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// export default find_inner_cycles;
|
|
226
|
-
module.exports = find_inner_cycles;
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* DATA
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
// let V = [[0.5774, 1.0], [1.0, 1.0], [1.1547, 0.0], [1.0, 0.0], [0.0, 0.0], [0.0, 0.732], [1.0, 0.1547], [0.732, 0.0], [1.0491, 0.183], [-0.317, 0.549], [1.0, 0.268], [0.183, -0.3169], [0.5491, 1.049], [0.4642, 1.0], [0.0, -0.4226], [0.0, 1.0]]
|
|
233
|
-
// let EV = [[0, 1], [2, 3], [5, 4], [7, 6], [2, 8], [3, 6], [4, 9], [0, 10], [9, 5], [8, 10], [7, 11], [12, 13], [6, 8], [6, 10], [4, 7], [4, 11], [4, 14], [5, 15], [11, 14], [0, 12], [13, 15], [0, 13], [1, 10], [3, 7], [5, 13]]
|
|
234
|
-
|
|
235
|
-
// let V = [[0,0],[10,0],[10,10],[0,10], [100,100],[110,100],[110,110],[100,110], [5,0], [5,10]]
|
|
236
|
-
// let V = [[0,0.5],[12,-0.7],[14,14],[-2,10], [103,106],[117,98],[96,112],[104,109], [5.5,0.8], [4.8,10.5]]
|
|
237
|
-
// let EV = [[3,9],[9,2],[2,1],[1,8],[8,0],[0,3],[8,9]] // IT WORKS
|
|
238
|
-
// let EV = [[3,9],[9,2],[2,1],[1,8],[8,0],[0,3],[8,9], [5,6], [6,7], [2,5]] // IT DOESN'T WORK
|
|
239
|
-
// let EV = [[3,2],[2,1],[1,0],[0,3]] // IT WORKS
|
|
240
|
-
// let EV = [[2,3],[1,2],[0,1],[3,0]] // IT WORKS
|
|
241
|
-
// let EV = [[2,3],[1,2],[0,1],[3,0],[6,7],[5,6],[4,5],[7,4]] // IT WORKS
|
|
242
|
-
// let EV = [[3,2],[2,1],[1,0],[0,3],[7,6],[6,5],[5,4],[4,7]] // IT WORKS
|
|
243
|
-
|
|
244
|
-
// let V = [[2,5],[5,6],[10,6.8],[23,8],[9.6,11.3],[20,15],[25,16],[29,18],[30,22],[4,11],[6,10],[24,25],[18,20],[27,7]]
|
|
245
|
-
// let EV = [[0,1],[10,0],[9,10],[9,1],[1,2],[4,2],[3,13],[2,3],[4,5],[5,6],[6,7],[12,5],[12,11],[11,6],[11,8],[7,8],[9,4]]
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* MAIN
|
|
249
|
-
*/
|
|
250
|
-
|
|
251
|
-
// let cycles_data = find_inner_cycles(V, EV)
|
|
252
|
-
// console.log('############## OUTPUT')
|
|
253
|
-
// console.log('EDGES:')
|
|
254
|
-
// console.log(cycles_data.e_cycles)
|
|
255
|
-
// console.log('\n')
|
|
256
|
-
// console.log('VERTICES:')
|
|
257
|
-
// console.log(cycles_data.v_cycles)
|
|
258
|
-
// console.log('\n')
|
|
259
|
-
// console.log(cycles_data.ev_mapping.every(m => m.color === 2))
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import Graph from './graph';
|
|
2
|
-
import getEdgesOfSubgraphs from './get-edges-of-subgraphs';
|
|
3
|
-
import graphCycles from './graph-cycles';
|
|
4
|
-
import { List } from 'immutable';
|
|
5
|
-
|
|
6
|
-
export function calculateInnerCycles(verticesArray, edgesArray) {
|
|
7
|
-
let innerCycles = new List();
|
|
8
|
-
|
|
9
|
-
let graph = new Graph(verticesArray.length);
|
|
10
|
-
edgesArray.forEach(line => {
|
|
11
|
-
graph.addEdge(line[0], line[1]);
|
|
12
|
-
graph.addEdge(line[1], line[0]);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
graph.BCC();
|
|
16
|
-
|
|
17
|
-
let subgraphs = graph.subgraphs.filter(subgraph => subgraph.length >= 3);
|
|
18
|
-
let edgesOfSubgraphsArray = getEdgesOfSubgraphs(subgraphs, graph);
|
|
19
|
-
|
|
20
|
-
let edges = [];
|
|
21
|
-
edgesOfSubgraphsArray.forEach(es => {
|
|
22
|
-
es.forEach(edge => edges.push(edge));
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
let cycles = graphCycles(verticesArray, edges);
|
|
26
|
-
cycles.v_cycles.forEach(cycle => {
|
|
27
|
-
cycle.shift();
|
|
28
|
-
innerCycles = innerCycles.push(cycle);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return innerCycles;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function isClockWiseOrder(innerCycleWithCoords) {
|
|
35
|
-
// See: https://stackoverflow.com/a/1165943 and http://blog.element84.com/polygon-winding.html
|
|
36
|
-
|
|
37
|
-
let i = 0;
|
|
38
|
-
let twiceEnclosedArea = 0;
|
|
39
|
-
let size = innerCycleWithCoords.size;
|
|
40
|
-
|
|
41
|
-
for (i = 0; i < size; i++) {
|
|
42
|
-
let { x: x1, y: y1 } = innerCycleWithCoords.get(i);
|
|
43
|
-
let { x: x2, y: y2 } = innerCycleWithCoords.get((i + 1) % size);
|
|
44
|
-
|
|
45
|
-
twiceEnclosedArea += (x2 - x1) * (y2 + y1);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return twiceEnclosedArea > 0;
|
|
49
|
-
}
|
package/src/utils/graph.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
//JS porting of this code http://www.geeksforgeeks.org/biconnected-components/
|
|
2
|
-
|
|
3
|
-
function create_array(length) {
|
|
4
|
-
let array = [];
|
|
5
|
-
for (let i = 0; i < length; ++i) {
|
|
6
|
-
array.push([]);
|
|
7
|
-
}
|
|
8
|
-
return array;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
class Edge {
|
|
12
|
-
constructor(u, v) {
|
|
13
|
-
this.u = u;
|
|
14
|
-
this.v = v;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
class Graph {
|
|
19
|
-
constructor(v) {
|
|
20
|
-
this.count = 0; // count is number of biconnected components
|
|
21
|
-
this.subgraphs = []; //biconnected components
|
|
22
|
-
this.time = 0; // time is used to find discovery times
|
|
23
|
-
|
|
24
|
-
this.V = v; // No. of vertices
|
|
25
|
-
this.E = 0; // No. of Edges
|
|
26
|
-
this.adj = []; // Adjacency List
|
|
27
|
-
|
|
28
|
-
this.adj = create_array(v);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//Function to add an edge into the graph
|
|
32
|
-
addEdge(v, w) {
|
|
33
|
-
this.adj[v].push(w);
|
|
34
|
-
this.E++;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// A recursive function that finds and prints strongly connected
|
|
38
|
-
// components using DFS traversal
|
|
39
|
-
// u --> The vertex to be visited next
|
|
40
|
-
// disc[] --> Stores discovery times of visited vertices
|
|
41
|
-
// low[] -- >> earliest visited vertex (the vertex with minimum
|
|
42
|
-
// discovery time) that can be reached from subtree
|
|
43
|
-
// rooted with current vertex
|
|
44
|
-
// *st -- >> To store visited edges
|
|
45
|
-
// // A recursive function that finds and prints strongly connected
|
|
46
|
-
// components using DFS traversal
|
|
47
|
-
// u --> The vertex to be visited next
|
|
48
|
-
// disc[] --> Stores discovery times of visited vertices
|
|
49
|
-
// low[] -- >> earliest visited vertex (the vertex with minimum
|
|
50
|
-
// discovery time) that can be reached from subtree
|
|
51
|
-
// rooted with current vertex
|
|
52
|
-
// *st -- >> To store visited edges
|
|
53
|
-
_BCCUtil(u, disc, low, st, parent) {
|
|
54
|
-
// Initialize discovery time and low value
|
|
55
|
-
disc[u] = low[u] = ++this.time;
|
|
56
|
-
this.children = 0;
|
|
57
|
-
|
|
58
|
-
// Go through all vertices adjacent to this
|
|
59
|
-
// v is current adjacent of 'u'
|
|
60
|
-
this.adj[u].forEach(v => {
|
|
61
|
-
// If v is not visited yet, then recur for it
|
|
62
|
-
if (disc[v] == -1) {
|
|
63
|
-
this.children++;
|
|
64
|
-
parent[v] = u;
|
|
65
|
-
|
|
66
|
-
// store the edge in stack
|
|
67
|
-
st.push(new Edge(u, v));
|
|
68
|
-
this._BCCUtil(v, disc, low, st, parent);
|
|
69
|
-
|
|
70
|
-
// Check if the subtree rooted with 'v' has a
|
|
71
|
-
// connection to one of the ancestors of 'u'
|
|
72
|
-
// Case 1 -- per Strongly Connected Components Article
|
|
73
|
-
if (low[u] > low[v]) low[u] = low[v];
|
|
74
|
-
|
|
75
|
-
// If u is an articulation point,
|
|
76
|
-
// pop all edges from stack till u -- v
|
|
77
|
-
if (
|
|
78
|
-
(disc[u] == 1 && this.children > 1) ||
|
|
79
|
-
(disc[u] > 1 && low[v] >= disc[u])
|
|
80
|
-
) {
|
|
81
|
-
let subgraph = [];
|
|
82
|
-
while (st[st.length - 1].u != u || st[st.length - 1].v != v) {
|
|
83
|
-
subgraph.push(st[st.length - 1]);
|
|
84
|
-
//console.log(st[st.length - 1].u + "--" + st[st.length - 1].v + " ");
|
|
85
|
-
st.splice(st.length - 1, 1);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
subgraph.push(st[st.length - 1]);
|
|
89
|
-
//console.log(st[st.length - 1].u + "--" + st[st.length - 1].v + " ");
|
|
90
|
-
this.subgraphs.push(subgraph);
|
|
91
|
-
subgraph = [];
|
|
92
|
-
//console.log()
|
|
93
|
-
st.splice(st.length - 1, 1);
|
|
94
|
-
|
|
95
|
-
this.count++;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Update low value of 'u' only of 'v' is still in stack
|
|
100
|
-
// (i.e. it's a back edge, not cross edge).
|
|
101
|
-
// Case 2 -- per Strongly Connected Components Article
|
|
102
|
-
else if (v != parent[u] && disc[v] < low[u]) {
|
|
103
|
-
if (low[u] > disc[v]) low[u] = disc[v];
|
|
104
|
-
st.push(new Edge(u, v));
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
BCC() {
|
|
110
|
-
let V = this.V;
|
|
111
|
-
let disc = create_array(V);
|
|
112
|
-
let low = create_array(V);
|
|
113
|
-
let parent = create_array(V);
|
|
114
|
-
let st = [];
|
|
115
|
-
|
|
116
|
-
// Initialize disc and low, and parent arrays
|
|
117
|
-
for (let i = 0; i < V; i++) {
|
|
118
|
-
disc[i] = -1;
|
|
119
|
-
low[i] = -1;
|
|
120
|
-
parent[i] = -1;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
for (let i = 0; i < V; i++) {
|
|
124
|
-
if (disc[i] == -1) this._BCCUtil(i, disc, low, st, parent);
|
|
125
|
-
|
|
126
|
-
let j = 0;
|
|
127
|
-
|
|
128
|
-
// If stack is not empty, pop all edges from stack
|
|
129
|
-
let subgraph = [];
|
|
130
|
-
while (st.length > 0) {
|
|
131
|
-
j = 1;
|
|
132
|
-
subgraph.push(st[st.length - 1]);
|
|
133
|
-
//console.log(st[st.length - 1].u + "--" + st[st.length - 1].v + " ");
|
|
134
|
-
st.splice(st.length - 1, 1);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (j == 1) {
|
|
138
|
-
this.subgraphs.push(subgraph);
|
|
139
|
-
subgraph = [];
|
|
140
|
-
//console.log();
|
|
141
|
-
this.count++;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
module.exports = Graph;
|