kitchen-simulator 1.1.1-test.7 → 1.1.1-test.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/@history.js +8 -2
- package/es/AppContext.js +8 -3
- package/es/KitchenConfigurator.js +93 -106
- package/es/KitchenConfiguratorApp.js +143 -154
- package/es/actions/area-actions.js +10 -5
- package/es/actions/export.js +27 -12
- package/es/actions/groups-actions.js +43 -27
- package/es/actions/holes-actions.js +53 -34
- package/es/actions/items-actions.js +143 -94
- package/es/actions/lines-actions.js +34 -21
- package/es/actions/project-actions.js +143 -94
- package/es/actions/scene-actions.js +19 -11
- package/es/actions/vertices-actions.js +13 -7
- package/es/actions/viewer2d-actions.js +34 -21
- package/es/actions/viewer3d-actions.js +16 -9
- package/es/catalog/areas/area/planner-element.js +16 -8
- package/es/catalog/catalog.js +19 -24
- package/es/catalog/factories/area-factory-3d.js +29 -22
- package/es/catalog/factories/area-factory.js +18 -14
- package/es/catalog/factories/export.js +12 -6
- package/es/catalog/factories/wall-factory-3d.js +39 -31
- package/es/catalog/factories/wall-factory.js +29 -21
- package/es/catalog/holes/door-closet/planner-element.js +22 -15
- package/es/catalog/holes/door-double/planner-element.js +22 -15
- package/es/catalog/holes/door-exterior/planner-element.js +23 -16
- package/es/catalog/holes/door-interior/planner-element.js +23 -16
- package/es/catalog/holes/door-panic/planner-element.js +14 -7
- package/es/catalog/holes/door-panic-double/planner-element.js +22 -15
- package/es/catalog/holes/door-sliding/planner-element.js +23 -16
- package/es/catalog/holes/doorway-framed/planner-element.js +18 -11
- package/es/catalog/holes/doorway-frameless/planner-element.js +14 -7
- package/es/catalog/holes/export.js +31 -13
- package/es/catalog/holes/window-clear/planner-element.js +17 -10
- package/es/catalog/holes/window-cross/planner-element.js +17 -10
- package/es/catalog/holes/window-double-hung/planner-element.js +17 -10
- package/es/catalog/holes/window-vertical/planner-element.js +17 -10
- package/es/catalog/lines/wall/planner-element.js +19 -11
- package/es/catalog/molding/molding-dcm/planner-element.js +12 -5
- package/es/catalog/molding/molding-fbm/planner-element.js +12 -5
- package/es/catalog/molding/molding-lrm/planner-element.js +12 -5
- package/es/catalog/properties/export.js +33 -20
- package/es/catalog/properties/property-checkbox.js +82 -35
- package/es/catalog/properties/property-color.js +21 -16
- package/es/catalog/properties/property-enum.js +70 -28
- package/es/catalog/properties/property-hidden.js +14 -9
- package/es/catalog/properties/property-lenght-measure.js +43 -39
- package/es/catalog/properties/property-length-measure.js +82 -34
- package/es/catalog/properties/property-length-measure_hole.js +43 -39
- package/es/catalog/properties/property-number.js +22 -17
- package/es/catalog/properties/property-read-only.js +21 -16
- package/es/catalog/properties/property-string.js +21 -16
- package/es/catalog/properties/property-toggle.js +21 -16
- package/es/catalog/properties/shared-property-style.js +5 -1
- package/es/catalog/utils/FuseUtils.js +13 -11
- package/es/catalog/utils/exporter.js +13 -11
- package/es/catalog/utils/geom-utils.js +27 -13
- package/es/catalog/utils/item-loader.js +95 -91
- package/es/catalog/utils/load-obj.js +26 -20
- package/es/catalog/utils/mtl-loader.js +7 -3
- package/es/catalog/utils/obj-loader.js +7 -3
- package/es/class/FuseUtils.js +13 -11
- package/es/class/area.js +26 -26
- package/es/class/export.js +38 -23
- package/es/class/group.js +57 -62
- package/es/class/guide.js +19 -19
- package/es/class/hole.js +87 -88
- package/es/class/item.js +148 -155
- package/es/class/layer.js +63 -63
- package/es/class/line.js +141 -144
- package/es/class/project.js +96 -94
- package/es/class/vertex.js +33 -33
- package/es/components/content.js +27 -19
- package/es/components/disclaimer/disclaimer.js +79 -93
- package/es/components/export.js +15 -8
- package/es/components/style/button.js +29 -30
- package/es/components/style/cancel-button.js +12 -8
- package/es/components/style/content-container.js +14 -12
- package/es/components/style/content-title.js +18 -15
- package/es/components/style/delete-button.js +15 -9
- package/es/components/style/export.js +48 -30
- package/es/components/style/form-block.js +13 -12
- package/es/components/style/form-color-input.js +12 -8
- package/es/components/style/form-label.js +13 -12
- package/es/components/style/form-number-input.js +71 -47
- package/es/components/style/form-number-input_2.js +42 -42
- package/es/components/style/form-select.js +58 -14
- package/es/components/style/form-slider.js +36 -16
- package/es/components/style/form-submit-button.js +15 -9
- package/es/components/style/form-text-input.js +55 -37
- package/es/components/viewer2d/area.js +22 -17
- package/es/components/viewer2d/export.js +48 -30
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +15 -11
- package/es/components/viewer2d/grids/grid-streak.js +15 -11
- package/es/components/viewer2d/grids/grid-vertical-streak.js +15 -11
- package/es/components/viewer2d/grids/grids.js +17 -15
- package/es/components/viewer2d/group.js +22 -15
- package/es/components/viewer2d/item.js +68 -68
- package/es/components/viewer2d/layer.js +28 -23
- package/es/components/viewer2d/line.js +109 -104
- package/es/components/viewer2d/ruler.js +27 -23
- package/es/components/viewer2d/rulerDist.js +26 -21
- package/es/components/viewer2d/rulerX.js +45 -45
- package/es/components/viewer2d/rulerY.js +43 -43
- package/es/components/viewer2d/scene.js +40 -46
- package/es/components/viewer2d/snap.js +20 -13
- package/es/components/viewer2d/state.js +25 -23
- package/es/components/viewer2d/utils.js +63 -21
- package/es/components/viewer2d/vertex.js +15 -8
- package/es/components/viewer2d/viewer2d.js +169 -166
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +21 -24
- package/es/components/viewer3d/dcm.js +5 -1
- package/es/components/viewer3d/fbm.js +5 -1
- package/es/components/viewer3d/front3D.js +19 -17
- package/es/components/viewer3d/grid-creator.js +15 -8
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +12 -6
- package/es/components/viewer3d/grids/grid-streak.js +11 -5
- package/es/components/viewer3d/grids/grid-vertical-streak.js +12 -6
- package/es/components/viewer3d/libs/first-person-controls.js +7 -2
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +5 -1
- package/es/components/viewer3d/libs/mtl-loader.js +6 -2
- package/es/components/viewer3d/libs/obj-loader.js +6 -2
- package/es/components/viewer3d/libs/orbit-controls.js +10 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- package/es/components/viewer3d/lrm.js +5 -1
- package/es/components/viewer3d/model.js +5 -1
- package/es/components/viewer3d/pointer-lock-navigation.js +8 -3
- package/es/components/viewer3d/ruler-utils/itemRect.js +23 -18
- package/es/components/viewer3d/ruler-utils/layer3D.js +64 -59
- package/es/components/viewer3d/ruler-utils/ruler3D.js +44 -42
- package/es/components/viewer3d/ruler-utils/scene3D.js +16 -11
- package/es/components/viewer3d/ruler-utils/state3D.js +9 -4
- package/es/components/viewer3d/scene-creator.js +225 -198
- package/es/components/viewer3d/three-memory-cleaner.js +10 -3
- package/es/components/viewer3d/viewer3d-first-person.js +44 -46
- package/es/components/viewer3d/viewer3d.js +206 -209
- package/es/constants.js +356 -349
- package/es/index.js +20 -15
- package/es/models.js +183 -183
- package/es/plugins/SVGLoader.js +51 -48
- package/es/plugins/autosave.js +7 -3
- package/es/plugins/console-debugger.js +10 -8
- package/es/plugins/export.js +15 -8
- package/es/plugins/keyboard.js +33 -29
- package/es/reducers/areas-reducer.js +11 -7
- package/es/reducers/export.js +39 -24
- package/es/reducers/groups-reducer.js +35 -31
- package/es/reducers/holes-reducer.js +47 -43
- package/es/reducers/items-reducer.js +110 -109
- package/es/reducers/lines-reducer.js +32 -28
- package/es/reducers/project-reducer.js +109 -105
- package/es/reducers/reducer.js +21 -16
- package/es/reducers/scene-reducer.js +19 -15
- package/es/reducers/user-reducer.js +9 -6
- package/es/reducers/vertices-reducer.js +15 -11
- package/es/reducers/viewer2d-reducer.js +22 -18
- package/es/reducers/viewer3d-reducer.js +20 -16
- package/es/shared-style.js +14 -10
- package/es/styles/export.js +9 -3
- package/es/translator/en.js +5 -1
- package/es/translator/it.js +5 -1
- package/es/translator/ru.js +5 -1
- package/es/translator/translator.js +17 -17
- package/es/utils/browser.js +7 -2
- package/es/utils/convert-units-lite.js +33 -0
- package/es/utils/email-validator.js +5 -1
- package/es/utils/export.js +32 -15
- package/es/utils/geometry.js +277 -191
- package/es/utils/get-edges-of-subgraphs.js +7 -1
- package/es/utils/graph-cycles.js +9 -9
- package/es/utils/graph-inner-cycles.js +16 -10
- package/es/utils/graph.js +15 -12
- package/es/utils/helper.js +61 -109
- package/es/utils/history.js +13 -8
- package/es/utils/id-broker.js +13 -12
- package/es/utils/logger.js +5 -1
- package/es/utils/math.js +10 -5
- package/es/utils/molding.js +175 -158
- package/es/utils/name-generator.js +11 -11
- package/es/utils/objects-utils.js +17 -7
- package/es/utils/phone-validator.js +5 -1
- package/es/utils/process-black-list.js +8 -6
- package/es/utils/react-if.js +10 -6
- package/es/utils/snap-scene.js +32 -32
- package/es/utils/snap.js +57 -51
- package/es/utils/summarizeCart.js +5 -1
- package/es/utils/threeCSG.es6.js +20 -17
- package/es/version.js +5 -1
- package/lib/@history.js +3 -2
- package/lib/AppContext.js +3 -2
- package/lib/KitchenConfigurator.js +70 -88
- package/lib/KitchenConfiguratorApp.js +98 -113
- package/lib/actions/export.js +1 -1
- package/lib/catalog/areas/area/planner-element.js +13 -8
- package/lib/catalog/catalog.js +9 -16
- package/lib/catalog/factories/area-factory-3d.js +1 -1
- package/lib/catalog/factories/area-factory.js +6 -7
- package/lib/catalog/factories/export.js +1 -1
- package/lib/catalog/factories/wall-factory-3d.js +4 -4
- package/lib/catalog/factories/wall-factory.js +4 -3
- package/lib/catalog/holes/door-closet/planner-element.js +4 -3
- package/lib/catalog/holes/door-double/planner-element.js +4 -3
- package/lib/catalog/holes/door-exterior/planner-element.js +4 -3
- package/lib/catalog/holes/door-interior/planner-element.js +4 -3
- package/lib/catalog/holes/door-panic/planner-element.js +4 -3
- package/lib/catalog/holes/door-panic-double/planner-element.js +4 -3
- package/lib/catalog/holes/door-sliding/planner-element.js +4 -3
- package/lib/catalog/holes/doorway-framed/planner-element.js +4 -3
- package/lib/catalog/holes/doorway-frameless/planner-element.js +4 -3
- package/lib/catalog/holes/export.js +14 -14
- package/lib/catalog/holes/window-clear/planner-element.js +4 -3
- package/lib/catalog/holes/window-cross/planner-element.js +4 -3
- package/lib/catalog/holes/window-double-hung/planner-element.js +4 -3
- package/lib/catalog/holes/window-vertical/planner-element.js +4 -3
- package/lib/catalog/lines/wall/planner-element.js +16 -11
- package/lib/catalog/molding/molding-dcm/planner-element.js +4 -3
- package/lib/catalog/molding/molding-fbm/planner-element.js +4 -3
- package/lib/catalog/molding/molding-lrm/planner-element.js +4 -3
- package/lib/catalog/properties/export.js +1 -1
- package/lib/catalog/properties/property-checkbox.js +68 -25
- package/lib/catalog/properties/property-color.js +3 -2
- package/lib/catalog/properties/property-enum.js +54 -16
- package/lib/catalog/properties/property-hidden.js +3 -2
- package/lib/catalog/properties/property-lenght-measure.js +10 -10
- package/lib/catalog/properties/property-length-measure.js +61 -17
- package/lib/catalog/properties/property-length-measure_hole.js +10 -10
- package/lib/catalog/properties/property-number.js +3 -2
- package/lib/catalog/properties/property-read-only.js +3 -2
- package/lib/catalog/properties/property-string.js +3 -2
- package/lib/catalog/properties/property-toggle.js +3 -2
- package/lib/catalog/properties/shared-property-style.js +2 -1
- package/lib/catalog/utils/FuseUtils.js +10 -11
- package/lib/catalog/utils/exporter.js +10 -12
- package/lib/catalog/utils/geom-utils.js +1 -1
- package/lib/catalog/utils/item-loader.js +29 -35
- package/lib/catalog/utils/mtl-loader.js +7 -3
- package/lib/catalog/utils/obj-loader.js +7 -3
- package/lib/class/FuseUtils.js +10 -11
- package/lib/class/area.js +9 -11
- package/lib/class/export.js +1 -1
- package/lib/class/group.js +13 -20
- package/lib/class/guide.js +9 -12
- package/lib/class/hole.js +7 -9
- package/lib/class/item.js +25 -35
- package/lib/class/layer.js +7 -9
- package/lib/class/line.js +14 -20
- package/lib/class/project.js +10 -11
- package/lib/class/vertex.js +9 -11
- package/lib/components/content.js +5 -3
- package/lib/components/disclaimer/disclaimer.js +69 -88
- package/lib/components/export.js +1 -1
- package/lib/components/style/button.js +17 -22
- package/lib/components/style/cancel-button.js +7 -7
- package/lib/components/style/content-container.js +5 -7
- package/lib/components/style/content-title.js +10 -12
- package/lib/components/style/delete-button.js +8 -8
- package/lib/components/style/export.js +1 -1
- package/lib/components/style/form-block.js +9 -12
- package/lib/components/style/form-color-input.js +7 -7
- package/lib/components/style/form-label.js +9 -12
- package/lib/components/style/form-number-input.js +43 -23
- package/lib/components/style/form-number-input_2.js +15 -19
- package/lib/components/style/form-select.js +53 -15
- package/lib/components/style/form-slider.js +28 -12
- package/lib/components/style/form-submit-button.js +8 -8
- package/lib/components/style/form-text-input.js +46 -32
- package/lib/components/viewer2d/area.js +8 -7
- package/lib/components/viewer2d/export.js +1 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +3 -3
- package/lib/components/viewer2d/grids/grid-streak.js +3 -3
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +3 -3
- package/lib/components/viewer2d/grids/grids.js +6 -10
- package/lib/components/viewer2d/group.js +4 -3
- package/lib/components/viewer2d/item.js +14 -19
- package/lib/components/viewer2d/layer.js +3 -2
- package/lib/components/viewer2d/line.js +4 -7
- package/lib/components/viewer2d/ruler.js +9 -9
- package/lib/components/viewer2d/rulerDist.js +7 -6
- package/lib/components/viewer2d/rulerX.js +15 -19
- package/lib/components/viewer2d/rulerY.js +15 -19
- package/lib/components/viewer2d/scene.js +24 -34
- package/lib/components/viewer2d/snap.js +4 -3
- package/lib/components/viewer2d/state.js +7 -11
- package/lib/components/viewer2d/utils.js +35 -2
- package/lib/components/viewer2d/vertex.js +4 -3
- package/lib/components/viewer2d/viewer2d.js +40 -41
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
- package/lib/components/viewer3d/dcm.js +2 -1
- package/lib/components/viewer3d/fbm.js +2 -1
- package/lib/components/viewer3d/front3D.js +6 -10
- package/lib/components/viewer3d/grid-creator.js +4 -3
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +3 -2
- package/lib/components/viewer3d/grids/grid-streak.js +3 -2
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +3 -2
- package/lib/components/viewer3d/libs/mtl-loader.js +7 -2
- package/lib/components/viewer3d/libs/obj-loader.js +7 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- package/lib/components/viewer3d/lrm.js +2 -1
- package/lib/components/viewer3d/pointer-lock-navigation.js +1 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +10 -9
- package/lib/components/viewer3d/ruler-utils/layer3D.js +35 -34
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +5 -7
- package/lib/components/viewer3d/ruler-utils/scene3D.js +4 -5
- package/lib/components/viewer3d/ruler-utils/state3D.js +3 -2
- package/lib/components/viewer3d/scene-creator.js +40 -45
- package/lib/components/viewer3d/three-memory-cleaner.js +1 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +13 -17
- package/lib/components/viewer3d/viewer3d.js +34 -38
- package/lib/index.js +16 -88
- package/lib/models.js +58 -63
- package/lib/plugins/autosave.js +2 -1
- package/lib/plugins/console-debugger.js +5 -7
- package/lib/plugins/export.js +1 -1
- package/lib/plugins/keyboard.js +2 -1
- package/lib/reducers/areas-reducer.js +2 -1
- package/lib/reducers/export.js +1 -1
- package/lib/reducers/groups-reducer.js +2 -1
- package/lib/reducers/holes-reducer.js +2 -1
- package/lib/reducers/items-reducer.js +2 -1
- package/lib/reducers/lines-reducer.js +2 -1
- package/lib/reducers/project-reducer.js +2 -1
- package/lib/reducers/scene-reducer.js +2 -1
- package/lib/reducers/user-reducer.js +2 -2
- package/lib/reducers/vertices-reducer.js +2 -1
- package/lib/reducers/viewer2d-reducer.js +5 -5
- package/lib/reducers/viewer3d-reducer.js +5 -5
- package/lib/styles/export.js +1 -1
- package/lib/translator/en.js +2 -1
- package/lib/translator/it.js +2 -1
- package/lib/translator/ru.js +2 -1
- package/lib/translator/translator.js +7 -10
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/export.js +2 -2
- package/lib/utils/geometry.js +20 -28
- package/lib/utils/get-edges-of-subgraphs.js +7 -1
- package/lib/utils/graph-cycles.js +9 -9
- package/lib/utils/graph-inner-cycles.js +1 -1
- package/lib/utils/graph.js +15 -12
- package/lib/utils/helper.js +14 -83
- package/lib/utils/history.js +1 -1
- package/lib/utils/id-broker.js +7 -10
- package/lib/utils/molding.js +66 -71
- package/lib/utils/name-generator.js +7 -9
- package/lib/utils/objects-utils.js +5 -3
- package/lib/utils/process-black-list.js +3 -5
- package/lib/utils/react-if.js +3 -2
- package/lib/utils/snap-scene.js +3 -7
- package/lib/utils/snap.js +22 -26
- package/lib/utils/threeCSG.es6.js +16 -15
- package/package.json +26 -54
- package/es/analytics/ga4.js +0 -191
- package/es/analytics/posthog.js +0 -60
- package/lib/analytics/ga4.js +0 -197
- package/lib/analytics/posthog.js +0 -68
package/es/class/hole.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var Hole = /*#__PURE__*/function () {
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
7
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
8
|
+
var _immutable = require("immutable");
|
|
9
|
+
var _export = require("./export");
|
|
10
|
+
var _export2 = require("../utils/export");
|
|
11
|
+
var _snap = require("../utils/snap");
|
|
12
|
+
var _constants = require("../constants");
|
|
13
|
+
var Hole = exports["default"] = /*#__PURE__*/function () {
|
|
14
14
|
function Hole() {
|
|
15
|
-
|
|
15
|
+
(0, _classCallCheck2["default"])(this, Hole);
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return (0, _createClass2["default"])(Hole, null, [{
|
|
18
18
|
key: "create",
|
|
19
19
|
value: function create(state, layerID, type, lineID, offset, properties, holeX, holeY) {
|
|
20
|
-
var holeID = IDBroker.acquireID();
|
|
20
|
+
var holeID = _export2.IDBroker.acquireID();
|
|
21
21
|
var hole = state.catalog.factoryElement(type, {
|
|
22
22
|
id: holeID,
|
|
23
23
|
url: state.catalog.getIn(['elements', type, 'info', 'url']),
|
|
@@ -78,8 +78,8 @@ var Hole = /*#__PURE__*/function () {
|
|
|
78
78
|
}, {
|
|
79
79
|
key: "select",
|
|
80
80
|
value: function select(state, layerID, holeID) {
|
|
81
|
-
state = Layer.select(state, layerID).updatedState;
|
|
82
|
-
state = Layer.selectElement(state, layerID, 'holes', holeID).updatedState;
|
|
81
|
+
state = _export.Layer.select(state, layerID).updatedState;
|
|
82
|
+
state = _export.Layer.selectElement(state, layerID, 'holes', holeID).updatedState;
|
|
83
83
|
return {
|
|
84
84
|
updatedState: state
|
|
85
85
|
};
|
|
@@ -89,7 +89,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
89
89
|
value: function remove(state, layerID, holeID) {
|
|
90
90
|
var hole = state.getIn(['scene', 'layers', layerID, 'holes', holeID]);
|
|
91
91
|
state = this.unselect(state, layerID, holeID).updatedState;
|
|
92
|
-
state = Layer.removeElement(state, layerID, 'holes', holeID).updatedState;
|
|
92
|
+
state = _export.Layer.removeElement(state, layerID, 'holes', holeID).updatedState;
|
|
93
93
|
state = state.updateIn(['scene', 'layers', layerID, 'lines', hole.line, 'holes'], function (holes) {
|
|
94
94
|
var index = holes.findIndex(function (ID) {
|
|
95
95
|
return holeID === ID;
|
|
@@ -97,7 +97,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
97
97
|
return index !== -1 ? holes.remove(index) : holes;
|
|
98
98
|
});
|
|
99
99
|
state.getIn(['scene', 'groups']).forEach(function (group) {
|
|
100
|
-
return state = Group.removeElement(state, group.id, layerID, 'holes', holeID).updatedState;
|
|
100
|
+
return state = _export.Group.removeElement(state, group.id, layerID, 'holes', holeID).updatedState;
|
|
101
101
|
});
|
|
102
102
|
return {
|
|
103
103
|
updatedState: state
|
|
@@ -106,7 +106,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
106
106
|
}, {
|
|
107
107
|
key: "unselect",
|
|
108
108
|
value: function unselect(state, layerID, holeID) {
|
|
109
|
-
state = Layer.unselect(state, layerID, 'holes', holeID).updatedState;
|
|
109
|
+
state = _export.Layer.unselect(state, layerID, 'holes', holeID).updatedState;
|
|
110
110
|
return {
|
|
111
111
|
updatedState: state
|
|
112
112
|
};
|
|
@@ -114,7 +114,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
114
114
|
}, {
|
|
115
115
|
key: "selectToolDrawingHole",
|
|
116
116
|
value: function selectToolDrawingHole(state, sceneComponentType) {
|
|
117
|
-
var snapElements = new List().withMutations(function (snapElements) {
|
|
117
|
+
var snapElements = new _immutable.List().withMutations(function (snapElements) {
|
|
118
118
|
var _state$getIn = state.getIn(['scene', 'layers', state.scene.selectedLayer]),
|
|
119
119
|
lines = _state$getIn.lines,
|
|
120
120
|
vertices = _state$getIn.vertices;
|
|
@@ -125,13 +125,13 @@ var Hole = /*#__PURE__*/function () {
|
|
|
125
125
|
var _vertices$get2 = vertices.get(line.vertices.get(1)),
|
|
126
126
|
x2 = _vertices$get2.x,
|
|
127
127
|
y2 = _vertices$get2.y;
|
|
128
|
-
addLineSegmentSnap(snapElements, x1, y1, x2, y2, 20, 1, line.id);
|
|
128
|
+
(0, _snap.addLineSegmentSnap)(snapElements, x1, y1, x2, y2, 20, 1, line.id);
|
|
129
129
|
});
|
|
130
130
|
});
|
|
131
131
|
state = state.merge({
|
|
132
|
-
mode: MODE_DRAWING_HOLE,
|
|
132
|
+
mode: _constants.MODE_DRAWING_HOLE,
|
|
133
133
|
snapElements: snapElements,
|
|
134
|
-
drawingSupport: Map({
|
|
134
|
+
drawingSupport: (0, _immutable.Map)({
|
|
135
135
|
type: sceneComponentType
|
|
136
136
|
})
|
|
137
137
|
});
|
|
@@ -142,7 +142,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
142
142
|
}, {
|
|
143
143
|
key: "selectToolDrawingHole3D",
|
|
144
144
|
value: function selectToolDrawingHole3D(state, sceneComponentType) {
|
|
145
|
-
var snapElements = new List().withMutations(function (snapElements) {
|
|
145
|
+
var snapElements = new _immutable.List().withMutations(function (snapElements) {
|
|
146
146
|
var _state$getIn2 = state.getIn(['scene', 'layers', state.scene.selectedLayer]),
|
|
147
147
|
lines = _state$getIn2.lines,
|
|
148
148
|
vertices = _state$getIn2.vertices;
|
|
@@ -153,13 +153,13 @@ var Hole = /*#__PURE__*/function () {
|
|
|
153
153
|
var _vertices$get4 = vertices.get(line.vertices.get(1)),
|
|
154
154
|
x2 = _vertices$get4.x,
|
|
155
155
|
y2 = _vertices$get4.y;
|
|
156
|
-
addLineSegmentSnap(snapElements, x1, y1, x2, y2, 20, 1, line.id);
|
|
156
|
+
(0, _snap.addLineSegmentSnap)(snapElements, x1, y1, x2, y2, 20, 1, line.id);
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
state = state.merge({
|
|
160
|
-
mode: MODE_DRAWING_HOLE_3D,
|
|
160
|
+
mode: _constants.MODE_DRAWING_HOLE_3D,
|
|
161
161
|
snapElements: snapElements,
|
|
162
|
-
drawingSupport: Map({
|
|
162
|
+
drawingSupport: (0, _immutable.Map)({
|
|
163
163
|
type: sceneComponentType
|
|
164
164
|
})
|
|
165
165
|
});
|
|
@@ -174,7 +174,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
174
174
|
var catalog = state.catalog;
|
|
175
175
|
//calculate snap and overwrite coords if needed
|
|
176
176
|
//force snap to segment
|
|
177
|
-
var snap = nearestSnap(state.snapElements, x, y, state.snapMask.merge({
|
|
177
|
+
var snap = (0, _snap.nearestSnap)(state.snapElements, x, y, state.snapMask.merge({
|
|
178
178
|
SNAP_SEGMENT: true
|
|
179
179
|
}));
|
|
180
180
|
if (snap) {
|
|
@@ -194,14 +194,14 @@ var Hole = /*#__PURE__*/function () {
|
|
|
194
194
|
y2 = _state$getIn4.y;
|
|
195
195
|
|
|
196
196
|
// // I need min and max vertices on this line segment
|
|
197
|
-
var minVertex = GeometryUtils.minVertex({
|
|
197
|
+
var minVertex = _export2.GeometryUtils.minVertex({
|
|
198
198
|
x: x1,
|
|
199
199
|
y: y1
|
|
200
200
|
}, {
|
|
201
201
|
x: x2,
|
|
202
202
|
y: y2
|
|
203
203
|
});
|
|
204
|
-
var maxVertex = GeometryUtils.maxVertex({
|
|
204
|
+
var maxVertex = _export2.GeometryUtils.maxVertex({
|
|
205
205
|
x: x1,
|
|
206
206
|
y: y1
|
|
207
207
|
}, {
|
|
@@ -211,10 +211,10 @@ var Hole = /*#__PURE__*/function () {
|
|
|
211
211
|
var width = catalog.factoryElement(state.drawingSupport.get('type')).properties.getIn(['width', 'length']);
|
|
212
212
|
|
|
213
213
|
// // Now I need min and max possible coordinates for the hole on the line. They depend on the width of the hole
|
|
214
|
-
var lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
|
|
215
|
-
var alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
|
|
216
|
-
var cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
|
|
217
|
-
var sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
|
|
214
|
+
var lineLength = _export2.GeometryUtils.pointsDistance(x1, y1, x2, y2);
|
|
215
|
+
var alpha = _export2.GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
|
|
216
|
+
var cosAlpha = _export2.GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
|
|
217
|
+
var sinAlpha = _export2.GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
|
|
218
218
|
var minLeftVertexHole = {
|
|
219
219
|
x: minVertex.x + (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * cosAlpha,
|
|
220
220
|
y: minVertex.y + (state.mode.includes('ING_HOLE') ? width + 1 : width) / 2 * sinAlpha
|
|
@@ -225,24 +225,24 @@ var Hole = /*#__PURE__*/function () {
|
|
|
225
225
|
};
|
|
226
226
|
var offset;
|
|
227
227
|
if (x < minLeftVertexHole.x) {
|
|
228
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
228
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
229
229
|
offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
|
|
230
230
|
} else {
|
|
231
231
|
if (x > maxRightVertexHole.x) {
|
|
232
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
232
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
233
233
|
offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
|
|
234
234
|
} else if (x === minLeftVertexHole.x && x === maxRightVertexHole.x) {
|
|
235
235
|
if (y < minLeftVertexHole.y) {
|
|
236
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
236
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
237
237
|
offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
|
|
238
238
|
} else if (y > maxRightVertexHole.y) {
|
|
239
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
239
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
240
240
|
offset = minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
|
|
241
241
|
} else {
|
|
242
|
-
offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
242
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
243
243
|
}
|
|
244
244
|
} else {
|
|
245
|
-
offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
245
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
246
246
|
// offset =
|
|
247
247
|
// minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
|
|
248
248
|
}
|
|
@@ -363,7 +363,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
363
363
|
var catalog = state.catalog;
|
|
364
364
|
//calculate snap and overwrite coords if needed
|
|
365
365
|
//force snap to segment
|
|
366
|
-
var snap = nearestSnap(state.snapElements, x, y, state.snapMask.merge({
|
|
366
|
+
var snap = (0, _snap.nearestSnap)(state.snapElements, x, y, state.snapMask.merge({
|
|
367
367
|
SNAP_SEGMENT: true
|
|
368
368
|
}));
|
|
369
369
|
if (snap) {
|
|
@@ -383,14 +383,14 @@ var Hole = /*#__PURE__*/function () {
|
|
|
383
383
|
y2 = _state$getIn6.y;
|
|
384
384
|
|
|
385
385
|
// // I need min and max vertices on this line segment
|
|
386
|
-
var minVertex = GeometryUtils.minVertex({
|
|
386
|
+
var minVertex = _export2.GeometryUtils.minVertex({
|
|
387
387
|
x: x1,
|
|
388
388
|
y: y1
|
|
389
389
|
}, {
|
|
390
390
|
x: x2,
|
|
391
391
|
y: y2
|
|
392
392
|
});
|
|
393
|
-
var maxVertex = GeometryUtils.maxVertex({
|
|
393
|
+
var maxVertex = _export2.GeometryUtils.maxVertex({
|
|
394
394
|
x: x1,
|
|
395
395
|
y: y1
|
|
396
396
|
}, {
|
|
@@ -400,10 +400,10 @@ var Hole = /*#__PURE__*/function () {
|
|
|
400
400
|
var width = catalog.factoryElement(state.drawingSupport.get('type')).properties.getIn(['width', 'length']);
|
|
401
401
|
|
|
402
402
|
// // Now I need min and max possible coordinates for the hole on the line. They depend on the width of the hole
|
|
403
|
-
var lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
|
|
404
|
-
var alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
|
|
405
|
-
var cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
|
|
406
|
-
var sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
|
|
403
|
+
var lineLength = _export2.GeometryUtils.pointsDistance(x1, y1, x2, y2);
|
|
404
|
+
var alpha = _export2.GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
|
|
405
|
+
var cosAlpha = _export2.GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
|
|
406
|
+
var sinAlpha = _export2.GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
|
|
407
407
|
var minLeftVertexHole = {
|
|
408
408
|
x: minVertex.x + (state.mode.includes('ING_HOLE_3D') ? width + 1 : width) / 2 * cosAlpha,
|
|
409
409
|
y: minVertex.y + (state.mode.includes('ING_HOLE_3D') ? width + 1 : width) / 2 * sinAlpha
|
|
@@ -414,28 +414,28 @@ var Hole = /*#__PURE__*/function () {
|
|
|
414
414
|
};
|
|
415
415
|
var offset;
|
|
416
416
|
if (x < minLeftVertexHole.x) {
|
|
417
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
417
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
418
418
|
} else if (x > maxRightVertexHole.x) {
|
|
419
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
419
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
420
420
|
} else {
|
|
421
421
|
if (x === minLeftVertexHole.x && x === maxRightVertexHole.x) {
|
|
422
422
|
if (y < minLeftVertexHole.y) {
|
|
423
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
423
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
424
424
|
/*
|
|
425
425
|
offset =
|
|
426
426
|
minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
|
|
427
427
|
*/
|
|
428
428
|
} else if (y > maxRightVertexHole.y) {
|
|
429
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
429
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
430
430
|
/*
|
|
431
431
|
offset =
|
|
432
432
|
minVertex.x === x1 && minVertex.y === y1 ? offset : 1 - offset;
|
|
433
433
|
*/
|
|
434
434
|
} else {
|
|
435
|
-
offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
435
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
436
436
|
}
|
|
437
437
|
} else {
|
|
438
|
-
offset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
438
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, x, y);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
if (this.checkHoleCollide(state.getIn(['scene', 'layers', layerID]), lineID, selectedHole, x, y, width)) {
|
|
@@ -591,16 +591,16 @@ var Hole = /*#__PURE__*/function () {
|
|
|
591
591
|
key: "endDrawingHole",
|
|
592
592
|
value: function endDrawingHole(state, layerID, x, y) {
|
|
593
593
|
state = this.updateDrawingHole(state, layerID, x, y).updatedState;
|
|
594
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
594
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
595
595
|
var popup = state.get('popup');
|
|
596
596
|
state = state.merge({
|
|
597
|
-
drawingSupport: Map({
|
|
597
|
+
drawingSupport: (0, _immutable.Map)({
|
|
598
598
|
type: state.drawingSupport.get('type')
|
|
599
599
|
}),
|
|
600
600
|
isOpen: !popup,
|
|
601
|
-
mode: MODE_IDLE
|
|
601
|
+
mode: _constants.MODE_IDLE
|
|
602
602
|
});
|
|
603
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
603
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
604
604
|
return {
|
|
605
605
|
updatedState: state
|
|
606
606
|
};
|
|
@@ -609,17 +609,17 @@ var Hole = /*#__PURE__*/function () {
|
|
|
609
609
|
key: "endDrawingHole3D",
|
|
610
610
|
value: function endDrawingHole3D(state, layerID, x, y) {
|
|
611
611
|
state = state.merge({
|
|
612
|
-
mode: MODE_IDLE_3D
|
|
612
|
+
mode: _constants.MODE_IDLE_3D
|
|
613
613
|
});
|
|
614
614
|
state = this.updateDrawingHole3D(state, layerID, x, y).updatedState;
|
|
615
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
615
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
616
616
|
var popup = state.get('popup');
|
|
617
617
|
state = state.merge({
|
|
618
|
-
drawingSupport: Map({
|
|
618
|
+
drawingSupport: (0, _immutable.Map)({
|
|
619
619
|
type: state.drawingSupport.get('type')
|
|
620
620
|
}),
|
|
621
621
|
isOpen: !popup,
|
|
622
|
-
mode: MODE_IDLE_3D
|
|
622
|
+
mode: _constants.MODE_IDLE_3D
|
|
623
623
|
});
|
|
624
624
|
return {
|
|
625
625
|
updatedState: state
|
|
@@ -633,11 +633,11 @@ var Hole = /*#__PURE__*/function () {
|
|
|
633
633
|
var line = layer.getIn(['lines', hole.line]);
|
|
634
634
|
var v0 = layer.getIn(['vertices', line.vertices.get(0)]);
|
|
635
635
|
var v1 = layer.getIn(['vertices', line.vertices.get(1)]);
|
|
636
|
-
var snapElements = addLineSegmentSnap(List(), v0.x, v0.y, v1.x, v1.y, 9999999, 1, null);
|
|
636
|
+
var snapElements = (0, _snap.addLineSegmentSnap)((0, _immutable.List)(), v0.x, v0.y, v1.x, v1.y, 9999999, 1, null);
|
|
637
637
|
state = state.merge({
|
|
638
|
-
mode: MODE_DRAGGING_HOLE,
|
|
638
|
+
mode: _constants.MODE_DRAGGING_HOLE,
|
|
639
639
|
snapElements: snapElements,
|
|
640
|
-
draggingSupport: Map({
|
|
640
|
+
draggingSupport: (0, _immutable.Map)({
|
|
641
641
|
layerID: layerID,
|
|
642
642
|
holeID: holeID,
|
|
643
643
|
startPointX: x,
|
|
@@ -656,7 +656,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
656
656
|
var line = layer.getIn(['lines', hole.line]);
|
|
657
657
|
var v0 = layer.getIn(['vertices', line.vertices.get(0)]);
|
|
658
658
|
var v1 = layer.getIn(['vertices', line.vertices.get(1)]);
|
|
659
|
-
var snapElements = addLineSegmentSnap(List(), v0.x, v0.y, v1.x, v1.y, 9999999, 1, null);
|
|
659
|
+
var snapElements = (0, _snap.addLineSegmentSnap)((0, _immutable.List)(), v0.x, v0.y, v1.x, v1.y, 9999999, 1, null);
|
|
660
660
|
state = state.updateIn(['scene', 'layers', layerID, 'lines', hole.line, 'holes'], function (holes) {
|
|
661
661
|
var index = holes.findIndex(function (ID) {
|
|
662
662
|
return holeID === ID;
|
|
@@ -664,9 +664,9 @@ var Hole = /*#__PURE__*/function () {
|
|
|
664
664
|
return index !== -1 ? holes.remove(index) : holes;
|
|
665
665
|
});
|
|
666
666
|
state = state.merge({
|
|
667
|
-
mode: MODE_DRAGGING_HOLE_3D,
|
|
667
|
+
mode: _constants.MODE_DRAGGING_HOLE_3D,
|
|
668
668
|
snapElements: snapElements,
|
|
669
|
-
draggingSupport: Map({
|
|
669
|
+
draggingSupport: (0, _immutable.Map)({
|
|
670
670
|
layerID: layerID,
|
|
671
671
|
holeID: holeID,
|
|
672
672
|
startPointX: x,
|
|
@@ -682,7 +682,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
682
682
|
value: function updateDraggingHole(state, x, y) {
|
|
683
683
|
//calculate snap and overwrite coords if needed
|
|
684
684
|
//force snap to segment
|
|
685
|
-
var snap = nearestSnap(state.snapElements, x, y, state.snapMask.merge({
|
|
685
|
+
var snap = (0, _snap.nearestSnap)(state.snapElements, x, y, state.snapMask.merge({
|
|
686
686
|
SNAP_SEGMENT: true
|
|
687
687
|
}));
|
|
688
688
|
if (!snap) return state;
|
|
@@ -702,13 +702,13 @@ var Hole = /*#__PURE__*/function () {
|
|
|
702
702
|
var _snap$point3 = snap.point;
|
|
703
703
|
x = _snap$point3.x;
|
|
704
704
|
y = _snap$point3.y;
|
|
705
|
-
var minVertex = GeometryUtils.minVertex(v0, v1);
|
|
706
|
-
var maxVertex = GeometryUtils.maxVertex(v0, v1);
|
|
705
|
+
var minVertex = _export2.GeometryUtils.minVertex(v0, v1);
|
|
706
|
+
var maxVertex = _export2.GeometryUtils.maxVertex(v0, v1);
|
|
707
707
|
|
|
708
708
|
// Now I need min and max possible coordinates for the hole on the line. They depend on the width of the hole
|
|
709
709
|
|
|
710
710
|
var width = hole.properties.get('width').get('length');
|
|
711
|
-
var lineLength = GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
|
|
711
|
+
var lineLength = _export2.GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
|
|
712
712
|
var alpha = Math.atan2(v1.y - v0.y, Math.abs(v1.x - v0.x));
|
|
713
713
|
var alpha1 = Math.atan2(v1.y - v0.y, v1.x - v0.x);
|
|
714
714
|
var angle_temp;
|
|
@@ -740,27 +740,27 @@ var Hole = /*#__PURE__*/function () {
|
|
|
740
740
|
var offset;
|
|
741
741
|
if (x < minLeftVertexHole.x) {
|
|
742
742
|
// Snap point is previous the the line
|
|
743
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
743
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
744
744
|
offset = minVertex === v0 ? offset : 1 - offset;
|
|
745
745
|
} else {
|
|
746
746
|
// Snap point is after the line or on the line
|
|
747
747
|
if (x > maxRightVertexHole.x) {
|
|
748
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
748
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
749
749
|
offset = minVertex === v0 ? offset : 1 - offset;
|
|
750
750
|
} else if (x === minLeftVertexHole.x && x === maxRightVertexHole.x) {
|
|
751
751
|
// I am on a vertical line, I need to check y coordinates
|
|
752
752
|
if (y < minLeftVertexHole.y) {
|
|
753
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
753
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, minLeftVertexHole.x, minLeftVertexHole.y);
|
|
754
754
|
offset = minVertex === v0 ? offset : 1 - offset;
|
|
755
755
|
} else if (y > maxRightVertexHole.y) {
|
|
756
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
756
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, maxRightVertexHole.x, maxRightVertexHole.y);
|
|
757
757
|
offset = minVertex === v0 ? offset : 1 - offset;
|
|
758
758
|
} else {
|
|
759
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, x, y);
|
|
759
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, x, y);
|
|
760
760
|
offset = minVertex === v0 ? offset : 1 - offset;
|
|
761
761
|
}
|
|
762
762
|
} else {
|
|
763
|
-
offset = GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, x, y);
|
|
763
|
+
offset = _export2.GeometryUtils.pointPositionOnLineSegment(minVertex.x, minVertex.y, maxVertex.x, maxVertex.y, x, y);
|
|
764
764
|
if (angle_temp > 90 && angle_temp < 270) {
|
|
765
765
|
offset = 1 - offset;
|
|
766
766
|
}
|
|
@@ -840,8 +840,8 @@ var Hole = /*#__PURE__*/function () {
|
|
|
840
840
|
return index === -1 ? holes.push(holeID) : holes;
|
|
841
841
|
});
|
|
842
842
|
state = state.merge({
|
|
843
|
-
mode: MODE_IDLE_3D,
|
|
844
|
-
draggingSupport: Map({})
|
|
843
|
+
mode: _constants.MODE_IDLE_3D,
|
|
844
|
+
draggingSupport: (0, _immutable.Map)({})
|
|
845
845
|
});
|
|
846
846
|
return {
|
|
847
847
|
updatedState: state
|
|
@@ -869,7 +869,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
869
869
|
value: function endDraggingHole(state, x, y) {
|
|
870
870
|
state = this.updateDraggingHole(state, x, y).updatedState;
|
|
871
871
|
state = state.merge({
|
|
872
|
-
mode: MODE_IDLE
|
|
872
|
+
mode: _constants.MODE_IDLE
|
|
873
873
|
});
|
|
874
874
|
return {
|
|
875
875
|
updatedState: state
|
|
@@ -886,7 +886,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
886
886
|
}, {
|
|
887
887
|
key: "setJsProperties",
|
|
888
888
|
value: function setJsProperties(state, layerID, holeID, properties) {
|
|
889
|
-
return this.setProperties(state, layerID, holeID, fromJS(properties));
|
|
889
|
+
return this.setProperties(state, layerID, holeID, (0, _immutable.fromJS)(properties));
|
|
890
890
|
}
|
|
891
891
|
}, {
|
|
892
892
|
key: "updateProperties",
|
|
@@ -901,7 +901,7 @@ var Hole = /*#__PURE__*/function () {
|
|
|
901
901
|
}, {
|
|
902
902
|
key: "updateJsProperties",
|
|
903
903
|
value: function updateJsProperties(state, layerID, holeID, properties) {
|
|
904
|
-
return this.updateProperties(state, layerID, holeID, fromJS(properties));
|
|
904
|
+
return this.updateProperties(state, layerID, holeID, (0, _immutable.fromJS)(properties));
|
|
905
905
|
}
|
|
906
906
|
}, {
|
|
907
907
|
key: "setAttributes",
|
|
@@ -913,11 +913,11 @@ var Hole = /*#__PURE__*/function () {
|
|
|
913
913
|
delete hAttr['offsetA'];
|
|
914
914
|
delete hAttr['offsetB'];
|
|
915
915
|
delete hAttr['offset'];
|
|
916
|
-
var misc = new Map({
|
|
916
|
+
var misc = new _immutable.Map({
|
|
917
917
|
_unitA: offsetA._unit,
|
|
918
918
|
_unitB: offsetB._unit
|
|
919
919
|
});
|
|
920
|
-
state = state.mergeIn(['scene', 'layers', layerID, 'holes', holeID], fromJS(hAttr)).mergeDeepIn(['scene', 'layers', layerID, 'holes', holeID], new Map({
|
|
920
|
+
state = state.mergeIn(['scene', 'layers', layerID, 'holes', holeID], (0, _immutable.fromJS)(hAttr)).mergeDeepIn(['scene', 'layers', layerID, 'holes', holeID], new _immutable.Map({
|
|
921
921
|
offset: offset,
|
|
922
922
|
misc: misc
|
|
923
923
|
}));
|
|
@@ -926,5 +926,4 @@ var Hole = /*#__PURE__*/function () {
|
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
928
|
}]);
|
|
929
|
-
}();
|
|
930
|
-
export { Hole as default };
|
|
929
|
+
}();
|