kitchen-simulator 4.4.6 → 5.0.0-new-api.1
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/LiteRenderer.js +15 -53
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/factories/area-factory-3d.js +0 -4
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/utils/exporter.js +2 -0
- package/es/catalog/utils/item-loader.js +0 -4
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/class/item.js +17 -6
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +0 -1
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +11 -6
- package/es/devLiteRenderer.js +124 -84
- package/es/mappings/external-events/mapExternalEventPayload.js +28 -0
- package/es/mappings/external-events/mappers/addItemMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfToCDSMapper.js +31 -0
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +37 -0
- package/es/mappings/external-events/mappers/loadProjectMapper.js +62 -0
- package/es/mappings/holesToCatalog.js +139 -0
- package/es/models.js +12 -1
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/isolate-event-handler.js +57 -45
- package/es/utils/molding.js +5 -3
- package/lib/LiteRenderer.js +17 -55
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/factories/area-factory-3d.js +0 -4
- package/lib/catalog/holes/door-double/door_double.png +0 -0
- package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
- package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/lib/catalog/holes/gate/gate.jpg +0 -0
- package/lib/catalog/holes/window-clear/texture.png +0 -0
- package/lib/catalog/holes/window-cross/texture.png +0 -0
- package/lib/catalog/holes/window-double-hung/texture.png +0 -0
- package/lib/catalog/holes/window-vertical/texture.png +0 -0
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/catalog/utils/item-loader.js +0 -4
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/class/item.js +17 -6
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +0 -1
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +16 -11
- package/lib/devLiteRenderer.js +126 -86
- package/lib/mappings/external-events/mapExternalEventPayload.js +33 -0
- package/lib/mappings/external-events/mappers/addItemMapper.js +92 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +93 -0
- package/lib/mappings/external-events/mappers/ccdfToCDSMapper.js +37 -0
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +44 -0
- package/lib/mappings/external-events/mappers/loadProjectMapper.js +70 -0
- package/lib/mappings/holesToCatalog.js +148 -0
- package/lib/models.js +12 -1
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/isolate-event-handler.js +57 -45
- package/lib/utils/molding.js +5 -3
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
Binary file
|
|
Binary file
|
package/es/catalog/catalog.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly } from "./properties/export";
|
|
5
4
|
import { UNIT_CENTIMETER, UNIT_INCH } from "../constants";
|
|
6
5
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
7
6
|
var Catalog = /*#__PURE__*/function () {
|
|
@@ -19,7 +18,6 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
19
18
|
};
|
|
20
19
|
this.propertyTypes = {};
|
|
21
20
|
this.unit = unit;
|
|
22
|
-
this.registerMultiplePropertyType([['color', PropertyColor, PropertyColor], ['enum', PropertyEnum, PropertyEnum], ['string', PropertyString, PropertyString], ['number', PropertyNumber, PropertyNumber], ['length-measure', PropertyLengthMeasure, PropertyLengthMeasure], ['toggle', PropertyToggle, PropertyToggle], ['checkbox', PropertyCheckbox, PropertyCheckbox], ['hidden', PropertyHidden, PropertyHidden], ['read-only', PropertyReadOnly, PropertyReadOnly]]);
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
/**
|
|
@@ -75,10 +75,6 @@ export function createArea(element, layer, scene, textures) {
|
|
|
75
75
|
} else {
|
|
76
76
|
color = SharedStyle.AREA_MESH_COLOR.unselected;
|
|
77
77
|
}
|
|
78
|
-
if (texture.uri === undefined || texture.uri == '') {
|
|
79
|
-
// @todo THIS IS A TEMPORARY FIX TO HAVE A DEFAULT FLOOR TEXTURE
|
|
80
|
-
texture.uri = layer.floorStyle.uri || 'https://media.test.diydesignspace.com/uploads/CountTop/202203162950_2/texture/oak-barcelona-s.jpg';
|
|
81
|
-
}
|
|
82
78
|
var shape = new Shape();
|
|
83
79
|
shape.moveTo(vertices[0].x, vertices[0].y);
|
|
84
80
|
for (var i = 1; i < vertices.length; i++) {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,6 +11,7 @@ export default function (_ref) {
|
|
|
11
11
|
description = _ref.description,
|
|
12
12
|
prototype = _ref.prototype,
|
|
13
13
|
base = _ref.base,
|
|
14
|
+
gltf = _ref.gltf,
|
|
14
15
|
shape_svg = _ref.shape_svg,
|
|
15
16
|
render2DItem = _ref.render2DItem,
|
|
16
17
|
render3DItem = _ref.render3DItem,
|
|
@@ -100,6 +101,7 @@ export default function (_ref) {
|
|
|
100
101
|
is_corner: is_corner,
|
|
101
102
|
shape_svg: shape_svg
|
|
102
103
|
},
|
|
104
|
+
gltf: gltf,
|
|
103
105
|
properties: _objectSpread(_objectSpread({
|
|
104
106
|
altitude: {
|
|
105
107
|
label: 'Distance from floor',
|
|
@@ -988,10 +988,6 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
|
|
|
988
988
|
if (isEmpty(counterTop.uri) && !isEmpty(layer === null || layer === void 0 || (_layer$toJS = layer.toJS()) === null || _layer$toJS === void 0 ? void 0 : _layer$toJS.counterTop.uri)) {
|
|
989
989
|
counterTop.uri = layer.toJS().counterTop.uri;
|
|
990
990
|
}
|
|
991
|
-
if (isEmpty(counterTop.uri)) {
|
|
992
|
-
//@todo THIS IS A TEMPORARY FIX FOR COUNTERTOP TEXTURE UNDEFINED ISSUE
|
|
993
|
-
counterTop.uri = 'https://media.test.diydesignspace.com/uploads/CountTop/202105074107_5/texture/Unique_Calcatta_texture.jpg';
|
|
994
|
-
}
|
|
995
991
|
var countTopMap = counterTop.uri;
|
|
996
992
|
var interiorMap = doorStyles.get('interior');
|
|
997
993
|
var countT = loadTexture(countTopMap);
|
package/es/class/area.js
CHANGED
|
@@ -14,7 +14,6 @@ var Area = /*#__PURE__*/function () {
|
|
|
14
14
|
key: "add",
|
|
15
15
|
value: function add(state, layerID, type, verticesCoords, catalog) {
|
|
16
16
|
var area;
|
|
17
|
-
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
18
17
|
var areaID;
|
|
19
18
|
areaID = IDBroker.acquireID();
|
|
20
19
|
var vertices = verticesCoords.map(function (v) {
|
package/es/class/export.js
CHANGED
|
@@ -6,13 +6,11 @@ import Hole from "./hole";
|
|
|
6
6
|
import Vertex from "./vertex";
|
|
7
7
|
import Area from "./area";
|
|
8
8
|
import Item from "./item";
|
|
9
|
-
import FuseUtils from "./FuseUtils";
|
|
10
9
|
import { HorizontalGuide, VerticalGuide } from "./guide";
|
|
11
|
-
export { Project, Group,
|
|
10
|
+
export { Project, Group, Layer, Line, Hole, Vertex, Area, Item, HorizontalGuide, VerticalGuide };
|
|
12
11
|
export default {
|
|
13
12
|
Project: Project,
|
|
14
13
|
Group: Group,
|
|
15
|
-
FuseUtils: FuseUtils,
|
|
16
14
|
Layer: Layer,
|
|
17
15
|
Line: Line,
|
|
18
16
|
Hole: Hole,
|
package/es/class/item.js
CHANGED
|
@@ -39,7 +39,16 @@ var Item = /*#__PURE__*/function () {
|
|
|
39
39
|
id: itemID,
|
|
40
40
|
itemID: state.catalog.getIn(['elements', type, 'itemID']),
|
|
41
41
|
name: NameGenerator.generateName('items', state.catalog.getIn(['elements', type, 'info', 'title'])),
|
|
42
|
+
long_name: state.catalog.getIn(['elements', type, 'long_name']),
|
|
43
|
+
sizeinfo: state.catalog.getIn(['elements', type, 'info', 'sizeinfo']),
|
|
44
|
+
description: state.catalog.getIn(['elements', type, 'info', 'description']),
|
|
45
|
+
base: state.catalog.getIn(['elements', type, 'info', 'image']),
|
|
46
|
+
shape_svg: state.catalog.getIn(['elements', type, 'info', 'shape_svg']),
|
|
47
|
+
gltf: state.catalog.getIn(['elements', type, 'gltf']),
|
|
48
|
+
is_corner: state.catalog.getIn(['elements', type, 'info', 'is_corner']),
|
|
49
|
+
obj_property: state.catalog.getIn(['elements', type, 'obj']),
|
|
42
50
|
sku_number: state.catalog.getIn(['elements', type, 'obj']).toJS().sku_number,
|
|
51
|
+
outline: state.catalog.getIn(['elements', type, 'info', 'outline']),
|
|
43
52
|
//style: state.catalog.getIn(['elements', type, 'info', 'door']),
|
|
44
53
|
category: state.catalog.getIn(['elements', type, 'type']),
|
|
45
54
|
layoutpos: state.catalog.getIn(['elements', type, 'info', 'layoutpos']),
|
|
@@ -59,18 +68,20 @@ var Item = /*#__PURE__*/function () {
|
|
|
59
68
|
doorStyle: refItem.doorStyle
|
|
60
69
|
});
|
|
61
70
|
} else {
|
|
62
|
-
var
|
|
71
|
+
var _layer$doorStyle, _temp, _ref, _temp$doorStyles$cds$, _temp2, _temp3, _state3;
|
|
63
72
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
64
|
-
var temp =
|
|
65
|
-
|
|
73
|
+
var temp = (_layer$doorStyle = layer === null || layer === void 0 ? void 0 : layer.doorStyle) !== null && _layer$doorStyle !== void 0 ? _layer$doorStyle : state.doorStyle;
|
|
74
|
+
if (!isEmpty(temp) && Map.isMap(temp)) temp = (_temp = temp) === null || _temp === void 0 ? void 0 : _temp.toJS();
|
|
75
|
+
var cds = (_ref = (_temp$doorStyles$cds$ = (_temp2 = temp) === null || _temp2 === void 0 || (_temp2 = _temp2.doorStyles) === null || _temp2 === void 0 || (_temp2 = _temp2.cds) === null || _temp2 === void 0 ? void 0 : _temp2.find(function (elem) {
|
|
66
76
|
var _state;
|
|
67
77
|
return elem.itemID === ((_state = state) === null || _state === void 0 || (_state = _state.catalog) === null || _state === void 0 ? void 0 : _state.getIn(['elements', type, 'itemID']));
|
|
68
|
-
})) !== null && _temp$doorStyles$cds$ !== void 0 ? _temp$doorStyles$cds$ : temp === null ||
|
|
78
|
+
})) !== null && _temp$doorStyles$cds$ !== void 0 ? _temp$doorStyles$cds$ : (_temp3 = temp) === null || _temp3 === void 0 || (_temp3 = _temp3.cds) === null || _temp3 === void 0 ? void 0 : _temp3.find(function (elem) {
|
|
69
79
|
var _state2;
|
|
70
80
|
return elem.itemID === ((_state2 = state) === null || _state2 === void 0 || (_state2 = _state2.catalog) === null || _state2 === void 0 ? void 0 : _state2.getIn(['elements', type, 'itemID']));
|
|
71
81
|
})) !== null && _ref !== void 0 ? _ref : (_state3 = state) === null || _state3 === void 0 || (_state3 = _state3.catalog) === null || _state3 === void 0 ? void 0 : _state3.getIn(['elements', type, 'cds']);
|
|
72
82
|
if (cds) {
|
|
73
|
-
var
|
|
83
|
+
var _temp4;
|
|
84
|
+
var updatedDoorStyles = _objectSpread(_objectSpread({}, (_temp4 = temp) === null || _temp4 === void 0 ? void 0 : _temp4.doorStyles), {}, {
|
|
74
85
|
cds: [cds],
|
|
75
86
|
cabinet_door_style_id: cds.cabinet_door_style_id
|
|
76
87
|
});
|
|
@@ -552,7 +563,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
552
563
|
if (!isEmpty(currentObject === null || currentObject === void 0 || (_currentObject$counte = currentObject.counterTop) === null || _currentObject$counte === void 0 ? void 0 : _currentObject$counte.uri)) {
|
|
553
564
|
var _currentObject$counte2;
|
|
554
565
|
counterTopURI = currentObject === null || currentObject === void 0 || (_currentObject$counte2 = currentObject.counterTop) === null || _currentObject$counte2 === void 0 ? void 0 : _currentObject$counte2.uri;
|
|
555
|
-
} else if (!isEmpty(state.getIn(['scene', 'layers', 'layer-1', 'counterTop']))) counterTopURI = state.getIn(['scene', 'layers', 'layer-1', 'counterTop']).uri;
|
|
566
|
+
} else if (!isEmpty(state.getIn(['scene', 'layers', 'layer-1', 'counterTop']))) counterTopURI = state.getIn(['scene', 'layers', 'layer-1', 'counterTop']).uri;
|
|
556
567
|
state = this.remove(state, state.scene.selectedLayer, selectedPos.selectedItemId).updatedState;
|
|
557
568
|
state = this.create(state, state.scene.selectedLayer, selectedObject.name, selectedPos.x, selectedPos.y, selectedObject.info.width, selectedObject.info.height, selectedPos.rotation, false, [], false, null, counterTopURI).updatedState;
|
|
558
569
|
// state = this.select(state, state.scene.selectedLayer, selectedPos.selectedItemId).updatedState;
|
package/es/components/content.js
CHANGED
|
@@ -7,18 +7,16 @@ import Viewer3DFirstPerson from "./viewer3d/viewer3d-first-person";
|
|
|
7
7
|
// import ProjectConfigurator from './configurator/project-configurator';
|
|
8
8
|
import * as constants from "../constants";
|
|
9
9
|
import Front3D from "./viewer3d/front3D";
|
|
10
|
-
export default function Content(_ref
|
|
10
|
+
export default function Content(_ref) {
|
|
11
11
|
var width = _ref.width,
|
|
12
12
|
height = _ref.height,
|
|
13
13
|
state = _ref.state,
|
|
14
14
|
customContents = _ref.customContents,
|
|
15
|
-
match = _ref.match,
|
|
16
15
|
setToolbar = _ref.setToolbar,
|
|
17
16
|
replaceCabinet = _ref.replaceCabinet,
|
|
18
17
|
keyDownEnable = _ref.keyDownEnable,
|
|
19
18
|
catalog = _ref.catalog,
|
|
20
19
|
onInternalEvent = _ref.onInternalEvent;
|
|
21
|
-
var projectActions = _ref2.projectActions;
|
|
22
20
|
var mode = state.get('mode');
|
|
23
21
|
|
|
24
22
|
// Internal Event for unselect_all
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import Button from "./button";
|
|
2
|
-
import CancelButton from "./cancel-button";
|
|
3
|
-
import ContentContainer from "./content-container";
|
|
4
|
-
import ContentTitle from "./content-title";
|
|
5
|
-
import DeleteButton from "./delete-button";
|
|
6
|
-
import FormBlock from "./form-block";
|
|
7
|
-
import FormColorInput from "./form-color-input";
|
|
8
|
-
import FormLabel from "./form-label";
|
|
9
1
|
import FormNumberInput from "./form-number-input";
|
|
10
|
-
|
|
11
|
-
import FormSlider from "./form-slider";
|
|
12
|
-
import FormSubmitButton from "./form-submit-button";
|
|
13
|
-
import FormTextInput from "./form-text-input";
|
|
14
|
-
import FormNumberInput2 from "./form-number-input_2";
|
|
15
|
-
export { Button, CancelButton, ContentContainer, ContentTitle, DeleteButton, FormBlock, FormColorInput, FormLabel, FormNumberInput, FormSelect, FormSlider, FormSubmitButton, FormTextInput, FormNumberInput2 };
|
|
2
|
+
export { FormNumberInput };
|
|
16
3
|
export default {
|
|
17
|
-
|
|
18
|
-
CancelButton: CancelButton,
|
|
19
|
-
ContentContainer: ContentContainer,
|
|
20
|
-
ContentTitle: ContentTitle,
|
|
21
|
-
DeleteButton: DeleteButton,
|
|
22
|
-
FormBlock: FormBlock,
|
|
23
|
-
FormColorInput: FormColorInput,
|
|
24
|
-
FormLabel: FormLabel,
|
|
25
|
-
FormNumberInput: FormNumberInput,
|
|
26
|
-
FormSelect: FormSelect,
|
|
27
|
-
FormSlider: FormSlider,
|
|
28
|
-
FormSubmitButton: FormSubmitButton,
|
|
29
|
-
FormTextInput: FormTextInput,
|
|
30
|
-
FormNumberInput2: FormNumberInput2
|
|
4
|
+
FormNumberInput: FormNumberInput
|
|
31
5
|
};
|
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { GeometryUtils } from "../../utils/export";
|
|
7
7
|
import Ruler from "./ruler";
|
|
8
|
-
import { BASE_CABINET_LAYOUTPOS, LINE_THICKNESS, MODE_DRAGGING_LINE, MODE_DRAWING_LINE, WALL_CABINET_LAYOUTPOS, MAX_ANGLE_SCALE, ROOM_SHAPE_MEASUREMENT_LINE_COLOR, ROOM_ELEMENT_MEASUREMENT_LINE_COLOR, BASE_ITEM_MEASUREMENT_LINE_COLOR, WALL_ITEM_MEASUREMENT_LINE_COLOR, DISTANCE_MEASUREMENT_LINE_COLOR, DASH_LINE_COLOR, TALL_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS } from "../../constants";
|
|
8
|
+
import { BASE_CABINET_LAYOUTPOS, LINE_THICKNESS, MODE_DRAGGING_LINE, MODE_DRAWING_LINE, WALL_CABINET_LAYOUTPOS, MAX_ANGLE_SCALE, ROOM_SHAPE_MEASUREMENT_LINE_COLOR, ROOM_ELEMENT_MEASUREMENT_LINE_COLOR, BASE_ITEM_MEASUREMENT_LINE_COLOR, WALL_ITEM_MEASUREMENT_LINE_COLOR, DISTANCE_MEASUREMENT_LINE_COLOR, DASH_LINE_COLOR, TALL_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS, ACCESSORIES_LAYOUTPOS } from "../../constants";
|
|
9
9
|
import * as Three from 'three';
|
|
10
10
|
import { isEmpty } from "./utils";
|
|
11
11
|
var STYLE = {
|
|
@@ -395,7 +395,7 @@ export default function Line(_ref) {
|
|
|
395
395
|
|
|
396
396
|
//base cabinet
|
|
397
397
|
var baseSpace = wallSpace + STEP;
|
|
398
|
-
var base_item = GeometryUtils.getAllItemSpecified(scene, catalog, [BASE_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS]);
|
|
398
|
+
var base_item = GeometryUtils.getAllItemSpecified(scene, catalog, [BASE_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS, ACCESSORIES_LAYOUTPOS]);
|
|
399
399
|
|
|
400
400
|
// base cabinet
|
|
401
401
|
var baseRuler = [];
|
|
@@ -4,7 +4,7 @@ import Viewer3D from "./viewer3d";
|
|
|
4
4
|
import State3D from "./ruler-utils/state3D";
|
|
5
5
|
import { isEmpty } from "../viewer2d/utils";
|
|
6
6
|
var k = 0;
|
|
7
|
-
export default function Front3D(_ref
|
|
7
|
+
export default function Front3D(_ref) {
|
|
8
8
|
var width = _ref.width,
|
|
9
9
|
height = _ref.height,
|
|
10
10
|
state = _ref.state,
|
|
@@ -12,7 +12,6 @@ export default function Front3D(_ref, _ref2) {
|
|
|
12
12
|
replaceCabinet = _ref.replaceCabinet,
|
|
13
13
|
keyDownEnable = _ref.keyDownEnable,
|
|
14
14
|
catalog = _ref.catalog;
|
|
15
|
-
var viewer2DActions = _ref2.viewer2DActions;
|
|
16
15
|
var _useState = useState(''),
|
|
17
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
17
|
mode = _useState2[0],
|
|
@@ -22,94 +22,4 @@ export function initPointerLock(camera, rendererElement) {
|
|
|
22
22
|
pointerlockChangeEvent: pointerlockchange,
|
|
23
23
|
requestPointerLockEvent: requestPointerLockEvent
|
|
24
24
|
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* Funzione per il calcolo delle collisioni con gli oggetti contenuti all'interno di un array.
|
|
28
|
-
* L'idea è quella di utilizzare il ray casting. Per tenere conto del fatto che ci possiamo
|
|
29
|
-
* muovere nelle quattro direzioni, applico una matrice di rotazione alla direzione verso la
|
|
30
|
-
* quale l'oggetto del pointer lock è orientato. */
|
|
31
|
-
|
|
32
|
-
function collision(controls, collisionArray) {
|
|
33
|
-
var rotationMatrix;
|
|
34
|
-
var cameraDirection = controls.getDirection(new THREE.Vector3(0, 0, 0)).clone();
|
|
35
|
-
if (controls.moveForward()) {
|
|
36
|
-
// Nothing to do!
|
|
37
|
-
} else if (controls.moveBackward()) {
|
|
38
|
-
rotationMatrix = new THREE.Matrix4();
|
|
39
|
-
rotationMatrix.makeRotationY(180 * Math.PI / 180);
|
|
40
|
-
} else if (controls.moveLeft()) {
|
|
41
|
-
rotationMatrix = new THREE.Matrix4();
|
|
42
|
-
rotationMatrix.makeRotationY(90 * Math.PI / 180);
|
|
43
|
-
} else if (controls.moveRight()) {
|
|
44
|
-
rotationMatrix = new THREE.Matrix4();
|
|
45
|
-
rotationMatrix.makeRotationY((360 - 90) * Math.PI / 180);
|
|
46
|
-
} else return;
|
|
47
|
-
if (rotationMatrix !== undefined) {
|
|
48
|
-
cameraDirection.applyMatrix4(rotationMatrix);
|
|
49
|
-
}
|
|
50
|
-
var rayCaster = new THREE.Raycaster(controls.getObject().position, cameraDirection.normalize());
|
|
51
|
-
var intersects = rayCaster.intersectObjects(collisionArray, true);
|
|
52
|
-
if (intersects.length > 0 && intersects[0].distance < 10) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* Funzione meno raffinata per il calcolo delle collisioni.
|
|
59
|
-
* In pratica viene definita una bounding geometry (in questo caso la skymap) e poi vengono fatti
|
|
60
|
-
* partire una serie di raggi dall'object del controller fino ai vertici di questa geometria. Se uno di questi interseca
|
|
61
|
-
* uno degli oggetti dei quali vogliamo controllare la collisione, allora la funzione restituirà il valore true */
|
|
62
|
-
/*
|
|
63
|
-
function collision(object, boundingGeometry, collisionArray ) {
|
|
64
|
-
|
|
65
|
-
for (let vertexIndex = 0; vertexIndex < boundingGeometry.geometry.vertices.length; vertexIndex++) {
|
|
66
|
-
let localVertex = boundingGeometry.geometry.vertices[vertexIndex].clone();
|
|
67
|
-
let globalVertex = localVertex.applyMatrix4( object.matrix );
|
|
68
|
-
let directionVector = globalVertex.sub( object.position );
|
|
69
|
-
|
|
70
|
-
let ray = new THREE.Raycaster(object.position, directionVector.clone().normalize());
|
|
71
|
-
let collisionResults = ray.intersectObjects(collisionArray, true);
|
|
72
|
-
if (collisionResults.length > 0 && collisionResults[0].distance < directionVector.length() - 1293) {
|
|
73
|
-
console.log("collisione: ",collisionResults[0].distance," ",directionVector.length()-1293);
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
/* Questa funzione si occupa di determinare se il controllo si trova su un oggetto, in caso negativo cade verso il basso
|
|
82
|
-
* (vedi esempio pointer lock) */
|
|
83
|
-
|
|
84
|
-
function translateY(controls, ray, objects) {
|
|
85
|
-
controls.isOnObject(false);
|
|
86
|
-
ray.ray.origin.copy(controls.getObject().position);
|
|
87
|
-
ray.ray.origin.y -= 10;
|
|
88
|
-
var intersections = ray.intersectObjects(objects, true);
|
|
89
|
-
if (intersections.length > 0) {
|
|
90
|
-
var distance = intersections[0].distance;
|
|
91
|
-
if (distance > 0 && distance < 10) {
|
|
92
|
-
controls.isOnObject(true);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* Queste funzioni bloccano o sbloccano il movimento del controller (utili in caso di collisione) */
|
|
98
|
-
|
|
99
|
-
function lockDirection(controls) {
|
|
100
|
-
if (controls.moveForward()) {
|
|
101
|
-
controls.lockMoveForward(true);
|
|
102
|
-
} else if (controls.moveBackward()) {
|
|
103
|
-
controls.lockMoveBackward(true);
|
|
104
|
-
} else if (controls.moveLeft()) {
|
|
105
|
-
controls.lockMoveLeft(true);
|
|
106
|
-
} else if (controls.moveRight()) {
|
|
107
|
-
controls.lockMoveRight(true);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function unlockAllDirection(controls) {
|
|
111
|
-
controls.lockMoveForward(false);
|
|
112
|
-
controls.lockMoveBackward(false);
|
|
113
|
-
controls.lockMoveLeft(false);
|
|
114
|
-
controls.lockMoveRight(false);
|
|
115
25
|
}
|
|
@@ -15,7 +15,6 @@ import { loadTexture } from "../../catalog/utils/item-loader";
|
|
|
15
15
|
import { returnReplaceableDeepSearchType } from "../viewer2d/utils";
|
|
16
16
|
import { animateDoor, isElevationView, isEmpty, isImmutable, replaceMeshesWithLineSegments, translateDrawer } from "../../utils/helper";
|
|
17
17
|
import { formatNumber } from "../../utils/math";
|
|
18
|
-
var transformBox;
|
|
19
18
|
export var fVLine = [];
|
|
20
19
|
var scene_mode = null;
|
|
21
20
|
export function parseData(sceneData, actions, catalog, camera, renderer, mode) {
|
|
@@ -2,20 +2,6 @@ import * as Three from 'three';
|
|
|
2
2
|
function disposeGeometry(geometry) {
|
|
3
3
|
geometry.dispose();
|
|
4
4
|
}
|
|
5
|
-
function disposeTexture(texture) {
|
|
6
|
-
if (!texture) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
texture.dispose();
|
|
10
|
-
}
|
|
11
|
-
function disposeMultimaterial(material) {
|
|
12
|
-
if (!(material.isMaterial && !Array.isArray(material))) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
material.materials.forEach(function (material) {
|
|
16
|
-
disposeMaterial(material);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
5
|
function disposeMaterial(material) {
|
|
20
6
|
if (!(material instanceof Three.Material)) {
|
|
21
7
|
return;
|
|
@@ -19,7 +19,7 @@ import { checkCabinetOverlap, createBacksplash, deleteSpecifiedMeshObjects, fVLi
|
|
|
19
19
|
import { disposeObject, disposeScene } from "./three-memory-cleaner";
|
|
20
20
|
import diff from 'immutablediff';
|
|
21
21
|
import * as SharedStyle from "../../shared-style";
|
|
22
|
-
import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT,
|
|
22
|
+
import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT, MODE_DRAGGING_HOLE_3D, INTERNAL_EVENT_REPLACE_CABINET } from "../../constants";
|
|
23
23
|
import { isUndefined } from 'util';
|
|
24
24
|
import { verticesDistance } from "../../utils/geometry";
|
|
25
25
|
import { convert } from "../../utils/convert-units-lite";
|
package/es/constants.js
CHANGED
|
@@ -597,6 +597,7 @@ export var BASE_CABINET_LAYOUTPOS = 'Base';
|
|
|
597
597
|
export var WALL_CABINET_LAYOUTPOS = 'Wall';
|
|
598
598
|
export var TALL_CABINET_LAYOUTPOS = 'Tall';
|
|
599
599
|
export var VANITY_CABINET_LAYOUTPOS = 'Vanity';
|
|
600
|
+
export var ACCESSORIES_LAYOUTPOS = 'Accessories';
|
|
600
601
|
export var TOP_MOLDING_LOCATION = 'Top';
|
|
601
602
|
export var MIDDLE_MOLDING_LOCATION = 'Middle';
|
|
602
603
|
export var BOTTOM_MOLDING_LOCATION = 'Bottom';
|
|
@@ -657,16 +658,16 @@ export var PROJECT_SETTING_OPTION = {
|
|
|
657
658
|
CHANGE_MEASUREMENT_UNIT: CHANGE_MEASUREMENT_UNIT
|
|
658
659
|
};
|
|
659
660
|
export var HOLE_NAMES = {
|
|
660
|
-
WINDOW_CLEAR: '
|
|
661
|
-
WINDOW_CROSS: 'Cross
|
|
662
|
-
WINDOW_DOUBLE_HUNG: 'Double Hung
|
|
663
|
-
WINDOW_VERTICAL: '
|
|
661
|
+
WINDOW_CLEAR: 'Clear',
|
|
662
|
+
WINDOW_CROSS: 'Cross',
|
|
663
|
+
WINDOW_DOUBLE_HUNG: 'Double Hung',
|
|
664
|
+
WINDOW_VERTICAL: 'Vertical',
|
|
664
665
|
DOOR_CLOSET: 'Closet',
|
|
665
666
|
DOOR_EXTERIOR: 'Exterior',
|
|
666
667
|
DOOR_INTERIOR: 'Interior',
|
|
667
668
|
DOOR_SLIDING: 'Sliding',
|
|
668
669
|
DOOR_FRAMED: 'Framed Doorway',
|
|
669
|
-
DOOR_FRAMELESS: '
|
|
670
|
+
DOOR_FRAMELESS: 'Frameless Doorway'
|
|
670
671
|
};
|
|
671
672
|
|
|
672
673
|
// direction type
|
|
@@ -771,4 +772,8 @@ export var ROOM_SHAPE_TYPE = {
|
|
|
771
772
|
export var DOORSTYLE_SCOPE_ALL = 'all';
|
|
772
773
|
export var DOORSTYLE_SCOPE_SINGLE = 'single';
|
|
773
774
|
export var DOORSTYLE_SCOPE_MULTIPLE = 'multiple';
|
|
774
|
-
export var DEFAULT_MOLDING_PIECE_LENGTH = 96; // in inch, 8 feet, standard length for molding pieces
|
|
775
|
+
export var DEFAULT_MOLDING_PIECE_LENGTH = 96; // in inch, 8 feet, standard length for molding pieces
|
|
776
|
+
// default urls
|
|
777
|
+
|
|
778
|
+
export var DEFAULT_INTERIOR_URL = '/assets/img/default/maple.jpg';
|
|
779
|
+
export var DEFAULT_DOOR_HANDLE_TEXTURE_URL = '/assets/img/default/steel.jpg';
|