qwc2 2025.10.9 → 2025.10.14
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/actions/display.js +30 -1
- package/actions/editing.js +22 -1
- package/actions/layerinfo.js +13 -1
- package/actions/layers.js +213 -3
- package/actions/localConfig.js +58 -1
- package/actions/locale.js +21 -1
- package/actions/locate.js +26 -1
- package/actions/logging.js +10 -1
- package/actions/map.js +105 -2
- package/actions/measurement.js +12 -1
- package/actions/processNotifications.js +37 -1
- package/actions/redlining.js +18 -1
- package/actions/redliningPick.js +12 -1
- package/actions/search.js +12 -1
- package/actions/serviceinfo.js +12 -1
- package/actions/task.js +55 -3
- package/actions/theme.js +339 -19
- package/actions/windows.js +164 -5
- package/components/AppMenu.js +435 -3
- package/components/AttributeForm.js +928 -32
- package/components/AttributeTableWidget.js +1105 -13
- package/components/AutoEditForm.js +189 -3
- package/components/CoordinateDisplayer.js +78 -2
- package/components/EditComboField.js +190 -6
- package/components/EditUploadField.js +315 -3
- package/components/ExportSelection.js +203 -2
- package/components/FullscreenSwitcher.js +90 -3
- package/components/Icon.js +81 -2
- package/components/IdentifyViewer.js +1161 -6
- package/components/ImportLayer.js +718 -20
- package/components/LayerInfoWindow.js +145 -2
- package/components/LinkFeatureForm.js +246 -5
- package/components/MapButton.js +88 -2
- package/components/MapSelection.js +287 -8
- package/components/MessageBar.js +68 -2
- package/components/NumericInputWindow.js +359 -2
- package/components/PickFeature.js +266 -2
- package/components/PluginsContainer.js +227 -8
- package/components/PrintSelection.js +620 -49
- package/components/ProcessNotifications.js +104 -2
- package/components/QtDesignerForm.js +1137 -18
- package/components/ResizeableWindow.js +591 -8
- package/components/SearchBox.js +1307 -20
- package/components/ServiceInfoWindow.js +107 -2
- package/components/SideBar.js +204 -4
- package/components/StandardApp.js +381 -20
- package/components/Swipeable.js +15 -1
- package/components/TaskBar.js +85 -2
- package/components/ThemeLayersListWindow.js +216 -4
- package/components/ThemeList.js +381 -7
- package/components/Toolbar.js +106 -2
- package/components/WindowManager.js +178 -2
- package/components/map/OlLayer.js +257 -6
- package/components/map/OlMap.js +405 -5
- package/components/map/layers/BingLayer.js +31 -2
- package/components/map/layers/GoogleLayer.js +222 -19
- package/components/map/layers/GraticuleLayer.js +21 -1
- package/components/map/layers/ImageLayer.js +15 -1
- package/components/map/layers/MVTLayer.js +52 -2
- package/components/map/layers/OSMLayer.js +24 -2
- package/components/map/layers/OverlayLayer.js +55 -3
- package/components/map/layers/VectorLayer.js +173 -8
- package/components/map/layers/WFSLayer.js +220 -6
- package/components/map/layers/WMSLayer.js +180 -6
- package/components/map/layers/WMTSLayer.js +67 -3
- package/components/map/layers/XYZLayer.js +24 -2
- package/components/map/layers/index.js +28 -1
- package/components/map3d/EditDataset3D.js +190 -3
- package/components/map3d/HeightProfile3D.js +402 -3
- package/components/map3d/ImportObjects3D.js +162 -2
- package/components/map3d/Map3D.js +1304 -38
- package/components/map3d/MapControls3D.js +392 -7
- package/components/map3d/SearchField3D.js +183 -11
- package/components/map3d/View3DSwitcher.js +98 -2
- package/components/map3d/drawtool/CreateTool3D.js +174 -4
- package/components/map3d/drawtool/EditTool3D.js +590 -6
- package/components/map3d/drawtool/NumericInput3D.js +336 -4
- package/components/map3d/layers/GeoTIFFLayer3D.js +15 -1
- package/components/map3d/layers/VectorLayer3D.js +53 -2
- package/components/map3d/layers/WFSLayer3D.js +109 -3
- package/components/map3d/layers/WMSLayer3D.js +70 -2
- package/components/map3d/layers/WMTSLayer3D.js +27 -3
- package/components/map3d/layers/index.js +14 -1
- package/components/map3d/utils/FirstPersonControls3D.js +423 -16
- package/components/map3d/utils/MiscUtils3D.js +221 -13
- package/components/map3d/utils/OrbitControls3D.js +176 -5
- package/components/map3d/utils/Tiles3DStyle.js +238 -9
- package/components/share/ShareLink.js +54 -2
- package/components/share/ShareQRCode.js +62 -2
- package/components/share/ShareSocials.js +125 -3
- package/components/timeline/FixedTimeline.js +236 -5
- package/components/timeline/InfiniteTimeline.js +347 -8
- package/components/timeline/TimelineFeaturesSlider.js +439 -5
- package/components/widgets/AccordeonWidget.js +96 -2
- package/components/widgets/ButtonBar.js +124 -2
- package/components/widgets/ColorButton.js +201 -3
- package/components/widgets/ComboBox.js +166 -2
- package/components/widgets/CopyButton.js +110 -2
- package/components/widgets/DateTimeInput.js +100 -3
- package/components/widgets/EditableSelect.js +230 -3
- package/components/widgets/FileSelector.js +128 -4
- package/components/widgets/Input.js +124 -2
- package/components/widgets/InputContainer.js +96 -2
- package/components/widgets/LayerCatalogWidget.js +219 -3
- package/components/widgets/MenuButton.js +157 -1
- package/components/widgets/ModalDialog.js +64 -2
- package/components/widgets/NavBar.js +119 -2
- package/components/widgets/NumberInput.js +226 -4
- package/components/widgets/PopupMenu.js +72 -1
- package/components/widgets/Primitives.js +6 -1
- package/components/widgets/ReCaptchaWidget.js +55 -1
- package/components/widgets/SearchWidget.js +255 -2
- package/components/widgets/Spinner.js +44 -2
- package/components/widgets/SuggestionInput.js +77 -2
- package/components/widgets/TextInput.js +308 -2
- package/components/widgets/ToggleSwitch.js +85 -2
- package/components/widgets/VectorLayerPicker.js +85 -3
- package/libs/openlayers.js +225 -5
- package/package.json +1 -1
- package/plugins/API.js +358 -15
- package/plugins/AttributeTable.js +109 -3
- package/plugins/Authentication.js +130 -5
- package/plugins/BackgroundSwitcher.js +218 -4
- package/plugins/Bookmark.js +289 -3
- package/plugins/BottomBar.js +298 -4
- package/plugins/CookiePopup.js +67 -3
- package/plugins/Cyclomedia.js +442 -5
- package/plugins/Editing.js +497 -9
- package/plugins/FeatureForm.js +366 -4
- package/plugins/FeatureSearch.js +458 -3
- package/plugins/GeometryDigitizer.js +664 -7
- package/plugins/HeightProfile.js +763 -15
- package/plugins/Help.js +102 -3
- package/plugins/HomeButton.js +80 -3
- package/plugins/Identify.js +543 -5
- package/plugins/LayerCatalog.js +215 -4
- package/plugins/LayerTree.js +1194 -6
- package/plugins/LocateButton.js +94 -3
- package/plugins/Map.js +320 -16
- package/plugins/MapCompare.js +94 -3
- package/plugins/MapCopyright.js +127 -5
- package/plugins/MapExport.js +613 -20
- package/plugins/MapFilter.js +868 -12
- package/plugins/MapInfoTooltip.js +277 -3
- package/plugins/MapLegend.js +253 -4
- package/plugins/MapTip.js +290 -4
- package/plugins/Measure.js +220 -4
- package/plugins/NewsPopup.js +137 -3
- package/plugins/OverviewMap.js +167 -7
- package/plugins/Panoramax.js +340 -2
- package/plugins/Portal.js +199 -4
- package/plugins/Print.js +1231 -15
- package/plugins/Redlining.js +750 -6
- package/plugins/Reports.js +332 -3
- package/plugins/Routing.js +1278 -15
- package/plugins/ScratchDrawing.js +173 -5
- package/plugins/Settings.js +241 -4
- package/plugins/Share.js +198 -3
- package/plugins/StartupMarker.js +84 -4
- package/plugins/TaskButton.js +88 -3
- package/plugins/ThemeSwitcher.js +164 -4
- package/plugins/TimeManager.js +971 -10
- package/plugins/TopBar.js +300 -7
- package/plugins/TourGuide.js +213 -2
- package/plugins/ValueTool.js +419 -4
- package/plugins/View3D.js +519 -14
- package/plugins/ZoomButtons.js +165 -3
- package/plugins/map/EditingSupport.js +199 -7
- package/plugins/map/LocateSupport.js +260 -4
- package/plugins/map/MeasurementSupport.js +216 -8
- package/plugins/map/RedliningPickSupport.js +201 -7
- package/plugins/map/RedliningSupport.js +726 -17
- package/plugins/map/SnapInteraction.js +101 -1
- package/plugins/map/SnapSupport.js +210 -2
- package/plugins/map/SnappingSupport.js +356 -17
- package/plugins/map3d/BackgroundSwitcher3D.js +44 -3
- package/plugins/map3d/BottomBar3D.js +118 -3
- package/plugins/map3d/Compare3D.js +422 -8
- package/plugins/map3d/Draw3D.js +353 -6
- package/plugins/map3d/ExportObjects3D.js +393 -18
- package/plugins/map3d/HideObjects3D.js +313 -12
- package/plugins/map3d/Identify3D.js +283 -12
- package/plugins/map3d/LayerTree3D.js +323 -3
- package/plugins/map3d/MapCopyright3D.js +128 -5
- package/plugins/map3d/MapExport3D.js +590 -10
- package/plugins/map3d/MapLight3D.js +553 -6
- package/plugins/map3d/Measure3D.js +571 -20
- package/plugins/map3d/OverviewMap3D.js +169 -3
- package/plugins/map3d/Settings3D.js +73 -3
- package/plugins/map3d/TopBar3D.js +207 -9
- package/plugins/redlining/RedliningBufferSupport.js +206 -3
- package/reducers/display.js +34 -2
- package/reducers/editing.js +68 -3
- package/reducers/index.js +9 -1
- package/reducers/layerinfo.js +26 -2
- package/reducers/layers.js +456 -9
- package/reducers/localConfig.js +122 -2
- package/reducers/locale.js +38 -2
- package/reducers/locate.js +40 -2
- package/reducers/map.js +176 -5
- package/reducers/measurement.js +42 -2
- package/reducers/processNotifications.js +49 -2
- package/reducers/redlining.js +50 -2
- package/reducers/redliningPick.js +27 -2
- package/reducers/search.js +20 -1
- package/reducers/serviceinfo.js +25 -2
- package/reducers/task.js +45 -2
- package/reducers/theme.js +51 -2
- package/reducers/windows.js +203 -2
- package/scripts/dist.sh +1 -1
- package/scripts/gen-plugin-docs.js +152 -2
- package/scripts/makeIconkit.js +85 -6
- package/scripts/themesConfig.js +742 -40
- package/scripts/updateTranslations.js +251 -10
- package/selectors/searchproviders.js +44 -2
- package/stores/StandardStore.js +42 -2
- package/utils/ConfigUtils.js +84 -3
- package/utils/CoordinatesUtils.js +234 -23
- package/utils/DxfUtils.js +237 -11
- package/utils/EditingInterface.js +421 -87
- package/utils/EditingUtils.js +357 -13
- package/utils/ElevationInterface.js +83 -22
- package/utils/FeatureStyles.js +429 -5
- package/utils/IdentifyUtils.js +443 -7
- package/utils/ImageEditor.js +79 -9
- package/utils/LayerUtils.js +1516 -50
- package/utils/LocaleUtils.js +117 -7
- package/utils/MapUtils.js +241 -59
- package/utils/MeasureUtils.js +323 -2
- package/utils/MiscUtils.js +189 -11
- package/utils/PermaLinkUtils.js +429 -6
- package/utils/PluginStore.js +27 -1
- package/utils/ResourceRegistry.js +15 -1
- package/utils/RoutingInterface.js +307 -7
- package/utils/SearchProviders.js +722 -19
- package/utils/ServiceLayerUtils.js +669 -14
- package/utils/Signal.js +32 -2
- package/utils/ThemeUtils.js +341 -7
- package/utils/VectorLayerUtils.js +589 -15
- package/utils/expr_grammar/grammar.js +2239 -2
- package/utils/expr_grammar/test.js +65 -3
|
@@ -1,11 +1,595 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
6
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
|
+
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
9
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
10
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
11
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
12
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
14
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
15
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
17
|
+
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
|
|
18
|
+
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
|
|
19
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
20
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
21
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
22
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
|
+
/**
|
|
2
26
|
* Copyright 2025 Sourcepole AG
|
|
3
27
|
* All rights reserved.
|
|
4
28
|
*
|
|
5
29
|
* This source code is licensed under the BSD-style license found in the
|
|
6
30
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import React from 'react';
|
|
34
|
+
import PropTypes from 'prop-types';
|
|
35
|
+
import { Color, Group, Vector3 } from 'three';
|
|
36
|
+
import { TransformControls } from 'three/addons/controls/TransformControls';
|
|
37
|
+
import { CSG } from 'three-csg-ts';
|
|
38
|
+
import LocaleUtils from '../../../utils/LocaleUtils';
|
|
39
|
+
import Icon from '../../Icon';
|
|
40
|
+
import ButtonBar from '../../widgets/ButtonBar';
|
|
41
|
+
import ColorButton from '../../widgets/ColorButton';
|
|
42
|
+
import TextInput from '../../widgets/TextInput';
|
|
43
|
+
import { updateObjectLabel } from '../utils/MiscUtils3D';
|
|
44
|
+
import NumericInput3D from './NumericInput3D';
|
|
45
|
+
var GroupSelection = /*#__PURE__*/function (_Group) {
|
|
46
|
+
function GroupSelection() {
|
|
47
|
+
var _this;
|
|
48
|
+
_classCallCheck(this, GroupSelection);
|
|
49
|
+
_this = _callSuper(this, GroupSelection);
|
|
50
|
+
_defineProperty(_this, "hasObject", function (object) {
|
|
51
|
+
return _this.children.indexOf(object) >= 0;
|
|
52
|
+
});
|
|
53
|
+
_defineProperty(_this, "addToSelection", function (object) {
|
|
54
|
+
_this.children.forEach(function (child) {
|
|
55
|
+
child.position.add(_this.position);
|
|
56
|
+
});
|
|
57
|
+
_this.add(object);
|
|
58
|
+
object.userData.originalColor = object.material.color.clone();
|
|
59
|
+
object.material.color.set(0xFF0000);
|
|
60
|
+
_this.recomputePosition();
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(_this, "removeFromSelection", function (object) {
|
|
63
|
+
_this.parent.attach(object);
|
|
64
|
+
object.material.color.set(object.userData.originalColor);
|
|
65
|
+
delete object.userData.originalColor;
|
|
66
|
+
_this.children.forEach(function (child) {
|
|
67
|
+
child.position.add(_this.position);
|
|
68
|
+
});
|
|
69
|
+
_this.recomputePosition();
|
|
70
|
+
});
|
|
71
|
+
_defineProperty(_this, "dissolve", function () {
|
|
72
|
+
if (_this.parent === null) {
|
|
73
|
+
// Group has already been removed from scene
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
while (_this.children.length) {
|
|
77
|
+
var object = _this.children.pop();
|
|
78
|
+
object.material.color.set(object.userData.originalColor);
|
|
79
|
+
delete object.userData.originalColor;
|
|
80
|
+
_this.parent.attach(object);
|
|
81
|
+
}
|
|
82
|
+
_this.removeFromParent();
|
|
83
|
+
});
|
|
84
|
+
_defineProperty(_this, "recomputePosition", function () {
|
|
85
|
+
if (_this.children.length === 0) {
|
|
86
|
+
_this.position.set(0, 0, 0);
|
|
87
|
+
} else {
|
|
88
|
+
var center = new Vector3();
|
|
89
|
+
_this.children.forEach(function (child) {
|
|
90
|
+
center.add(child.position);
|
|
91
|
+
});
|
|
92
|
+
center.divideScalar(_this.children.length);
|
|
93
|
+
_this.position.copy(center);
|
|
94
|
+
_this.children.forEach(function (child) {
|
|
95
|
+
child.position.sub(_this.position);
|
|
96
|
+
});
|
|
97
|
+
_this.updateMatrixWorld(true);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
_this.isGroupSelection = true;
|
|
101
|
+
return _this;
|
|
102
|
+
}
|
|
103
|
+
_inherits(GroupSelection, _Group);
|
|
104
|
+
return _createClass(GroupSelection, [{
|
|
105
|
+
key: "clone",
|
|
106
|
+
value: function clone() {
|
|
107
|
+
var clone = _superPropGet(GroupSelection, "clone", this, 3)([]);
|
|
108
|
+
clone.isGroupSelection = true;
|
|
109
|
+
return clone;
|
|
110
|
+
}
|
|
111
|
+
}]);
|
|
112
|
+
}(Group);
|
|
113
|
+
var EditTool3D = /*#__PURE__*/function (_React$Component) {
|
|
114
|
+
function EditTool3D() {
|
|
115
|
+
var _this2;
|
|
116
|
+
_classCallCheck(this, EditTool3D);
|
|
117
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
118
|
+
args[_key] = arguments[_key];
|
|
119
|
+
}
|
|
120
|
+
_this2 = _callSuper(this, EditTool3D, [].concat(args));
|
|
121
|
+
_defineProperty(_this2, "state", {
|
|
122
|
+
mode: 'translate',
|
|
123
|
+
numericInput: false,
|
|
124
|
+
selectCount: 0,
|
|
125
|
+
csgBackup: null,
|
|
126
|
+
label: ''
|
|
127
|
+
});
|
|
128
|
+
_defineProperty(_this2, "toolButtonClicked", function (key) {
|
|
129
|
+
if (key === "NumericInput") {
|
|
130
|
+
_this2.toggleNumericInput();
|
|
131
|
+
} else if (key === "clone") {
|
|
132
|
+
_this2.cloneSelectedObject();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
_defineProperty(_this2, "selectShapeOnRelease", function (ev) {
|
|
136
|
+
if (ev.button === 0 && !_this2.transformControls.dragging) {
|
|
137
|
+
var renderer = _this2.props.sceneContext.scene.renderer;
|
|
138
|
+
renderer.domElement.addEventListener("pointerup", _this2.selectShape, {
|
|
139
|
+
once: true
|
|
140
|
+
});
|
|
141
|
+
renderer.domElement.addEventListener("pointermove", function () {
|
|
142
|
+
renderer.domElement.removeEventListener("pointerup", _this2.selectShape);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
_defineProperty(_this2, "selectShape", function (ev) {
|
|
147
|
+
var rect = ev.target.getBoundingClientRect();
|
|
148
|
+
var x = (ev.clientX - rect.left) / rect.width * 2 - 1;
|
|
149
|
+
var y = -((ev.clientY - rect.top) / rect.height) * 2 + 1;
|
|
150
|
+
var intersection = _this2.props.sceneContext.getSceneIntersection(x, y);
|
|
151
|
+
if (intersection) {
|
|
152
|
+
// Check if closest (first) intersected object is within the current draw group
|
|
153
|
+
var object = intersection.object;
|
|
154
|
+
var drawGroup = _this2.props.sceneContext.getSceneObject(_this2.props.drawGroupId);
|
|
155
|
+
for (var parent = object.parent; parent; parent = parent.parent) {
|
|
156
|
+
if (parent === drawGroup) {
|
|
157
|
+
if (ev.ctrlKey && _this2.props.selectedObject) {
|
|
158
|
+
_this2.addRemoveFromSelection(object);
|
|
159
|
+
} else {
|
|
160
|
+
_this2.dissolveSelectionGroup();
|
|
161
|
+
_this2.props.objectPicked(object);
|
|
162
|
+
}
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (!ev.ctrlKey) {
|
|
168
|
+
_this2.dissolveSelectionGroup();
|
|
169
|
+
_this2.props.objectPicked(null);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
_defineProperty(_this2, "addRemoveFromSelection", function (object) {
|
|
173
|
+
if (_this2.props.selectedObject === object) {
|
|
174
|
+
_this2.props.objectPicked(null);
|
|
175
|
+
} else if (_this2.props.selectedObject.isGroupSelection) {
|
|
176
|
+
if (_this2.props.selectedObject.hasObject(object)) {
|
|
177
|
+
_this2.props.selectedObject.removeFromSelection(object);
|
|
178
|
+
if (_this2.props.selectedObject.children.length === 1) {
|
|
179
|
+
var child = _this2.props.selectedObject.children[0];
|
|
180
|
+
_this2.props.selectedObject.dissolve();
|
|
181
|
+
_this2.props.objectPicked(child);
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
_this2.props.selectedObject.addToSelection(object);
|
|
185
|
+
}
|
|
186
|
+
_this2.setState({
|
|
187
|
+
selectCount: _this2.props.selectedObject.children.length
|
|
188
|
+
});
|
|
189
|
+
_this2.updateTransformHelper();
|
|
190
|
+
} else {
|
|
191
|
+
var groupSelection = new GroupSelection();
|
|
192
|
+
object.parent.add(groupSelection);
|
|
193
|
+
groupSelection.addToSelection(object);
|
|
194
|
+
if (_this2.props.selectedObject && _this2.props.selectedObject !== object) {
|
|
195
|
+
groupSelection.addToSelection(_this2.props.selectedObject);
|
|
196
|
+
}
|
|
197
|
+
_this2.props.objectPicked(groupSelection);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
_defineProperty(_this2, "dissolveSelectionGroup", function () {
|
|
201
|
+
var _this2$props$selected;
|
|
202
|
+
if ((_this2$props$selected = _this2.props.selectedObject) !== null && _this2$props$selected !== void 0 && _this2$props$selected.isGroupSelection) {
|
|
203
|
+
_this2.props.selectedObject.dissolve();
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
_defineProperty(_this2, "updateTransformHelper", function () {
|
|
207
|
+
_this2.transformControls.getHelper().updateMatrixWorld();
|
|
208
|
+
_this2.props.sceneContext.scene.notifyChange();
|
|
209
|
+
});
|
|
210
|
+
_defineProperty(_this2, "onKeyDown", function (ev) {
|
|
211
|
+
if (ev.key === "Escape") {
|
|
212
|
+
_this2.transformControls.reset();
|
|
213
|
+
} else if (ev.key === "Control") {
|
|
214
|
+
_this2.transformControls.enabled = false;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
_defineProperty(_this2, "onKeyUp", function (ev) {
|
|
218
|
+
if (ev.key === "Control") {
|
|
219
|
+
_this2.transformControls.enabled = true;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
_defineProperty(_this2, "toggleNumericInput", function () {
|
|
223
|
+
_this2.setState(function (state) {
|
|
224
|
+
return {
|
|
225
|
+
numericInput: !state.numericInput
|
|
226
|
+
};
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
_defineProperty(_this2, "applyCsgOperation", function (operation) {
|
|
230
|
+
var result = null;
|
|
231
|
+
var children = _toConsumableArray(_this2.props.selectedObject.children).reverse();
|
|
232
|
+
if (operation === "union") {
|
|
233
|
+
result = CSG.union.apply(CSG, _toConsumableArray(children));
|
|
234
|
+
} else if (operation === "subtract") {
|
|
235
|
+
result = CSG.subtract.apply(CSG, _toConsumableArray(children));
|
|
236
|
+
} else if (operation === "intersect") {
|
|
237
|
+
result = CSG.intersect.apply(CSG, _toConsumableArray(children));
|
|
238
|
+
}
|
|
239
|
+
if (result) {
|
|
240
|
+
var parent = _this2.props.selectedObject.parent;
|
|
241
|
+
result.position.add(_this2.props.selectedObject.position);
|
|
242
|
+
_this2.props.selectedObject.dissolve();
|
|
243
|
+
children[0].removeFromParent();
|
|
244
|
+
children[1].removeFromParent();
|
|
245
|
+
result.material.color = new Color().lerpColors(children[0].material.color, children[1].material.color, 0.5);
|
|
246
|
+
result.userData.originalChildren = children;
|
|
247
|
+
parent.attach(result);
|
|
248
|
+
// Re-center object
|
|
249
|
+
var offset = result.geometry.boundingBox.getCenter(new Vector3());
|
|
250
|
+
offset.applyQuaternion(result.quaternion);
|
|
251
|
+
result.position.add(offset);
|
|
252
|
+
result.geometry.center();
|
|
253
|
+
_this2.props.objectPicked(result);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
_defineProperty(_this2, "undoCsgOperation", function () {
|
|
257
|
+
var parent = _this2.props.selectedObject.parent;
|
|
258
|
+
var children = _this2.state.csgBackup;
|
|
259
|
+
parent.attach(children[0]);
|
|
260
|
+
parent.attach(children[1]);
|
|
261
|
+
_this2.props.selectedObject.removeFromParent();
|
|
262
|
+
var group = new GroupSelection();
|
|
263
|
+
group.addToSelection(children[0]);
|
|
264
|
+
group.addToSelection(children[1]);
|
|
265
|
+
parent.add(group);
|
|
266
|
+
_this2.props.objectPicked(group);
|
|
267
|
+
});
|
|
268
|
+
_defineProperty(_this2, "clearCsgBackup", function () {
|
|
269
|
+
_this2.setState({
|
|
270
|
+
csgBackup: null
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
_defineProperty(_this2, "setLabel", function (text) {
|
|
274
|
+
_this2.setState({
|
|
275
|
+
label: text
|
|
276
|
+
});
|
|
277
|
+
_this2.props.selectedObject.userData.label = text;
|
|
278
|
+
updateObjectLabel(_this2.props.selectedObject, _this2.props.sceneContext);
|
|
279
|
+
_this2.props.sceneContext.scene.notifyChange(_this2.props.selectedObject);
|
|
280
|
+
});
|
|
281
|
+
_defineProperty(_this2, "cloneSelectedObject", function () {
|
|
282
|
+
if (_this2.props.selectedObject) {
|
|
283
|
+
var clonedObject = _this2.deepClone(_this2.props.selectedObject);
|
|
284
|
+
clonedObject.position.x += 10;
|
|
285
|
+
clonedObject.position.y += 10;
|
|
286
|
+
clonedObject.updateMatrixWorld();
|
|
287
|
+
_this2.props.selectedObject.parent.add(clonedObject);
|
|
288
|
+
_this2.props.objectPicked(clonedObject);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
_defineProperty(_this2, "deepClone", function (object) {
|
|
292
|
+
var clone = object.clone(false);
|
|
293
|
+
if (object.geometry) {
|
|
294
|
+
clone.geometry = object.geometry.clone();
|
|
295
|
+
}
|
|
296
|
+
if (object.material) {
|
|
297
|
+
if (Array.isArray(object.material)) {
|
|
298
|
+
clone.material = object.material.map(function (mat) {
|
|
299
|
+
return mat.clone();
|
|
300
|
+
});
|
|
301
|
+
} else {
|
|
302
|
+
clone.material = object.material.clone();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
object.children.forEach(function (child) {
|
|
306
|
+
clone.add(_this2.deepClone(child));
|
|
307
|
+
});
|
|
308
|
+
return clone;
|
|
309
|
+
});
|
|
310
|
+
_defineProperty(_this2, "onControlMouseDown", function (e) {
|
|
311
|
+
var object = e.target.object;
|
|
312
|
+
if (object.geometry) {
|
|
313
|
+
if (!object.geometry.boundingBox) object.geometry.computeBoundingBox();
|
|
314
|
+
_this2._bbox = object.geometry.boundingBox.clone();
|
|
315
|
+
_this2._scaleStart = object.scale.clone();
|
|
316
|
+
_this2._positionStart = object.position.clone();
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
_defineProperty(_this2, "onControlObjectChange", function (e) {
|
|
320
|
+
var control = e.target;
|
|
321
|
+
var mode = control.mode,
|
|
322
|
+
object = control.object;
|
|
323
|
+
if (mode === 'scale') {
|
|
324
|
+
// Block zero or negative scales
|
|
325
|
+
object.scale.max(new Vector3(0.1, 0.1, 0.1));
|
|
326
|
+
var offset = new Vector3();
|
|
327
|
+
if (_this2._bbox) {
|
|
328
|
+
if (control.pointStart.x > 0) {
|
|
329
|
+
offset.x = _this2._bbox.min.x * (_this2._scaleStart.x - object.scale.x);
|
|
330
|
+
} else {
|
|
331
|
+
offset.x = _this2._bbox.max.x * (_this2._scaleStart.x - object.scale.x);
|
|
332
|
+
}
|
|
333
|
+
if (control.pointStart.y > 0) {
|
|
334
|
+
offset.y = _this2._bbox.min.y * (_this2._scaleStart.y - object.scale.y);
|
|
335
|
+
} else {
|
|
336
|
+
offset.y = _this2._bbox.max.y * (_this2._scaleStart.y - object.scale.y);
|
|
337
|
+
}
|
|
338
|
+
if (control.pointStart.z > 0) {
|
|
339
|
+
offset.z = _this2._bbox.min.z * (_this2._scaleStart.z - object.scale.z);
|
|
340
|
+
} else {
|
|
341
|
+
offset.z = _this2._bbox.max.z * (_this2._scaleStart.z - object.scale.z);
|
|
342
|
+
}
|
|
343
|
+
offset.applyQuaternion(object.quaternion);
|
|
344
|
+
object.position.copy(offset).add(_this2._positionStart);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
object.updateMatrixWorld();
|
|
348
|
+
_this2.transformControls.getHelper().updateMatrixWorld();
|
|
349
|
+
_this2.props.sceneContext.scene.notifyChange(object);
|
|
350
|
+
});
|
|
351
|
+
_defineProperty(_this2, "onControlChange", function (e) {
|
|
352
|
+
_this2.transformControls.getHelper().updateMatrixWorld();
|
|
353
|
+
_this2.props.sceneContext.scene.notifyChange(_this2.transformControls.getHelper());
|
|
354
|
+
});
|
|
355
|
+
_defineProperty(_this2, "onControlMouseUp", function (e) {
|
|
356
|
+
_this2._bbox = null;
|
|
357
|
+
_this2._scaleStart = null;
|
|
358
|
+
_this2._positionStart = null;
|
|
359
|
+
var object = e.target.object;
|
|
360
|
+
_this2.clearCsgBackup();
|
|
361
|
+
object.updateMatrixWorld();
|
|
362
|
+
_this2.transformControls.getHelper().updateMatrixWorld();
|
|
363
|
+
_this2.props.sceneContext.scene.notifyChange(object);
|
|
364
|
+
});
|
|
365
|
+
return _this2;
|
|
366
|
+
}
|
|
367
|
+
_inherits(EditTool3D, _React$Component);
|
|
368
|
+
return _createClass(EditTool3D, [{
|
|
369
|
+
key: "componentDidMount",
|
|
370
|
+
value: function componentDidMount() {
|
|
371
|
+
var _this3 = this;
|
|
372
|
+
var camera = this.props.sceneContext.scene.view.camera;
|
|
373
|
+
var renderer = this.props.sceneContext.scene.renderer;
|
|
374
|
+
this.transformControls = new TransformControls(camera, renderer.domElement);
|
|
375
|
+
this.props.sceneContext.scene.add(this.transformControls.getHelper());
|
|
376
|
+
this.transformControls.setMode(this.state.mode);
|
|
377
|
+
this.transformControls.setSpace('local');
|
|
378
|
+
this.transformControls.setTranslationSnap(1);
|
|
379
|
+
this.transformControls.scaleFromEdge = true;
|
|
380
|
+
this.transformControls.allowNegativeScales = false;
|
|
381
|
+
this.transformControls.setRotationSnap(5 / 180 * Math.PI);
|
|
382
|
+
this.transformControls.addEventListener('mouseDown', this.onControlMouseDown);
|
|
383
|
+
this.transformControls.addEventListener('objectChange', this.onControlObjectChange);
|
|
384
|
+
this.transformControls.addEventListener('change', this.onControlChange);
|
|
385
|
+
this.transformControls.addEventListener('mouseUp', this.onControlMouseUp);
|
|
386
|
+
this.transformControls.addEventListener('dragging-changed', function (event) {
|
|
387
|
+
_this3.props.sceneContext.scene.view.controls.enabled = !event.value;
|
|
388
|
+
});
|
|
389
|
+
renderer.domElement.addEventListener("pointerdown", this.selectShapeOnRelease);
|
|
390
|
+
renderer.domElement.addEventListener('keydown', this.onKeyDown);
|
|
391
|
+
renderer.domElement.addEventListener('keyup', this.onKeyUp);
|
|
392
|
+
if (this.props.selectedObject) {
|
|
393
|
+
var _this$props$selectedO;
|
|
394
|
+
this.transformControls.attach(this.props.selectedObject);
|
|
395
|
+
this.transformControls.getHelper().updateMatrixWorld();
|
|
396
|
+
this.props.colorChanged(this.props.selectedObject.material.color.toArray().map(function (c) {
|
|
397
|
+
return c * 255;
|
|
398
|
+
}));
|
|
399
|
+
this.setState({
|
|
400
|
+
label: ((_this$props$selectedO = this.props.selectedObject.userData) === null || _this$props$selectedO === void 0 ? void 0 : _this$props$selectedO.label) || "",
|
|
401
|
+
selectCount: 1
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
this.props.sceneContext.scene.view.controls.addEventListener('change', this.updateTransformHelper);
|
|
405
|
+
this.props.sceneContext.scene.notifyChange();
|
|
406
|
+
}
|
|
407
|
+
}, {
|
|
408
|
+
key: "componentDidUpdate",
|
|
409
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
410
|
+
var _this4 = this;
|
|
411
|
+
if (this.props.selectedObject !== prevProps.selectedObject) {
|
|
412
|
+
var _prevProps$selectedOb;
|
|
413
|
+
if ((_prevProps$selectedOb = prevProps.selectedObject) !== null && _prevProps$selectedOb !== void 0 && _prevProps$selectedOb.isGroupSelection) {
|
|
414
|
+
prevProps.selectedObject.dissolve();
|
|
415
|
+
}
|
|
416
|
+
if (prevProps.selectedObject) {
|
|
417
|
+
this.transformControls.detach();
|
|
418
|
+
this.clearCsgBackup();
|
|
419
|
+
}
|
|
420
|
+
var selectCount = 0;
|
|
421
|
+
if (this.props.selectedObject) {
|
|
422
|
+
var _this$props$selectedO2;
|
|
423
|
+
this.transformControls.attach(this.props.selectedObject);
|
|
424
|
+
if (!this.props.selectedObject.isGroupSelection) {
|
|
425
|
+
selectCount = 1;
|
|
426
|
+
this.props.colorChanged(this.props.selectedObject.material.color.toArray().map(function (c) {
|
|
427
|
+
return c * 255;
|
|
428
|
+
}));
|
|
429
|
+
} else {
|
|
430
|
+
selectCount = this.props.selectedObject.children.length;
|
|
431
|
+
}
|
|
432
|
+
if (this.props.selectedObject.userData.originalChildren) {
|
|
433
|
+
this.setState({
|
|
434
|
+
csgBackup: this.props.selectedObject.userData.originalChildren
|
|
435
|
+
});
|
|
436
|
+
delete this.props.selectedObject.userData.originalChildren;
|
|
437
|
+
}
|
|
438
|
+
this.setState({
|
|
439
|
+
label: ((_this$props$selectedO2 = this.props.selectedObject.userData) === null || _this$props$selectedO2 === void 0 ? void 0 : _this$props$selectedO2.label) || ""
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
this.transformControls.getHelper().updateMatrixWorld();
|
|
443
|
+
this.props.sceneContext.scene.notifyChange();
|
|
444
|
+
this.setState({
|
|
445
|
+
selectCount: selectCount
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
if (this.state.mode !== prevState.mode) {
|
|
449
|
+
this.transformControls.setMode(this.state.mode);
|
|
450
|
+
this.transformControls.setSpace('local');
|
|
451
|
+
this.transformControls.getHelper().updateMatrixWorld();
|
|
452
|
+
this.props.sceneContext.scene.notifyChange();
|
|
453
|
+
}
|
|
454
|
+
if (this.props.color !== prevProps.color && this.props.selectedObject) {
|
|
455
|
+
if (!this.props.selectedObject.isGroupSelection) {
|
|
456
|
+
var _this$props$selectedO3;
|
|
457
|
+
(_this$props$selectedO3 = this.props.selectedObject.material.color).setRGB.apply(_this$props$selectedO3, _toConsumableArray(this.props.color.map(function (c) {
|
|
458
|
+
return c / 255;
|
|
459
|
+
})));
|
|
460
|
+
} else {
|
|
461
|
+
this.props.selectedObject.children.forEach(function (child) {
|
|
462
|
+
var _child$userData$origi;
|
|
463
|
+
(_child$userData$origi = child.userData.originalColor).setRGB.apply(_child$userData$origi, _toConsumableArray(_this4.props.color.map(function (c) {
|
|
464
|
+
return c / 255;
|
|
465
|
+
})));
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
this.props.sceneContext.scene.notifyChange();
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}, {
|
|
472
|
+
key: "componentWillUnmount",
|
|
473
|
+
value: function componentWillUnmount() {
|
|
474
|
+
this.clearCsgBackup();
|
|
475
|
+
this.dissolveSelectionGroup();
|
|
476
|
+
this.transformControls.detach();
|
|
477
|
+
this.props.sceneContext.scene.remove(this.transformControls.getHelper());
|
|
478
|
+
this.transformControls.dispose();
|
|
479
|
+
var domElement = this.props.sceneContext.scene.renderer.domElement;
|
|
480
|
+
this.props.sceneContext.scene.view.controls.removeEventListener('change', this.updateTransformHelper);
|
|
481
|
+
domElement.removeEventListener("pointerdown", this.selectShapeOnRelease);
|
|
482
|
+
domElement.removeEventListener('keydown', this.onKeyDown);
|
|
483
|
+
this.props.sceneContext.scene.notifyChange();
|
|
484
|
+
}
|
|
485
|
+
}, {
|
|
486
|
+
key: "render",
|
|
487
|
+
value: function render() {
|
|
488
|
+
var _this5 = this;
|
|
489
|
+
var editButtons = [{
|
|
490
|
+
key: "translate",
|
|
491
|
+
label: LocaleUtils.tr("draw3d.translate")
|
|
492
|
+
}, {
|
|
493
|
+
key: "scale",
|
|
494
|
+
label: LocaleUtils.tr("draw3d.scale")
|
|
495
|
+
}, {
|
|
496
|
+
key: "rotate",
|
|
497
|
+
label: LocaleUtils.tr("draw3d.rotate")
|
|
498
|
+
}];
|
|
499
|
+
var extraButtons = [{
|
|
500
|
+
key: "clone",
|
|
501
|
+
tooltip: LocaleUtils.tr("draw3d.clone"),
|
|
502
|
+
icon: "clone"
|
|
503
|
+
}, {
|
|
504
|
+
key: "NumericInput",
|
|
505
|
+
tooltip: LocaleUtils.tr("draw3d.numericinput"),
|
|
506
|
+
icon: "numericinput"
|
|
507
|
+
}];
|
|
508
|
+
var csgButtons = [{
|
|
509
|
+
key: "union",
|
|
510
|
+
label: LocaleUtils.tr("draw3d.union")
|
|
511
|
+
}, {
|
|
512
|
+
key: "subtract",
|
|
513
|
+
label: LocaleUtils.tr("draw3d.subtract")
|
|
514
|
+
}, {
|
|
515
|
+
key: "intersect",
|
|
516
|
+
label: LocaleUtils.tr("draw3d.intersect")
|
|
517
|
+
}];
|
|
518
|
+
return [/*#__PURE__*/React.createElement("div", {
|
|
519
|
+
className: "redlining-controlsbar",
|
|
520
|
+
key: "BasicControls"
|
|
521
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
522
|
+
className: "redlining-control"
|
|
523
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
524
|
+
className: "redlining-control-icon",
|
|
525
|
+
icon: "pen",
|
|
526
|
+
size: "large"
|
|
527
|
+
}), /*#__PURE__*/React.createElement(ColorButton, {
|
|
528
|
+
alpha: false,
|
|
529
|
+
color: this.props.color,
|
|
530
|
+
onColorChanged: this.props.colorChanged
|
|
531
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
532
|
+
className: "redlining-control"
|
|
533
|
+
}, /*#__PURE__*/React.createElement(ButtonBar, {
|
|
534
|
+
active: this.state.mode,
|
|
535
|
+
buttons: editButtons,
|
|
536
|
+
onClick: function onClick(mode) {
|
|
537
|
+
return _this5.setState({
|
|
538
|
+
mode: mode
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
542
|
+
className: "redlining-control"
|
|
543
|
+
}, /*#__PURE__*/React.createElement(ButtonBar, {
|
|
544
|
+
active: this.state.numericInput ? "NumericInput" : null,
|
|
545
|
+
buttons: extraButtons,
|
|
546
|
+
onClick: this.toolButtonClicked
|
|
547
|
+
})), this.state.numericInput ? /*#__PURE__*/React.createElement(NumericInput3D, {
|
|
548
|
+
sceneContext: this.props.sceneContext,
|
|
549
|
+
selectedObject: this.props.selectedObject,
|
|
550
|
+
toggleNumericInput: this.toggleNumericInput,
|
|
551
|
+
transformControls: this.transformControls
|
|
552
|
+
}) : null), this.state.selectCount === 0 ? /*#__PURE__*/React.createElement("div", {
|
|
553
|
+
className: "redlining-message",
|
|
554
|
+
key: "CtrlHint"
|
|
555
|
+
}, LocaleUtils.tr("draw3d.ctrlhint")) : null, this.state.selectCount === 1 ? /*#__PURE__*/React.createElement("div", {
|
|
556
|
+
className: "redlining-controlsbar",
|
|
557
|
+
key: "Label"
|
|
558
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
559
|
+
className: "redlining-control redlining-control-fill controlgroup"
|
|
560
|
+
}, /*#__PURE__*/React.createElement("span", null, LocaleUtils.tr("draw3d.label"), ":\xA0"), /*#__PURE__*/React.createElement(TextInput, {
|
|
561
|
+
className: "controlgroup-fillitem",
|
|
562
|
+
onChange: this.setLabel,
|
|
563
|
+
value: this.state.label
|
|
564
|
+
}))) : null, this.state.selectCount === 2 ? /*#__PURE__*/React.createElement("div", {
|
|
565
|
+
className: "redlining-controlsbar",
|
|
566
|
+
key: "CSGControls"
|
|
567
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
568
|
+
className: "redlining-control redlining-control-fill"
|
|
569
|
+
}, /*#__PURE__*/React.createElement(ButtonBar, {
|
|
570
|
+
buttons: csgButtons,
|
|
571
|
+
onClick: this.applyCsgOperation
|
|
572
|
+
}))) : null, this.state.csgBackup ? /*#__PURE__*/React.createElement("div", {
|
|
573
|
+
className: "redlining-controlsbar",
|
|
574
|
+
key: "CSGControls"
|
|
575
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
576
|
+
className: "redlining-control redlining-control-fill"
|
|
577
|
+
}, /*#__PURE__*/React.createElement(ButtonBar, {
|
|
578
|
+
buttons: [{
|
|
579
|
+
key: "undo",
|
|
580
|
+
label: LocaleUtils.tr("draw3d.undoBool")
|
|
581
|
+
}],
|
|
582
|
+
onClick: this.undoCsgOperation
|
|
583
|
+
}))) : null];
|
|
584
|
+
}
|
|
585
|
+
}]);
|
|
586
|
+
}(React.Component);
|
|
587
|
+
_defineProperty(EditTool3D, "propTypes", {
|
|
588
|
+
color: PropTypes.array,
|
|
589
|
+
colorChanged: PropTypes.func,
|
|
590
|
+
drawGroupId: PropTypes.string,
|
|
591
|
+
objectPicked: PropTypes.func,
|
|
592
|
+
sceneContext: PropTypes.object,
|
|
593
|
+
selectedObject: PropTypes.object
|
|
594
|
+
});
|
|
595
|
+
export { EditTool3D as default };
|