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,945 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author qiao / https://github.com/qiao
|
|
3
|
-
* @author mrdoob / http://mrdoob.com
|
|
4
|
-
* @author alteredq / http://alteredqualia.com/
|
|
5
|
-
* @author WestLangley / http://github.com/WestLangley
|
|
6
|
-
* @author erich666 / http://erichaines.com
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// This set of controls performs orbiting, dollying (zooming), and panning.
|
|
10
|
-
// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
|
|
11
|
-
//
|
|
12
|
-
// Orbit - left mouse / touch: one finger move
|
|
13
|
-
// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish
|
|
14
|
-
// Pan - right mouse, or arrow keys / touch: three finter swipe
|
|
15
|
-
|
|
16
|
-
let THREE = window.THREE || require('three');
|
|
17
|
-
let OrbitControls;
|
|
18
|
-
|
|
19
|
-
module.exports = OrbitControls = function (object, domElement) {
|
|
20
|
-
this.object = object;
|
|
21
|
-
|
|
22
|
-
this.domElement = domElement !== undefined ? domElement : document;
|
|
23
|
-
|
|
24
|
-
// Set to false to disable this control
|
|
25
|
-
this.enabled = true;
|
|
26
|
-
|
|
27
|
-
// "target" sets the location of focus, where the object orbits around
|
|
28
|
-
this.target = new THREE.Vector3();
|
|
29
|
-
|
|
30
|
-
// How far you can dolly in and out ( PerspectiveCamera only )
|
|
31
|
-
this.minDistance = 0;
|
|
32
|
-
this.maxDistance = Infinity;
|
|
33
|
-
|
|
34
|
-
// How far you can zoom in and out ( OrthographicCamera only )
|
|
35
|
-
this.minZoom = 0;
|
|
36
|
-
this.maxZoom = Infinity;
|
|
37
|
-
|
|
38
|
-
// How far you can orbit vertically, upper and lower limits.
|
|
39
|
-
// Range is 0 to Math.PI radians.
|
|
40
|
-
this.minPolarAngle = 0; // radians
|
|
41
|
-
this.maxPolarAngle = Math.PI; // radians
|
|
42
|
-
|
|
43
|
-
// How far you can orbit horizontally, upper and lower limits.
|
|
44
|
-
// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].
|
|
45
|
-
this.minAzimuthAngle = -Infinity; // radians
|
|
46
|
-
this.maxAzimuthAngle = Infinity; // radians
|
|
47
|
-
|
|
48
|
-
// Set to true to enable damping (inertia)
|
|
49
|
-
// If damping is enabled, you must call controls.update() in your animation loop
|
|
50
|
-
this.enableDamping = false;
|
|
51
|
-
this.dampingFactor = 0.25;
|
|
52
|
-
|
|
53
|
-
// This option actually enables dollying in and out; left as "zoom" for backwards compatibility.
|
|
54
|
-
// Set to false to disable zooming
|
|
55
|
-
this.enableZoom = true;
|
|
56
|
-
this.zoomSpeed = 1.0;
|
|
57
|
-
|
|
58
|
-
// Set to false to disable rotating
|
|
59
|
-
this.enableRotate = true;
|
|
60
|
-
this.rotateSpeed = 1.0;
|
|
61
|
-
|
|
62
|
-
// Set to false to disable panning
|
|
63
|
-
this.enablePan = true;
|
|
64
|
-
this.keyPanSpeed = 7.0; // pixels moved per arrow key push
|
|
65
|
-
|
|
66
|
-
// Set to true to automatically rotate around the target
|
|
67
|
-
// If auto-rotate is enabled, you must call controls.update() in your animation loop
|
|
68
|
-
this.autoRotate = false;
|
|
69
|
-
this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60
|
|
70
|
-
|
|
71
|
-
// Set to false to disable use of the keys
|
|
72
|
-
this.enableKeys = true;
|
|
73
|
-
|
|
74
|
-
// The four arrow keys
|
|
75
|
-
this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };
|
|
76
|
-
|
|
77
|
-
// Mouse buttons
|
|
78
|
-
this.mouseButtons = {
|
|
79
|
-
ORBIT: THREE.MOUSE.LEFT,
|
|
80
|
-
ZOOM: THREE.MOUSE.MIDDLE,
|
|
81
|
-
PAN: THREE.MOUSE.RIGHT,
|
|
82
|
-
TILT: THREE.MOUSE.LEFT
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// for reset
|
|
86
|
-
this.target0 = this.target.clone();
|
|
87
|
-
this.position0 = this.object.position.clone();
|
|
88
|
-
this.zoom0 = this.object.zoom;
|
|
89
|
-
|
|
90
|
-
//
|
|
91
|
-
// public methods
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
this.getPolarAngle = function () {
|
|
95
|
-
return spherical.phi;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
this.getAzimuthalAngle = function () {
|
|
99
|
-
return spherical.theta;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
this.reset = function () {
|
|
103
|
-
scope.target.copy(scope.target0);
|
|
104
|
-
scope.object.position.copy(scope.position0);
|
|
105
|
-
scope.object.zoom = scope.zoom0;
|
|
106
|
-
|
|
107
|
-
scope.object.updateProjectionMatrix();
|
|
108
|
-
scope.dispatchEvent(changeEvent);
|
|
109
|
-
|
|
110
|
-
scope.update();
|
|
111
|
-
|
|
112
|
-
state = STATE.NONE;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// this method is exposed, but perhaps it would be better if we can make it private...
|
|
116
|
-
this.update = (function () {
|
|
117
|
-
let offset = new THREE.Vector3();
|
|
118
|
-
|
|
119
|
-
// so camera.up is the orbit axis
|
|
120
|
-
let quat = new THREE.Quaternion().setFromUnitVectors(
|
|
121
|
-
object.up,
|
|
122
|
-
new THREE.Vector3(0, 1, 0)
|
|
123
|
-
);
|
|
124
|
-
let quatInverse = quat.clone().inverse();
|
|
125
|
-
|
|
126
|
-
let lastPosition = new THREE.Vector3();
|
|
127
|
-
let lastQuaternion = new THREE.Quaternion();
|
|
128
|
-
|
|
129
|
-
return function update() {
|
|
130
|
-
let position = scope.object.position;
|
|
131
|
-
|
|
132
|
-
offset.copy(position).sub(scope.target);
|
|
133
|
-
|
|
134
|
-
// rotate offset to "y-axis-is-up" space
|
|
135
|
-
offset.applyQuaternion(quat);
|
|
136
|
-
|
|
137
|
-
// angle from z-axis around y-axis
|
|
138
|
-
spherical.setFromVector3(offset);
|
|
139
|
-
|
|
140
|
-
if (scope.autoRotate && state === STATE.NONE) {
|
|
141
|
-
rotateLeft(getAutoRotationAngle());
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
spherical.theta += sphericalDelta.theta;
|
|
145
|
-
spherical.phi += sphericalDelta.phi;
|
|
146
|
-
|
|
147
|
-
// restrict theta to be between desired limits
|
|
148
|
-
spherical.theta = Math.max(
|
|
149
|
-
scope.minAzimuthAngle,
|
|
150
|
-
Math.min(scope.maxAzimuthAngle, spherical.theta)
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
// restrict phi to be between desired limits
|
|
154
|
-
spherical.phi = Math.max(
|
|
155
|
-
scope.minPolarAngle,
|
|
156
|
-
Math.min(scope.maxPolarAngle, spherical.phi)
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
spherical.makeSafe();
|
|
160
|
-
|
|
161
|
-
spherical.radius *= scale;
|
|
162
|
-
|
|
163
|
-
// restrict radius to be between desired limits
|
|
164
|
-
spherical.radius = Math.max(
|
|
165
|
-
scope.minDistance,
|
|
166
|
-
Math.min(scope.maxDistance, spherical.radius)
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
// move target to panned location
|
|
170
|
-
scope.target.add(panOffset);
|
|
171
|
-
scope.target.add(
|
|
172
|
-
new THREE.Vector3(
|
|
173
|
-
offset.x * -(1 - scale),
|
|
174
|
-
offset.y * -(1 - scale),
|
|
175
|
-
offset.z * -(1 - scale)
|
|
176
|
-
)
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
offset.setFromSpherical(spherical);
|
|
180
|
-
|
|
181
|
-
// rotate offset back to "camera-up-vector-is-up" space
|
|
182
|
-
offset.applyQuaternion(quatInverse);
|
|
183
|
-
|
|
184
|
-
position.copy(scope.target).add(offset);
|
|
185
|
-
|
|
186
|
-
scope.object.lookAt(scope.target);
|
|
187
|
-
scope.object.rotateZ(tiltAngle);
|
|
188
|
-
|
|
189
|
-
if (scope.enableDamping === true) {
|
|
190
|
-
sphericalDelta.theta *= 1 - scope.dampingFactor;
|
|
191
|
-
sphericalDelta.phi *= 1 - scope.dampingFactor;
|
|
192
|
-
} else {
|
|
193
|
-
sphericalDelta.set(0, 0, 0);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
scale = 1;
|
|
197
|
-
panOffset.set(0, 0, 0);
|
|
198
|
-
|
|
199
|
-
// update condition is:
|
|
200
|
-
// min(camera displacement, camera rotation in radians)^2 > EPS
|
|
201
|
-
// using small-angle approximation cos(x/2) = 1 - x^2 / 8
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
zoomChanged ||
|
|
205
|
-
lastPosition.distanceToSquared(scope.object.position) > EPS ||
|
|
206
|
-
8 * (1 - lastQuaternion.dot(scope.object.quaternion)) > EPS
|
|
207
|
-
) {
|
|
208
|
-
scope.dispatchEvent(changeEvent);
|
|
209
|
-
|
|
210
|
-
lastPosition.copy(scope.object.position);
|
|
211
|
-
lastQuaternion.copy(scope.object.quaternion);
|
|
212
|
-
zoomChanged = false;
|
|
213
|
-
|
|
214
|
-
return true;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return false;
|
|
218
|
-
};
|
|
219
|
-
})();
|
|
220
|
-
|
|
221
|
-
this.dispose = function () {
|
|
222
|
-
scope.domElement.removeEventListener('contextmenu', onContextMenu, false);
|
|
223
|
-
scope.domElement.removeEventListener('mousedown', onMouseDown, false);
|
|
224
|
-
scope.domElement.removeEventListener('wheel', onMouseWheel, false);
|
|
225
|
-
|
|
226
|
-
scope.domElement.removeEventListener('touchstart', onTouchStart, false);
|
|
227
|
-
scope.domElement.removeEventListener('touchend', onTouchEnd, false);
|
|
228
|
-
scope.domElement.removeEventListener('touchmove', onTouchMove, false);
|
|
229
|
-
|
|
230
|
-
document.removeEventListener('mousemove', onMouseMove, false);
|
|
231
|
-
document.removeEventListener('mouseup', onMouseUp, false);
|
|
232
|
-
|
|
233
|
-
window.removeEventListener('keydown', onKeyDown, false);
|
|
234
|
-
|
|
235
|
-
//scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
//
|
|
239
|
-
// internals
|
|
240
|
-
//
|
|
241
|
-
|
|
242
|
-
let scope = this;
|
|
243
|
-
|
|
244
|
-
let changeEvent = { type: 'change' };
|
|
245
|
-
let startEvent = { type: 'start' };
|
|
246
|
-
let endEvent = { type: 'end' };
|
|
247
|
-
|
|
248
|
-
let STATE = {
|
|
249
|
-
NONE: -1,
|
|
250
|
-
ROTATE: 0,
|
|
251
|
-
DOLLY: 1,
|
|
252
|
-
PAN: 2,
|
|
253
|
-
TOUCH_ROTATE: 3,
|
|
254
|
-
TOUCH_DOLLY: 4,
|
|
255
|
-
TOUCH_PAN: 5,
|
|
256
|
-
TILT: 6
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
let state = STATE.NONE;
|
|
260
|
-
|
|
261
|
-
let EPS = 0.000001;
|
|
262
|
-
|
|
263
|
-
// current position in spherical coordinates
|
|
264
|
-
let spherical = new THREE.Spherical();
|
|
265
|
-
let sphericalDelta = new THREE.Spherical();
|
|
266
|
-
|
|
267
|
-
let scale = 1;
|
|
268
|
-
let panOffset = new THREE.Vector3();
|
|
269
|
-
let zoomChanged = false;
|
|
270
|
-
let tiltAngle = 0;
|
|
271
|
-
let originTilt = 0;
|
|
272
|
-
let tiltStartAngle = 0;
|
|
273
|
-
let centerX = this.domElement.clientWidth / 2;
|
|
274
|
-
let centerY = this.domElement.clientHeight / 2;
|
|
275
|
-
|
|
276
|
-
let rotateStart = new THREE.Vector2();
|
|
277
|
-
let rotateEnd = new THREE.Vector2();
|
|
278
|
-
let rotateDelta = new THREE.Vector2();
|
|
279
|
-
|
|
280
|
-
let panStart = new THREE.Vector2();
|
|
281
|
-
let panEnd = new THREE.Vector2();
|
|
282
|
-
let panDelta = new THREE.Vector2();
|
|
283
|
-
|
|
284
|
-
let dollyStart = new THREE.Vector2();
|
|
285
|
-
let dollyEnd = new THREE.Vector2();
|
|
286
|
-
let dollyDelta = new THREE.Vector2();
|
|
287
|
-
|
|
288
|
-
let tiltStart = new THREE.Vector2();
|
|
289
|
-
let tiltEnd = new THREE.Vector2();
|
|
290
|
-
let tiltDelta = new THREE.Vector2();
|
|
291
|
-
|
|
292
|
-
function getAutoRotationAngle() {
|
|
293
|
-
return ((2 * Math.PI) / 60 / 60) * scope.autoRotateSpeed;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
function getZoomScale() {
|
|
297
|
-
return Math.pow(0.95, scope.zoomSpeed);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
function rotateLeft(angle) {
|
|
301
|
-
sphericalDelta.theta -= angle;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
function rotateUp(angle) {
|
|
305
|
-
sphericalDelta.phi -= angle;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
let panLeft = (function () {
|
|
309
|
-
let v = new THREE.Vector3();
|
|
310
|
-
|
|
311
|
-
return function panLeft(distance, objectMatrix) {
|
|
312
|
-
v.setFromMatrixColumn(objectMatrix, 0); // get X column of objectMatrix
|
|
313
|
-
v.multiplyScalar(-distance);
|
|
314
|
-
|
|
315
|
-
panOffset.add(v);
|
|
316
|
-
};
|
|
317
|
-
})();
|
|
318
|
-
|
|
319
|
-
let panUp = (function () {
|
|
320
|
-
let v = new THREE.Vector3();
|
|
321
|
-
|
|
322
|
-
return function panUp(distance, objectMatrix) {
|
|
323
|
-
v.setFromMatrixColumn(objectMatrix, 1); // get Y column of objectMatrix
|
|
324
|
-
v.multiplyScalar(distance);
|
|
325
|
-
|
|
326
|
-
panOffset.add(v);
|
|
327
|
-
};
|
|
328
|
-
})();
|
|
329
|
-
|
|
330
|
-
// deltaX and deltaY are in pixels; right and down are positive
|
|
331
|
-
let pan = (function () {
|
|
332
|
-
let offset = new THREE.Vector3();
|
|
333
|
-
|
|
334
|
-
return function pan(deltaX, deltaY) {
|
|
335
|
-
let element =
|
|
336
|
-
scope.domElement === document
|
|
337
|
-
? scope.domElement.body
|
|
338
|
-
: scope.domElement;
|
|
339
|
-
|
|
340
|
-
if (scope.object instanceof THREE.PerspectiveCamera) {
|
|
341
|
-
// perspective
|
|
342
|
-
let position = scope.object.position;
|
|
343
|
-
offset.copy(position).sub(scope.target);
|
|
344
|
-
let targetDistance = offset.length();
|
|
345
|
-
// half of the fov is center to top of screen
|
|
346
|
-
targetDistance *= Math.tan(((scope.object.fov / 2) * Math.PI) / 180.0);
|
|
347
|
-
|
|
348
|
-
// we actually don't use screenWidth, since perspective camera is fixed to screen height
|
|
349
|
-
panLeft(
|
|
350
|
-
(2 * deltaX * targetDistance) / element.clientHeight,
|
|
351
|
-
scope.object.matrix
|
|
352
|
-
);
|
|
353
|
-
panUp(
|
|
354
|
-
(2 * deltaY * targetDistance) / element.clientHeight,
|
|
355
|
-
scope.object.matrix
|
|
356
|
-
);
|
|
357
|
-
} else if (scope.object instanceof THREE.OrthographicCamera) {
|
|
358
|
-
// orthographic
|
|
359
|
-
panLeft(
|
|
360
|
-
(deltaX * (scope.object.right - scope.object.left)) /
|
|
361
|
-
scope.object.zoom /
|
|
362
|
-
element.clientWidth,
|
|
363
|
-
scope.object.matrix
|
|
364
|
-
);
|
|
365
|
-
panUp(
|
|
366
|
-
(deltaY * (scope.object.top - scope.object.bottom)) /
|
|
367
|
-
scope.object.zoom /
|
|
368
|
-
element.clientHeight,
|
|
369
|
-
scope.object.matrix
|
|
370
|
-
);
|
|
371
|
-
} else {
|
|
372
|
-
// camera neither orthographic nor perspective
|
|
373
|
-
console.warn(
|
|
374
|
-
'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.'
|
|
375
|
-
);
|
|
376
|
-
scope.enablePan = false;
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
})();
|
|
380
|
-
|
|
381
|
-
let tilt = (function () {
|
|
382
|
-
return function tilt(deltaX, deltaY) {
|
|
383
|
-
let Vec = new THREE.Vector2(deltaX, deltaY);
|
|
384
|
-
tiltAngle = originTilt + (Vec.angle() - tiltStartAngle);
|
|
385
|
-
};
|
|
386
|
-
})();
|
|
387
|
-
|
|
388
|
-
function dollyIn(dollyScale) {
|
|
389
|
-
if (scope.object instanceof THREE.PerspectiveCamera) {
|
|
390
|
-
scale /= dollyScale;
|
|
391
|
-
} else if (scope.object instanceof THREE.OrthographicCamera) {
|
|
392
|
-
scope.object.zoom = Math.max(
|
|
393
|
-
scope.minZoom,
|
|
394
|
-
Math.min(scope.maxZoom, scope.object.zoom * dollyScale)
|
|
395
|
-
);
|
|
396
|
-
scope.object.updateProjectionMatrix();
|
|
397
|
-
zoomChanged = true;
|
|
398
|
-
} else {
|
|
399
|
-
console.warn(
|
|
400
|
-
'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.'
|
|
401
|
-
);
|
|
402
|
-
scope.enableZoom = false;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
function dollyOut(dollyScale) {
|
|
407
|
-
if (scope.object instanceof THREE.PerspectiveCamera) {
|
|
408
|
-
scale *= dollyScale;
|
|
409
|
-
} else if (scope.object instanceof THREE.OrthographicCamera) {
|
|
410
|
-
scope.object.zoom = Math.max(
|
|
411
|
-
scope.minZoom,
|
|
412
|
-
Math.min(scope.maxZoom, scope.object.zoom / dollyScale)
|
|
413
|
-
);
|
|
414
|
-
scope.object.updateProjectionMatrix();
|
|
415
|
-
zoomChanged = true;
|
|
416
|
-
} else {
|
|
417
|
-
console.warn(
|
|
418
|
-
'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.'
|
|
419
|
-
);
|
|
420
|
-
scope.enableZoom = false;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
//
|
|
425
|
-
// event callbacks - update the object state
|
|
426
|
-
//
|
|
427
|
-
|
|
428
|
-
function handleMouseDownRotate(event) {
|
|
429
|
-
rotateStart.set(event.clientX, event.clientY);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
function handleMouseDownDolly(event) {
|
|
433
|
-
dollyStart.set(event.clientX, event.clientY);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
function handleMouseDownPan(event) {
|
|
437
|
-
panStart.set(event.clientX, event.clientY);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
function handleMouseDownTilt(event) {
|
|
441
|
-
tiltStart.set(event.clientX, event.clientY);
|
|
442
|
-
originTilt = tiltAngle;
|
|
443
|
-
let StartVec = new THREE.Vector2(
|
|
444
|
-
event.clientX - centerX,
|
|
445
|
-
event.clientY - centerY
|
|
446
|
-
);
|
|
447
|
-
tiltStartAngle = StartVec.angle();
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
function handleMouseMoveRotate(event) {
|
|
451
|
-
rotateEnd.set(event.clientX, event.clientY);
|
|
452
|
-
rotateDelta.subVectors(rotateEnd, rotateStart);
|
|
453
|
-
|
|
454
|
-
let element =
|
|
455
|
-
scope.domElement === document ? scope.domElement.body : scope.domElement;
|
|
456
|
-
|
|
457
|
-
// rotating across whole screen goes 360 degrees around
|
|
458
|
-
rotateLeft(
|
|
459
|
-
((2 * Math.PI * rotateDelta.x) / element.clientWidth) * scope.rotateSpeed
|
|
460
|
-
);
|
|
461
|
-
|
|
462
|
-
// rotating up and down along whole screen attempts to go 360, but limited to 180
|
|
463
|
-
rotateUp(
|
|
464
|
-
((2 * Math.PI * rotateDelta.y) / element.clientHeight) * scope.rotateSpeed
|
|
465
|
-
);
|
|
466
|
-
|
|
467
|
-
rotateStart.copy(rotateEnd);
|
|
468
|
-
|
|
469
|
-
scope.update();
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
function handleMouseMoveDolly(event) {
|
|
473
|
-
dollyEnd.set(event.clientX, event.clientY);
|
|
474
|
-
|
|
475
|
-
dollyDelta.subVectors(dollyEnd, dollyStart);
|
|
476
|
-
|
|
477
|
-
if (dollyDelta.y > 0) {
|
|
478
|
-
dollyIn(getZoomScale());
|
|
479
|
-
} else if (dollyDelta.y < 0) {
|
|
480
|
-
dollyOut(getZoomScale());
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
dollyStart.copy(dollyEnd);
|
|
484
|
-
|
|
485
|
-
scope.update();
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
function handleMouseMovePan(event) {
|
|
489
|
-
panEnd.set(event.clientX, event.clientY);
|
|
490
|
-
|
|
491
|
-
panDelta.subVectors(panEnd, panStart);
|
|
492
|
-
|
|
493
|
-
pan(panDelta.x, panDelta.y);
|
|
494
|
-
|
|
495
|
-
panStart.copy(panEnd);
|
|
496
|
-
|
|
497
|
-
scope.update();
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
function handleMouseMoveTilt(event) {
|
|
501
|
-
tiltEnd.set(event.clientX, event.clientY);
|
|
502
|
-
|
|
503
|
-
tiltDelta.subVectors(tiltEnd, tiltStart);
|
|
504
|
-
|
|
505
|
-
tilt(event.clientX - centerX, event.clientY - centerY);
|
|
506
|
-
|
|
507
|
-
// tiltStart.copy(tiltEnd);
|
|
508
|
-
|
|
509
|
-
scope.update();
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
function handleMouseUp(event) {}
|
|
513
|
-
|
|
514
|
-
function handleMouseWheel(event) {
|
|
515
|
-
if (event.deltaY < 0) {
|
|
516
|
-
dollyOut(getZoomScale());
|
|
517
|
-
} else if (event.deltaY > 0) {
|
|
518
|
-
dollyIn(getZoomScale());
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
scope.update();
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
function handleKeyDown(event) {
|
|
525
|
-
console.log(event);
|
|
526
|
-
switch (event.keyCode) {
|
|
527
|
-
case scope.keys.UP:
|
|
528
|
-
pan(0, scope.keyPanSpeed);
|
|
529
|
-
scope.update();
|
|
530
|
-
break;
|
|
531
|
-
|
|
532
|
-
case scope.keys.BOTTOM:
|
|
533
|
-
pan(0, -scope.keyPanSpeed);
|
|
534
|
-
scope.update();
|
|
535
|
-
break;
|
|
536
|
-
|
|
537
|
-
case scope.keys.LEFT:
|
|
538
|
-
pan(scope.keyPanSpeed, 0);
|
|
539
|
-
scope.update();
|
|
540
|
-
break;
|
|
541
|
-
|
|
542
|
-
case scope.keys.RIGHT:
|
|
543
|
-
pan(-scope.keyPanSpeed, 0);
|
|
544
|
-
scope.update();
|
|
545
|
-
break;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
function handleTouchStartRotate(event) {
|
|
550
|
-
rotateStart.set(event.touches[0].pageX, event.touches[0].pageY);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
function handleTouchStartDolly(event) {
|
|
554
|
-
let dx = event.touches[0].pageX - event.touches[1].pageX;
|
|
555
|
-
let dy = event.touches[0].pageY - event.touches[1].pageY;
|
|
556
|
-
|
|
557
|
-
let distance = Math.sqrt(dx * dx + dy * dy);
|
|
558
|
-
|
|
559
|
-
dollyStart.set(0, distance);
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
function handleTouchStartPan(event) {
|
|
563
|
-
panStart.set(event.touches[0].pageX, event.touches[0].pageY);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
function handleTouchMoveRotate(event) {
|
|
567
|
-
rotateEnd.set(event.touches[0].pageX, event.touches[0].pageY);
|
|
568
|
-
rotateDelta.subVectors(rotateEnd, rotateStart);
|
|
569
|
-
|
|
570
|
-
let element =
|
|
571
|
-
scope.domElement === document ? scope.domElement.body : scope.domElement;
|
|
572
|
-
|
|
573
|
-
// rotating across whole screen goes 360 degrees around
|
|
574
|
-
rotateLeft(
|
|
575
|
-
((2 * Math.PI * rotateDelta.x) / element.clientWidth) * scope.rotateSpeed
|
|
576
|
-
);
|
|
577
|
-
|
|
578
|
-
// rotating up and down along whole screen attempts to go 360, but limited to 180
|
|
579
|
-
rotateUp(
|
|
580
|
-
((2 * Math.PI * rotateDelta.y) / element.clientHeight) * scope.rotateSpeed
|
|
581
|
-
);
|
|
582
|
-
|
|
583
|
-
rotateStart.copy(rotateEnd);
|
|
584
|
-
|
|
585
|
-
scope.update();
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
function handleTouchMoveDolly(event) {
|
|
589
|
-
let dx = event.touches[0].pageX - event.touches[1].pageX;
|
|
590
|
-
let dy = event.touches[0].pageY - event.touches[1].pageY;
|
|
591
|
-
|
|
592
|
-
let distance = Math.sqrt(dx * dx + dy * dy);
|
|
593
|
-
|
|
594
|
-
dollyEnd.set(0, distance);
|
|
595
|
-
|
|
596
|
-
dollyDelta.subVectors(dollyEnd, dollyStart);
|
|
597
|
-
|
|
598
|
-
if (dollyDelta.y > 0) {
|
|
599
|
-
dollyOut(getZoomScale());
|
|
600
|
-
} else if (dollyDelta.y < 0) {
|
|
601
|
-
dollyIn(getZoomScale());
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
dollyStart.copy(dollyEnd);
|
|
605
|
-
|
|
606
|
-
scope.update();
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
function handleTouchMovePan(event) {
|
|
610
|
-
panEnd.set(event.touches[0].pageX, event.touches[0].pageY);
|
|
611
|
-
|
|
612
|
-
panDelta.subVectors(panEnd, panStart);
|
|
613
|
-
|
|
614
|
-
pan(panDelta.x, panDelta.y);
|
|
615
|
-
|
|
616
|
-
panStart.copy(panEnd);
|
|
617
|
-
|
|
618
|
-
scope.update();
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
function handleTouchEnd(event) {}
|
|
622
|
-
|
|
623
|
-
//
|
|
624
|
-
// event handlers - FSM: listen for events and reset state
|
|
625
|
-
//
|
|
626
|
-
|
|
627
|
-
function onMouseDown(event) {
|
|
628
|
-
if (scope.enabled === false) return;
|
|
629
|
-
|
|
630
|
-
event.preventDefault();
|
|
631
|
-
|
|
632
|
-
if (event.button === scope.mouseButtons.ORBIT) {
|
|
633
|
-
if (scope.enableRotate === false) return;
|
|
634
|
-
if (!event.ctrlKey) {
|
|
635
|
-
handleMouseDownRotate(event);
|
|
636
|
-
|
|
637
|
-
state = STATE.ROTATE;
|
|
638
|
-
} else {
|
|
639
|
-
state = STATE.TILT;
|
|
640
|
-
handleMouseDownTilt(event);
|
|
641
|
-
}
|
|
642
|
-
} else if (event.button === scope.mouseButtons.ZOOM) {
|
|
643
|
-
if (scope.enableZoom === false) return;
|
|
644
|
-
|
|
645
|
-
handleMouseDownDolly(event);
|
|
646
|
-
|
|
647
|
-
state = STATE.DOLLY;
|
|
648
|
-
} else if (event.button === scope.mouseButtons.PAN) {
|
|
649
|
-
if (scope.enablePan === false) return;
|
|
650
|
-
|
|
651
|
-
handleMouseDownPan(event);
|
|
652
|
-
|
|
653
|
-
state = STATE.PAN;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
if (state !== STATE.NONE) {
|
|
657
|
-
document.addEventListener('mousemove', onMouseMove, false);
|
|
658
|
-
document.addEventListener('mouseup', onMouseUp, false);
|
|
659
|
-
scope.dispatchEvent(startEvent);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
function onMouseMove(event) {
|
|
664
|
-
if (scope.enabled === false) return;
|
|
665
|
-
|
|
666
|
-
if (state === STATE.ROTATE) {
|
|
667
|
-
if (scope.enableRotate === false) return;
|
|
668
|
-
|
|
669
|
-
handleMouseMoveRotate(event);
|
|
670
|
-
} else if (state === STATE.DOLLY) {
|
|
671
|
-
if (scope.enableZoom === false) return;
|
|
672
|
-
|
|
673
|
-
handleMouseMoveDolly(event);
|
|
674
|
-
} else if (state === STATE.PAN) {
|
|
675
|
-
if (scope.enablePan === false) return;
|
|
676
|
-
|
|
677
|
-
handleMouseMovePan(event);
|
|
678
|
-
} else if (state === STATE.TILT) {
|
|
679
|
-
handleMouseMoveTilt(event);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
function onMouseUp(event) {
|
|
684
|
-
if (scope.enabled === false) return;
|
|
685
|
-
|
|
686
|
-
handleMouseUp(event);
|
|
687
|
-
|
|
688
|
-
document.removeEventListener('mousemove', onMouseMove, false);
|
|
689
|
-
document.removeEventListener('mouseup', onMouseUp, false);
|
|
690
|
-
|
|
691
|
-
scope.dispatchEvent(endEvent);
|
|
692
|
-
|
|
693
|
-
state = STATE.NONE;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
function onMouseWheel(event) {
|
|
697
|
-
if (
|
|
698
|
-
scope.enabled === false ||
|
|
699
|
-
scope.enableZoom === false ||
|
|
700
|
-
(state !== STATE.NONE && state !== STATE.ROTATE)
|
|
701
|
-
)
|
|
702
|
-
return;
|
|
703
|
-
|
|
704
|
-
event.stopPropagation();
|
|
705
|
-
|
|
706
|
-
handleMouseWheel(event);
|
|
707
|
-
|
|
708
|
-
scope.dispatchEvent(startEvent); // not sure why these are here...
|
|
709
|
-
scope.dispatchEvent(endEvent);
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
function onKeyDown(event) {
|
|
713
|
-
if (
|
|
714
|
-
scope.enabled === false ||
|
|
715
|
-
scope.enableKeys === false ||
|
|
716
|
-
scope.enablePan === false
|
|
717
|
-
)
|
|
718
|
-
return;
|
|
719
|
-
|
|
720
|
-
handleKeyDown(event);
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
function onTouchStart(event) {
|
|
724
|
-
if (scope.enabled === false) return;
|
|
725
|
-
|
|
726
|
-
switch (event.touches.length) {
|
|
727
|
-
case 1: // one-fingered touch: rotate
|
|
728
|
-
if (scope.enableRotate === false) return;
|
|
729
|
-
|
|
730
|
-
handleTouchStartRotate(event);
|
|
731
|
-
|
|
732
|
-
state = STATE.TOUCH_ROTATE;
|
|
733
|
-
|
|
734
|
-
break;
|
|
735
|
-
|
|
736
|
-
case 2: // two-fingered touch: dolly
|
|
737
|
-
if (scope.enableZoom === false) return;
|
|
738
|
-
|
|
739
|
-
handleTouchStartDolly(event);
|
|
740
|
-
|
|
741
|
-
state = STATE.TOUCH_DOLLY;
|
|
742
|
-
|
|
743
|
-
break;
|
|
744
|
-
|
|
745
|
-
case 3: // three-fingered touch: pan
|
|
746
|
-
if (scope.enablePan === false) return;
|
|
747
|
-
|
|
748
|
-
handleTouchStartPan(event);
|
|
749
|
-
|
|
750
|
-
state = STATE.TOUCH_PAN;
|
|
751
|
-
|
|
752
|
-
break;
|
|
753
|
-
|
|
754
|
-
default:
|
|
755
|
-
state = STATE.NONE;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
if (state !== STATE.NONE) {
|
|
759
|
-
scope.dispatchEvent(startEvent);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
function onTouchMove(event) {
|
|
764
|
-
if (scope.enabled === false) return;
|
|
765
|
-
|
|
766
|
-
event.stopPropagation();
|
|
767
|
-
|
|
768
|
-
switch (event.touches.length) {
|
|
769
|
-
case 1: // one-fingered touch: rotate
|
|
770
|
-
if (scope.enableRotate === false) return;
|
|
771
|
-
if (state !== STATE.TOUCH_ROTATE) return; // is this needed?...
|
|
772
|
-
|
|
773
|
-
handleTouchMoveRotate(event);
|
|
774
|
-
|
|
775
|
-
break;
|
|
776
|
-
|
|
777
|
-
case 2: // two-fingered touch: dolly
|
|
778
|
-
if (scope.enableZoom === false) return;
|
|
779
|
-
if (state !== STATE.TOUCH_DOLLY) return; // is this needed?...
|
|
780
|
-
|
|
781
|
-
handleTouchMoveDolly(event);
|
|
782
|
-
|
|
783
|
-
break;
|
|
784
|
-
|
|
785
|
-
case 3: // three-fingered touch: pan
|
|
786
|
-
if (scope.enablePan === false) return;
|
|
787
|
-
if (state !== STATE.TOUCH_PAN) return; // is this needed?...
|
|
788
|
-
|
|
789
|
-
handleTouchMovePan(event);
|
|
790
|
-
|
|
791
|
-
break;
|
|
792
|
-
|
|
793
|
-
default:
|
|
794
|
-
state = STATE.NONE;
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
function onTouchEnd(event) {
|
|
799
|
-
if (scope.enabled === false) return;
|
|
800
|
-
|
|
801
|
-
handleTouchEnd(event);
|
|
802
|
-
|
|
803
|
-
scope.dispatchEvent(endEvent);
|
|
804
|
-
|
|
805
|
-
state = STATE.NONE;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
function onContextMenu(event) {
|
|
809
|
-
event.preventDefault();
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
scope.domElement.addEventListener('contextmenu', onContextMenu, false);
|
|
813
|
-
|
|
814
|
-
scope.domElement.addEventListener('mousedown', onMouseDown, false);
|
|
815
|
-
scope.domElement.addEventListener('wheel', onMouseWheel, { passive: true });
|
|
816
|
-
|
|
817
|
-
scope.domElement.addEventListener('touchstart', onTouchStart, {
|
|
818
|
-
passive: true
|
|
819
|
-
});
|
|
820
|
-
scope.domElement.addEventListener('touchend', onTouchEnd, { passive: true });
|
|
821
|
-
scope.domElement.addEventListener('touchmove', onTouchMove, {
|
|
822
|
-
passive: true
|
|
823
|
-
});
|
|
824
|
-
|
|
825
|
-
window.addEventListener('keydown', onKeyDown, { passive: true });
|
|
826
|
-
|
|
827
|
-
// set window to call out of this//
|
|
828
|
-
window.tDKeyDown = handleKeyDown;
|
|
829
|
-
window.zoomFunc = dollyIn;
|
|
830
|
-
// ////////////////////////////////
|
|
831
|
-
|
|
832
|
-
// force an update at start
|
|
833
|
-
|
|
834
|
-
this.update();
|
|
835
|
-
};
|
|
836
|
-
|
|
837
|
-
OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype);
|
|
838
|
-
OrbitControls.prototype.constructor = OrbitControls;
|
|
839
|
-
|
|
840
|
-
Object.defineProperties(OrbitControls.prototype, {
|
|
841
|
-
center: {
|
|
842
|
-
get: function () {
|
|
843
|
-
console.warn('THREE.OrbitControls: .center has been renamed to .target');
|
|
844
|
-
return this.target;
|
|
845
|
-
}
|
|
846
|
-
},
|
|
847
|
-
|
|
848
|
-
// backward compatibility
|
|
849
|
-
|
|
850
|
-
noZoom: {
|
|
851
|
-
get: function () {
|
|
852
|
-
console.warn(
|
|
853
|
-
'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.'
|
|
854
|
-
);
|
|
855
|
-
return !this.enableZoom;
|
|
856
|
-
},
|
|
857
|
-
|
|
858
|
-
set: function (value) {
|
|
859
|
-
console.warn(
|
|
860
|
-
'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.'
|
|
861
|
-
);
|
|
862
|
-
this.enableZoom = !value;
|
|
863
|
-
}
|
|
864
|
-
},
|
|
865
|
-
|
|
866
|
-
noRotate: {
|
|
867
|
-
get: function () {
|
|
868
|
-
console.warn(
|
|
869
|
-
'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.'
|
|
870
|
-
);
|
|
871
|
-
return !this.enableRotate;
|
|
872
|
-
},
|
|
873
|
-
|
|
874
|
-
set: function (value) {
|
|
875
|
-
console.warn(
|
|
876
|
-
'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.'
|
|
877
|
-
);
|
|
878
|
-
this.enableRotate = !value;
|
|
879
|
-
}
|
|
880
|
-
},
|
|
881
|
-
|
|
882
|
-
noPan: {
|
|
883
|
-
get: function () {
|
|
884
|
-
console.warn(
|
|
885
|
-
'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.'
|
|
886
|
-
);
|
|
887
|
-
return !this.enablePan;
|
|
888
|
-
},
|
|
889
|
-
|
|
890
|
-
set: function (value) {
|
|
891
|
-
console.warn(
|
|
892
|
-
'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.'
|
|
893
|
-
);
|
|
894
|
-
this.enablePan = !value;
|
|
895
|
-
}
|
|
896
|
-
},
|
|
897
|
-
|
|
898
|
-
noKeys: {
|
|
899
|
-
get: function () {
|
|
900
|
-
console.warn(
|
|
901
|
-
'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.'
|
|
902
|
-
);
|
|
903
|
-
return !this.enableKeys;
|
|
904
|
-
},
|
|
905
|
-
|
|
906
|
-
set: function (value) {
|
|
907
|
-
console.warn(
|
|
908
|
-
'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.'
|
|
909
|
-
);
|
|
910
|
-
this.enableKeys = !value;
|
|
911
|
-
}
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
staticMoving: {
|
|
915
|
-
get: function () {
|
|
916
|
-
console.warn(
|
|
917
|
-
'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.'
|
|
918
|
-
);
|
|
919
|
-
return !this.enableDamping;
|
|
920
|
-
},
|
|
921
|
-
|
|
922
|
-
set: function (value) {
|
|
923
|
-
console.warn(
|
|
924
|
-
'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.'
|
|
925
|
-
);
|
|
926
|
-
this.enableDamping = !value;
|
|
927
|
-
}
|
|
928
|
-
},
|
|
929
|
-
|
|
930
|
-
dynamicDampingFactor: {
|
|
931
|
-
get: function () {
|
|
932
|
-
console.warn(
|
|
933
|
-
'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.'
|
|
934
|
-
);
|
|
935
|
-
return this.dampingFactor;
|
|
936
|
-
},
|
|
937
|
-
|
|
938
|
-
set: function (value) {
|
|
939
|
-
console.warn(
|
|
940
|
-
'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.'
|
|
941
|
-
);
|
|
942
|
-
this.dampingFactor = value;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
});
|