kitchen-simulator 1.0.0-clark.67 → 1.0.0-clark.71
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/catalog/factories/wall-factory.js +8 -8
- package/es/catalog/utils/exporter.js +2 -0
- package/es/catalog/utils/item-loader.js +8 -2
- package/es/class/item.js +1 -3
- package/es/class/line.js +27 -12
- package/es/components/viewer2d/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/item.js +10 -5
- package/es/components/viewer2d/line.js +315 -243
- package/es/components/viewer2d/ruler.js +16 -36
- package/es/components/viewer2d/rulerDist.js +18 -32
- package/es/components/viewer2d/viewer2d.js +18 -7
- package/es/constants.js +6 -0
- package/es/models.js +6 -5
- package/es/shared-style.js +4 -4
- package/es/utils/isolate-event-handler.js +5 -0
- package/lib/catalog/factories/wall-factory.js +8 -8
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/catalog/utils/item-loader.js +8 -2
- package/lib/class/item.js +1 -3
- package/lib/class/line.js +27 -12
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/item.js +10 -5
- package/lib/components/viewer2d/line.js +315 -242
- package/lib/components/viewer2d/ruler.js +15 -35
- package/lib/components/viewer2d/rulerDist.js +18 -32
- package/lib/components/viewer2d/viewer2d.js +18 -7
- package/lib/constants.js +10 -4
- package/lib/models.js +6 -5
- package/lib/shared-style.js +4 -4
- package/lib/utils/isolate-event-handler.js +5 -0
- package/package.json +1 -1
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { convert } from "../../utils/convert-units-lite";
|
|
4
4
|
import IDBroker from "../../utils/id-broker";
|
|
5
|
-
import {
|
|
5
|
+
import { TEXT_COLOR_NEUTRAL_7 } from "../../constants";
|
|
6
|
+
import { STYLE_ROOM_SHAPE } from "./line";
|
|
6
7
|
var STYLE = {
|
|
7
8
|
stroke: TEXT_COLOR_NEUTRAL_7,
|
|
8
9
|
strokeWidth: '1px'
|
|
@@ -15,6 +16,7 @@ var STYLE_TEXT = {
|
|
|
15
16
|
textAnchor: 'middle',
|
|
16
17
|
fontSize: '12px',
|
|
17
18
|
pointerEvents: 'none',
|
|
19
|
+
fill: '#455A64',
|
|
18
20
|
//http://stackoverflow.com/questions/826782/how-to-disable-text-selection-highlighting-using-css
|
|
19
21
|
WebkitTouchCallout: 'none' /* iOS Safari */,
|
|
20
22
|
WebkitUserSelect: 'none' /* Chrome/Safari/Opera */,
|
|
@@ -28,37 +30,9 @@ export default function Ruler(_ref) {
|
|
|
28
30
|
unit = _ref.unit,
|
|
29
31
|
rulerUnit = _ref.rulerUnit,
|
|
30
32
|
transform = _ref.transform,
|
|
31
|
-
|
|
32
|
-
var update = function update(lengthInput, unitInput, type) {
|
|
33
|
-
var newLength = toFixedFloat(lengthInput);
|
|
34
|
-
var merged = null;
|
|
35
|
-
if (type === 0) {
|
|
36
|
-
merged = value.merge({
|
|
37
|
-
_length: newLength,
|
|
38
|
-
length: convert(newLength).from(unitInput).to('cm')
|
|
39
|
-
});
|
|
40
|
-
} else {
|
|
41
|
-
merged = value.merge({
|
|
42
|
-
_length: convert(newLength).from(UNIT_INCH).to(unitInput),
|
|
43
|
-
_unit: unitInput
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
// if (hook) {
|
|
47
|
-
// return hook(merged, sourceElement, internalState, state).then(val => {
|
|
48
|
-
// return onUpdate(val);
|
|
49
|
-
// });
|
|
50
|
-
// }
|
|
51
|
-
// return onUpdate(merged);
|
|
52
|
-
};
|
|
53
|
-
// let _unit = "in";
|
|
54
|
-
// let distanceText = convert(length).from(unit).to(rulerUnit);
|
|
33
|
+
style = _ref.style;
|
|
55
34
|
var distanceText = convert(length).from(unit).to(rulerUnit).toFixed(0);
|
|
56
|
-
var
|
|
57
|
-
// let _ft_len = convert(_length).from('in').to('ft');
|
|
58
|
-
// let _ft_val = Math.floor(_ft_len); _ft_len -= _ft_val;
|
|
59
|
-
// let _in_val = convert(_ft_len).from('ft').to('in').toFixed(0);
|
|
60
|
-
// let distanceText = `${_ft_val}'${_in_val}"`;
|
|
61
|
-
var textLength = (distanceText.length + layer.unit.length) * 18;
|
|
35
|
+
var textLength = (distanceText.length + layer.unit.length) * 9;
|
|
62
36
|
return /*#__PURE__*/React.createElement("g", {
|
|
63
37
|
transform: transform
|
|
64
38
|
}, /*#__PURE__*/React.createElement("g", {
|
|
@@ -79,18 +53,24 @@ export default function Ruler(_ref) {
|
|
|
79
53
|
style: STYLE_TEXT,
|
|
80
54
|
fill: TEXT_COLOR_NEUTRAL_7
|
|
81
55
|
}, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit === 'in' ? '"' : layer.unit)), /*#__PURE__*/React.createElement("line", {
|
|
82
|
-
x1:
|
|
56
|
+
x1: style === STYLE_ROOM_SHAPE ? 0 : 4,
|
|
83
57
|
y1: "0",
|
|
84
58
|
x2: (length - textLength) / 2 < 0 ? 0 : (length - textLength) / 2,
|
|
85
59
|
y2: "0",
|
|
86
|
-
style:
|
|
60
|
+
style: style
|
|
87
61
|
}), /*#__PURE__*/React.createElement("line", {
|
|
88
62
|
x1: (length + textLength) / 2 < 0 ? 0 : (length + textLength) / 2 < length ? (length + textLength) / 2 : length,
|
|
89
63
|
y1: "0",
|
|
90
|
-
x2: length,
|
|
64
|
+
x2: style === STYLE_ROOM_SHAPE ? length : length - 4,
|
|
91
65
|
y2: "0",
|
|
92
|
-
style:
|
|
93
|
-
})
|
|
66
|
+
style: style
|
|
67
|
+
}), style !== STYLE_ROOM_SHAPE && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("polygon", {
|
|
68
|
+
points: "3, 0, 6.5, -2, 6.5, 2 ",
|
|
69
|
+
style: style
|
|
70
|
+
}), /*#__PURE__*/React.createElement("polygon", {
|
|
71
|
+
points: "".concat(length - 3, ", 0, ").concat(length - 6.5, ", 2, ").concat(length - 6.5, ", -2"),
|
|
72
|
+
style: style
|
|
73
|
+
})));
|
|
94
74
|
}
|
|
95
75
|
Ruler.propTypes = {
|
|
96
76
|
length: PropTypes.number.isRequired,
|
|
@@ -7,13 +7,15 @@ var ARROW_STYLE = {
|
|
|
7
7
|
strokeLinecap: 'round'
|
|
8
8
|
};
|
|
9
9
|
var STYLE = {
|
|
10
|
-
stroke: '
|
|
11
|
-
|
|
10
|
+
stroke: '#455A64',
|
|
11
|
+
fill: '#455A64',
|
|
12
|
+
strokeWidth: '1.5px'
|
|
12
13
|
};
|
|
13
14
|
var STYLE_TEXT = {
|
|
14
15
|
textAnchor: 'middle',
|
|
15
16
|
fontSize: '10px',
|
|
16
17
|
pointerEvents: 'none',
|
|
18
|
+
fill: '#455A64',
|
|
17
19
|
//http://stackoverflow.com/questions/826782/how-to-disable-text-selection-highlighting-using-css
|
|
18
20
|
WebkitTouchCallout: 'none' /* iOS Safari */,
|
|
19
21
|
WebkitUserSelect: 'none' /* Chrome/Safari/Opera */,
|
|
@@ -75,32 +77,24 @@ export default function RulerDist(_ref) {
|
|
|
75
77
|
y: "0",
|
|
76
78
|
transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
|
|
77
79
|
style: STYLE_TEXT
|
|
78
|
-
}, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit)), /*#__PURE__*/React.createElement("
|
|
79
|
-
cx: "1",
|
|
80
|
-
cy: "0",
|
|
81
|
-
fill: "white",
|
|
82
|
-
r: "1.1",
|
|
83
|
-
stroke: "black",
|
|
84
|
-
strokeWidth: "0.6"
|
|
85
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
80
|
+
}, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit === 'in' ? '"' : layer.unit)), /*#__PURE__*/React.createElement("line", {
|
|
86
81
|
x1: "2",
|
|
87
82
|
y1: "0",
|
|
88
83
|
x2: (length - textLength) / 2 < 0 ? 0 : length,
|
|
89
84
|
y2: "0",
|
|
90
85
|
style: STYLE
|
|
86
|
+
}), /*#__PURE__*/React.createElement("polygon", {
|
|
87
|
+
points: "1, 0, 4.5, -2, 4.5, 2 ",
|
|
88
|
+
style: STYLE
|
|
91
89
|
}), /*#__PURE__*/React.createElement("line", {
|
|
92
90
|
x1: (length + textLength) / 2 < 0 ? 0 : (length + textLength) / 2 < length ? (length + textLength) / 2 : length,
|
|
93
91
|
y1: "0",
|
|
94
92
|
x2: length,
|
|
95
93
|
y2: "0",
|
|
96
94
|
style: STYLE
|
|
97
|
-
}), /*#__PURE__*/React.createElement("
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
fill: "white",
|
|
101
|
-
r: "1.1",
|
|
102
|
-
stroke: "black",
|
|
103
|
-
strokeWidth: "0.6"
|
|
95
|
+
}), /*#__PURE__*/React.createElement("polygon", {
|
|
96
|
+
points: "".concat(length - 1, ", 0, ").concat(length - 4.5, ", 2, ").concat(length - 4.5, ", -2"),
|
|
97
|
+
style: STYLE
|
|
104
98
|
}));
|
|
105
99
|
} else {
|
|
106
100
|
return /*#__PURE__*/React.createElement("g", {
|
|
@@ -110,32 +104,24 @@ export default function RulerDist(_ref) {
|
|
|
110
104
|
y: "0",
|
|
111
105
|
transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
|
|
112
106
|
style: STYLE_TEXT
|
|
113
|
-
}, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit)), /*#__PURE__*/React.createElement("
|
|
114
|
-
cx: "1",
|
|
115
|
-
cy: "0",
|
|
116
|
-
fill: "white",
|
|
117
|
-
r: "1.1",
|
|
118
|
-
stroke: "black",
|
|
119
|
-
strokeWidth: "0.6"
|
|
120
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
107
|
+
}, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit === 'in' ? '"' : layer.unit)), /*#__PURE__*/React.createElement("line", {
|
|
121
108
|
x1: "2",
|
|
122
109
|
y1: "0",
|
|
123
110
|
x2: (length - textLength) / 2 < 0 ? 0 : (length - textLength) / 2,
|
|
124
111
|
y2: "0",
|
|
125
112
|
style: STYLE
|
|
113
|
+
}), /*#__PURE__*/React.createElement("polygon", {
|
|
114
|
+
points: "1, 0, 4.5, -2, 4.5, 2 ",
|
|
115
|
+
style: STYLE
|
|
126
116
|
}), /*#__PURE__*/React.createElement("line", {
|
|
127
117
|
x1: (length + textLength) / 2 < 0 ? 0 : (length + textLength) / 2 < length ? (length + textLength) / 2 : length,
|
|
128
118
|
y1: "0",
|
|
129
119
|
x2: length,
|
|
130
120
|
y2: "0",
|
|
131
121
|
style: STYLE
|
|
132
|
-
}), /*#__PURE__*/React.createElement("
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
fill: "white",
|
|
136
|
-
r: "1.1",
|
|
137
|
-
stroke: "black",
|
|
138
|
-
strokeWidth: "0.6"
|
|
122
|
+
}), /*#__PURE__*/React.createElement("polygon", {
|
|
123
|
+
points: "".concat(length - 1, ", 0, ").concat(length - 4.5, ", 2, ").concat(length - 4.5, ", -2"),
|
|
124
|
+
style: STYLE
|
|
139
125
|
}));
|
|
140
126
|
}
|
|
141
127
|
}
|
|
@@ -390,6 +390,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
390
390
|
vertices[dragVertexId].y = y;
|
|
391
391
|
}
|
|
392
392
|
var absAngle, lineAngle;
|
|
393
|
+
var angles = [];
|
|
393
394
|
if (draggingLine.vertices[0] !== draggingLine.vertices[1]) {
|
|
394
395
|
if (isEmpty(relatedLines) && mode !== 'DRAGGING_LINE') {
|
|
395
396
|
endDrag.push(true);
|
|
@@ -408,6 +409,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
408
409
|
absAngle = Math.abs(lineAngle);
|
|
409
410
|
var tmpRelated = [];
|
|
410
411
|
GeometryUtils.getRelatedLines(tmpRelated, line, vertices, allLines, draggingLine.id);
|
|
412
|
+
angles.push(lineAngle);
|
|
411
413
|
for (var j = 0; j < tmpRelated.length; j++) {
|
|
412
414
|
var tmpAngle = Math.abs(GeometryUtils.angleBetweenTwoLines(tmpRelated[j], line, vertices));
|
|
413
415
|
if (tmpAngle < MIN_ANGLE_DISALLOW_DRAW_WALL || tmpAngle > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
@@ -425,7 +427,6 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
425
427
|
vtx = x;
|
|
426
428
|
vty = y;
|
|
427
429
|
} else {
|
|
428
|
-
var rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
|
|
429
430
|
// the origin point of rotation(snapping)
|
|
430
431
|
var _originVerId = draggingLine.vertices.findIndex(function (vertice) {
|
|
431
432
|
return vertice !== dragVertexId;
|
|
@@ -434,12 +435,22 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
434
435
|
if (stepUnit) {
|
|
435
436
|
var _ox = vertices[_originVerId].x;
|
|
436
437
|
var _oy = vertices[_originVerId].y;
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
438
|
+
angles.forEach(function (angle, index) {
|
|
439
|
+
if (Math.abs(angle) < MIN_ANGLE_DISALLOW_DRAW_WALL || Math.abs(angle) > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
440
|
+
var absVal = Math.abs(angle);
|
|
441
|
+
var rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absVal;
|
|
442
|
+
if (absVal > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
443
|
+
absVal = 360 - absVal;
|
|
444
|
+
rest = -(MIN_ANGLE_DISALLOW_DRAW_WALL - absVal);
|
|
445
|
+
}
|
|
446
|
+
// determine the direction of rotation.
|
|
447
|
+
rest = angle > 0 ? -rest : rest;
|
|
448
|
+
// rotate the current point to last point around the first point of drawing line.
|
|
449
|
+
var res = GeometryUtils.rotatePointAroundPoint(x, y, _ox, _oy, rest);
|
|
450
|
+
vtx = res.x;
|
|
451
|
+
vty = res.y;
|
|
452
|
+
}
|
|
453
|
+
});
|
|
443
454
|
}
|
|
444
455
|
}
|
|
445
456
|
|
package/es/constants.js
CHANGED
|
@@ -545,6 +545,12 @@ export var LABEL_COLOR = '#6E7191';
|
|
|
545
545
|
export var TEXT_COLOR = '#000000';
|
|
546
546
|
export var ACCENT_COLOR = '#AD00FF';
|
|
547
547
|
export var BROWN_COLOR = '#624100';
|
|
548
|
+
export var ROOM_SHAPE_MEASUREMENT_LINE_COLOR = '#455A64';
|
|
549
|
+
export var ROOM_ELEMENT_MEASUREMENT_LINE_COLOR = '#B0BEC5';
|
|
550
|
+
export var BASE_ITEM_MEASUREMENT_LINE_COLOR = '#0277BD';
|
|
551
|
+
export var WALL_ITEM_MEASUREMENT_LINE_COLOR = '#00897B';
|
|
552
|
+
export var DISTANCE_MEASUREMENT_LINE_COLOR = '#7B1FA2';
|
|
553
|
+
export var DASH_LINE_COLOR = '#78909C';
|
|
548
554
|
export var DEFAULT_FONT_FAMILY = 'Open Sans';
|
|
549
555
|
|
|
550
556
|
// Download summary
|
package/es/models.js
CHANGED
|
@@ -38,16 +38,16 @@ export var DefaultGrids = new Map({
|
|
|
38
38
|
id: 'h1',
|
|
39
39
|
type: 'horizontal-streak',
|
|
40
40
|
properties: {
|
|
41
|
-
step:
|
|
42
|
-
colors: ['
|
|
41
|
+
step: 24,
|
|
42
|
+
colors: ['rgba(193, 202, 228, 0.45)'] // dot's color
|
|
43
43
|
}
|
|
44
44
|
}),
|
|
45
45
|
v1: new Grid({
|
|
46
46
|
id: 'v1',
|
|
47
47
|
type: 'vertical-streak',
|
|
48
48
|
properties: {
|
|
49
|
-
step:
|
|
50
|
-
colors: ['
|
|
49
|
+
step: 24,
|
|
50
|
+
colors: ['rgba(193, 202, 228, 0.45)'] // dot's color
|
|
51
51
|
}
|
|
52
52
|
})
|
|
53
53
|
});
|
|
@@ -339,7 +339,8 @@ export var CatalogElement = /*#__PURE__*/function (_Record1) {
|
|
|
339
339
|
properties: new Map(),
|
|
340
340
|
obj: new Map(),
|
|
341
341
|
type: '',
|
|
342
|
-
cds: new Map()
|
|
342
|
+
cds: new Map(),
|
|
343
|
+
customer_property: new Map()
|
|
343
344
|
}, 'CatalogElement'));
|
|
344
345
|
export var Catalog = /*#__PURE__*/function (_Record10) {
|
|
345
346
|
function Catalog() {
|
package/es/shared-style.js
CHANGED
|
@@ -54,13 +54,13 @@ export var AREA_MESH_COLOR = {
|
|
|
54
54
|
unselected: 'rgb(221,221,255)'
|
|
55
55
|
};
|
|
56
56
|
export var INTERIOR_LINE = {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
selected: '#6E1EA8',
|
|
58
|
+
unselected: ' #455A64'
|
|
59
59
|
};
|
|
60
60
|
export var LINE_MESH_COLOR = {
|
|
61
|
-
selected: '#
|
|
61
|
+
selected: '#6E1EA8',
|
|
62
62
|
unselected: 'rgb(135,145,171)'
|
|
63
63
|
};
|
|
64
64
|
export var LINE_MESH = {
|
|
65
|
-
selected: '#
|
|
65
|
+
selected: '#6E1EA8'
|
|
66
66
|
};
|
|
@@ -504,6 +504,11 @@ function _handleExternalEvent() {
|
|
|
504
504
|
}
|
|
505
505
|
_element = evt.payload;
|
|
506
506
|
catalog = state.getIn(['catalog']).toJS(); // add item to catalog of state
|
|
507
|
+
_element = _objectSpread(_objectSpread({}, _element), {}, {
|
|
508
|
+
cds: {
|
|
509
|
+
itemID: _element.itemID
|
|
510
|
+
}
|
|
511
|
+
});
|
|
507
512
|
if (!isEmpty(catalog === null || catalog === void 0 ? void 0 : catalog.elements[_element.name])) {
|
|
508
513
|
_context5.next = 8;
|
|
509
514
|
break;
|
|
@@ -27,11 +27,11 @@ var STYLE_LINE = {
|
|
|
27
27
|
// strokeWidth:1
|
|
28
28
|
};
|
|
29
29
|
var STYLE_INTERIOR_LINE = {
|
|
30
|
-
strokeWidth:
|
|
30
|
+
strokeWidth: 2,
|
|
31
31
|
stroke: SharedStyle.INTERIOR_LINE.unselected
|
|
32
32
|
};
|
|
33
33
|
var STYLE_INTERIOR_LINE_SELECTED = {
|
|
34
|
-
strokeWidth:
|
|
34
|
+
strokeWidth: 4,
|
|
35
35
|
stroke: SharedStyle.INTERIOR_LINE.selected,
|
|
36
36
|
fill: SharedStyle.INTERIOR_LINE.selected,
|
|
37
37
|
rx: '2px'
|
|
@@ -224,9 +224,9 @@ function WallFactory(name, info, textures) {
|
|
|
224
224
|
})));
|
|
225
225
|
return !element.selected ? /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("polygon", {
|
|
226
226
|
points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
|
|
227
|
-
fill: "
|
|
228
|
-
fillRule
|
|
229
|
-
}),
|
|
227
|
+
fill: "#CFD8DC"
|
|
228
|
+
// fillRule="evenodd"
|
|
229
|
+
}), /*#__PURE__*/_react["default"].createElement("line", {
|
|
230
230
|
x1: x1,
|
|
231
231
|
y1: y1,
|
|
232
232
|
x2: x2,
|
|
@@ -234,9 +234,9 @@ function WallFactory(name, info, textures) {
|
|
|
234
234
|
style: STYLE_INTERIOR_LINE
|
|
235
235
|
})) : /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("polygon", {
|
|
236
236
|
points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
|
|
237
|
-
fill: "
|
|
238
|
-
fillRule
|
|
239
|
-
}),
|
|
237
|
+
fill: "#CFD8DC"
|
|
238
|
+
// fillRule="evenodd"
|
|
239
|
+
}), /*#__PURE__*/_react["default"].createElement("line", {
|
|
240
240
|
x1: x1,
|
|
241
241
|
y1: y1,
|
|
242
242
|
x2: x2,
|
|
@@ -27,6 +27,7 @@ function _default(_ref) {
|
|
|
27
27
|
alti = _ref.alti,
|
|
28
28
|
obj_property = _ref.obj_property,
|
|
29
29
|
outlineSVGData = _ref.outlineSVGData,
|
|
30
|
+
customer_property = _ref.customer_property,
|
|
30
31
|
cds = _ref.cds;
|
|
31
32
|
var _length = alti || 0;
|
|
32
33
|
// const length = convert(_length).from("in").to("cm");
|
|
@@ -143,6 +144,7 @@ function _default(_ref) {
|
|
|
143
144
|
img: base,
|
|
144
145
|
obj: obj_property,
|
|
145
146
|
cds: cds,
|
|
147
|
+
customer_property: customer_property,
|
|
146
148
|
render2D: function render2D(element, layer, scene) {
|
|
147
149
|
return render2DItem.call(this, element, layer, scene, sizeinfo, layoutpos, is_corner, shape_svg);
|
|
148
150
|
},
|
|
@@ -369,8 +369,14 @@ function render3DItem(element, layer, scene, sizeinfo, structure_json, is_corner
|
|
|
369
369
|
if (layer.toJS().counterTop.uri) {
|
|
370
370
|
counterTop.uri = layer.toJS().counterTop.uri;
|
|
371
371
|
}
|
|
372
|
-
if ('name'
|
|
373
|
-
|
|
372
|
+
if (element.doorStyle.has('name')) {
|
|
373
|
+
var tempDoorStyle = element.doorStyle.toJS().doorStyles;
|
|
374
|
+
if (!tempDoorStyle.hasOwnProperty('base')) {
|
|
375
|
+
tempDoorStyle = _objectSpread(_objectSpread({}, tempDoorStyle), {}, {
|
|
376
|
+
base: ''
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
doorStyles = new _immutable.Map(tempDoorStyle);
|
|
374
380
|
color = element.doorStyle.color;
|
|
375
381
|
glossness = element.doorStyle.glossness;
|
|
376
382
|
handleMaterial.metalness = element.doorStyle.metalness;
|
package/lib/class/item.js
CHANGED
|
@@ -78,9 +78,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
78
78
|
}
|
|
79
79
|
var setSizeOfItemByDoorStyle = function setSizeOfItemByDoorStyle() {
|
|
80
80
|
var doorStyle = item.get('doorStyle').toJS();
|
|
81
|
-
var euroCDS = state.catalog.getIn(['elements', type, '
|
|
82
|
-
return element && element.is_euro_cds;
|
|
83
|
-
});
|
|
81
|
+
var euroCDS = state.catalog.getIn(['elements', type, 'customer_property']).is_euro_cds;
|
|
84
82
|
if (doorStyle.door_style_name === 'Euro & Frameless' && euroCDS.length > 0) {
|
|
85
83
|
var newProperties = item.get('properties').toJS();
|
|
86
84
|
if (newProperties.hasOwnProperty('depth')) {
|
package/lib/class/line.js
CHANGED
|
@@ -510,7 +510,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
|
|
|
510
510
|
// let relatedLines = [];
|
|
511
511
|
var vertices = state.getIn(['scene', 'layers', layerID, 'vertices']).toJS();
|
|
512
512
|
var drawingLine = state.getIn(['scene', 'layers', layerID, 'lines', lineID]).toJS();
|
|
513
|
-
var moveFlag =
|
|
513
|
+
var moveFlag = [];
|
|
514
514
|
var tx = vertices[drawingLine.vertices[1]].x;
|
|
515
515
|
var ty = vertices[drawingLine.vertices[1]].y;
|
|
516
516
|
if (!(0, _helper.isEmpty)(relatedLines)) {
|
|
@@ -518,6 +518,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
|
|
|
518
518
|
vertices[drawingLine.vertices[1]].y = y;
|
|
519
519
|
}
|
|
520
520
|
var absAngle, lineAngle;
|
|
521
|
+
var angles = [];
|
|
521
522
|
|
|
522
523
|
// get the angle of two lines and check the angle
|
|
523
524
|
if (drawingLine.vertices[0] !== drawingLine.vertices[1]) {
|
|
@@ -529,9 +530,10 @@ var Line = exports["default"] = /*#__PURE__*/function () {
|
|
|
529
530
|
lineAngle = _export2.GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
|
|
530
531
|
// check whether the angle is less than or bigger than specific value.
|
|
531
532
|
absAngle = Math.abs(lineAngle);
|
|
533
|
+
angles.push(lineAngle);
|
|
532
534
|
if (absAngle < _constants.MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
533
|
-
moveFlag
|
|
534
|
-
} else moveFlag
|
|
535
|
+
moveFlag.push(false);
|
|
536
|
+
} else moveFlag.push(true);
|
|
535
537
|
}
|
|
536
538
|
});
|
|
537
539
|
} else {
|
|
@@ -543,23 +545,36 @@ var Line = exports["default"] = /*#__PURE__*/function () {
|
|
|
543
545
|
}
|
|
544
546
|
|
|
545
547
|
// if the angle is bigger or less than specific value, the wall mustn't be drawn at new position
|
|
546
|
-
if (moveFlag) {
|
|
548
|
+
if (!moveFlag.some(function (flag) {
|
|
549
|
+
return flag === false;
|
|
550
|
+
})) {
|
|
547
551
|
tx = x;
|
|
548
552
|
ty = y;
|
|
549
553
|
} else {
|
|
550
|
-
var rest = _constants.MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
|
|
551
554
|
// the origin point of rotation(snapping)
|
|
552
555
|
var ox = vertices[drawingLine.vertices[0]].x;
|
|
553
556
|
var oy = vertices[drawingLine.vertices[0]].y;
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
557
|
+
angles.forEach(function (angle, index) {
|
|
558
|
+
if (!moveFlag[index]) {
|
|
559
|
+
var absVal = Math.abs(angle);
|
|
560
|
+
var rest = _constants.MIN_ANGLE_DISALLOW_DRAW_WALL - absVal;
|
|
561
|
+
if (absVal > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
562
|
+
absVal = 360 - absVal;
|
|
563
|
+
rest = -(_constants.MIN_ANGLE_DISALLOW_DRAW_WALL - absVal);
|
|
564
|
+
}
|
|
565
|
+
// determine the direction of rotation.
|
|
566
|
+
rest = angle > 0 ? -rest : rest;
|
|
567
|
+
// rotate the current point to last point around the first point of drawing line.
|
|
568
|
+
var res = _export2.GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
|
|
569
|
+
tx = res.x;
|
|
570
|
+
ty = res.y;
|
|
571
|
+
}
|
|
572
|
+
});
|
|
560
573
|
}
|
|
561
574
|
// angle snapping as a value of UNIT_ANGLE
|
|
562
|
-
if (moveFlag
|
|
575
|
+
if (!moveFlag.some(function (flag) {
|
|
576
|
+
return flag === false;
|
|
577
|
+
}) && !(0, _helper.isEmpty)(absAngle) && absAngle % _constants.UNIT_ANGLE !== 0) {
|
|
563
578
|
var result = _export2.GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
|
|
564
579
|
tx = result.x;
|
|
565
580
|
ty = result.y;
|
|
@@ -127,11 +127,11 @@ function Item(_ref, _ref2) {
|
|
|
127
127
|
var selectedItem;
|
|
128
128
|
if (layer.selected.items.size > 0) {
|
|
129
129
|
selectedItem = layer.getIn(['items', layer.selected.items.get(0)]);
|
|
130
|
-
var
|
|
131
|
-
var
|
|
130
|
+
var _catid = selectedItem.type;
|
|
131
|
+
var _cat = (0, _geometry.findCatalogElement)(catalog, _catid);
|
|
132
132
|
currentItem = {
|
|
133
133
|
selectedItem: selectedItem,
|
|
134
|
-
cat:
|
|
134
|
+
cat: _cat
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
layer.items.forEach(function (item) {
|
|
@@ -269,7 +269,7 @@ function Item(_ref, _ref2) {
|
|
|
269
269
|
if (_export.GeometryUtils.pointsDistance(p0.x, p0.y, p1.x, p1.y) > _export.GeometryUtils.pointsDistance(p0.x, p0.y, coordinatePoint.x, coordinatePoint.y) && _export.GeometryUtils.pointsDistance(p0.x, p0.y, p1.x, p1.y) > _export.GeometryUtils.pointsDistance(p1.x, p1.y, coordinatePoint.x, coordinatePoint.y)) {
|
|
270
270
|
if (_export.GeometryUtils.pointsDistance(coordinatePoint.x, coordinatePoint.y, center_x, center_y) > _export.GeometryUtils.pointsDistance(centerpoint[0].x, centerpoint[0].y, coordinatePoint.x, coordinatePoint.y)) {
|
|
271
271
|
comparelength.push(_export.GeometryUtils.pointsDistance(centerpoint[0].x, centerpoint[0].y, coordinatePoint.x, coordinatePoint.y));
|
|
272
|
-
a = Math.
|
|
272
|
+
a = Math.max.apply(null, comparelength);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
}
|
|
@@ -284,8 +284,13 @@ function Item(_ref, _ref2) {
|
|
|
284
284
|
var nh = height / 2;
|
|
285
285
|
var _getDistant = getDistant(x, y, val.rotRad),
|
|
286
286
|
PointArray = _getDistant.PointArray;
|
|
287
|
+
var catid = item.type;
|
|
288
|
+
var cat = catalog.elements[catid];
|
|
287
289
|
PointArray.forEach(function (pointElement, index) {
|
|
288
290
|
if (pointElement[0] == undefined) PointArray[index][0] = 0;
|
|
291
|
+
if (pointElement[1] === -90 && cat.info.is_corner !== 1) {
|
|
292
|
+
PointArray[index][0] -= 4;
|
|
293
|
+
}
|
|
289
294
|
});
|
|
290
295
|
if (Array.isArray(PointArray)) {
|
|
291
296
|
itemsActions.storeDistArray(layerID, id, PointArray);
|
|
@@ -314,7 +319,7 @@ function Item(_ref, _ref2) {
|
|
|
314
319
|
length: itemDistanceFromLine,
|
|
315
320
|
angle: rotation,
|
|
316
321
|
rotation: element[1],
|
|
317
|
-
transform: "translate(".concat(element[1] === 180 ? -nw : element[1] === 0 ? nw : 0, ", ").concat(element[1] === 90 ? nh : element[1] === -90 ? -nh
|
|
322
|
+
transform: "translate(".concat(element[1] === 180 ? -nw : element[1] === 0 ? nw : 0, ", ").concat(element[1] === 90 ? nh : element[1] === -90 ? cat.info.is_corner !== 1 ? -(nh + 4) : -nh : 0, ") rotate(").concat(element[1], ", 0, 0)")
|
|
318
323
|
})));
|
|
319
324
|
}
|
|
320
325
|
});
|