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