@buerli.io/react-cad 0.13.0 → 0.13.1-beta.3
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/build/components/UI/CAD/ToolBar/AssemblyModeCmds.d.ts +2 -2
- package/build/components/UI/CAD/ToolBar/PartModeCmds.d.ts +2 -2
- package/build/components/UI/CAD/ToolBar/useCommands.d.ts +5 -2
- package/build/components/UI/CAD/common/MultiSelect.d.ts +12 -0
- package/build/components/UI/CAD/hooks/useContextMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/plugins/ProductManagement/types.d.ts +0 -1
- package/build/index.cjs.js +1055 -756
- package/build/index.js +1055 -756
- package/build/plugins/Sketch/Root/SketchGroup.d.ts +1 -0
- package/build/plugins/Sketch/View/graphics/hooks.d.ts +2 -0
- package/build/plugins/Sketch/View/handlers/hoverHelpers.d.ts +3 -0
- package/build/plugins/Sketch/types.d.ts +3 -0
- package/build/plugins/Sketch/utils/Interaction.d.ts +2 -1
- package/build/plugins/Sketch/utils/OverdefinedStateManager.d.ts +6 -0
- package/build/utils/helpers.d.ts +1 -0
- package/package.json +5 -4
package/build/index.js
CHANGED
|
@@ -9,11 +9,11 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
9
9
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
10
10
|
import { useFrame, useThree, createPortal, extend } from '@react-three/fiber';
|
|
11
11
|
import { Html, useCursor, Text as Text$3, Merged, Grid } from '@react-three/drei';
|
|
12
|
+
import { CloseCircleTwoTone, ArrowUpOutlined, CheckOutlined, QuestionCircleFilled, DownOutlined, RightOutlined, EyeFilled, EyeOutlined, CheckCircleTwoTone, EditOutlined, DeleteOutlined, CaretRightOutlined, CaretDownOutlined, PlusOutlined, ExclamationCircleTwoTone, CloseOutlined, InfoCircleTwoTone, MessageOutlined, EditFilled, AppstoreOutlined, FileOutlined, DeploymentUnitOutlined, LeftOutlined, AppstoreAddOutlined, ExportOutlined, BgColorsOutlined, FontSizeOutlined, ColumnWidthOutlined, ExpandAltOutlined, CodeSandboxOutlined, SelectOutlined, PlusSquareOutlined } from '@ant-design/icons';
|
|
12
13
|
import create from 'zustand';
|
|
13
14
|
import vanilla from 'zustand/vanilla';
|
|
14
15
|
import 'antd/dist/antd.css';
|
|
15
16
|
import styled, { css, keyframes } from 'styled-components';
|
|
16
|
-
import { ArrowUpOutlined, CheckOutlined, QuestionCircleFilled, DownOutlined, RightOutlined, EyeFilled, EyeOutlined, EditOutlined, DeleteOutlined, CaretRightOutlined, CaretDownOutlined, PlusOutlined, CheckCircleTwoTone, CloseCircleTwoTone, ExclamationCircleTwoTone, CloseOutlined, InfoCircleTwoTone, MessageOutlined, EditFilled, AppstoreOutlined, FileOutlined, DeploymentUnitOutlined, LeftOutlined, AppstoreAddOutlined, ExportOutlined, BgColorsOutlined, FontSizeOutlined, ColumnWidthOutlined, ExpandAltOutlined, CodeSandboxOutlined, SelectOutlined, PlusSquareOutlined } from '@ant-design/icons';
|
|
17
17
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
18
18
|
import { findDOMNode } from 'react-dom';
|
|
19
19
|
import { Tooltip, Input as Input$1, Typography, Tag, Divider as Divider$1, Space, Button, Badge, Modal, Dropdown as Dropdown$1, Skeleton as Skeleton$1, Tabs as Tabs$1 } from 'antd';
|
|
@@ -39,8 +39,51 @@ import { CSS } from '@dnd-kit/utilities';
|
|
|
39
39
|
import Tooltip$1 from 'antd/lib/tooltip';
|
|
40
40
|
import * as deepmerge from 'deepmerge';
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const EMPTYARRAY = [];
|
|
43
|
+
const NOCCID = Number.MIN_SAFE_INTEGER;
|
|
44
|
+
const EMPTYSTR = '';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
48
|
+
* Use useDrawingArr if you want to get an array from store. It returns EMPTYARRAY if requested one is undefined.
|
|
49
|
+
*
|
|
50
|
+
* @param drawingId
|
|
51
|
+
* @param selector
|
|
52
|
+
* @returns requested by selector array or EMPTYARRAY if requested is undefined or null
|
|
53
|
+
*/
|
|
54
|
+
function useDrawingArr(drawingId, selector) {
|
|
55
|
+
const res = useDrawing(drawingId, selector);
|
|
56
|
+
return res || EMPTYARRAY;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
61
|
+
* Use useDrawingCCId if you want to get an object id from store. It returns NOCCID if requested one is undefined or null.
|
|
62
|
+
*
|
|
63
|
+
* @param drawingId
|
|
64
|
+
* @param selector
|
|
65
|
+
* @returns requested by selector object id or NOCCID if requested is undefined or null
|
|
66
|
+
*/
|
|
67
|
+
function useDrawingCCId(drawingId, selector) {
|
|
68
|
+
const res = useDrawing(drawingId, selector);
|
|
69
|
+
return res || NOCCID;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
74
|
+
* Use useDrawingStr if you want to get a string from store. It returns EMPTYSTR if requested one is undefined.
|
|
75
|
+
*
|
|
76
|
+
* @param drawingId
|
|
77
|
+
* @param selector
|
|
78
|
+
* @returns requested by selector string or EMPTYSTRING if requested one is undefined or null
|
|
79
|
+
*/
|
|
80
|
+
function useDrawingStr(drawingId, selector) {
|
|
81
|
+
const res = useDrawing(drawingId, selector);
|
|
82
|
+
return res || EMPTYSTR;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function ownKeys$y(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
86
|
+
function _objectSpread$y(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$y(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$y(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
44
87
|
function getGraphicId(tree, refOrObjId) {
|
|
45
88
|
const res = {
|
|
46
89
|
graphicId: refOrObjId,
|
|
@@ -81,7 +124,11 @@ function getGraphicId(tree, refOrObjId) {
|
|
|
81
124
|
*/
|
|
82
125
|
|
|
83
126
|
function useSelectedItems(drawingId, refOrObjIds) {
|
|
84
|
-
const
|
|
127
|
+
const activeContainers = useDrawingArr(drawingId, d => {
|
|
128
|
+
var _d$structure$tree;
|
|
129
|
+
return (_d$structure$tree = d.structure.tree[d.structure.currentProduct || NOCCID]) == null ? void 0 : _d$structure$tree.solids;
|
|
130
|
+
});
|
|
131
|
+
const visibleContainers = useDrawingArr(drawingId, d => d.structure.visibleContainers);
|
|
85
132
|
const cacheStamp = useDrawing(drawingId, d => d.geometry.stamp);
|
|
86
133
|
const cache = getDrawing(drawingId).geometry.cache;
|
|
87
134
|
const sortedContainerIds = React__default.useMemo(() => {
|
|
@@ -92,14 +139,14 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
92
139
|
3. Remove duplicats from elems array
|
|
93
140
|
*/
|
|
94
141
|
const allContainers = Object.getOwnPropertyNames(cache).map(n => Number(n)).sort((a, b) => b - a);
|
|
95
|
-
const
|
|
96
|
-
return
|
|
97
|
-
}, [cache, visibleContainers]);
|
|
142
|
+
const sortedContainerIds_ = [...activeContainers, ...visibleContainers, ...allContainers];
|
|
143
|
+
return sortedContainerIds_.filter((grId, i) => sortedContainerIds_.indexOf(grId) === i);
|
|
144
|
+
}, [cache, activeContainers, visibleContainers]);
|
|
98
145
|
|
|
99
146
|
// TODO: !!!Important!!! This may not properly create a graphic item for BuerliGeometry in assembly mode, but currently it isn't needed to.
|
|
100
147
|
const prodId = getDrawing(drawingId).structure.currentProduct;
|
|
101
148
|
const createSelItem = React__default.useCallback(element => {
|
|
102
|
-
return createGraphicItem(prodId, _objectSpread$
|
|
149
|
+
return createGraphicItem(prodId, _objectSpread$y(_objectSpread$y({}, element), {}, {
|
|
103
150
|
productId: prodId
|
|
104
151
|
}));
|
|
105
152
|
}, [prodId]);
|
|
@@ -124,7 +171,7 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
124
171
|
if (grIds && grIds.length > 0) {
|
|
125
172
|
const elem = cont.map[Number(grIds[0])];
|
|
126
173
|
if (elem) {
|
|
127
|
-
elems.push(_objectSpread$
|
|
174
|
+
elems.push(_objectSpread$y(_objectSpread$y({}, elem), {}, {
|
|
128
175
|
graphicId: contId,
|
|
129
176
|
type: cont.type
|
|
130
177
|
}));
|
|
@@ -160,12 +207,8 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
160
207
|
return selectedItems;
|
|
161
208
|
}
|
|
162
209
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const EMPTYSTR = '';
|
|
166
|
-
|
|
167
|
-
function ownKeys$w(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
168
|
-
function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$w(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$w(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
210
|
+
function ownKeys$x(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
211
|
+
function _objectSpread$x(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$x(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$x(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
169
212
|
function addMembers(drawingId, ccObjId) {
|
|
170
213
|
const drawingState = getDrawing(drawingId);
|
|
171
214
|
const objInTree = drawingState.structure.tree[ccObjId];
|
|
@@ -176,7 +219,7 @@ function addMembers(drawingId, ccObjId) {
|
|
|
176
219
|
const members = {};
|
|
177
220
|
Object.keys(curMembers).forEach(memberName => {
|
|
178
221
|
const curMember = curMembers[memberName];
|
|
179
|
-
members[memberName] = _objectSpread$
|
|
222
|
+
members[memberName] = _objectSpread$x(_objectSpread$x({}, curMember), {}, {
|
|
180
223
|
name: memberName
|
|
181
224
|
});
|
|
182
225
|
if (curMember.type === MemberType.POINT && Array.isArray(curMember.value)) {
|
|
@@ -192,7 +235,10 @@ function addMembers(drawingId, ccObjId) {
|
|
|
192
235
|
};
|
|
193
236
|
}
|
|
194
237
|
function useGlobalToLocalMatrix(drawingId, objId) {
|
|
195
|
-
const csys = useDrawing(drawingId, drawing =>
|
|
238
|
+
const csys = useDrawing(drawingId, drawing => {
|
|
239
|
+
var _drawing$structure$tr;
|
|
240
|
+
return objId && ((_drawing$structure$tr = drawing.structure.tree[objId]) == null ? void 0 : _drawing$structure$tr.coordinateSystem);
|
|
241
|
+
});
|
|
196
242
|
return React__default.useMemo(() => {
|
|
197
243
|
// TODO: remove undefined check when dimSet will be created on object creation.
|
|
198
244
|
if (!csys) return new THREE.Matrix4();
|
|
@@ -205,7 +251,7 @@ function useGlobalToLocalMatrix(drawingId, objId) {
|
|
|
205
251
|
function getGlobalToLocalMatrix(drawingId, objId) {
|
|
206
252
|
const drawing = getDrawing(drawingId);
|
|
207
253
|
const object = drawing.structure.tree[objId];
|
|
208
|
-
const matrix = object.coordinateSystem ? MathUtils.convertToMatrix4(object.coordinateSystem) : new THREE.Matrix4();
|
|
254
|
+
const matrix = object != null && object.coordinateSystem ? MathUtils.convertToMatrix4(object.coordinateSystem) : new THREE.Matrix4();
|
|
209
255
|
return matrix.invert();
|
|
210
256
|
}
|
|
211
257
|
function convertToVector(point) {
|
|
@@ -308,6 +354,9 @@ const isSketchRegion = arg => {
|
|
|
308
354
|
const objClass = typeof arg === 'string' ? arg : arg.class;
|
|
309
355
|
return ccUtils.base.isA(objClass, CCClasses.CCSketchRegion);
|
|
310
356
|
};
|
|
357
|
+
const isSketchObj = obj => {
|
|
358
|
+
return ccUtils.base.isA(obj == null ? void 0 : obj.class, CCClasses.CCSketch) || isSketchGeometry(obj) || is2DConstraint(obj);
|
|
359
|
+
};
|
|
311
360
|
const degreesToRadians = degrees => {
|
|
312
361
|
return degrees * Math.PI / 180;
|
|
313
362
|
};
|
|
@@ -349,6 +398,7 @@ const stringifyValue = (value, type) => {
|
|
|
349
398
|
|
|
350
399
|
// Searches for an object in the tree or graphic containers
|
|
351
400
|
function findObject(drawingId, id, unrollRefs = false) {
|
|
401
|
+
var _drawing$structure$tr2;
|
|
352
402
|
const drawing = getDrawing(drawingId);
|
|
353
403
|
const tree = drawing.structure.tree;
|
|
354
404
|
const obj = tree[id];
|
|
@@ -365,9 +415,10 @@ function findObject(drawingId, id, unrollRefs = false) {
|
|
|
365
415
|
}
|
|
366
416
|
const cache = drawing.geometry.cache;
|
|
367
417
|
const allContainers = Object.getOwnPropertyNames(cache).map(n => Number(n)).sort((a, b) => b - a);
|
|
368
|
-
const
|
|
369
|
-
const
|
|
370
|
-
|
|
418
|
+
const activeContainers = ((_drawing$structure$tr2 = drawing.structure.tree[drawing.structure.currentProduct || NOCCID]) == null ? void 0 : _drawing$structure$tr2.solids) || [];
|
|
419
|
+
const visibleContainers = drawing.structure.visibleContainers || [];
|
|
420
|
+
let sortedContainerIds = [...activeContainers, ...visibleContainers, ...allContainers];
|
|
421
|
+
sortedContainerIds = sortedContainerIds.filter((grId, i) => sortedContainerIds.indexOf(grId) === i);
|
|
371
422
|
if (cache[graphicId]) {
|
|
372
423
|
return cache[graphicId];
|
|
373
424
|
}
|
|
@@ -483,45 +534,6 @@ function getRegionCoordSys(drawingId, regionObj) {
|
|
|
483
534
|
return [originPos, xAxis, yAxis];
|
|
484
535
|
}
|
|
485
536
|
|
|
486
|
-
/**
|
|
487
|
-
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
488
|
-
* Use useDrawingArr if you want to get an array from store. It returns EMPTYARRAY if requested one is undefined.
|
|
489
|
-
*
|
|
490
|
-
* @param drawingId
|
|
491
|
-
* @param selector
|
|
492
|
-
* @returns requested by selector array or EMPTYARRAY if requested is undefined or null
|
|
493
|
-
*/
|
|
494
|
-
function useDrawingArr(drawingId, selector) {
|
|
495
|
-
const res = useDrawing(drawingId, selector);
|
|
496
|
-
return res || EMPTYARRAY;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
501
|
-
* Use useDrawingCCId if you want to get an object id from store. It returns NOCCID if requested one is undefined or null.
|
|
502
|
-
*
|
|
503
|
-
* @param drawingId
|
|
504
|
-
* @param selector
|
|
505
|
-
* @returns requested by selector object id or NOCCID if requested is undefined or null
|
|
506
|
-
*/
|
|
507
|
-
function useDrawingCCId(drawingId, selector) {
|
|
508
|
-
const res = useDrawing(drawingId, selector);
|
|
509
|
-
return res || NOCCID;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
514
|
-
* Use useDrawingStr if you want to get a string from store. It returns EMPTYSTR if requested one is undefined.
|
|
515
|
-
*
|
|
516
|
-
* @param drawingId
|
|
517
|
-
* @param selector
|
|
518
|
-
* @returns requested by selector string or EMPTYSTRING if requested one is undefined or null
|
|
519
|
-
*/
|
|
520
|
-
function useDrawingStr(drawingId, selector) {
|
|
521
|
-
const res = useDrawing(drawingId, selector);
|
|
522
|
-
return res || EMPTYSTR;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
537
|
const DimSetContext = /*#__PURE__*/React__default.createContext({
|
|
526
538
|
globalToLocalM: new THREE.Matrix4(),
|
|
527
539
|
drawingId: -1
|
|
@@ -1188,8 +1200,8 @@ const isAngular = dim => ccUtils.base.isA(dim.class, CCClasses.CCAngularDimensio
|
|
|
1188
1200
|
const isRadial = dim => ccUtils.base.isA(dim.class, CCClasses.CCRadialDimension) && !ccUtils.base.isA(dim.class, CCClasses.CCDiameterDimension);
|
|
1189
1201
|
const isDiameter = dim => ccUtils.base.isA(dim.class, CCClasses.CCDiameterDimension);
|
|
1190
1202
|
|
|
1191
|
-
function ownKeys$
|
|
1192
|
-
function _objectSpread$
|
|
1203
|
+
function ownKeys$w(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1204
|
+
function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$w(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$w(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1193
1205
|
const isFeatureActive = drawingId => {
|
|
1194
1206
|
const activePlugin = getDrawing(drawingId).plugin.active.feature;
|
|
1195
1207
|
if (activePlugin) {
|
|
@@ -1225,8 +1237,8 @@ const appApi = (set, get) => ({
|
|
|
1225
1237
|
const curInstance = api.getState().drawing.refs[drawingId].structure.currentInstance;
|
|
1226
1238
|
res = state.assemblyTree.prodStack;
|
|
1227
1239
|
curInstance && res.push(curInstance);
|
|
1228
|
-
return _objectSpread$
|
|
1229
|
-
assemblyTree: _objectSpread$
|
|
1240
|
+
return _objectSpread$w(_objectSpread$w({}, state), {}, {
|
|
1241
|
+
assemblyTree: _objectSpread$w(_objectSpread$w({}, state.assemblyTree), {}, {
|
|
1230
1242
|
prodStack: [...res]
|
|
1231
1243
|
})
|
|
1232
1244
|
});
|
|
@@ -1242,8 +1254,8 @@ const appApi = (set, get) => ({
|
|
|
1242
1254
|
set(state => {
|
|
1243
1255
|
const res = state.assemblyTree.prodStack;
|
|
1244
1256
|
res.pop();
|
|
1245
|
-
return _objectSpread$
|
|
1246
|
-
assemblyTree: _objectSpread$
|
|
1257
|
+
return _objectSpread$w(_objectSpread$w({}, state), {}, {
|
|
1258
|
+
assemblyTree: _objectSpread$w(_objectSpread$w({}, state.assemblyTree), {}, {
|
|
1247
1259
|
prodStack: [...res]
|
|
1248
1260
|
})
|
|
1249
1261
|
});
|
|
@@ -1251,8 +1263,8 @@ const appApi = (set, get) => ({
|
|
|
1251
1263
|
ccAPI.assemblyBuilder.setCurrentInstance(drawingId, prevProd).catch(console.warn);
|
|
1252
1264
|
},
|
|
1253
1265
|
clearProdStack: () => {
|
|
1254
|
-
set(state => _objectSpread$
|
|
1255
|
-
assemblyTree: _objectSpread$
|
|
1266
|
+
set(state => _objectSpread$w(_objectSpread$w({}, state), {}, {
|
|
1267
|
+
assemblyTree: _objectSpread$w(_objectSpread$w({}, state.assemblyTree), {}, {
|
|
1256
1268
|
prodStack: []
|
|
1257
1269
|
})
|
|
1258
1270
|
}));
|
|
@@ -1262,7 +1274,7 @@ const appApi = (set, get) => ({
|
|
|
1262
1274
|
return;
|
|
1263
1275
|
}
|
|
1264
1276
|
const visibleMap = get().assemblyTree.visibleMap;
|
|
1265
|
-
const visibleMapNew = _objectSpread$
|
|
1277
|
+
const visibleMapNew = _objectSpread$w({}, visibleMap);
|
|
1266
1278
|
instanceIds.forEach((instanceId, index) => {
|
|
1267
1279
|
const objIds = objIdsArr[index];
|
|
1268
1280
|
const visible = visibleMap[instanceId];
|
|
@@ -1277,8 +1289,8 @@ const appApi = (set, get) => ({
|
|
|
1277
1289
|
});
|
|
1278
1290
|
visibleMapNew[instanceId] = visibleNew;
|
|
1279
1291
|
});
|
|
1280
|
-
set(state => _objectSpread$
|
|
1281
|
-
assemblyTree: _objectSpread$
|
|
1292
|
+
set(state => _objectSpread$w(_objectSpread$w({}, state), {}, {
|
|
1293
|
+
assemblyTree: _objectSpread$w(_objectSpread$w({}, state.assemblyTree), {}, {
|
|
1282
1294
|
visibleMap: visibleMapNew
|
|
1283
1295
|
})
|
|
1284
1296
|
}));
|
|
@@ -1286,7 +1298,7 @@ const appApi = (set, get) => ({
|
|
|
1286
1298
|
},
|
|
1287
1299
|
blankDiv: {
|
|
1288
1300
|
show: callback => {
|
|
1289
|
-
set(state => _objectSpread$
|
|
1301
|
+
set(state => _objectSpread$w(_objectSpread$w({}, state), {}, {
|
|
1290
1302
|
blankDiv: {
|
|
1291
1303
|
isActive: true,
|
|
1292
1304
|
onClose: callback
|
|
@@ -1294,7 +1306,7 @@ const appApi = (set, get) => ({
|
|
|
1294
1306
|
}));
|
|
1295
1307
|
},
|
|
1296
1308
|
hide: () => {
|
|
1297
|
-
set(state => _objectSpread$
|
|
1309
|
+
set(state => _objectSpread$w(_objectSpread$w({}, state), {}, {
|
|
1298
1310
|
blankDiv: {
|
|
1299
1311
|
isActive: false,
|
|
1300
1312
|
onClose: undefined
|
|
@@ -1392,7 +1404,7 @@ const DimValue = ({
|
|
|
1392
1404
|
dimId,
|
|
1393
1405
|
disableEvents = false
|
|
1394
1406
|
}) => {
|
|
1395
|
-
var _dimension$members, _dimension$members$ma, _master$members;
|
|
1407
|
+
var _dimension$members, _dimension$members$ma, _master$members, _master$members$lgsSt, _master$members2, _master$members2$lgsS;
|
|
1396
1408
|
const {
|
|
1397
1409
|
drawingId
|
|
1398
1410
|
} = React__default.useContext(DimSetContext);
|
|
@@ -1407,11 +1419,13 @@ const DimValue = ({
|
|
|
1407
1419
|
// If we are in sketch context, master is a constraint, so the useValue should be taken if it exists, if doesn't take value.
|
|
1408
1420
|
const memberName = isSketchConstr ? master != null && (_master$members = master.members) != null && _master$members.userValue ? 'userValue' : 'value' : dimension.name;
|
|
1409
1421
|
const angle = isAngular(dimension);
|
|
1422
|
+
const lgsState = (_master$members$lgsSt = master == null ? void 0 : (_master$members2 = master.members) == null ? void 0 : (_master$members2$lgsS = _master$members2.lgsState) == null ? void 0 : _master$members2$lgsS.value) != null ? _master$members$lgsSt : 1;
|
|
1423
|
+
const isUnsatisfied = !(lgsState & 1);
|
|
1410
1424
|
const valueParam = useNumParam(drawingId, masterId, memberName, {
|
|
1411
1425
|
angle
|
|
1412
1426
|
});
|
|
1413
1427
|
const caption = React__default.useMemo(() => {
|
|
1414
|
-
var _master$
|
|
1428
|
+
var _master$members3, _master$members3$memb, _master$members4, _master$members4$memb;
|
|
1415
1429
|
if (!master) {
|
|
1416
1430
|
var _dimension$members2, _dimension$members2$v, _dimension$members3, _dimension$members3$d;
|
|
1417
1431
|
const dimValue = (_dimension$members2 = dimension.members) == null ? void 0 : (_dimension$members2$v = _dimension$members2.value) == null ? void 0 : _dimension$members2$v.value;
|
|
@@ -1423,10 +1437,10 @@ const DimValue = ({
|
|
|
1423
1437
|
}
|
|
1424
1438
|
|
|
1425
1439
|
// const paramName = dimension.members.paramName.value
|
|
1426
|
-
const expr = ((_master$
|
|
1440
|
+
const expr = ((_master$members3 = master.members) == null ? void 0 : (_master$members3$memb = _master$members3[memberName]) == null ? void 0 : _master$members3$memb.expression.replace(/ /g, '').replace(/ExpressionSet./g, '@')) || '';
|
|
1427
1441
|
const degValue = expr.length > 0 && expr[expr.length - 1] === 'g' ? Number(expr.slice(0, expr.length - 1)) : NaN;
|
|
1428
1442
|
const isDeg = !isNaN(degValue);
|
|
1429
|
-
const value = isDeg ? degValue : (_master$
|
|
1443
|
+
const value = isDeg ? degValue : (_master$members4 = master.members) == null ? void 0 : (_master$members4$memb = _master$members4[memberName]) == null ? void 0 : _master$members4$memb.value;
|
|
1430
1444
|
const valueStr = isDeg ? value.toFixed(2) + 'g' : value.toFixed(2);
|
|
1431
1445
|
return expr && !isDeg ? expr + ' (' + valueStr + ')' : valueStr;
|
|
1432
1446
|
}, [dimension, master, memberName, angle]);
|
|
@@ -1504,12 +1518,20 @@ const DimValue = ({
|
|
|
1504
1518
|
}
|
|
1505
1519
|
e.stopPropagation();
|
|
1506
1520
|
}, [update]);
|
|
1521
|
+
const [iconOffset, setIconOffset] = React__default.useState(0);
|
|
1507
1522
|
useFrame(args => {
|
|
1508
1523
|
if (!textRef.current || !textRef.current.parent) {
|
|
1509
1524
|
return;
|
|
1510
1525
|
}
|
|
1511
1526
|
textRef.current.quaternion.copy(textRef.current.parent.getWorldQuaternion(quat$2)).invert().multiply(args.camera.quaternion);
|
|
1512
1527
|
textRef.current.scale.setScalar(1 / args.camera.zoom);
|
|
1528
|
+
if (!textRef.current.geometry.boundingBox) {
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
const iconOffsetNew = textRef.current.geometry.boundingBox.max.x + 4;
|
|
1532
|
+
if (Math.abs(iconOffsetNew - iconOffset) > 1e-3) {
|
|
1533
|
+
setIconOffset(iconOffsetNew);
|
|
1534
|
+
}
|
|
1513
1535
|
});
|
|
1514
1536
|
return /*#__PURE__*/React__default.createElement("group", {
|
|
1515
1537
|
position: position
|
|
@@ -1528,7 +1550,14 @@ const DimValue = ({
|
|
|
1528
1550
|
userData: {
|
|
1529
1551
|
onHUD: true
|
|
1530
1552
|
}
|
|
1531
|
-
}, handlers), caption
|
|
1553
|
+
}, handlers), caption, isUnsatisfied && /*#__PURE__*/React__default.createElement(Html, {
|
|
1554
|
+
style: {
|
|
1555
|
+
transform: `translate3d(${iconOffset}px,19px,0)`,
|
|
1556
|
+
pointerEvents: 'none'
|
|
1557
|
+
}
|
|
1558
|
+
}, /*#__PURE__*/React__default.createElement(CloseCircleTwoTone, {
|
|
1559
|
+
twoToneColor: "#eb2f96"
|
|
1560
|
+
})))) : /*#__PURE__*/React__default.createElement(Html, {
|
|
1532
1561
|
zIndexRange: [blankZIndex + 1, blankZIndex + 1],
|
|
1533
1562
|
style: {
|
|
1534
1563
|
transform: 'translate3d(-50%,0,0)',
|
|
@@ -2342,8 +2371,58 @@ function useRefsParam(drawingId, objId, memberName) {
|
|
|
2342
2371
|
});
|
|
2343
2372
|
}
|
|
2344
2373
|
|
|
2345
|
-
|
|
2346
|
-
|
|
2374
|
+
const MultiSelectContext = /*#__PURE__*/React__default.createContext(null);
|
|
2375
|
+
const MultiSelect = ({
|
|
2376
|
+
children,
|
|
2377
|
+
drawingId,
|
|
2378
|
+
items,
|
|
2379
|
+
createInfo
|
|
2380
|
+
}) => {
|
|
2381
|
+
const itemsInfo = React__default.useMemo(() => items.map(createInfo), [items, createInfo]);
|
|
2382
|
+
const lastSelected = React__default.useRef(-1);
|
|
2383
|
+
const setLastSelected = React__default.useCallback((objId, overwrite) => {
|
|
2384
|
+
if (lastSelected.current === -1 || overwrite) lastSelected.current = objId;
|
|
2385
|
+
}, []);
|
|
2386
|
+
const multiSelect = React__default.useCallback(objId => {
|
|
2387
|
+
const drawing = getDrawing(drawingId);
|
|
2388
|
+
if (objId === lastSelected.current) {
|
|
2389
|
+
const select = drawing.api.interaction.select;
|
|
2390
|
+
select(createInfo(objId));
|
|
2391
|
+
return;
|
|
2392
|
+
}
|
|
2393
|
+
const index1 = items.indexOf(lastSelected.current);
|
|
2394
|
+
const index2 = items.indexOf(objId);
|
|
2395
|
+
if (index1 === -1 || index2 === -1) {
|
|
2396
|
+
return;
|
|
2397
|
+
}
|
|
2398
|
+
const start = Math.min(index1, index2);
|
|
2399
|
+
const end = Math.max(index1, index2);
|
|
2400
|
+
const toSelect = itemsInfo.slice(start, end + 1);
|
|
2401
|
+
const setSelected = drawing.api.interaction.setSelected;
|
|
2402
|
+
setSelected(toSelect);
|
|
2403
|
+
}, [drawingId, items, itemsInfo, createInfo]);
|
|
2404
|
+
const needsReset = useDrawing(drawingId, d => {
|
|
2405
|
+
var _d$interaction$select;
|
|
2406
|
+
return (_d$interaction$select = d.interaction.selected) == null ? void 0 : _d$interaction$select.every(selItem => !itemsInfo.some(info => info.uniqueIdent === selItem.uniqueIdent));
|
|
2407
|
+
}) || false;
|
|
2408
|
+
React__default.useEffect(() => {
|
|
2409
|
+
// Reset lastSelected if selected array becomes empty
|
|
2410
|
+
if (needsReset) {
|
|
2411
|
+
lastSelected.current = -1;
|
|
2412
|
+
}
|
|
2413
|
+
}, [needsReset]);
|
|
2414
|
+
const contextValue = React__default.useMemo(() => ({
|
|
2415
|
+
setLastSelected,
|
|
2416
|
+
multiSelect
|
|
2417
|
+
}), [setLastSelected, multiSelect]);
|
|
2418
|
+
return /*#__PURE__*/React__default.createElement(MultiSelectContext.Provider, {
|
|
2419
|
+
value: contextValue
|
|
2420
|
+
}, children);
|
|
2421
|
+
};
|
|
2422
|
+
|
|
2423
|
+
function ownKeys$v(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2424
|
+
function _objectSpread$v(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$v(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$v(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2425
|
+
|
|
2347
2426
|
/**
|
|
2348
2427
|
* Implies the following data structure:
|
|
2349
2428
|
* data: {
|
|
@@ -2374,22 +2453,32 @@ const getEventInfo = e => {
|
|
|
2374
2453
|
return {
|
|
2375
2454
|
delta: eRTF.delta,
|
|
2376
2455
|
stopPropagation: eRTF.stopPropagation,
|
|
2456
|
+
ctrlKey: eRTF.nativeEvent.ctrlKey,
|
|
2377
2457
|
shiftKey: eRTF.nativeEvent.shiftKey
|
|
2378
2458
|
};
|
|
2379
2459
|
} else {
|
|
2380
2460
|
return {
|
|
2381
2461
|
delta: 0,
|
|
2382
2462
|
stopPropagation: undefined,
|
|
2463
|
+
ctrlKey: eDef.ctrlKey,
|
|
2383
2464
|
shiftKey: eDef.shiftKey
|
|
2384
2465
|
};
|
|
2385
2466
|
}
|
|
2386
2467
|
};
|
|
2387
2468
|
function useSelect$1(drawingId, objId) {
|
|
2469
|
+
const {
|
|
2470
|
+
setLastSelected,
|
|
2471
|
+
multiSelect
|
|
2472
|
+
} = React__default.useContext(MultiSelectContext) || {
|
|
2473
|
+
setLastSelected: undefined,
|
|
2474
|
+
multiSelect: undefined
|
|
2475
|
+
};
|
|
2388
2476
|
const onClick = React__default.useCallback(e => {
|
|
2389
2477
|
var _drawing$plugin$refs, _drawing$structure$tr;
|
|
2390
2478
|
const {
|
|
2391
2479
|
delta,
|
|
2392
2480
|
stopPropagation,
|
|
2481
|
+
ctrlKey,
|
|
2393
2482
|
shiftKey
|
|
2394
2483
|
} = getEventInfo(e);
|
|
2395
2484
|
if (delta > 1) {
|
|
@@ -2397,16 +2486,18 @@ function useSelect$1(drawingId, objId) {
|
|
|
2397
2486
|
}
|
|
2398
2487
|
const drawing = getDrawing(drawingId);
|
|
2399
2488
|
const productId = drawing.structure.currentProduct;
|
|
2489
|
+
if (!productId) {
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2400
2492
|
let object = drawing.structure.tree[objId];
|
|
2401
2493
|
const selection = drawing.selection.refs[drawing.selection.active || ''];
|
|
2402
|
-
const isSelActive = selection !== undefined;
|
|
2403
2494
|
const isSelectable = (selection == null ? void 0 : selection.isSelectable(TreeObjScope, {
|
|
2404
2495
|
object
|
|
2405
2496
|
})) || false;
|
|
2406
2497
|
const activeId = ((_drawing$plugin$refs = drawing.plugin.refs[drawing.plugin.active.feature || -1]) == null ? void 0 : _drawing$plugin$refs.id) || -1;
|
|
2407
2498
|
const objClass = ((_drawing$structure$tr = drawing.structure.tree[activeId]) == null ? void 0 : _drawing$structure$tr.class) || '';
|
|
2408
2499
|
const isSketchActive = ccUtils.base.isA(objClass, CCClasses.CCSketch);
|
|
2409
|
-
if (
|
|
2500
|
+
if (isSketchActive && !isSketchObj(object) && !isSelectable) {
|
|
2410
2501
|
return;
|
|
2411
2502
|
}
|
|
2412
2503
|
stopPropagation == null ? void 0 : stopPropagation();
|
|
@@ -2424,13 +2515,18 @@ function useSelect$1(drawingId, objId) {
|
|
|
2424
2515
|
}
|
|
2425
2516
|
return;
|
|
2426
2517
|
}
|
|
2518
|
+
setLastSelected == null ? void 0 : setLastSelected(objId, !shiftKey);
|
|
2519
|
+
if (shiftKey && multiSelect) {
|
|
2520
|
+
multiSelect(objId);
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2427
2523
|
const interactionInfo = createInfo({
|
|
2428
2524
|
objectId: objId,
|
|
2429
2525
|
prodRefId: productId
|
|
2430
2526
|
});
|
|
2431
2527
|
const select = drawing.api.interaction.select;
|
|
2432
|
-
select(interactionInfo, shiftKey);
|
|
2433
|
-
}, [drawingId, objId]);
|
|
2528
|
+
select(interactionInfo, ctrlKey || shiftKey);
|
|
2529
|
+
}, [drawingId, objId, setLastSelected, multiSelect]);
|
|
2434
2530
|
return React__default.useMemo(() => ({
|
|
2435
2531
|
onClick
|
|
2436
2532
|
}), [onClick]);
|
|
@@ -2443,16 +2539,18 @@ function useHover$1(drawingId, objId) {
|
|
|
2443
2539
|
} = getEventInfo(e);
|
|
2444
2540
|
const drawing = getDrawing(drawingId);
|
|
2445
2541
|
const productId = drawing.structure.currentProduct;
|
|
2542
|
+
if (!productId) {
|
|
2543
|
+
return;
|
|
2544
|
+
}
|
|
2446
2545
|
const object = drawing.structure.tree[objId];
|
|
2447
2546
|
const selection = drawing.selection.refs[drawing.selection.active || ''];
|
|
2448
|
-
const isSelActive = selection !== undefined;
|
|
2449
2547
|
const isSelectable = (selection == null ? void 0 : selection.isSelectable(TreeObjScope, {
|
|
2450
2548
|
object
|
|
2451
2549
|
})) || false;
|
|
2452
2550
|
const activeId = ((_drawing$plugin$refs2 = drawing.plugin.refs[drawing.plugin.active.feature || -1]) == null ? void 0 : _drawing$plugin$refs2.id) || -1;
|
|
2453
2551
|
const objClass = ((_drawing$structure$tr2 = drawing.structure.tree[activeId]) == null ? void 0 : _drawing$structure$tr2.class) || '';
|
|
2454
2552
|
const isSketchActive = ccUtils.base.isA(objClass, CCClasses.CCSketch);
|
|
2455
|
-
if (
|
|
2553
|
+
if (isSketchActive && !isSketchObj(object) && !isSelectable) {
|
|
2456
2554
|
return;
|
|
2457
2555
|
}
|
|
2458
2556
|
stopPropagation == null ? void 0 : stopPropagation();
|
|
@@ -2560,6 +2658,9 @@ function useIsSSelected(drawingId, objId) {
|
|
|
2560
2658
|
return false;
|
|
2561
2659
|
}
|
|
2562
2660
|
const object = drawing.structure.tree[objId];
|
|
2661
|
+
if (!object) {
|
|
2662
|
+
return false;
|
|
2663
|
+
}
|
|
2563
2664
|
const selApi = drawing.api.selection;
|
|
2564
2665
|
return selApi.isItemSelected(createTreeObjSelItem(productId, object));
|
|
2565
2666
|
}, [drawingId, objId, selItems]);
|
|
@@ -2572,7 +2673,7 @@ function useTreeObjInteraction(drawingId, objId) {
|
|
|
2572
2673
|
const isGSelected = useIsGSelected(drawingId, objId);
|
|
2573
2674
|
const isSHovered = useIsSHovered(drawingId, objId);
|
|
2574
2675
|
const isSSelected = useIsSSelected(drawingId, objId);
|
|
2575
|
-
const handlers = React__default.useMemo(() => _objectSpread$
|
|
2676
|
+
const handlers = React__default.useMemo(() => _objectSpread$v(_objectSpread$v({}, hHandlers), sHandlers), [hHandlers, sHandlers]);
|
|
2576
2677
|
return React__default.useMemo(() => {
|
|
2577
2678
|
// If the handlers are switched off immediately after the selection (workplane selection for the sketcher), then hovered would keep being equal to true, making the mesh color wrong.
|
|
2578
2679
|
// Thus, we don't want hovered and selected to be true if the object is not selectable.
|
|
@@ -3043,8 +3144,8 @@ const SelectionRestorer = ({
|
|
|
3043
3144
|
return null;
|
|
3044
3145
|
};
|
|
3045
3146
|
|
|
3046
|
-
function ownKeys$
|
|
3047
|
-
function _objectSpread$
|
|
3147
|
+
function ownKeys$u(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3148
|
+
function _objectSpread$u(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$u(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$u(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3048
3149
|
|
|
3049
3150
|
/**
|
|
3050
3151
|
* Implies the following data structure:
|
|
@@ -3058,7 +3159,7 @@ function _objectSpread$t(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
3058
3159
|
const MateScope = 'HLConstraintScope';
|
|
3059
3160
|
const createMateItem = (matePath, csys, flip, reoriented) => {
|
|
3060
3161
|
return {
|
|
3061
|
-
id: `Mate|${matePath.toString()}|${csys.id}
|
|
3162
|
+
id: `Mate|${matePath.toString()}|${csys.id}`,
|
|
3062
3163
|
scope: MateScope,
|
|
3063
3164
|
data: {
|
|
3064
3165
|
matePath,
|
|
@@ -3138,7 +3239,7 @@ function useMateSelection(drawingId, matePath, csysId) {
|
|
|
3138
3239
|
}));
|
|
3139
3240
|
const handlers = React__default.useMemo(() => {
|
|
3140
3241
|
if (isSelectable) {
|
|
3141
|
-
return _objectSpread$
|
|
3242
|
+
return _objectSpread$u(_objectSpread$u({}, hHandlers), sHandlers);
|
|
3142
3243
|
}
|
|
3143
3244
|
return {};
|
|
3144
3245
|
}, [isSelectable, hHandlers, sHandlers]);
|
|
@@ -3181,8 +3282,11 @@ const PluginBounds = ({
|
|
|
3181
3282
|
};
|
|
3182
3283
|
|
|
3183
3284
|
const _excluded$6 = ["children"];
|
|
3285
|
+
function isDOM(node) {
|
|
3286
|
+
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
3287
|
+
}
|
|
3184
3288
|
const PluginTooltip = _ref => {
|
|
3185
|
-
var _React$useContext, _ref$current, _pluginBoundsRef$curr;
|
|
3289
|
+
var _React$useContext, _ref$current, _ref$current$triggerR, _ref$current$triggerR2, _ref$current2, _pluginBoundsRef$curr;
|
|
3186
3290
|
let {
|
|
3187
3291
|
children
|
|
3188
3292
|
} = _ref,
|
|
@@ -3191,7 +3295,11 @@ const PluginTooltip = _ref => {
|
|
|
3191
3295
|
const pluginBoundsRef = (_React$useContext = React__default.useContext(PBContext)) == null ? void 0 : _React$useContext.pluginBoundsRef;
|
|
3192
3296
|
const [, setStateChanged] = React__default.useState(0); // We want to trigger a rerender when the tooltip is opened
|
|
3193
3297
|
|
|
3194
|
-
|
|
3298
|
+
// In some cases, antd components return strange refs which should be handled differently here to prevent findDOMNode errors.
|
|
3299
|
+
// ref.current?.triggerRef.current?.input?.parentNode in particular is needed to get the correct element if RadioButton was wrapped.
|
|
3300
|
+
// BUT this is obviously a hack, and the problem should ideally be resolved the other way somehow...
|
|
3301
|
+
const node = ((_ref$current = ref.current) == null ? void 0 : (_ref$current$triggerR = _ref$current.triggerRef.current) == null ? void 0 : (_ref$current$triggerR2 = _ref$current$triggerR.input) == null ? void 0 : _ref$current$triggerR2.parentNode) || ((_ref$current2 = ref.current) == null ? void 0 : _ref$current2.triggerRef.current);
|
|
3302
|
+
const elem = isDOM(node) ? findDOMNode(node) : undefined;
|
|
3195
3303
|
const elemRect = elem == null ? void 0 : elem.getBoundingClientRect();
|
|
3196
3304
|
const pbRect = pluginBoundsRef == null ? void 0 : (_pluginBoundsRef$curr = pluginBoundsRef.current) == null ? void 0 : _pluginBoundsRef$curr.getBoundingClientRect();
|
|
3197
3305
|
let offsetX = 0;
|
|
@@ -3376,10 +3484,11 @@ const MateRestorer = ({
|
|
|
3376
3484
|
return [createMateItem(matePath, mate, flip, reoriented)];
|
|
3377
3485
|
}, [drawingId, matePath, csysId, flip, reoriented]);
|
|
3378
3486
|
React__default.useEffect(() => {
|
|
3487
|
+
var _selItems$, _selector$items$, _selItems$2, _selector$items$2;
|
|
3379
3488
|
if (!selectorId) return;
|
|
3380
3489
|
const selector = getDrawing(drawingId).selection.refs[selectorId];
|
|
3381
3490
|
const selApi = getDrawing(drawingId).api.selection;
|
|
3382
|
-
if (!selApi.areItemsSelected(selItems, selectorId)
|
|
3491
|
+
if (selItems.length !== selector.items.length || !(selApi.areItemsSelected(selItems, selectorId) && ((_selItems$ = selItems[0]) == null ? void 0 : _selItems$.data.flip) === ((_selector$items$ = selector.items[0]) == null ? void 0 : _selector$items$.data.flip) && ((_selItems$2 = selItems[0]) == null ? void 0 : _selItems$2.data.reoriented) === ((_selector$items$2 = selector.items[0]) == null ? void 0 : _selector$items$2.data.reoriented))) {
|
|
3383
3492
|
setMateParam(selItems[0]);
|
|
3384
3493
|
selApi.setItems(selectorId, selItems);
|
|
3385
3494
|
}
|
|
@@ -4134,8 +4243,8 @@ var index$H = /*#__PURE__*/Object.freeze({
|
|
|
4134
4243
|
description: description$H
|
|
4135
4244
|
});
|
|
4136
4245
|
|
|
4137
|
-
function ownKeys$
|
|
4138
|
-
function _objectSpread$
|
|
4246
|
+
function ownKeys$t(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4247
|
+
function _objectSpread$t(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$t(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$t(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4139
4248
|
function parseVal(val) {
|
|
4140
4249
|
const float = Number(val);
|
|
4141
4250
|
if (!isNaN(float)) {
|
|
@@ -4386,13 +4495,13 @@ const PointEditor = ({
|
|
|
4386
4495
|
newVals[i] = val;
|
|
4387
4496
|
}
|
|
4388
4497
|
});
|
|
4389
|
-
return _objectSpread$
|
|
4498
|
+
return _objectSpread$t(_objectSpread$t({}, state), {}, {
|
|
4390
4499
|
displayVals: newVals
|
|
4391
4500
|
});
|
|
4392
4501
|
})).catch();
|
|
4393
4502
|
} else {
|
|
4394
4503
|
const value = defaults.value;
|
|
4395
|
-
setDisplayState(state => _objectSpread$
|
|
4504
|
+
setDisplayState(state => _objectSpread$t(_objectSpread$t({}, state), {}, {
|
|
4396
4505
|
displayVals: [value.x, value.y, value.z]
|
|
4397
4506
|
}));
|
|
4398
4507
|
}
|
|
@@ -4408,7 +4517,7 @@ const PointEditor = ({
|
|
|
4408
4517
|
editMode: false,
|
|
4409
4518
|
displayVals: res_ !== null ? [res_.x, res_.y, res_.z] : [...state.displayVals]
|
|
4410
4519
|
}));
|
|
4411
|
-
}).catch(() => setDisplayState(state => _objectSpread$
|
|
4520
|
+
}).catch(() => setDisplayState(state => _objectSpread$t(_objectSpread$t({}, state), {}, {
|
|
4412
4521
|
editMode: false
|
|
4413
4522
|
})));
|
|
4414
4523
|
} else {
|
|
@@ -4430,7 +4539,7 @@ const PointEditor = ({
|
|
|
4430
4539
|
caption: caption,
|
|
4431
4540
|
highlighted: param.isChanged()
|
|
4432
4541
|
}, !editMode && /*#__PURE__*/React__default.createElement(DisplayBase, {
|
|
4433
|
-
onClick: () => setDisplayState(state => _objectSpread$
|
|
4542
|
+
onClick: () => setDisplayState(state => _objectSpread$t(_objectSpread$t({}, state), {}, {
|
|
4434
4543
|
editMode: true
|
|
4435
4544
|
}))
|
|
4436
4545
|
}, /*#__PURE__*/React__default.createElement(PluginTooltip, {
|
|
@@ -4513,11 +4622,11 @@ const PointEditor = ({
|
|
|
4513
4622
|
}, "\u2014")));
|
|
4514
4623
|
};
|
|
4515
4624
|
|
|
4516
|
-
function ownKeys$
|
|
4517
|
-
function _objectSpread$
|
|
4625
|
+
function ownKeys$s(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4626
|
+
function _objectSpread$s(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$s(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$s(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4518
4627
|
function createPointParam(member) {
|
|
4519
4628
|
const isExpr = member.expression.length > 0;
|
|
4520
|
-
const value = isExpr ? member.expression : _objectSpread$
|
|
4629
|
+
const value = isExpr ? member.expression : _objectSpread$s({}, member.value);
|
|
4521
4630
|
return {
|
|
4522
4631
|
value,
|
|
4523
4632
|
isExpr
|
|
@@ -6881,8 +6990,8 @@ const Digits = ({
|
|
|
6881
6990
|
|
|
6882
6991
|
const vectorToString = (point, digits) => `${point.toArray().map(n => MathUtils.round(n, digits)).join(', ')}`;
|
|
6883
6992
|
|
|
6884
|
-
function ownKeys$
|
|
6885
|
-
function _objectSpread$
|
|
6993
|
+
function ownKeys$r(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6994
|
+
function _objectSpread$r(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$r(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$r(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6886
6995
|
const Excluded = [GraphicType.LOOP].concat(EntityTypes);
|
|
6887
6996
|
const RootImpl$o = ({
|
|
6888
6997
|
drawingId,
|
|
@@ -6953,7 +7062,7 @@ const Output = ({
|
|
|
6953
7062
|
const {
|
|
6954
7063
|
value
|
|
6955
7064
|
} = res.measureData;
|
|
6956
|
-
return _objectSpread$
|
|
7065
|
+
return _objectSpread$r(_objectSpread$r({}, res), {}, {
|
|
6957
7066
|
asString: MathUtils.round(value, digits)
|
|
6958
7067
|
});
|
|
6959
7068
|
}
|
|
@@ -6963,13 +7072,13 @@ const Output = ({
|
|
|
6963
7072
|
const {
|
|
6964
7073
|
value
|
|
6965
7074
|
} = res.measureData;
|
|
6966
|
-
return _objectSpread$
|
|
7075
|
+
return _objectSpread$r(_objectSpread$r({}, res), {}, {
|
|
6967
7076
|
asString: vectorToString(value, digits)
|
|
6968
7077
|
});
|
|
6969
7078
|
}
|
|
6970
7079
|
}
|
|
6971
7080
|
}
|
|
6972
|
-
return _objectSpread$
|
|
7081
|
+
return _objectSpread$r(_objectSpread$r({}, res), {}, {
|
|
6973
7082
|
asString: ''
|
|
6974
7083
|
});
|
|
6975
7084
|
});
|
|
@@ -7523,6 +7632,7 @@ const description$n = {
|
|
|
7523
7632
|
},
|
|
7524
7633
|
|
|
7525
7634
|
// Contains information about objects under the pointer (`interaction.objects[interaction.cycle]` should equal `hovered`)
|
|
7635
|
+
overdefined: {},
|
|
7526
7636
|
isDragged: false,
|
|
7527
7637
|
// When used drags some objects, this should equal true.
|
|
7528
7638
|
scale: 1,
|
|
@@ -7549,8 +7659,8 @@ function getSketchState(drawingId, pluginId) {
|
|
|
7549
7659
|
return plugin.state;
|
|
7550
7660
|
}
|
|
7551
7661
|
|
|
7552
|
-
function ownKeys$
|
|
7553
|
-
function _objectSpread$
|
|
7662
|
+
function ownKeys$q(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7663
|
+
function _objectSpread$q(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$q(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$q(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7554
7664
|
function CreateAngle(drawingId, pluginId) {
|
|
7555
7665
|
const {
|
|
7556
7666
|
set
|
|
@@ -7591,8 +7701,8 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
7591
7701
|
set(state_ => {
|
|
7592
7702
|
const tmpAngularDimension = state_.tmpObjects[tmpDimensionId];
|
|
7593
7703
|
return {
|
|
7594
|
-
tmpObjects: _objectSpread$
|
|
7595
|
-
[tmpDimensionId]: _objectSpread$
|
|
7704
|
+
tmpObjects: _objectSpread$q(_objectSpread$q({}, state_.tmpObjects), {}, {
|
|
7705
|
+
[tmpDimensionId]: _objectSpread$q(_objectSpread$q({}, tmpAngularDimension), params)
|
|
7596
7706
|
})
|
|
7597
7707
|
};
|
|
7598
7708
|
});
|
|
@@ -7618,7 +7728,7 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
7618
7728
|
const dir1 = linesInfo.dir1;
|
|
7619
7729
|
const center = linesInfo.center;
|
|
7620
7730
|
const dimPos = center.clone().addScaledVector(dir0.clone().add(dir1).normalize(), 10);
|
|
7621
|
-
const tmpAngularDimension = _objectSpread$
|
|
7731
|
+
const tmpAngularDimension = _objectSpread$q(_objectSpread$q({
|
|
7622
7732
|
class: TmpObjClasses.AngularDimension,
|
|
7623
7733
|
id: tmpDimensionId
|
|
7624
7734
|
}, linesInfo), {}, {
|
|
@@ -7746,8 +7856,8 @@ function getGeometryPriority(object) {
|
|
|
7746
7856
|
return -1;
|
|
7747
7857
|
}
|
|
7748
7858
|
|
|
7749
|
-
function ownKeys$
|
|
7750
|
-
function _objectSpread$
|
|
7859
|
+
function ownKeys$p(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7860
|
+
function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$p(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$p(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7751
7861
|
let timerId;
|
|
7752
7862
|
const projectPointOnGeometry = (point, geometryId, tree) => {
|
|
7753
7863
|
const geometry = tree[geometryId];
|
|
@@ -7793,7 +7903,7 @@ const setHoverState = (drawingId, pluginId, cycle, objects, hoverPos) => {
|
|
|
7793
7903
|
const highlightedNonGeom = highlighted.filter(id => id !== hoveredId && (is2DConstraint(tree[id]) || isSketchRegion(tree[id])));
|
|
7794
7904
|
return {
|
|
7795
7905
|
highlighted: [...highlightedNonGeom, hoveredId, ...entities],
|
|
7796
|
-
interaction: _objectSpread$
|
|
7906
|
+
interaction: _objectSpread$p(_objectSpread$p({}, state_.interaction), {}, {
|
|
7797
7907
|
cycle,
|
|
7798
7908
|
objects
|
|
7799
7909
|
})
|
|
@@ -7802,12 +7912,12 @@ const setHoverState = (drawingId, pluginId, cycle, objects, hoverPos) => {
|
|
|
7802
7912
|
} else {
|
|
7803
7913
|
const linked = Object.values(tree).filter(obj => is2DConstraint(obj) || isSketchRegion(obj)).filter(obj => getEntities(drawingId, obj.id).some(entityId => entityId === hoveredId)).map(obj => obj.id);
|
|
7804
7914
|
const state = getSketchState(drawingId, pluginId);
|
|
7805
|
-
const constraintsToGeometry = _objectSpread$
|
|
7915
|
+
const constraintsToGeometry = _objectSpread$p({}, state.interaction.constraintsToGeometry);
|
|
7806
7916
|
linked.forEach(id => {
|
|
7807
7917
|
constraintsToGeometry[id] = hoveredId;
|
|
7808
7918
|
});
|
|
7809
7919
|
const prevHoveredId = state.interaction.objects[state.interaction.cycle % state.interaction.objects.length];
|
|
7810
|
-
const lastHoveredPos = _objectSpread$
|
|
7920
|
+
const lastHoveredPos = _objectSpread$p({}, state.interaction.lastHoveredPos);
|
|
7811
7921
|
if (!hoverPos) {
|
|
7812
7922
|
linked.forEach(id => delete lastHoveredPos[id]);
|
|
7813
7923
|
} else if (hoveredId !== prevHoveredId) {
|
|
@@ -7835,7 +7945,7 @@ const setHoverState = (drawingId, pluginId, cycle, objects, hoverPos) => {
|
|
|
7835
7945
|
const highlightedNonGeom = highlighted.filter(id => is2DConstraint(tree[id]) || isSketchRegion(tree[id]));
|
|
7836
7946
|
return {
|
|
7837
7947
|
highlighted: highlightedNonGeom,
|
|
7838
|
-
interaction: _objectSpread$
|
|
7948
|
+
interaction: _objectSpread$p(_objectSpread$p({}, state_.interaction), {}, {
|
|
7839
7949
|
cycle,
|
|
7840
7950
|
objects
|
|
7841
7951
|
})
|
|
@@ -7871,7 +7981,7 @@ const unhover = (drawingId, pluginId, objId) => {
|
|
|
7871
7981
|
const objectsNew = objects.filter(id => id !== objId);
|
|
7872
7982
|
setHoverState(drawingId, pluginId, 0, objectsNew);
|
|
7873
7983
|
};
|
|
7874
|
-
const select = (drawingId,
|
|
7984
|
+
const select = (drawingId, selectedId) => {
|
|
7875
7985
|
const drawing = getDrawing(drawingId);
|
|
7876
7986
|
const curProduct = drawing.structure.currentProduct;
|
|
7877
7987
|
const select_ = drawing.api.interaction.select;
|
|
@@ -7890,8 +8000,43 @@ const tab = (drawingId, pluginId) => {
|
|
|
7890
8000
|
setHoverState(drawingId, pluginId, cycle, objects);
|
|
7891
8001
|
};
|
|
7892
8002
|
|
|
7893
|
-
|
|
8003
|
+
const getSketchObjIds = (drawingId, sketchId, intersections) => {
|
|
8004
|
+
const drawing = getDrawing(drawingId);
|
|
8005
|
+
const tree = drawing.structure.tree;
|
|
8006
|
+
const selection = drawing.selection.refs[drawing.selection.active || ''];
|
|
8007
|
+
const isSelActive = selection !== undefined;
|
|
8008
|
+
const objIds = intersections.map(intersection => {
|
|
8009
|
+
var _intersection$object$;
|
|
8010
|
+
return ((_intersection$object$ = intersection.object.userData) == null ? void 0 : _intersection$object$.objId) || undefined;
|
|
8011
|
+
});
|
|
8012
|
+
return objIds.filter((objId, i) => {
|
|
8013
|
+
var _object$members;
|
|
8014
|
+
const object = tree[objId || NOCCID];
|
|
8015
|
+
const isSelectable = object && (selection == null ? void 0 : selection.isSelectable(TreeObjScope, {
|
|
8016
|
+
object
|
|
8017
|
+
})) || false;
|
|
8018
|
+
const isSketchObj = object && (isSketchGeometry(object) || is2DConstraint(object)) && getAncestorIdByClass(drawingId, object.id, CCClasses.CCSketch) === sketchId;
|
|
8019
|
+
const isSketchRegion_ = object && isSketchRegion(object) && ((_object$members = object.members) == null ? void 0 : _object$members.sketch.value) === sketchId;
|
|
8020
|
+
const canBeSelected = !isSelActive || isSelectable;
|
|
8021
|
+
return object && (isSketchObj || isSketchRegion_) && canBeSelected && objIds.indexOf(objId) === i;
|
|
8022
|
+
});
|
|
8023
|
+
};
|
|
8024
|
+
const hoverIntersections = (drawingId, pluginId, intersections) => {
|
|
7894
8025
|
const sketchId = getPlugin(drawingId, pluginId).objectId;
|
|
8026
|
+
const tree = getDrawing(drawingId).structure.tree;
|
|
8027
|
+
const sketchObjIds = getSketchObjIds(drawingId, sketchId, intersections);
|
|
8028
|
+
const sketchIntersection = intersections.find(intersection => {
|
|
8029
|
+
var _intersection$object$2;
|
|
8030
|
+
const objId = (_intersection$object$2 = intersection.object.userData) == null ? void 0 : _intersection$object$2.objId;
|
|
8031
|
+
const obj = tree[objId];
|
|
8032
|
+
return ccUtils.base.isA(obj == null ? void 0 : obj.class, CCClasses.CCSketch);
|
|
8033
|
+
});
|
|
8034
|
+
const hoverPos = sketchIntersection ? sketchIntersection.point.clone() : new THREE.Vector3();
|
|
8035
|
+
hoverPos.applyMatrix4(getGlobalToLocalMatrix(drawingId, sketchId));
|
|
8036
|
+
hover(drawingId, pluginId, sketchObjIds, hoverPos);
|
|
8037
|
+
};
|
|
8038
|
+
|
|
8039
|
+
function Hover(drawingId, pluginId) {
|
|
7895
8040
|
const filter = object => true;
|
|
7896
8041
|
const onDeactivate = () => {
|
|
7897
8042
|
const setHovered = getDrawing(drawingId).api.interaction.setHovered;
|
|
@@ -7902,27 +8047,6 @@ function Hover(drawingId, pluginId) {
|
|
|
7902
8047
|
tab(drawingId, pluginId);
|
|
7903
8048
|
}
|
|
7904
8049
|
};
|
|
7905
|
-
const getSketchObjIds = e => {
|
|
7906
|
-
const drawing = getDrawing(drawingId);
|
|
7907
|
-
const tree = drawing.structure.tree;
|
|
7908
|
-
const selection = drawing.selection.refs[drawing.selection.active || ''];
|
|
7909
|
-
const isSelActive = selection !== undefined;
|
|
7910
|
-
const objIds = e.intersections.map(intersection => {
|
|
7911
|
-
var _intersection$object$;
|
|
7912
|
-
return ((_intersection$object$ = intersection.object.userData) == null ? void 0 : _intersection$object$.objId) || undefined;
|
|
7913
|
-
});
|
|
7914
|
-
return objIds.filter((objId, i) => {
|
|
7915
|
-
var _object$members;
|
|
7916
|
-
const object = tree[objId || NOCCID];
|
|
7917
|
-
const isSelectable = object && (selection == null ? void 0 : selection.isSelectable(TreeObjScope, {
|
|
7918
|
-
object
|
|
7919
|
-
})) || false;
|
|
7920
|
-
const isSketchObj = object && (isSketchGeometry(object) || is2DConstraint(object)) && getAncestorIdByClass(drawingId, object.id, CCClasses.CCSketch) === sketchId;
|
|
7921
|
-
const isSketchRegion_ = object && isSketchRegion(object) && ((_object$members = object.members) == null ? void 0 : _object$members.sketch.value) === sketchId;
|
|
7922
|
-
const canBeSelected = !isSelActive || isSelectable;
|
|
7923
|
-
return object && (isSketchObj || isSketchRegion_) && canBeSelected && objIds.indexOf(objId) === i;
|
|
7924
|
-
});
|
|
7925
|
-
};
|
|
7926
8050
|
|
|
7927
8051
|
// A single handler for both onPointerOver / onPointerOut
|
|
7928
8052
|
const onHover = e => {
|
|
@@ -7931,16 +8055,7 @@ function Hover(drawingId, pluginId) {
|
|
|
7931
8055
|
if (!tree[hoveredId] || ccUtils.base.isA(tree[hoveredId].class, CCClasses.CCSketch)) {
|
|
7932
8056
|
return;
|
|
7933
8057
|
}
|
|
7934
|
-
|
|
7935
|
-
const sketchIntersection = e.intersections.find(intersection => {
|
|
7936
|
-
var _intersection$object$2;
|
|
7937
|
-
const objId = (_intersection$object$2 = intersection.object.userData) == null ? void 0 : _intersection$object$2.objId;
|
|
7938
|
-
const obj = tree[objId];
|
|
7939
|
-
return ccUtils.base.isA(obj == null ? void 0 : obj.class, CCClasses.CCSketch);
|
|
7940
|
-
});
|
|
7941
|
-
const hoverPos = sketchIntersection ? sketchIntersection.point.clone() : new THREE.Vector3();
|
|
7942
|
-
hoverPos.applyMatrix4(getGlobalToLocalMatrix(drawingId, sketchId));
|
|
7943
|
-
hover(drawingId, pluginId, sketchObjIds, hoverPos);
|
|
8058
|
+
hoverIntersections(drawingId, pluginId, e.intersections);
|
|
7944
8059
|
};
|
|
7945
8060
|
return {
|
|
7946
8061
|
name: HandlersList.HOVER,
|
|
@@ -8290,8 +8405,8 @@ const MergedWrapper = ({
|
|
|
8290
8405
|
);
|
|
8291
8406
|
};
|
|
8292
8407
|
|
|
8293
|
-
function ownKeys$
|
|
8294
|
-
function _objectSpread$
|
|
8408
|
+
function ownKeys$o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8409
|
+
function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8295
8410
|
|
|
8296
8411
|
// Artificial delay in 16 ms.
|
|
8297
8412
|
const artifDelay = 16;
|
|
@@ -8391,29 +8506,21 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
8391
8506
|
cycle,
|
|
8392
8507
|
objects
|
|
8393
8508
|
} = getSketchState(drawingId, pluginId).interaction;
|
|
8394
|
-
pressedId = objects.length > 0 ? objects[cycle % objects.length] :
|
|
8395
|
-
const pressedObj = getDrawing(drawingId).structure.tree[pressedId];
|
|
8509
|
+
pressedId = objects.length > 0 ? objects[cycle % objects.length] : NOCCID;
|
|
8396
8510
|
if (e.nativeEvent.shiftKey) {
|
|
8397
|
-
if (!ccUtils.base.isA(pressedObj.class, CCClasses.CCSketch)) {
|
|
8398
|
-
// If clicked on a sketch child propagate down to Sketch plane.
|
|
8399
|
-
return;
|
|
8400
|
-
}
|
|
8401
8511
|
isRectSelectionActive = true;
|
|
8402
|
-
rectClickPoint = e.point.clone().project(e.camera);
|
|
8403
|
-
pressedId = NOCCID;
|
|
8404
8512
|
camControls.enabled = false;
|
|
8405
|
-
e.
|
|
8406
|
-
e.stopPropagation();
|
|
8513
|
+
rectClickPoint = e.point.clone().project(e.camera);
|
|
8407
8514
|
set({
|
|
8408
8515
|
rubberBandRectangle: {
|
|
8409
8516
|
min: rectClickPoint.clone(),
|
|
8410
8517
|
max: rectClickPoint.clone()
|
|
8411
8518
|
}
|
|
8412
8519
|
});
|
|
8520
|
+
e.stopPropagation();
|
|
8413
8521
|
return;
|
|
8414
8522
|
}
|
|
8415
|
-
if (
|
|
8416
|
-
pressedId = NOCCID;
|
|
8523
|
+
if (pressedId === NOCCID) {
|
|
8417
8524
|
return;
|
|
8418
8525
|
}
|
|
8419
8526
|
const intersectionPoint = getPointOnPlane(e.unprojectedPoint, e.camera, getGlobalToLocalMatrix(drawingId, sketchId));
|
|
@@ -8449,31 +8556,42 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
8449
8556
|
const setSelected = drawing.api.interaction.setSelected;
|
|
8450
8557
|
if (isRectSelectionActive) {
|
|
8451
8558
|
isRectSelectionActive = false;
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8559
|
+
if (isMoved) {
|
|
8560
|
+
const highlighted = getSketchState(drawingId, pluginId).highlighted;
|
|
8561
|
+
const highlightedInfo = highlighted.map(id => createInfo({
|
|
8562
|
+
objectId: id,
|
|
8563
|
+
prodRefId: curProduct
|
|
8564
|
+
}));
|
|
8565
|
+
const curSelected = drawing.interaction.selected || [];
|
|
8566
|
+
setSelected([...curSelected, ...highlightedInfo]);
|
|
8567
|
+
set({
|
|
8568
|
+
highlighted: [],
|
|
8569
|
+
rubberBandRectangle: undefined
|
|
8570
|
+
});
|
|
8571
|
+
pressedId = NOCCID;
|
|
8572
|
+
e.stopPropagation();
|
|
8573
|
+
return;
|
|
8574
|
+
}
|
|
8466
8575
|
}
|
|
8467
|
-
set({
|
|
8468
|
-
isDragged: false
|
|
8469
|
-
});
|
|
8470
8576
|
if (isMoved === false) {
|
|
8471
8577
|
if (pressedId === NOCCID) {
|
|
8472
8578
|
clearSelection();
|
|
8579
|
+
set({
|
|
8580
|
+
isDragged: false,
|
|
8581
|
+
rubberBandRectangle: undefined
|
|
8582
|
+
});
|
|
8583
|
+
e.stopPropagation();
|
|
8473
8584
|
return;
|
|
8474
8585
|
}
|
|
8475
|
-
select(drawingId,
|
|
8586
|
+
select(drawingId, pressedId);
|
|
8476
8587
|
}
|
|
8588
|
+
set({
|
|
8589
|
+
isDragged: false,
|
|
8590
|
+
rubberBandRectangle: undefined
|
|
8591
|
+
});
|
|
8592
|
+
|
|
8593
|
+
// We want to reset the interaction state after the drag stops
|
|
8594
|
+
hoverIntersections(drawingId, pluginId, e.intersections);
|
|
8477
8595
|
clearIgnoreList();
|
|
8478
8596
|
clearDraggedPoints();
|
|
8479
8597
|
pressedId = NOCCID;
|
|
@@ -8558,7 +8676,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
8558
8676
|
name: HandlersList.DRAG,
|
|
8559
8677
|
filter,
|
|
8560
8678
|
onDeactivate,
|
|
8561
|
-
pointerHandlers: _objectSpread$
|
|
8679
|
+
pointerHandlers: _objectSpread$o({
|
|
8562
8680
|
onPointerDown,
|
|
8563
8681
|
onPointerUp,
|
|
8564
8682
|
onPointerMove
|
|
@@ -8570,8 +8688,8 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
8570
8688
|
};
|
|
8571
8689
|
}
|
|
8572
8690
|
|
|
8573
|
-
function ownKeys$
|
|
8574
|
-
function _objectSpread$
|
|
8691
|
+
function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8692
|
+
function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8575
8693
|
function DrawPoint(drawingId, pluginId) {
|
|
8576
8694
|
const {
|
|
8577
8695
|
set
|
|
@@ -8620,7 +8738,7 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
8620
8738
|
}).then(() => {
|
|
8621
8739
|
// Remove the old temporary point once a permanent one is created in its place
|
|
8622
8740
|
set(state => {
|
|
8623
|
-
const tmpObjects_ = _objectSpread$
|
|
8741
|
+
const tmpObjects_ = _objectSpread$n({}, state.tmpObjects);
|
|
8624
8742
|
delete tmpObjects_[curPointId];
|
|
8625
8743
|
return {
|
|
8626
8744
|
tmpObjects: tmpObjects_
|
|
@@ -8633,8 +8751,8 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
8633
8751
|
set(state => {
|
|
8634
8752
|
const tmpPoint = state.tmpObjects[curPointId];
|
|
8635
8753
|
return {
|
|
8636
|
-
tmpObjects: _objectSpread$
|
|
8637
|
-
[tmpPointId]: _objectSpread$
|
|
8754
|
+
tmpObjects: _objectSpread$n(_objectSpread$n({}, state.tmpObjects), {}, {
|
|
8755
|
+
[tmpPointId]: _objectSpread$n(_objectSpread$n({}, tmpPoint), {}, {
|
|
8638
8756
|
id: tmpPointId,
|
|
8639
8757
|
position: tmpPoint.position.clone()
|
|
8640
8758
|
})
|
|
@@ -8651,8 +8769,8 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
8651
8769
|
const tmpPoint = state.tmpObjects[tmpPointId];
|
|
8652
8770
|
return {
|
|
8653
8771
|
mousePos,
|
|
8654
|
-
tmpObjects: _objectSpread$
|
|
8655
|
-
[tmpPointId]: _objectSpread$
|
|
8772
|
+
tmpObjects: _objectSpread$n(_objectSpread$n({}, state.tmpObjects), {}, {
|
|
8773
|
+
[tmpPointId]: _objectSpread$n(_objectSpread$n({}, tmpPoint), {}, {
|
|
8656
8774
|
position: mousePos
|
|
8657
8775
|
})
|
|
8658
8776
|
})
|
|
@@ -8672,8 +8790,8 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
8672
8790
|
};
|
|
8673
8791
|
}
|
|
8674
8792
|
|
|
8675
|
-
function ownKeys$
|
|
8676
|
-
function _objectSpread$
|
|
8793
|
+
function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8794
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8677
8795
|
function DrawLine(drawingId, pluginId) {
|
|
8678
8796
|
// Global hooks:
|
|
8679
8797
|
const {
|
|
@@ -8752,7 +8870,7 @@ function DrawLine(drawingId, pluginId) {
|
|
|
8752
8870
|
endPId: tmpEndP.id
|
|
8753
8871
|
};
|
|
8754
8872
|
return {
|
|
8755
|
-
tmpObjects: _objectSpread$
|
|
8873
|
+
tmpObjects: _objectSpread$m(_objectSpread$m({}, state.tmpObjects), {}, {
|
|
8756
8874
|
[tmpStartP.id]: tmpStartP,
|
|
8757
8875
|
[tmpLine.id]: tmpLine
|
|
8758
8876
|
})
|
|
@@ -8788,7 +8906,7 @@ function DrawLine(drawingId, pluginId) {
|
|
|
8788
8906
|
var _lastAddedLine$childr;
|
|
8789
8907
|
// Remove the old temporary line and its points once a permanent one is created in its place
|
|
8790
8908
|
set(state => {
|
|
8791
|
-
const tmpObjects_ = _objectSpread$
|
|
8909
|
+
const tmpObjects_ = _objectSpread$m({}, state.tmpObjects);
|
|
8792
8910
|
delete tmpObjects_[curStartPId];
|
|
8793
8911
|
delete tmpObjects_[curEndPId];
|
|
8794
8912
|
delete tmpObjects_[curLineId];
|
|
@@ -8811,16 +8929,16 @@ function DrawLine(drawingId, pluginId) {
|
|
|
8811
8929
|
const tmpEndP = state.tmpObjects[curEndPId];
|
|
8812
8930
|
const tmpLine = state.tmpObjects[curLineId];
|
|
8813
8931
|
return {
|
|
8814
|
-
tmpObjects: _objectSpread$
|
|
8815
|
-
[tmpStartPId]: _objectSpread$
|
|
8932
|
+
tmpObjects: _objectSpread$m(_objectSpread$m({}, state.tmpObjects), {}, {
|
|
8933
|
+
[tmpStartPId]: _objectSpread$m(_objectSpread$m({}, tmpStartP), {}, {
|
|
8816
8934
|
id: tmpStartPId,
|
|
8817
8935
|
position: tmpEndP.position.clone()
|
|
8818
8936
|
}),
|
|
8819
|
-
[tmpEndPId]: _objectSpread$
|
|
8937
|
+
[tmpEndPId]: _objectSpread$m(_objectSpread$m({}, tmpEndP), {}, {
|
|
8820
8938
|
id: tmpEndPId,
|
|
8821
8939
|
position: tmpEndP.position.clone()
|
|
8822
8940
|
}),
|
|
8823
|
-
[tmpLineId]: _objectSpread$
|
|
8941
|
+
[tmpLineId]: _objectSpread$m(_objectSpread$m({}, tmpLine), {}, {
|
|
8824
8942
|
id: tmpLineId,
|
|
8825
8943
|
startPId: tmpStartPId,
|
|
8826
8944
|
endPId: tmpEndPId
|
|
@@ -8839,8 +8957,8 @@ function DrawLine(drawingId, pluginId) {
|
|
|
8839
8957
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
8840
8958
|
return {
|
|
8841
8959
|
mousePos,
|
|
8842
|
-
tmpObjects: _objectSpread$
|
|
8843
|
-
[tmpEndPId]: _objectSpread$
|
|
8960
|
+
tmpObjects: _objectSpread$m(_objectSpread$m({}, state.tmpObjects), {}, {
|
|
8961
|
+
[tmpEndPId]: _objectSpread$m(_objectSpread$m({}, tmpEndP), {}, {
|
|
8844
8962
|
position: mousePos
|
|
8845
8963
|
})
|
|
8846
8964
|
})
|
|
@@ -8863,8 +8981,8 @@ function DrawLine(drawingId, pluginId) {
|
|
|
8863
8981
|
};
|
|
8864
8982
|
}
|
|
8865
8983
|
|
|
8866
|
-
function ownKeys$
|
|
8867
|
-
function _objectSpread$
|
|
8984
|
+
function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8985
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8868
8986
|
function DrawRectangle(drawingId, pluginId, rectType) {
|
|
8869
8987
|
const {
|
|
8870
8988
|
set
|
|
@@ -8940,7 +9058,7 @@ function DrawRectangle(drawingId, pluginId, rectType) {
|
|
|
8940
9058
|
isSquare: e.shiftKey,
|
|
8941
9059
|
isCentered: rectType === HandlersList.DRAWRECTCENTER
|
|
8942
9060
|
};
|
|
8943
|
-
const newTmpObjects = _objectSpread$
|
|
9061
|
+
const newTmpObjects = _objectSpread$l(_objectSpread$l({}, state.tmpObjects), {}, {
|
|
8944
9062
|
[tmpRect.id]: tmpRect
|
|
8945
9063
|
});
|
|
8946
9064
|
delete newTmpObjects[tmpPointId];
|
|
@@ -8976,7 +9094,7 @@ function DrawRectangle(drawingId, pluginId, rectType) {
|
|
|
8976
9094
|
}).then(() => {
|
|
8977
9095
|
// Remove the old temporary rectangle once a permanent one is created in its place
|
|
8978
9096
|
set(state => {
|
|
8979
|
-
const tmpObjects = _objectSpread$
|
|
9097
|
+
const tmpObjects = _objectSpread$l({}, state.tmpObjects);
|
|
8980
9098
|
delete tmpObjects[curRectId];
|
|
8981
9099
|
return {
|
|
8982
9100
|
tmpObjects
|
|
@@ -8994,7 +9112,7 @@ function DrawRectangle(drawingId, pluginId, rectType) {
|
|
|
8994
9112
|
position: tmpRect_.end.clone()
|
|
8995
9113
|
};
|
|
8996
9114
|
return {
|
|
8997
|
-
tmpObjects: _objectSpread$
|
|
9115
|
+
tmpObjects: _objectSpread$l(_objectSpread$l({}, state.tmpObjects), {}, {
|
|
8998
9116
|
[tmpPoint.id]: tmpPoint
|
|
8999
9117
|
})
|
|
9000
9118
|
};
|
|
@@ -9010,19 +9128,19 @@ function DrawRectangle(drawingId, pluginId, rectType) {
|
|
|
9010
9128
|
let newTmpObjs = null;
|
|
9011
9129
|
if (additionIndex === 0) {
|
|
9012
9130
|
const tmpPoint = state.tmpObjects[tmpPointId];
|
|
9013
|
-
newTmpObjs = _objectSpread$
|
|
9014
|
-
[tmpPointId]: _objectSpread$
|
|
9131
|
+
newTmpObjs = _objectSpread$l(_objectSpread$l({}, state.tmpObjects), {}, {
|
|
9132
|
+
[tmpPointId]: _objectSpread$l(_objectSpread$l({}, tmpPoint), {}, {
|
|
9015
9133
|
position: snappedPos
|
|
9016
9134
|
})
|
|
9017
9135
|
});
|
|
9018
9136
|
} else {
|
|
9019
|
-
newTmpObjs = _objectSpread$
|
|
9020
|
-
[tmpRectId]: _objectSpread$
|
|
9137
|
+
newTmpObjs = _objectSpread$l(_objectSpread$l({}, state.tmpObjects), {}, {
|
|
9138
|
+
[tmpRectId]: _objectSpread$l(_objectSpread$l({}, state.tmpObjects[tmpRectId]), {}, {
|
|
9021
9139
|
end: new THREE.Vector3(snappedPos.x, snappedPos.y, 0)
|
|
9022
9140
|
})
|
|
9023
9141
|
});
|
|
9024
9142
|
}
|
|
9025
|
-
return _objectSpread$
|
|
9143
|
+
return _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
9026
9144
|
tmpObjects: newTmpObjs,
|
|
9027
9145
|
mousePos: snappedPos
|
|
9028
9146
|
});
|
|
@@ -9031,9 +9149,9 @@ function DrawRectangle(drawingId, pluginId, rectType) {
|
|
|
9031
9149
|
};
|
|
9032
9150
|
const keydown = e => {
|
|
9033
9151
|
if (e.code === 'ShiftLeft' || e.code === 'ShiftRight') {
|
|
9034
|
-
set(state => _objectSpread$
|
|
9035
|
-
tmpObjects: _objectSpread$
|
|
9036
|
-
[tmpRectId]: _objectSpread$
|
|
9152
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
9153
|
+
tmpObjects: _objectSpread$l(_objectSpread$l({}, state.tmpObjects), {}, {
|
|
9154
|
+
[tmpRectId]: _objectSpread$l(_objectSpread$l({}, state.tmpObjects[tmpRectId]), {}, {
|
|
9037
9155
|
isSquare: true
|
|
9038
9156
|
})
|
|
9039
9157
|
})
|
|
@@ -9042,9 +9160,9 @@ function DrawRectangle(drawingId, pluginId, rectType) {
|
|
|
9042
9160
|
};
|
|
9043
9161
|
const keyup = e => {
|
|
9044
9162
|
if (e.code === 'ShiftLeft' || e.code === 'ShiftRight') {
|
|
9045
|
-
set(state => _objectSpread$
|
|
9046
|
-
tmpObjects: _objectSpread$
|
|
9047
|
-
[tmpRectId]: _objectSpread$
|
|
9163
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
9164
|
+
tmpObjects: _objectSpread$l(_objectSpread$l({}, state.tmpObjects), {}, {
|
|
9165
|
+
[tmpRectId]: _objectSpread$l(_objectSpread$l({}, state.tmpObjects[tmpRectId]), {}, {
|
|
9048
9166
|
isSquare: false
|
|
9049
9167
|
})
|
|
9050
9168
|
})
|
|
@@ -9226,8 +9344,8 @@ const Circle$1 = ({
|
|
|
9226
9344
|
}), /*#__PURE__*/React__default.createElement("meshBasicMaterial", materialProps));
|
|
9227
9345
|
};
|
|
9228
9346
|
|
|
9229
|
-
function ownKeys$
|
|
9230
|
-
function _objectSpread$
|
|
9347
|
+
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9348
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9231
9349
|
function DrawArc(drawingId, pluginId, arcType) {
|
|
9232
9350
|
// Global hooks:
|
|
9233
9351
|
const {
|
|
@@ -9280,7 +9398,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9280
9398
|
additionIndex = 0;
|
|
9281
9399
|
lastAddedEndPointId = NOCCID;
|
|
9282
9400
|
set(state => {
|
|
9283
|
-
const tmpStartP = _objectSpread$
|
|
9401
|
+
const tmpStartP = _objectSpread$k(_objectSpread$k({}, state.tmpObjects[tmpStartPId]), {}, {
|
|
9284
9402
|
position: lastMousePos.clone()
|
|
9285
9403
|
});
|
|
9286
9404
|
return {
|
|
@@ -9293,20 +9411,20 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9293
9411
|
additionIndex = 1;
|
|
9294
9412
|
set(state => {
|
|
9295
9413
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
9296
|
-
const tmpEndP = _objectSpread$
|
|
9414
|
+
const tmpEndP = _objectSpread$k(_objectSpread$k({}, state.tmpObjects[tmpEndPId]), {}, {
|
|
9297
9415
|
position: lastMousePos.clone()
|
|
9298
9416
|
});
|
|
9299
9417
|
const centerPos = calculateCenterPoint(tmpStartP.position, lastMousePos, lastMousePos);
|
|
9300
|
-
const tmpCenterP = _objectSpread$
|
|
9418
|
+
const tmpCenterP = _objectSpread$k(_objectSpread$k({}, state.tmpObjects[tmpCenterPId]), {}, {
|
|
9301
9419
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
9302
9420
|
});
|
|
9303
|
-
const tmpArc = _objectSpread$
|
|
9421
|
+
const tmpArc = _objectSpread$k(_objectSpread$k({}, state.tmpObjects[tmpArcId]), {}, {
|
|
9304
9422
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
9305
9423
|
drawAsLine: centerPos === undefined,
|
|
9306
9424
|
clockwise: false
|
|
9307
9425
|
});
|
|
9308
9426
|
return {
|
|
9309
|
-
tmpObjects: _objectSpread$
|
|
9427
|
+
tmpObjects: _objectSpread$k(_objectSpread$k({}, state.tmpObjects), {}, {
|
|
9310
9428
|
[tmpEndP.id]: tmpEndP,
|
|
9311
9429
|
[tmpCenterP.id]: tmpCenterP,
|
|
9312
9430
|
[tmpArc.id]: tmpArc
|
|
@@ -9417,7 +9535,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9417
9535
|
clockwise: false
|
|
9418
9536
|
};
|
|
9419
9537
|
return {
|
|
9420
|
-
tmpObjects: _objectSpread$
|
|
9538
|
+
tmpObjects: _objectSpread$k(_objectSpread$k({}, state.tmpObjects), {}, {
|
|
9421
9539
|
[tmpEndP.id]: tmpEndP,
|
|
9422
9540
|
[tmpCenterP.id]: tmpCenterP,
|
|
9423
9541
|
[tmpArc.id]: tmpArc
|
|
@@ -9446,7 +9564,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9446
9564
|
clockwise: false
|
|
9447
9565
|
};
|
|
9448
9566
|
return {
|
|
9449
|
-
tmpObjects: _objectSpread$
|
|
9567
|
+
tmpObjects: _objectSpread$k(_objectSpread$k({}, state.tmpObjects), {}, {
|
|
9450
9568
|
[tmpCenterP.id]: tmpCenterP,
|
|
9451
9569
|
[tmpArc.id]: tmpArc
|
|
9452
9570
|
})
|
|
@@ -9493,7 +9611,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9493
9611
|
var _lastAddedArc$childre;
|
|
9494
9612
|
// Remove the old temporary arc and its points once a permanent one is created in its place
|
|
9495
9613
|
set(state => {
|
|
9496
|
-
const tmpObjects_ = _objectSpread$
|
|
9614
|
+
const tmpObjects_ = _objectSpread$k({}, state.tmpObjects);
|
|
9497
9615
|
delete tmpObjects_[curStartPId];
|
|
9498
9616
|
delete tmpObjects_[curEndPId];
|
|
9499
9617
|
delete tmpObjects_[curCenterPId];
|
|
@@ -9526,20 +9644,20 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9526
9644
|
const tmpCenterP = state.tmpObjects[curCenterPId];
|
|
9527
9645
|
const tmpArcP = state.tmpObjects[curArcId];
|
|
9528
9646
|
return {
|
|
9529
|
-
tmpObjects: _objectSpread$
|
|
9530
|
-
[tmpStartPId]: _objectSpread$
|
|
9647
|
+
tmpObjects: _objectSpread$k(_objectSpread$k({}, state.tmpObjects), {}, {
|
|
9648
|
+
[tmpStartPId]: _objectSpread$k(_objectSpread$k({}, tmpStartP), {}, {
|
|
9531
9649
|
id: tmpStartPId,
|
|
9532
9650
|
position: tmpEndP.position.clone()
|
|
9533
9651
|
}),
|
|
9534
|
-
[tmpEndPId]: _objectSpread$
|
|
9652
|
+
[tmpEndPId]: _objectSpread$k(_objectSpread$k({}, tmpEndP), {}, {
|
|
9535
9653
|
id: tmpEndPId,
|
|
9536
9654
|
position: tmpEndP.position.clone()
|
|
9537
9655
|
}),
|
|
9538
|
-
[tmpCenterPId]: _objectSpread$
|
|
9656
|
+
[tmpCenterPId]: _objectSpread$k(_objectSpread$k({}, tmpCenterP), {}, {
|
|
9539
9657
|
id: tmpCenterPId,
|
|
9540
9658
|
position: tmpEndP.position.clone()
|
|
9541
9659
|
}),
|
|
9542
|
-
[tmpArcId]: _objectSpread$
|
|
9660
|
+
[tmpArcId]: _objectSpread$k(_objectSpread$k({}, tmpArcP), {}, {
|
|
9543
9661
|
id: tmpArcId,
|
|
9544
9662
|
startPId: tmpStartPId,
|
|
9545
9663
|
endPId: tmpEndPId,
|
|
@@ -9561,8 +9679,8 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9561
9679
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
9562
9680
|
return {
|
|
9563
9681
|
mousePos: lastMousePos,
|
|
9564
|
-
tmpObjects: _objectSpread$
|
|
9565
|
-
[tmpStartPId]: _objectSpread$
|
|
9682
|
+
tmpObjects: _objectSpread$k(_objectSpread$k({}, state.tmpObjects), {}, {
|
|
9683
|
+
[tmpStartPId]: _objectSpread$k(_objectSpread$k({}, tmpStartP), {}, {
|
|
9566
9684
|
position: lastMousePos.clone()
|
|
9567
9685
|
})
|
|
9568
9686
|
})
|
|
@@ -9575,14 +9693,14 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9575
9693
|
const centerPos = calculateCenterPoint(tmpStartP.position, lastMousePos, lastMousePos);
|
|
9576
9694
|
return {
|
|
9577
9695
|
mousePos: lastMousePos,
|
|
9578
|
-
tmpObjects: _objectSpread$
|
|
9579
|
-
[tmpEndPId]: _objectSpread$
|
|
9696
|
+
tmpObjects: _objectSpread$k(_objectSpread$k({}, state.tmpObjects), {}, {
|
|
9697
|
+
[tmpEndPId]: _objectSpread$k(_objectSpread$k({}, tmpEndP), {}, {
|
|
9580
9698
|
position: lastMousePos.clone()
|
|
9581
9699
|
}),
|
|
9582
|
-
[tmpCenterPId]: _objectSpread$
|
|
9700
|
+
[tmpCenterPId]: _objectSpread$k(_objectSpread$k({}, tmpCenterP), {}, {
|
|
9583
9701
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
9584
9702
|
}),
|
|
9585
|
-
[tmpArcId]: _objectSpread$
|
|
9703
|
+
[tmpArcId]: _objectSpread$k(_objectSpread$k({}, tmpArc), {}, {
|
|
9586
9704
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
9587
9705
|
drawAsLine: centerPos === undefined,
|
|
9588
9706
|
clockwise: false
|
|
@@ -9597,14 +9715,14 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9597
9715
|
const centerPos = calculateCenterPoint(tmpStartP.position, tmpEndP.position, lastMousePos);
|
|
9598
9716
|
return {
|
|
9599
9717
|
mousePos: lastMousePos,
|
|
9600
|
-
tmpObjects: _objectSpread$
|
|
9601
|
-
[tmpEndPId]: _objectSpread$
|
|
9718
|
+
tmpObjects: _objectSpread$k(_objectSpread$k({}, state.tmpObjects), {}, {
|
|
9719
|
+
[tmpEndPId]: _objectSpread$k(_objectSpread$k({}, tmpEndP), {}, {
|
|
9602
9720
|
position: arcType === HandlersList.DRAWARCTANGENT ? lastMousePos.clone() : tmpEndP.position
|
|
9603
9721
|
}),
|
|
9604
|
-
[tmpCenterPId]: _objectSpread$
|
|
9722
|
+
[tmpCenterPId]: _objectSpread$k(_objectSpread$k({}, tmpCenterP), {}, {
|
|
9605
9723
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
9606
9724
|
}),
|
|
9607
|
-
[tmpArcId]: _objectSpread$
|
|
9725
|
+
[tmpArcId]: _objectSpread$k(_objectSpread$k({}, tmpArc), {}, {
|
|
9608
9726
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
9609
9727
|
drawAsLine: centerPos === undefined,
|
|
9610
9728
|
clockwise: evaluateClockwise(tmpStartP.position, tmpEndP.position, lastMousePos)
|
|
@@ -9630,8 +9748,8 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
9630
9748
|
};
|
|
9631
9749
|
}
|
|
9632
9750
|
|
|
9633
|
-
function ownKeys$
|
|
9634
|
-
function _objectSpread$
|
|
9751
|
+
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9752
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9635
9753
|
function DrawCircle(drawingId, pluginId) {
|
|
9636
9754
|
const {
|
|
9637
9755
|
set
|
|
@@ -9675,7 +9793,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
9675
9793
|
} else {
|
|
9676
9794
|
additionIndex = 0;
|
|
9677
9795
|
set(state => {
|
|
9678
|
-
const tmpCenterP = _objectSpread$
|
|
9796
|
+
const tmpCenterP = _objectSpread$j(_objectSpread$j({}, state.tmpObjects[tmpCenterPId]), {}, {
|
|
9679
9797
|
position: lastMousePos.clone()
|
|
9680
9798
|
});
|
|
9681
9799
|
return {
|
|
@@ -9704,7 +9822,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
9704
9822
|
radius: 0.001
|
|
9705
9823
|
};
|
|
9706
9824
|
return {
|
|
9707
|
-
tmpObjects: _objectSpread$
|
|
9825
|
+
tmpObjects: _objectSpread$j(_objectSpread$j({}, state.tmpObjects), {}, {
|
|
9708
9826
|
[tmpCenterP.id]: tmpCenterP,
|
|
9709
9827
|
[tmpCircle.id]: tmpCircle
|
|
9710
9828
|
})
|
|
@@ -9726,7 +9844,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
9726
9844
|
}).then(() => {
|
|
9727
9845
|
// Remove the old temporary circle and its center point once a permanent one is created in its place
|
|
9728
9846
|
set(state => {
|
|
9729
|
-
const tmpObjects_ = _objectSpread$
|
|
9847
|
+
const tmpObjects_ = _objectSpread$j({}, state.tmpObjects);
|
|
9730
9848
|
delete tmpObjects_[curCenterPId];
|
|
9731
9849
|
delete tmpObjects_[curCircleId];
|
|
9732
9850
|
return {
|
|
@@ -9741,8 +9859,8 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
9741
9859
|
set(state => {
|
|
9742
9860
|
const tmpCenterP = state.tmpObjects[curCenterPId];
|
|
9743
9861
|
return {
|
|
9744
|
-
tmpObjects: _objectSpread$
|
|
9745
|
-
[tmpCenterPId]: _objectSpread$
|
|
9862
|
+
tmpObjects: _objectSpread$j(_objectSpread$j({}, state.tmpObjects), {}, {
|
|
9863
|
+
[tmpCenterPId]: _objectSpread$j(_objectSpread$j({}, tmpCenterP), {}, {
|
|
9746
9864
|
id: tmpCenterPId,
|
|
9747
9865
|
position: e.point.clone().applyMatrix4(getGlobalToLocalMatrix(drawingId, sketchId))
|
|
9748
9866
|
})
|
|
@@ -9762,8 +9880,8 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
9762
9880
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
9763
9881
|
return {
|
|
9764
9882
|
mousePos: lastMousePos,
|
|
9765
|
-
tmpObjects: _objectSpread$
|
|
9766
|
-
[tmpCenterPId]: _objectSpread$
|
|
9883
|
+
tmpObjects: _objectSpread$j(_objectSpread$j({}, state.tmpObjects), {}, {
|
|
9884
|
+
[tmpCenterPId]: _objectSpread$j(_objectSpread$j({}, tmpCenterP), {}, {
|
|
9767
9885
|
position: snappedPos || localPos
|
|
9768
9886
|
})
|
|
9769
9887
|
})
|
|
@@ -9773,8 +9891,8 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
9773
9891
|
const tmpCircle = state.tmpObjects[tmpCircleId];
|
|
9774
9892
|
return {
|
|
9775
9893
|
mousePos: lastMousePos,
|
|
9776
|
-
tmpObjects: _objectSpread$
|
|
9777
|
-
[tmpCircleId]: _objectSpread$
|
|
9894
|
+
tmpObjects: _objectSpread$j(_objectSpread$j({}, state.tmpObjects), {}, {
|
|
9895
|
+
[tmpCircleId]: _objectSpread$j(_objectSpread$j({}, tmpCircle), {}, {
|
|
9778
9896
|
radius: Math.max(tmpCenterP.position.distanceTo(localPos), 0.001)
|
|
9779
9897
|
})
|
|
9780
9898
|
})
|
|
@@ -9900,7 +10018,7 @@ var img$F = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100
|
|
|
9900
10018
|
var img$E = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect x='18.5' y='18.5' width='64' height='64' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3cpath d='M48.6562 36.4062V53.2637C48.6562 56.0645 47.7773 58.2793 46.0195 59.9082C44.2734 61.5371 41.8828 62.3516 38.8477 62.3516C35.8594 62.3516 33.4863 61.5605 31.7285 59.9785C29.9707 58.3965 29.0742 56.2227 29.0391 53.457V36.4062H34.3125V53.2988C34.3125 54.9746 34.7109 56.1992 35.5078 56.9727C36.3164 57.7344 37.4297 58.1152 38.8477 58.1152C41.8125 58.1152 43.3184 56.5566 43.3652 53.4395V36.4062H48.6562ZM66.252 55.2852C66.252 54.2891 65.9004 53.5273 65.1973 53C64.4941 52.4609 63.2285 51.8984 61.4004 51.3125C59.5723 50.7148 58.125 50.1289 57.0586 49.5547C54.1523 47.9844 52.6992 45.8691 52.6992 43.209C52.6992 41.8262 53.0859 40.5957 53.8594 39.5176C54.6445 38.4277 55.7637 37.5781 57.2168 36.9688C58.6816 36.3594 60.3223 36.0547 62.1387 36.0547C63.9668 36.0547 65.5957 36.3887 67.0254 37.0566C68.4551 37.7129 69.5625 38.6445 70.3477 39.8516C71.1445 41.0586 71.543 42.4297 71.543 43.9648H66.2695C66.2695 42.793 65.9004 41.8848 65.1621 41.2402C64.4238 40.584 63.3867 40.2559 62.0508 40.2559C60.7617 40.2559 59.7598 40.5312 59.0449 41.082C58.3301 41.6211 57.9727 42.3359 57.9727 43.2266C57.9727 44.0586 58.3887 44.7559 59.2207 45.3184C60.0645 45.8809 61.3008 46.4082 62.9297 46.9004C65.9297 47.8027 68.1152 48.9219 69.4863 50.2578C70.8574 51.5938 71.543 53.2578 71.543 55.25C71.543 57.4648 70.7051 59.2051 69.0293 60.4707C67.3535 61.7246 65.0977 62.3516 62.2617 62.3516C60.293 62.3516 58.5 61.9941 56.8828 61.2793C55.2656 60.5527 54.0293 59.5625 53.1738 58.3086C52.3301 57.0547 51.9082 55.6016 51.9082 53.9492H57.1992C57.1992 56.7734 58.8867 58.1855 62.2617 58.1855C63.5156 58.1855 64.4941 57.9336 65.1973 57.4297C65.9004 56.9141 66.252 56.1992 66.252 55.2852Z' fill='black'/%3e%3c/svg%3e";
|
|
9901
10019
|
var useReference = img$E;
|
|
9902
10020
|
|
|
9903
|
-
var img$D = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100'
|
|
10021
|
+
var img$D = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black' stroke-linecap='square'%3e %3ccircle cx='50' cy='50' r='25' fill='%239c9c9c' stroke-width='5'/%3e %3ccircle cx='50' cy='50' r='5' stroke-width='6'/%3e %3cpath d='m80.642 75.712a40 40 0 0 1-30.642 14.288 40 40 0 0 1-30.642-14.288' fill='none' stroke-width='5'/%3e %3cpath d='m87.07 68.051-1.8316 11.517-9.1925-7.7135z' stroke-width='4'/%3e %3c/g%3e%3c/svg%3e";
|
|
9904
10022
|
|
|
9905
10023
|
const RootContext = /*#__PURE__*/React__default.createContext({
|
|
9906
10024
|
drawingId: -1,
|
|
@@ -9934,7 +10052,7 @@ const GroupLabel = styled.span`
|
|
|
9934
10052
|
`;
|
|
9935
10053
|
const PostfixSpace = styled.div`
|
|
9936
10054
|
float: left;
|
|
9937
|
-
|
|
10055
|
+
margin-top: 1px;
|
|
9938
10056
|
`;
|
|
9939
10057
|
const CollapseButtonSpace = styled.div`
|
|
9940
10058
|
float: right;
|
|
@@ -9947,7 +10065,8 @@ const CollapseButton$1 = styled.div`
|
|
|
9947
10065
|
border-left: 1px solid rgba(127, 127, 127, 1);
|
|
9948
10066
|
padding: 1px 1px 0px 1px;
|
|
9949
10067
|
`;
|
|
9950
|
-
const
|
|
10068
|
+
const InfoSpace = styled.div`
|
|
10069
|
+
display: flex;
|
|
9951
10070
|
float: right;
|
|
9952
10071
|
padding: 1px 8px 0px 0px;
|
|
9953
10072
|
`;
|
|
@@ -9965,6 +10084,7 @@ const SketchGroup = ({
|
|
|
9965
10084
|
helpUrl = 'https://buerli.io/',
|
|
9966
10085
|
collapse = false,
|
|
9967
10086
|
postfix,
|
|
10087
|
+
info,
|
|
9968
10088
|
children
|
|
9969
10089
|
}) => {
|
|
9970
10090
|
const {
|
|
@@ -9981,7 +10101,7 @@ const SketchGroup = ({
|
|
|
9981
10101
|
const onQuestionIconClick = React__default.useCallback(() => window.open(helpUrl, '_blank'), [helpUrl]);
|
|
9982
10102
|
return /*#__PURE__*/React__default.createElement(GroupWrapper, null, /*#__PURE__*/React__default.createElement(HeaderSpace, null, /*#__PURE__*/React__default.createElement(GroupLabel, null, caption), postfix && /*#__PURE__*/React__default.createElement(PostfixSpace, null, postfix), /*#__PURE__*/React__default.createElement(CollapseButtonSpace, null, collapse && /*#__PURE__*/React__default.createElement(CollapseButton$1, {
|
|
9983
10103
|
onClick: onCollapseClick
|
|
9984
|
-
}, isDisplayed && /*#__PURE__*/React__default.createElement(DownOutlined, null), !isDisplayed && /*#__PURE__*/React__default.createElement(RightOutlined, null))), /*#__PURE__*/React__default.createElement(
|
|
10104
|
+
}, isDisplayed && /*#__PURE__*/React__default.createElement(DownOutlined, null), !isDisplayed && /*#__PURE__*/React__default.createElement(RightOutlined, null))), /*#__PURE__*/React__default.createElement(InfoSpace, null, info, /*#__PURE__*/React__default.createElement(QuestionIcon$1, {
|
|
9985
10105
|
onClick: onQuestionIconClick
|
|
9986
10106
|
}))), isDisplayed && /*#__PURE__*/React__default.createElement(ContentSpace, null, children));
|
|
9987
10107
|
};
|
|
@@ -10975,9 +11095,6 @@ const EyeIcon$1 = () => {
|
|
|
10975
11095
|
return /*#__PURE__*/React__default.createElement(PluginTooltip, {
|
|
10976
11096
|
title: `Constraints visibility: ${alwaysShowConstr ? 'Always show' : 'Show on hover'}`
|
|
10977
11097
|
}, /*#__PURE__*/React__default.createElement(Component, {
|
|
10978
|
-
style: {
|
|
10979
|
-
marginTop: '1px'
|
|
10980
|
-
},
|
|
10981
11098
|
onClick: onClick
|
|
10982
11099
|
}));
|
|
10983
11100
|
};
|
|
@@ -10999,7 +11116,6 @@ const CoincidenceIcon = () => {
|
|
|
10999
11116
|
style: {
|
|
11000
11117
|
width: '14px',
|
|
11001
11118
|
height: '14px',
|
|
11002
|
-
marginTop: '1px',
|
|
11003
11119
|
marginLeft: '2px',
|
|
11004
11120
|
cursor: 'pointer',
|
|
11005
11121
|
opacity: showCoincidence ? 1.0 : 0.5
|
|
@@ -11008,6 +11124,29 @@ const CoincidenceIcon = () => {
|
|
|
11008
11124
|
onClick: onClick
|
|
11009
11125
|
}));
|
|
11010
11126
|
};
|
|
11127
|
+
const SolverState$1 = () => {
|
|
11128
|
+
var _solverStateMemb$memb;
|
|
11129
|
+
const {
|
|
11130
|
+
drawingId,
|
|
11131
|
+
pluginId
|
|
11132
|
+
} = React__default.useContext(RootContext);
|
|
11133
|
+
const sketchId = usePlugin(drawingId, pluginId, p => p.id);
|
|
11134
|
+
const solverStateMemb = useDrawing(drawingId, d => {
|
|
11135
|
+
var _d$structure$tree$ske, _d$structure$tree$ske2;
|
|
11136
|
+
return (_d$structure$tree$ske = d.structure.tree[sketchId]) == null ? void 0 : (_d$structure$tree$ske2 = _d$structure$tree$ske.members) == null ? void 0 : _d$structure$tree$ske2.solverState;
|
|
11137
|
+
});
|
|
11138
|
+
const solverState = solverStateMemb == null ? void 0 : (_solverStateMemb$memb = solverStateMemb.members[2]) == null ? void 0 : _solverStateMemb$memb.value;
|
|
11139
|
+
const isSolved = Boolean(solverState && solverState & 1);
|
|
11140
|
+
const Component = isSolved ? CheckCircleTwoTone : CloseCircleTwoTone;
|
|
11141
|
+
return solverState === undefined ? null : /*#__PURE__*/React__default.createElement(PluginTooltip, {
|
|
11142
|
+
title: isSolved ? 'Solved' : 'Not Solved'
|
|
11143
|
+
}, /*#__PURE__*/React__default.createElement(Component, {
|
|
11144
|
+
style: {
|
|
11145
|
+
marginRight: '2px'
|
|
11146
|
+
},
|
|
11147
|
+
twoToneColor: isSolved ? '#52c41a' : '#eb2f96'
|
|
11148
|
+
}));
|
|
11149
|
+
};
|
|
11011
11150
|
const ConstrBtn = ({
|
|
11012
11151
|
constrClass,
|
|
11013
11152
|
disabled
|
|
@@ -11114,9 +11253,15 @@ const Constraints$2 = () => {
|
|
|
11114
11253
|
display: 'flex'
|
|
11115
11254
|
}
|
|
11116
11255
|
}, /*#__PURE__*/React__default.createElement(EyeIcon$1, null), /*#__PURE__*/React__default.createElement(CoincidenceIcon, null));
|
|
11256
|
+
const solverInfo = /*#__PURE__*/React__default.createElement("div", {
|
|
11257
|
+
style: {
|
|
11258
|
+
display: 'flex'
|
|
11259
|
+
}
|
|
11260
|
+
}, /*#__PURE__*/React__default.createElement(SolverState$1, null));
|
|
11117
11261
|
return /*#__PURE__*/React__default.createElement(SketchGroup, {
|
|
11118
11262
|
caption: "Constraints",
|
|
11119
|
-
postfix: postfix
|
|
11263
|
+
postfix: postfix,
|
|
11264
|
+
info: solverInfo
|
|
11120
11265
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11121
11266
|
ref: ref
|
|
11122
11267
|
}, /*#__PURE__*/React__default.createElement(ConstrButtonGroup, {
|
|
@@ -11354,8 +11499,8 @@ function recognizeFilletByArc(object, tree, sketchId) {
|
|
|
11354
11499
|
};
|
|
11355
11500
|
}
|
|
11356
11501
|
|
|
11357
|
-
function ownKeys$
|
|
11358
|
-
function _objectSpread$
|
|
11502
|
+
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11503
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11359
11504
|
function Fillet(drawingId, pluginId) {
|
|
11360
11505
|
const plugin = getPlugin(drawingId, pluginId);
|
|
11361
11506
|
const set = plugin.set;
|
|
@@ -11487,7 +11632,7 @@ function Fillet(drawingId, pluginId) {
|
|
|
11487
11632
|
if (!data) {
|
|
11488
11633
|
return;
|
|
11489
11634
|
}
|
|
11490
|
-
ccAPI.sketcher.createFillet(drawingId, sketchId, data.info.lines.map(line => line.id), data.info.lineStarts.map(lineStart => lineStart.id), data.info.incidence, data.info.control, data.params.start, getArcAngles(_objectSpread$
|
|
11635
|
+
ccAPI.sketcher.createFillet(drawingId, sketchId, data.info.lines.map(line => line.id), data.info.lineStarts.map(lineStart => lineStart.id), data.info.incidence, data.info.control, data.params.start, getArcAngles(_objectSpread$i(_objectSpread$i({}, data.params), {}, {
|
|
11491
11636
|
radius: 1
|
|
11492
11637
|
})).mid, data.params.end).catch(console.warn);
|
|
11493
11638
|
set({
|
|
@@ -11591,8 +11736,8 @@ function Trim(drawingId, pluginId) {
|
|
|
11591
11736
|
};
|
|
11592
11737
|
}
|
|
11593
11738
|
|
|
11594
|
-
function ownKeys$
|
|
11595
|
-
function _objectSpread$
|
|
11739
|
+
function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11740
|
+
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11596
11741
|
const tolerance$5 = 1e-6;
|
|
11597
11742
|
const tMinClosed = 1e-3;
|
|
11598
11743
|
const tMaxClosed = 1 - 1e-3;
|
|
@@ -11762,7 +11907,7 @@ function intersectCircleCircle(circle1, circle2) {
|
|
|
11762
11907
|
const c = w * w - dy * dy;
|
|
11763
11908
|
let res = solveQuadratic(a, b, c).filter(u => u >= -1 && u <= 1).map(u => Math.acos(u) / (2 * Math.PI));
|
|
11764
11909
|
res = [...res, ...res.map(u => -u)];
|
|
11765
|
-
const points = res.map(t => getParameterizedPosition(t, _objectSpread$
|
|
11910
|
+
const points = res.map(t => getParameterizedPosition(t, _objectSpread$h(_objectSpread$h({}, circle1), {}, {
|
|
11766
11911
|
class: CCClasses.CCCircle
|
|
11767
11912
|
}))).filter(point => Math.abs(point.distanceTo(circle1.center) - circle1.radius) < tolerance$5 && Math.abs(point.distanceTo(circle2.center) - circle2.radius) < tolerance$5);
|
|
11768
11913
|
const circle1Intersections = points.map(point => getNormalizedPosition(point, circle1));
|
|
@@ -12133,8 +12278,8 @@ function UseRef(drawingId, pluginId) {
|
|
|
12133
12278
|
};
|
|
12134
12279
|
}
|
|
12135
12280
|
|
|
12136
|
-
function ownKeys$
|
|
12137
|
-
function _objectSpread$
|
|
12281
|
+
function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12282
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12138
12283
|
function SSelect(drawingId, pluginId) {
|
|
12139
12284
|
const hoverHandler = Hover(drawingId, pluginId);
|
|
12140
12285
|
const filter = object => true;
|
|
@@ -12185,10 +12330,10 @@ function SSelect(drawingId, pluginId) {
|
|
|
12185
12330
|
name: HandlersList.SSELECT,
|
|
12186
12331
|
filter,
|
|
12187
12332
|
onDeactivate,
|
|
12188
|
-
pointerHandlers: _objectSpread$
|
|
12333
|
+
pointerHandlers: _objectSpread$g({
|
|
12189
12334
|
onClick
|
|
12190
12335
|
}, hoverHandler.pointerHandlers),
|
|
12191
|
-
keyHandlers: _objectSpread$
|
|
12336
|
+
keyHandlers: _objectSpread$g({}, hoverHandler.keyHandlers)
|
|
12192
12337
|
};
|
|
12193
12338
|
}
|
|
12194
12339
|
|
|
@@ -12251,6 +12396,7 @@ const useGeomParams = objId => {
|
|
|
12251
12396
|
const isSelected = gSelected || sSelected;
|
|
12252
12397
|
const isHovered = gHovered || sHovered;
|
|
12253
12398
|
const isHighlighted = useSketchState(drawingId, pluginId, state => state.highlighted.indexOf(objId) !== -1);
|
|
12399
|
+
const isConstrOverdefined = useSketchState(drawingId, pluginId, state => state.overdefined[objId] !== undefined);
|
|
12254
12400
|
const {
|
|
12255
12401
|
renderOrder,
|
|
12256
12402
|
offsetUnits
|
|
@@ -12269,7 +12415,8 @@ const useGeomParams = objId => {
|
|
|
12269
12415
|
polygonOffsetUnits: offsetUnits,
|
|
12270
12416
|
isHovered,
|
|
12271
12417
|
isSelected,
|
|
12272
|
-
isHighlighted
|
|
12418
|
+
isHighlighted,
|
|
12419
|
+
isConstrOverdefined
|
|
12273
12420
|
};
|
|
12274
12421
|
};
|
|
12275
12422
|
function isUnknown(lgsState) {
|
|
@@ -12294,11 +12441,13 @@ const getPointColor = objState => {
|
|
|
12294
12441
|
isSelected,
|
|
12295
12442
|
isGHovered,
|
|
12296
12443
|
isHighlighted,
|
|
12444
|
+
isConstrOverdefined,
|
|
12297
12445
|
lgsState
|
|
12298
12446
|
} = objState;
|
|
12299
12447
|
if (!isSketchActive) return 0x006666;
|
|
12300
12448
|
if (isSelected) return 0xffa500;
|
|
12301
12449
|
if (isGHovered || isHighlighted) return 0x00ff00;
|
|
12450
|
+
if (isConstrOverdefined) return 0x990000;
|
|
12302
12451
|
if (isWelldefined(lgsState)) return 0x000000;
|
|
12303
12452
|
if (isOverdefined(lgsState)) return 0x990000;
|
|
12304
12453
|
return 0x0066ff;
|
|
@@ -12309,11 +12458,13 @@ const getLineColor = objState => {
|
|
|
12309
12458
|
isSelected,
|
|
12310
12459
|
isGHovered,
|
|
12311
12460
|
isHighlighted,
|
|
12461
|
+
isConstrOverdefined,
|
|
12312
12462
|
lgsState
|
|
12313
12463
|
} = objState;
|
|
12314
12464
|
if (isSelected) return 0xffa500;
|
|
12315
12465
|
if (isGHovered || isHighlighted) return 0x00ff00;
|
|
12316
12466
|
if (!isSketchActive) return 0x009999;
|
|
12467
|
+
if (isConstrOverdefined) return 0x990000;
|
|
12317
12468
|
if (isWelldefined(lgsState)) return 0x000000;
|
|
12318
12469
|
if (isOverdefined(lgsState)) return 0x990000;
|
|
12319
12470
|
return 0x0066ff;
|
|
@@ -12324,11 +12475,13 @@ const getArcColor = objState => {
|
|
|
12324
12475
|
isSelected,
|
|
12325
12476
|
isGHovered,
|
|
12326
12477
|
isHighlighted,
|
|
12478
|
+
isConstrOverdefined,
|
|
12327
12479
|
lgsState
|
|
12328
12480
|
} = objState;
|
|
12329
12481
|
if (isSelected) return 0xffa500;
|
|
12330
12482
|
if (isGHovered || isHighlighted) return 0x00ff00;
|
|
12331
12483
|
if (!isSketchActive) return 0x009999;
|
|
12484
|
+
if (isConstrOverdefined) return 0x990000;
|
|
12332
12485
|
if (isWelldefined(lgsState)) return 0x000000;
|
|
12333
12486
|
if (isOverdefined(lgsState)) return 0x990000;
|
|
12334
12487
|
return 0x0066ff;
|
|
@@ -12341,9 +12494,8 @@ const getConstrColor = objState => {
|
|
|
12341
12494
|
lgsState
|
|
12342
12495
|
} = objState;
|
|
12343
12496
|
if (isSelected) return 0xffff00;
|
|
12344
|
-
if (isUnknown(lgsState)) return 0x66ff66;
|
|
12345
12497
|
if (isOverdefined(lgsState) && isSatisfied(lgsState)) return 0xff6600;
|
|
12346
|
-
if (isOverdefined(lgsState)) return 0x990000;
|
|
12498
|
+
if (isUnknown(lgsState) || isOverdefined(lgsState)) return 0x990000;
|
|
12347
12499
|
if (isGHovered) return 0x28d79f;
|
|
12348
12500
|
if (isHighlighted) return 0xbbecdd;
|
|
12349
12501
|
return 0xdddddd;
|
|
@@ -12431,6 +12583,7 @@ const useColor = objId => {
|
|
|
12431
12583
|
const sSelected = useIsSSelected(drawingId, objId);
|
|
12432
12584
|
const isSelected = gSelected || sSelected;
|
|
12433
12585
|
const isHighlighted = useSketchState(drawingId, pluginId, state => state.highlighted.indexOf(objId) !== -1);
|
|
12586
|
+
const isConstrOverdefined = useSketchState(drawingId, pluginId, state => state.overdefined[objId] !== undefined);
|
|
12434
12587
|
const lgsState = useDrawing(drawingId, d => {
|
|
12435
12588
|
var _d$structure$tree$obj, _d$structure$tree$obj2, _d$structure$tree$obj3;
|
|
12436
12589
|
return ((_d$structure$tree$obj = d.structure.tree[objId]) == null ? void 0 : (_d$structure$tree$obj2 = _d$structure$tree$obj.members) == null ? void 0 : (_d$structure$tree$obj3 = _d$structure$tree$obj2.lgsState) == null ? void 0 : _d$structure$tree$obj3.value) || 0;
|
|
@@ -12443,9 +12596,10 @@ const useColor = objId => {
|
|
|
12443
12596
|
isGHovered: gHovered,
|
|
12444
12597
|
isSHovered: sHovered,
|
|
12445
12598
|
isSelected,
|
|
12599
|
+
isConstrOverdefined,
|
|
12446
12600
|
lgsState
|
|
12447
12601
|
});
|
|
12448
|
-
}, [drawingId, objId, gHovered, sHovered, isActive, isHighlighted, isSelected, lgsState]);
|
|
12602
|
+
}, [drawingId, objId, gHovered, sHovered, isActive, isHighlighted, isSelected, isConstrOverdefined, lgsState]);
|
|
12449
12603
|
return color;
|
|
12450
12604
|
};
|
|
12451
12605
|
const useUserData = objId => {
|
|
@@ -13163,8 +13317,8 @@ const Regions$1 = ({
|
|
|
13163
13317
|
});
|
|
13164
13318
|
};
|
|
13165
13319
|
|
|
13166
|
-
function ownKeys$
|
|
13167
|
-
function _objectSpread$
|
|
13320
|
+
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13321
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13168
13322
|
|
|
13169
13323
|
/*
|
|
13170
13324
|
* !polygonOffset!
|
|
@@ -13206,13 +13360,14 @@ const CCLine = props => {
|
|
|
13206
13360
|
polygonOffsetUnits,
|
|
13207
13361
|
isHovered,
|
|
13208
13362
|
isSelected,
|
|
13209
|
-
isHighlighted
|
|
13363
|
+
isHighlighted,
|
|
13364
|
+
isConstrOverdefined
|
|
13210
13365
|
} = useGeomParams(objId);
|
|
13211
13366
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Line, {
|
|
13212
13367
|
start: start,
|
|
13213
13368
|
end: end,
|
|
13214
|
-
scalePlus: isHovered || isSelected || isHighlighted,
|
|
13215
|
-
meshProps: _objectSpread$
|
|
13369
|
+
scalePlus: isHovered || isSelected || isHighlighted || isConstrOverdefined,
|
|
13370
|
+
meshProps: _objectSpread$f(_objectSpread$f({
|
|
13216
13371
|
renderOrder
|
|
13217
13372
|
}, handlers), {}, {
|
|
13218
13373
|
userData
|
|
@@ -13249,7 +13404,8 @@ const CCPoint = props => {
|
|
|
13249
13404
|
polygonOffsetUnits,
|
|
13250
13405
|
isHovered,
|
|
13251
13406
|
isSelected,
|
|
13252
|
-
isHighlighted
|
|
13407
|
+
isHighlighted,
|
|
13408
|
+
isConstrOverdefined
|
|
13253
13409
|
} = useGeomParams(objId);
|
|
13254
13410
|
const position = convertToVector((_point$members = point.members) == null ? void 0 : _point$members.pos);
|
|
13255
13411
|
React__default.useEffect(() => {
|
|
@@ -13261,8 +13417,8 @@ const CCPoint = props => {
|
|
|
13261
13417
|
// It's not possible to change polygonOffset in drei/Merged component,
|
|
13262
13418
|
// so we have to increase size of hovered or selected point to make the point not occluded buy other ones
|
|
13263
13419
|
,
|
|
13264
|
-
scalePlus: isHovered || isSelected || isHighlighted,
|
|
13265
|
-
meshProps: _objectSpread$
|
|
13420
|
+
scalePlus: isHovered || isSelected || isHighlighted || isConstrOverdefined,
|
|
13421
|
+
meshProps: _objectSpread$f(_objectSpread$f({
|
|
13266
13422
|
renderOrder
|
|
13267
13423
|
}, handlers), {}, {
|
|
13268
13424
|
userData
|
|
@@ -13309,15 +13465,16 @@ const CCArc = props => {
|
|
|
13309
13465
|
polygonOffsetUnits,
|
|
13310
13466
|
isHovered,
|
|
13311
13467
|
isSelected,
|
|
13312
|
-
isHighlighted
|
|
13468
|
+
isHighlighted,
|
|
13469
|
+
isConstrOverdefined
|
|
13313
13470
|
} = useGeomParams(objId);
|
|
13314
13471
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Arc, {
|
|
13315
13472
|
start: startPoint,
|
|
13316
13473
|
end: endPoint,
|
|
13317
13474
|
center: centerPoint,
|
|
13318
13475
|
clockwise: clockwise,
|
|
13319
|
-
scalePlus: isHovered || isSelected || isHighlighted,
|
|
13320
|
-
meshProps: _objectSpread$
|
|
13476
|
+
scalePlus: isHovered || isSelected || isHighlighted || isConstrOverdefined,
|
|
13477
|
+
meshProps: _objectSpread$f({
|
|
13321
13478
|
renderOrder,
|
|
13322
13479
|
userData
|
|
13323
13480
|
}, handlers),
|
|
@@ -13354,13 +13511,14 @@ const CCCircle = props => {
|
|
|
13354
13511
|
polygonOffsetUnits,
|
|
13355
13512
|
isHovered,
|
|
13356
13513
|
isSelected,
|
|
13357
|
-
isHighlighted
|
|
13514
|
+
isHighlighted,
|
|
13515
|
+
isConstrOverdefined
|
|
13358
13516
|
} = useGeomParams(objId);
|
|
13359
13517
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Circle, {
|
|
13360
13518
|
center: center,
|
|
13361
13519
|
radius: radius,
|
|
13362
|
-
scalePlus: isHovered || isSelected || isHighlighted,
|
|
13363
|
-
meshProps: _objectSpread$
|
|
13520
|
+
scalePlus: isHovered || isSelected || isHighlighted || isConstrOverdefined,
|
|
13521
|
+
meshProps: _objectSpread$f({
|
|
13364
13522
|
renderOrder,
|
|
13365
13523
|
userData
|
|
13366
13524
|
}, handlers),
|
|
@@ -13872,17 +14030,17 @@ const MousePosition = () => {
|
|
|
13872
14030
|
}, `${mousePos.x.toFixed(2)}, ${mousePos.y.toFixed(2)}`)) : null;
|
|
13873
14031
|
};
|
|
13874
14032
|
|
|
13875
|
-
function ownKeys$
|
|
13876
|
-
function _objectSpread$
|
|
14033
|
+
function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14034
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13877
14035
|
const useGeometryOverridesStore = create((set, get) => ({
|
|
13878
14036
|
overrides: {},
|
|
13879
14037
|
addOverride: (name, override) => set(state => ({
|
|
13880
|
-
overrides: _objectSpread$
|
|
14038
|
+
overrides: _objectSpread$e(_objectSpread$e({}, state.overrides), {}, {
|
|
13881
14039
|
[name]: override
|
|
13882
14040
|
})
|
|
13883
14041
|
})),
|
|
13884
14042
|
removeOverride: name => set(state => {
|
|
13885
|
-
const overrides_ = _objectSpread$
|
|
14043
|
+
const overrides_ = _objectSpread$e({}, state.overrides);
|
|
13886
14044
|
delete overrides_[name];
|
|
13887
14045
|
return {
|
|
13888
14046
|
overrides: overrides_
|
|
@@ -13949,23 +14107,42 @@ const useOperationSequence = (drawingId, partId) => {
|
|
|
13949
14107
|
}, [children, drawingId]);
|
|
13950
14108
|
};
|
|
13951
14109
|
|
|
13952
|
-
const
|
|
14110
|
+
const getFeatureIds = (drawingId, opSeqId) => {
|
|
13953
14111
|
var _tree$opSeqId;
|
|
13954
|
-
const pluginAPI = getDrawing(drawingId).api.plugin;
|
|
13955
|
-
if (isActive) pluginAPI.setActiveFeature(null);
|
|
13956
14112
|
const tree = getDrawing(drawingId).structure.tree;
|
|
13957
14113
|
const featureRefIds = ((_tree$opSeqId = tree[opSeqId]) == null ? void 0 : _tree$opSeqId.children) || [];
|
|
13958
|
-
|
|
14114
|
+
return featureRefIds.map(refId => {
|
|
13959
14115
|
var _tree$refId, _tree$refId$members;
|
|
13960
14116
|
return (_tree$refId = tree[refId]) == null ? void 0 : (_tree$refId$members = _tree$refId.members) == null ? void 0 : _tree$refId$members.refObj.value;
|
|
13961
|
-
});
|
|
13962
|
-
|
|
14117
|
+
}).slice(7); // Ignore first 7 features since they are base WorkGeometry
|
|
14118
|
+
};
|
|
14119
|
+
|
|
14120
|
+
const getHLConstraintIds = drawingId => {
|
|
14121
|
+
var _tree$curProdId, _tree$constrSetId;
|
|
14122
|
+
const drawing = getDrawing(drawingId);
|
|
14123
|
+
const tree = drawing.structure.tree;
|
|
14124
|
+
const curProdId = drawing.structure.currentProduct;
|
|
14125
|
+
const prodChildren = ((_tree$curProdId = tree[curProdId]) == null ? void 0 : _tree$curProdId.children) || [];
|
|
14126
|
+
const constrSetId = prodChildren.find(childId => ccUtils.base.isA(tree[childId].class, CCClasses.CCConstraintSet)) || NOCCID;
|
|
14127
|
+
return ((_tree$constrSetId = tree[constrSetId]) == null ? void 0 : _tree$constrSetId.children) || [];
|
|
14128
|
+
};
|
|
14129
|
+
const deleteFeature = (drawingId, featureId, opSeqId) => {
|
|
14130
|
+
var _drawing$structure$tr;
|
|
14131
|
+
const drawing = getDrawing(drawingId);
|
|
14132
|
+
const curProdId = drawing.structure.currentProduct;
|
|
14133
|
+
const isPart = ccUtils.base.isA(((_drawing$structure$tr = drawing.structure.tree[curProdId]) == null ? void 0 : _drawing$structure$tr.class) || '', CCClasses.CCPart);
|
|
14134
|
+
const featureIds = isPart ? getFeatureIds(drawingId, opSeqId) : getHLConstraintIds(drawingId);
|
|
14135
|
+
if (featureIds.indexOf(drawing.plugin.active.feature) !== -1) {
|
|
14136
|
+
const pluginAPI = drawing.api.plugin;
|
|
14137
|
+
pluginAPI.setActiveFeature(null);
|
|
14138
|
+
}
|
|
14139
|
+
const selectedInfo = drawing.interaction.selected || [];
|
|
13963
14140
|
const selectedFeatures = selectedInfo.map(info => info.objectId).filter(id => featureIds.indexOf(id) !== -1);
|
|
13964
14141
|
const ids = selectedFeatures.indexOf(featureId) === -1 ? [...selectedFeatures, featureId] : selectedFeatures;
|
|
13965
14142
|
const idsSorted = ids.sort((a, b) => b - a);
|
|
13966
14143
|
ccAPI.baseModeler.deleteObjects(drawingId, idsSorted).catch(console.warn);
|
|
13967
14144
|
};
|
|
13968
|
-
function useContextMenuItems$4(drawingId,
|
|
14145
|
+
function useContextMenuItems$4(drawingId, setEditName) {
|
|
13969
14146
|
const curPartId = useDrawing(drawingId, d => d.structure.currentProduct || d.structure.root);
|
|
13970
14147
|
const opSeqId = useOperationSequence(drawingId, curPartId) || NOCCID;
|
|
13971
14148
|
return React__default.useMemo(() => {
|
|
@@ -13981,10 +14158,10 @@ function useContextMenuItems$4(drawingId, isActive, setEditName) {
|
|
|
13981
14158
|
icon: /*#__PURE__*/React__default.createElement(DeleteOutlined, null),
|
|
13982
14159
|
key: 'deleteFeature',
|
|
13983
14160
|
onClick: menuInfo => {
|
|
13984
|
-
deleteFeature(drawingId, menuInfo.interactionInfo.objectId, opSeqId
|
|
14161
|
+
deleteFeature(drawingId, menuInfo.interactionInfo.objectId, opSeqId);
|
|
13985
14162
|
}
|
|
13986
14163
|
}];
|
|
13987
|
-
}, [drawingId, opSeqId,
|
|
14164
|
+
}, [drawingId, opSeqId, setEditName]);
|
|
13988
14165
|
}
|
|
13989
14166
|
|
|
13990
14167
|
const useCurrentInstance = drawingId => {
|
|
@@ -14322,6 +14499,101 @@ const GeometryOverridesManager = ({
|
|
|
14322
14499
|
return null;
|
|
14323
14500
|
};
|
|
14324
14501
|
|
|
14502
|
+
function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14503
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14504
|
+
const ConstraintManager = ({
|
|
14505
|
+
drawingId,
|
|
14506
|
+
pluginId,
|
|
14507
|
+
constraintId
|
|
14508
|
+
}) => {
|
|
14509
|
+
var _constraint$members, _ref, _constraint$members2, _constraint$members2$;
|
|
14510
|
+
const constraint = useDrawing(drawingId, d => d.structure.tree[constraintId]);
|
|
14511
|
+
const entitiesMem = constraint == null ? void 0 : (_constraint$members = constraint.members) == null ? void 0 : _constraint$members.entities;
|
|
14512
|
+
const lgsState = (_ref = constraint == null ? void 0 : (_constraint$members2 = constraint.members) == null ? void 0 : (_constraint$members2$ = _constraint$members2.lgsState) == null ? void 0 : _constraint$members2$.value) != null ? _ref : 1;
|
|
14513
|
+
const isUnsatisfied = !(lgsState & 1);
|
|
14514
|
+
const entities = React__default.useMemo(() => (entitiesMem == null ? void 0 : entitiesMem.members.map(memb => memb.value)) || [], [entitiesMem]);
|
|
14515
|
+
const addOverdefined = React__default.useCallback(entities_ => {
|
|
14516
|
+
const {
|
|
14517
|
+
set
|
|
14518
|
+
} = getPlugin(drawingId, pluginId);
|
|
14519
|
+
const {
|
|
14520
|
+
overdefined
|
|
14521
|
+
} = getSketchState(drawingId, pluginId);
|
|
14522
|
+
const overdefinedNew = _objectSpread$d({}, overdefined);
|
|
14523
|
+
entities_.forEach(id => {
|
|
14524
|
+
var _overdefined$id;
|
|
14525
|
+
const entityConstrArr = ((_overdefined$id = overdefined[id]) == null ? void 0 : _overdefined$id.filter(cId => cId !== constraintId)) || [];
|
|
14526
|
+
entityConstrArr.push(constraintId);
|
|
14527
|
+
overdefinedNew[id] = entityConstrArr;
|
|
14528
|
+
});
|
|
14529
|
+
set({
|
|
14530
|
+
overdefined: overdefinedNew
|
|
14531
|
+
});
|
|
14532
|
+
}, [drawingId, pluginId, constraintId]);
|
|
14533
|
+
const removeOverdefined = React__default.useCallback(entities_ => {
|
|
14534
|
+
const {
|
|
14535
|
+
set
|
|
14536
|
+
} = getPlugin(drawingId, pluginId);
|
|
14537
|
+
const {
|
|
14538
|
+
overdefined
|
|
14539
|
+
} = getSketchState(drawingId, pluginId);
|
|
14540
|
+
const overdefinedNew = _objectSpread$d({}, overdefined);
|
|
14541
|
+
entities_.forEach(id => {
|
|
14542
|
+
if (!overdefined[id]) {
|
|
14543
|
+
return;
|
|
14544
|
+
}
|
|
14545
|
+
const entityConstrArr = overdefined[id].filter(cId => cId !== constraintId);
|
|
14546
|
+
if (entityConstrArr.length === 0) {
|
|
14547
|
+
delete overdefinedNew[id];
|
|
14548
|
+
return;
|
|
14549
|
+
}
|
|
14550
|
+
overdefinedNew[id] = entityConstrArr;
|
|
14551
|
+
});
|
|
14552
|
+
set({
|
|
14553
|
+
overdefined: overdefinedNew
|
|
14554
|
+
});
|
|
14555
|
+
}, [drawingId, pluginId, constraintId]);
|
|
14556
|
+
React__default.useEffect(() => {
|
|
14557
|
+
const {
|
|
14558
|
+
overdefined
|
|
14559
|
+
} = getSketchState(drawingId, pluginId);
|
|
14560
|
+
if (isUnsatisfied && entities.some(id => !overdefined[id] || overdefined[id].indexOf(constraintId) === -1)) {
|
|
14561
|
+
// Only update if some of constraint's entities aren't linked with the current unsatisfied constraint
|
|
14562
|
+
addOverdefined(entities);
|
|
14563
|
+
} else if (!isUnsatisfied && entities.some(id => overdefined[id] && overdefined[id].indexOf(constraintId) !== -1)) {
|
|
14564
|
+
// Only update if some of constraint's entities are linked with the current satisfied constraint
|
|
14565
|
+
removeOverdefined(entities);
|
|
14566
|
+
}
|
|
14567
|
+
}, [drawingId, pluginId, constraintId, entities, isUnsatisfied, addOverdefined, removeOverdefined]);
|
|
14568
|
+
|
|
14569
|
+
// Should only be executed on dismount
|
|
14570
|
+
React__default.useEffect(() => {
|
|
14571
|
+
return () => removeOverdefined(entities);
|
|
14572
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14573
|
+
}, []);
|
|
14574
|
+
return null;
|
|
14575
|
+
};
|
|
14576
|
+
const OverdefinedStateManager = ({
|
|
14577
|
+
drawingId,
|
|
14578
|
+
pluginId
|
|
14579
|
+
}) => {
|
|
14580
|
+
const sketchId = usePlugin(drawingId, pluginId, p => p.objectId);
|
|
14581
|
+
const sketchChildren = useDrawingArr(drawingId, drawing => {
|
|
14582
|
+
var _drawing$structure$tr;
|
|
14583
|
+
return (_drawing$structure$tr = drawing.structure.tree[sketchId]) == null ? void 0 : _drawing$structure$tr.children;
|
|
14584
|
+
});
|
|
14585
|
+
const constraintIds = React__default.useMemo(() => {
|
|
14586
|
+
const tree = getDrawing(drawingId).structure.tree;
|
|
14587
|
+
return sketchChildren == null ? void 0 : sketchChildren.filter(id => is2DConstraint(tree[id]));
|
|
14588
|
+
}, [drawingId, sketchChildren]);
|
|
14589
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, constraintIds.map(id => /*#__PURE__*/React__default.createElement(ConstraintManager, {
|
|
14590
|
+
key: id,
|
|
14591
|
+
drawingId: drawingId,
|
|
14592
|
+
pluginId: pluginId,
|
|
14593
|
+
constraintId: id
|
|
14594
|
+
})));
|
|
14595
|
+
};
|
|
14596
|
+
|
|
14325
14597
|
function useSetScale(drawingId, pluginId) {
|
|
14326
14598
|
useFrame(args => {
|
|
14327
14599
|
const plugin = getPlugin(drawingId, pluginId);
|
|
@@ -14550,6 +14822,7 @@ function useStateReset(drawingId, pluginId) {
|
|
|
14550
14822
|
lastHoveredPos: {},
|
|
14551
14823
|
constraintsToGeometry: {}
|
|
14552
14824
|
},
|
|
14825
|
+
overdefined: {},
|
|
14553
14826
|
isDragged: false,
|
|
14554
14827
|
mousePos: undefined,
|
|
14555
14828
|
drawnObjectsRef: undefined,
|
|
@@ -14588,7 +14861,10 @@ const DrawingMode = ({
|
|
|
14588
14861
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TmpGraphics, null), /*#__PURE__*/React__default.createElement(Sketch, {
|
|
14589
14862
|
key: sketchId,
|
|
14590
14863
|
objId: sketchId
|
|
14591
|
-
}), /*#__PURE__*/React__default.createElement(MousePosition, null), /*#__PURE__*/React__default.createElement(RubberBandRectangle, null),
|
|
14864
|
+
}), /*#__PURE__*/React__default.createElement(MousePosition, null), /*#__PURE__*/React__default.createElement(RubberBandRectangle, null), /*#__PURE__*/React__default.createElement(OverdefinedStateManager, {
|
|
14865
|
+
drawingId: drawingId,
|
|
14866
|
+
pluginId: pluginId
|
|
14867
|
+
}), dimId && /*#__PURE__*/React__default.createElement(DimensionSet, {
|
|
14592
14868
|
drawingId: drawingId,
|
|
14593
14869
|
objectId: dimId,
|
|
14594
14870
|
applyTransform: false,
|
|
@@ -15320,7 +15596,6 @@ function useContextMenuItems$3(drawingId, pluginId, setRename) {
|
|
|
15320
15596
|
const {
|
|
15321
15597
|
Text: Text$1
|
|
15322
15598
|
} = Typography;
|
|
15323
|
-
const DetailsContext = /*#__PURE__*/React__default.createContext(null);
|
|
15324
15599
|
const RefTag = ({
|
|
15325
15600
|
objId,
|
|
15326
15601
|
refId,
|
|
@@ -15401,18 +15676,12 @@ const RefTag = ({
|
|
|
15401
15676
|
const ObjTitle = ({
|
|
15402
15677
|
objId,
|
|
15403
15678
|
refId,
|
|
15404
|
-
withMenu = false
|
|
15405
|
-
index
|
|
15679
|
+
withMenu = false
|
|
15406
15680
|
}) => {
|
|
15407
15681
|
const {
|
|
15408
15682
|
drawingId,
|
|
15409
15683
|
pluginId
|
|
15410
15684
|
} = React__default.useContext(RootContext);
|
|
15411
|
-
const {
|
|
15412
|
-
items,
|
|
15413
|
-
lastSelected,
|
|
15414
|
-
setLastSelected
|
|
15415
|
-
} = React__default.useContext(DetailsContext);
|
|
15416
15685
|
const name = useDrawingStr(drawingId, d => {
|
|
15417
15686
|
var _d$structure$tree$obj;
|
|
15418
15687
|
return (_d$structure$tree$obj = d.structure.tree[objId]) == null ? void 0 : _d$structure$tree$obj.name;
|
|
@@ -15422,10 +15691,14 @@ const ObjTitle = ({
|
|
|
15422
15691
|
return (_d$structure$tree$obj2 = d.structure.tree[objId]) == null ? void 0 : _d$structure$tree$obj2.class;
|
|
15423
15692
|
});
|
|
15424
15693
|
const activeHandler = useSketchState(drawingId, pluginId, state => state.activeHandler);
|
|
15425
|
-
const
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
|
|
15694
|
+
const {
|
|
15695
|
+
isSHovered,
|
|
15696
|
+
isSSelected,
|
|
15697
|
+
handlers
|
|
15698
|
+
} = useTreeObjInteraction(drawingId, objId);
|
|
15699
|
+
const onTreeObjClick = handlers.onClick;
|
|
15700
|
+
const onTreeObjPointerOver = handlers.onPointerOver;
|
|
15701
|
+
const onTreeObjPointerOut = handlers.onPointerOut;
|
|
15429
15702
|
const isGHovered = useDrawing(drawingId, d => {
|
|
15430
15703
|
var _d$interaction$hovere;
|
|
15431
15704
|
return ((_d$interaction$hovere = d.interaction.hovered) == null ? void 0 : _d$interaction$hovere.objectId) === objId;
|
|
@@ -15488,40 +15761,24 @@ const ObjTitle = ({
|
|
|
15488
15761
|
unhover(drawingId, pluginId, objId);
|
|
15489
15762
|
onHide_();
|
|
15490
15763
|
}, [drawingId, pluginId, objId, onHide_]);
|
|
15491
|
-
|
|
15492
|
-
// TODO: Implement global selection in onClick? Not sure if needed...
|
|
15493
15764
|
const onClick = React__default.useCallback(e => {
|
|
15494
|
-
if (activeHandler === HandlersList.DRAG) {
|
|
15495
|
-
|
|
15496
|
-
const start = Math.min(lastSelected, index);
|
|
15497
|
-
const end = Math.max(lastSelected, index);
|
|
15498
|
-
const toSelect = items.slice(start, end + 1);
|
|
15499
|
-
const set = getPlugin(drawingId, pluginId).set;
|
|
15500
|
-
set({
|
|
15501
|
-
selected: toSelect
|
|
15502
|
-
});
|
|
15503
|
-
} else {
|
|
15504
|
-
if (index !== undefined) {
|
|
15505
|
-
setLastSelected(index);
|
|
15506
|
-
}
|
|
15507
|
-
select(drawingId, pluginId, objId);
|
|
15508
|
-
}
|
|
15509
|
-
} else if (!activeHandler) {
|
|
15510
|
-
// if no handler is active, some selector should be active
|
|
15511
|
-
onClickSel && onClickSel(e);
|
|
15765
|
+
if (activeHandler === HandlersList.DRAG || activeHandler === HandlersList.SSELECT) {
|
|
15766
|
+
onTreeObjClick(e);
|
|
15512
15767
|
}
|
|
15513
|
-
}, [
|
|
15768
|
+
}, [activeHandler, onTreeObjClick]);
|
|
15514
15769
|
const onContextMenuDefault = React__default.useCallback(e => {
|
|
15515
15770
|
e.preventDefault();
|
|
15516
15771
|
}, []);
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15772
|
+
|
|
15773
|
+
/* const onMouseEnter = React.useCallback(() => {
|
|
15774
|
+
hover(drawingId, pluginId, [objId])
|
|
15775
|
+
}, [drawingId, pluginId, objId]) */
|
|
15776
|
+
|
|
15520
15777
|
const onMouseLeave = React__default.useCallback(() => {
|
|
15521
15778
|
if (!isContextMenuActive) {
|
|
15522
|
-
|
|
15779
|
+
onTreeObjPointerOut(drawingId, pluginId, objId);
|
|
15523
15780
|
}
|
|
15524
|
-
}, [drawingId, pluginId, objId, isContextMenuActive]);
|
|
15781
|
+
}, [drawingId, pluginId, objId, isContextMenuActive, onTreeObjPointerOut]);
|
|
15525
15782
|
const nameComponent = rename ? /*#__PURE__*/React__default.createElement(NameEdit, {
|
|
15526
15783
|
drawingId: drawingId,
|
|
15527
15784
|
objId: objId,
|
|
@@ -15542,7 +15799,7 @@ const ObjTitle = ({
|
|
|
15542
15799
|
margin: '0px 2px 0px 0px'
|
|
15543
15800
|
},
|
|
15544
15801
|
onClick: onClick,
|
|
15545
|
-
onMouseEnter:
|
|
15802
|
+
onMouseEnter: onTreeObjPointerOver,
|
|
15546
15803
|
onMouseLeave: onMouseLeave,
|
|
15547
15804
|
onContextMenu: withMenu ? onContextMenu : onContextMenuDefault
|
|
15548
15805
|
}, imgName && resources[imgName] && /*#__PURE__*/React__default.createElement(Img, {
|
|
@@ -15587,8 +15844,7 @@ const ObjTitle = ({
|
|
|
15587
15844
|
const SketchObj = ({
|
|
15588
15845
|
objId,
|
|
15589
15846
|
level,
|
|
15590
|
-
refId
|
|
15591
|
-
index
|
|
15847
|
+
refId
|
|
15592
15848
|
}) => {
|
|
15593
15849
|
const {
|
|
15594
15850
|
drawingId
|
|
@@ -15606,8 +15862,7 @@ const SketchObj = ({
|
|
|
15606
15862
|
}) : /*#__PURE__*/React__default.createElement(Indent, null), /*#__PURE__*/React__default.createElement(ObjTitle, {
|
|
15607
15863
|
objId: objId,
|
|
15608
15864
|
refId: refId,
|
|
15609
|
-
withMenu: level === 0
|
|
15610
|
-
index: index
|
|
15865
|
+
withMenu: level === 0
|
|
15611
15866
|
})), children.map(childId => /*#__PURE__*/React__default.createElement("div", {
|
|
15612
15867
|
key: childId,
|
|
15613
15868
|
style: {
|
|
@@ -15623,6 +15878,7 @@ const Details = () => {
|
|
|
15623
15878
|
drawingId,
|
|
15624
15879
|
pluginId
|
|
15625
15880
|
} = React__default.useContext(RootContext);
|
|
15881
|
+
const curProduct = useDrawingCCId(drawingId, d => d.structure.currentProduct);
|
|
15626
15882
|
const sketchId = usePlugin(drawingId, pluginId, plugin => plugin.objectId);
|
|
15627
15883
|
const sketchChildren = useDrawing(drawingId, d => d.structure.tree[sketchId].children);
|
|
15628
15884
|
const ccUseSetId = useDrawing(drawingId, d => sketchChildren == null ? void 0 : sketchChildren.find(id => {
|
|
@@ -15658,29 +15914,17 @@ const Details = () => {
|
|
|
15658
15914
|
const hasConstraints = constraints.length > 0;
|
|
15659
15915
|
const [geomCollapsed, setGeomCollapsed] = React__default.useState(false);
|
|
15660
15916
|
const [constrCollapsed, setConstrCollapsed] = React__default.useState(false);
|
|
15661
|
-
const
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
const selected = selectedInfo.map(info => info.objectId);
|
|
15666
|
-
// Either reset lastSelected if selected array becomes empty, or set it to something if the user selects something in the view
|
|
15667
|
-
React__default.useEffect(() => {
|
|
15668
|
-
if (selected.length === 0) {
|
|
15669
|
-
setLastSelected(-1);
|
|
15670
|
-
} else if (lastSelected === -1) {
|
|
15671
|
-
setLastSelected(items.findIndex(item => selected.indexOf(item) !== -1));
|
|
15672
|
-
}
|
|
15673
|
-
}, [selected, items, lastSelected]);
|
|
15674
|
-
const contextValue = React__default.useMemo(() => ({
|
|
15675
|
-
items,
|
|
15676
|
-
lastSelected,
|
|
15677
|
-
setLastSelected
|
|
15678
|
-
}), [items, lastSelected]);
|
|
15917
|
+
const createInfo_ = React__default.useCallback(objId => createInfo({
|
|
15918
|
+
objectId: objId,
|
|
15919
|
+
prodRefId: curProduct
|
|
15920
|
+
}), [curProduct]);
|
|
15679
15921
|
return /*#__PURE__*/React__default.createElement(SketchGroup, {
|
|
15680
15922
|
caption: "Details",
|
|
15681
15923
|
collapse: true
|
|
15682
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
15683
|
-
|
|
15924
|
+
}, /*#__PURE__*/React__default.createElement(MultiSelect, {
|
|
15925
|
+
drawingId: drawingId,
|
|
15926
|
+
items: items,
|
|
15927
|
+
createInfo: createInfo_
|
|
15684
15928
|
}, !hasGeometry && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
15685
15929
|
style: {
|
|
15686
15930
|
marginLeft: '2px'
|
|
@@ -15708,16 +15952,14 @@ const Details = () => {
|
|
|
15708
15952
|
style: {
|
|
15709
15953
|
display: geomCollapsed ? 'none' : 'block'
|
|
15710
15954
|
}
|
|
15711
|
-
}, refGeometry.map(([id, refId]
|
|
15955
|
+
}, refGeometry.map(([id, refId]) => /*#__PURE__*/React__default.createElement(SketchObj, {
|
|
15712
15956
|
objId: id,
|
|
15713
15957
|
refId: refId,
|
|
15714
15958
|
key: id,
|
|
15715
|
-
index: i,
|
|
15716
15959
|
level: 0
|
|
15717
|
-
})), geometry.map(
|
|
15960
|
+
})), geometry.map(id => /*#__PURE__*/React__default.createElement(SketchObj, {
|
|
15718
15961
|
objId: id,
|
|
15719
15962
|
key: id,
|
|
15720
|
-
index: geomStartIndex + i,
|
|
15721
15963
|
level: 0
|
|
15722
15964
|
})))), hasConstraints && !isTrimActive && /*#__PURE__*/React__default.createElement("div", {
|
|
15723
15965
|
style: {
|
|
@@ -15737,10 +15979,9 @@ const Details = () => {
|
|
|
15737
15979
|
style: {
|
|
15738
15980
|
display: constrCollapsed ? 'none' : 'block'
|
|
15739
15981
|
}
|
|
15740
|
-
}, constraints.map(
|
|
15982
|
+
}, constraints.map(id => /*#__PURE__*/React__default.createElement(SketchObj, {
|
|
15741
15983
|
objId: id,
|
|
15742
15984
|
key: id,
|
|
15743
|
-
index: constrStartIndex + i,
|
|
15744
15985
|
level: 0
|
|
15745
15986
|
}))))));
|
|
15746
15987
|
};
|
|
@@ -16030,7 +16271,7 @@ const EditRegion = ({
|
|
|
16030
16271
|
return (_d$structure$tree$reg = d.structure.tree[regionId]) == null ? void 0 : _d$structure$tree$reg.name;
|
|
16031
16272
|
});
|
|
16032
16273
|
const [rename, setRename] = React__default.useState(false);
|
|
16033
|
-
const menuItems = useContextMenuItems$4(drawingId,
|
|
16274
|
+
const menuItems = useContextMenuItems$4(drawingId, setRename);
|
|
16034
16275
|
const menuInfo = React__default.useMemo(() => ({
|
|
16035
16276
|
interactionInfo: createInfo({
|
|
16036
16277
|
objectId: regionId
|
|
@@ -19473,6 +19714,13 @@ const SectionHeader = ({
|
|
|
19473
19714
|
}, children);
|
|
19474
19715
|
};
|
|
19475
19716
|
|
|
19717
|
+
const createConstraintInfo = (drawingId, constraintId) => {
|
|
19718
|
+
const curInstanceId = getDrawing(drawingId).structure.currentInstance;
|
|
19719
|
+
return createInfo({
|
|
19720
|
+
objectId: constraintId,
|
|
19721
|
+
prodRefId: curInstanceId
|
|
19722
|
+
});
|
|
19723
|
+
};
|
|
19476
19724
|
function usePrecheckErrorId$1(drawingId, constraintId) {
|
|
19477
19725
|
const constraintChildren = useDrawingArr(drawingId, d => {
|
|
19478
19726
|
var _d$structure$tree$con;
|
|
@@ -19571,25 +19819,16 @@ const Constraint = ({
|
|
|
19571
19819
|
drawingId,
|
|
19572
19820
|
constraintId
|
|
19573
19821
|
}) => {
|
|
19574
|
-
const hoveredId = useDrawing(drawingId, d => {
|
|
19575
|
-
var _d$interaction$hovere;
|
|
19576
|
-
return (_d$interaction$hovere = d.interaction.hovered) == null ? void 0 : _d$interaction$hovere.objectId;
|
|
19577
|
-
});
|
|
19578
19822
|
const name = useDrawing(drawingId, d => {
|
|
19579
19823
|
var _d$structure$tree$con2;
|
|
19580
19824
|
return (_d$structure$tree$con2 = d.structure.tree[constraintId]) == null ? void 0 : _d$structure$tree$con2.name;
|
|
19581
19825
|
});
|
|
19582
19826
|
const isActive = useDrawing(drawingId, d => d.plugin.active.feature === constraintId);
|
|
19583
|
-
const isHovered = hoveredId === constraintId;
|
|
19584
19827
|
const [rename, setRename] = React__default.useState(false);
|
|
19585
|
-
const menuItems = useContextMenuItems$4(drawingId,
|
|
19828
|
+
const menuItems = useContextMenuItems$4(drawingId, setRename);
|
|
19586
19829
|
const menuInfo = React__default.useMemo(() => {
|
|
19587
|
-
const curInstanceId = getDrawing(drawingId).structure.currentInstance;
|
|
19588
19830
|
return {
|
|
19589
|
-
interactionInfo:
|
|
19590
|
-
objectId: constraintId,
|
|
19591
|
-
prodRefId: curInstanceId
|
|
19592
|
-
})
|
|
19831
|
+
interactionInfo: createConstraintInfo(drawingId, constraintId)
|
|
19593
19832
|
};
|
|
19594
19833
|
}, [drawingId, constraintId]);
|
|
19595
19834
|
const {
|
|
@@ -19599,19 +19838,20 @@ const Constraint = ({
|
|
|
19599
19838
|
} = useContextMenuInteraction(drawingId);
|
|
19600
19839
|
const errorId = usePrecheckErrorId$1(drawingId, constraintId);
|
|
19601
19840
|
const {
|
|
19841
|
+
isGHovered,
|
|
19842
|
+
isGSelected,
|
|
19843
|
+
isSHovered,
|
|
19602
19844
|
handlers
|
|
19603
19845
|
} = useTreeObjInteraction(drawingId, constraintId);
|
|
19604
19846
|
const onClick = handlers.onClick;
|
|
19847
|
+
const isHovered = isGHovered || isSHovered;
|
|
19848
|
+
const isHighlighted = isHovered || isGSelected;
|
|
19605
19849
|
const onDoubleClick = React__default.useCallback(() => {
|
|
19606
19850
|
getDrawing(drawingId).api.plugin.setActiveFeature(constraintId);
|
|
19607
19851
|
}, [drawingId, constraintId]);
|
|
19608
19852
|
const onMouseEnter = React__default.useCallback(() => {
|
|
19609
19853
|
const setHovered = getDrawing(drawingId).api.interaction.setHovered;
|
|
19610
|
-
|
|
19611
|
-
setHovered(createInfo({
|
|
19612
|
-
objectId: constraintId,
|
|
19613
|
-
prodRefId: curInstanceId
|
|
19614
|
-
}));
|
|
19854
|
+
setHovered(createConstraintInfo(drawingId, constraintId));
|
|
19615
19855
|
}, [drawingId, constraintId]);
|
|
19616
19856
|
const onMouseLeave = React__default.useCallback(() => {
|
|
19617
19857
|
if (!isContextMenuActive) {
|
|
@@ -19644,7 +19884,7 @@ const Constraint = ({
|
|
|
19644
19884
|
flex: 1,
|
|
19645
19885
|
minWidth: '0px'
|
|
19646
19886
|
},
|
|
19647
|
-
hovered:
|
|
19887
|
+
hovered: isHighlighted,
|
|
19648
19888
|
bordered: true,
|
|
19649
19889
|
onClick: onClick,
|
|
19650
19890
|
onDoubleClick: onDoubleClick,
|
|
@@ -19671,11 +19911,16 @@ const List$2 = ({
|
|
|
19671
19911
|
constrIds,
|
|
19672
19912
|
drawingId
|
|
19673
19913
|
}) => {
|
|
19674
|
-
|
|
19914
|
+
const createInfo_ = React__default.useCallback(objId => createConstraintInfo(drawingId, objId), [drawingId]);
|
|
19915
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(MultiSelect, {
|
|
19916
|
+
drawingId: drawingId,
|
|
19917
|
+
items: constrIds,
|
|
19918
|
+
createInfo: createInfo_
|
|
19919
|
+
}, constrIds.map(constrId => /*#__PURE__*/React__default.createElement(Constraint, {
|
|
19675
19920
|
key: constrId,
|
|
19676
19921
|
drawingId: drawingId,
|
|
19677
19922
|
constraintId: constrId
|
|
19678
|
-
})));
|
|
19923
|
+
}))));
|
|
19679
19924
|
};
|
|
19680
19925
|
|
|
19681
19926
|
/**
|
|
@@ -21204,7 +21449,7 @@ const Feature = ({
|
|
|
21204
21449
|
const pluginApi = getDrawing(drawingId).api.plugin;
|
|
21205
21450
|
pluginApi.setVisiblePlugin(featureId, !visible);
|
|
21206
21451
|
}, [drawingId, visible, featureId, disabled, rename]);
|
|
21207
|
-
const menuItems = useContextMenuItems$4(drawingId,
|
|
21452
|
+
const menuItems = useContextMenuItems$4(drawingId, setRename);
|
|
21208
21453
|
const {
|
|
21209
21454
|
name: menuHeaderName,
|
|
21210
21455
|
icon
|
|
@@ -21412,7 +21657,25 @@ const List$1 = ({
|
|
|
21412
21657
|
var _d$structure$tree$opS;
|
|
21413
21658
|
return (_d$structure$tree$opS = d.structure.tree[opSeqId]) == null ? void 0 : _d$structure$tree$opS.children;
|
|
21414
21659
|
});
|
|
21415
|
-
|
|
21660
|
+
const featureIds = React__default.useMemo(() => {
|
|
21661
|
+
const tree = getDrawing(drawingId).structure.tree;
|
|
21662
|
+
return featureRefIds.map(refId => {
|
|
21663
|
+
var _tree$refId, _tree$refId$members;
|
|
21664
|
+
return (_tree$refId = tree[refId]) == null ? void 0 : (_tree$refId$members = _tree$refId.members) == null ? void 0 : _tree$refId$members.refObj.value;
|
|
21665
|
+
});
|
|
21666
|
+
}, [drawingId, featureRefIds]);
|
|
21667
|
+
const createInfo_ = React__default.useCallback(objId => {
|
|
21668
|
+
const productId = getDrawing(drawingId).structure.currentProduct;
|
|
21669
|
+
return createInfo({
|
|
21670
|
+
objectId: objId,
|
|
21671
|
+
prodRefId: productId
|
|
21672
|
+
});
|
|
21673
|
+
}, [drawingId]);
|
|
21674
|
+
return /*#__PURE__*/React__default.createElement(MultiSelect, {
|
|
21675
|
+
drawingId: drawingId,
|
|
21676
|
+
items: featureIds,
|
|
21677
|
+
createInfo: createInfo_
|
|
21678
|
+
}, /*#__PURE__*/React__default.createElement(SortableList, {
|
|
21416
21679
|
items: featureRefIds,
|
|
21417
21680
|
onSortEnd: (oldIndex, newIndex) => {
|
|
21418
21681
|
const rootId_ = getDrawing(drawingId).structure.currentProduct;
|
|
@@ -21429,7 +21692,7 @@ const List$1 = ({
|
|
|
21429
21692
|
drawingId: drawingId,
|
|
21430
21693
|
featureRefId: item
|
|
21431
21694
|
})
|
|
21432
|
-
});
|
|
21695
|
+
}));
|
|
21433
21696
|
};
|
|
21434
21697
|
const FeatureList = ({
|
|
21435
21698
|
drawingId
|
|
@@ -21500,6 +21763,22 @@ const usePatternConstraintInfo = drawingId => {
|
|
|
21500
21763
|
instances: isPatternActive ? [instanceId] : undefined
|
|
21501
21764
|
}), [isPatternActive, instanceId]);
|
|
21502
21765
|
};
|
|
21766
|
+
const useIsNestedMateSSelected = (drawingId, instanceId) => {
|
|
21767
|
+
const matePath = React__default.useMemo(() => getMatePath(drawingId, instanceId), [drawingId, instanceId]);
|
|
21768
|
+
return useDrawing(drawingId, d => {
|
|
21769
|
+
const selection = d.selection.refs[d.selection.active || ''];
|
|
21770
|
+
const selItem = selection == null ? void 0 : selection.items[0];
|
|
21771
|
+
if (!selItem || selItem.scope !== MateScope) {
|
|
21772
|
+
return false;
|
|
21773
|
+
}
|
|
21774
|
+
const selPath = selItem.data.matePath;
|
|
21775
|
+
if (matePath.length > selPath.length) {
|
|
21776
|
+
return false;
|
|
21777
|
+
}
|
|
21778
|
+
const shift = selPath.length - matePath.length;
|
|
21779
|
+
return matePath.every((id, index) => id === selPath[index + shift]);
|
|
21780
|
+
}) || false;
|
|
21781
|
+
};
|
|
21503
21782
|
|
|
21504
21783
|
// Sets all products in tree hidden/visible
|
|
21505
21784
|
function setProductsHidden(drawingId, prodId, hidden) {
|
|
@@ -21591,7 +21870,8 @@ const InstanceTitle = ({
|
|
|
21591
21870
|
const selectedIds = (selected == null ? void 0 : selected.map(sel => sel.graphicId && sel.prodRefId ? sel.prodRefId : sel.objectId)) || [];
|
|
21592
21871
|
const isGSelected = selectedIds.indexOf(instanceId) !== -1;
|
|
21593
21872
|
const isSelected = isGSelected || isSSelected;
|
|
21594
|
-
const
|
|
21873
|
+
const isMateSSelected = useIsNestedMateSSelected(drawingId, instanceId);
|
|
21874
|
+
const isHighlighted = isHovered || isSelected || isMateSSelected || ((selectedIds == null ? void 0 : selectedIds.length) === 1 ? hasSelectedChild(drawingId, instanceId, selectedIds[0]) : false);
|
|
21595
21875
|
const isBlocked = useDrawing(drawingId, d => {
|
|
21596
21876
|
var _d$selection$refs;
|
|
21597
21877
|
const isSelActive = d.selection.active !== null;
|
|
@@ -21851,6 +22131,10 @@ const InstanceNode = ({
|
|
|
21851
22131
|
const [collapsed, setCollapsed] = React__default.useState(true);
|
|
21852
22132
|
const ref = React__default.useRef(null);
|
|
21853
22133
|
const hasCollapsed = ((_ref$current = ref.current) == null ? void 0 : _ref$current.children) && ref.current.children.length > 0;
|
|
22134
|
+
const createInfo_ = React__default.useCallback(objId => createInfo({
|
|
22135
|
+
objectId: objId,
|
|
22136
|
+
prodRefId: objId
|
|
22137
|
+
}), []);
|
|
21854
22138
|
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(FlexRow, null, /*#__PURE__*/React__default.createElement(Indents, {
|
|
21855
22139
|
level: level
|
|
21856
22140
|
}), hasCollapsed ? /*#__PURE__*/React__default.createElement(CollapseButton, {
|
|
@@ -21865,6 +22149,10 @@ const InstanceNode = ({
|
|
|
21865
22149
|
style: {
|
|
21866
22150
|
display: collapsed ? 'none' : 'block'
|
|
21867
22151
|
}
|
|
22152
|
+
}, /*#__PURE__*/React__default.createElement(MultiSelect, {
|
|
22153
|
+
drawingId: drawingId,
|
|
22154
|
+
items: instanceChildren,
|
|
22155
|
+
createInfo: createInfo_
|
|
21868
22156
|
}, geometrySetId && /*#__PURE__*/React__default.createElement(GeometrySetNode, {
|
|
21869
22157
|
drawingId: drawingId,
|
|
21870
22158
|
objectId: geometrySetId,
|
|
@@ -21875,7 +22163,7 @@ const InstanceNode = ({
|
|
|
21875
22163
|
drawingId: drawingId,
|
|
21876
22164
|
nodeId: childId,
|
|
21877
22165
|
level: level + 1
|
|
21878
|
-
}))));
|
|
22166
|
+
})))));
|
|
21879
22167
|
};
|
|
21880
22168
|
const AssemblyNode = ({
|
|
21881
22169
|
drawingId,
|
|
@@ -21918,6 +22206,10 @@ const AssemblyNodeList = ({
|
|
|
21918
22206
|
var _tree$id2;
|
|
21919
22207
|
return ccUtils.base.isA((_tree$id2 = tree[id]) == null ? void 0 : _tree$id2.class, CCClasses.CCGeometrySet);
|
|
21920
22208
|
});
|
|
22209
|
+
const createInfo_ = React__default.useCallback(objId => createInfo({
|
|
22210
|
+
objectId: objId,
|
|
22211
|
+
prodRefId: objId
|
|
22212
|
+
}), []);
|
|
21921
22213
|
const {
|
|
21922
22214
|
isPatternActive,
|
|
21923
22215
|
instances
|
|
@@ -21933,6 +22225,10 @@ const AssemblyNodeList = ({
|
|
|
21933
22225
|
}), [currentInstance, isPatternActive, activeRigidsets]);
|
|
21934
22226
|
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(AssemblyNodeContext.Provider, {
|
|
21935
22227
|
value: contextValue
|
|
22228
|
+
}, /*#__PURE__*/React__default.createElement(MultiSelect, {
|
|
22229
|
+
drawingId: drawingId,
|
|
22230
|
+
items: instanceChildren,
|
|
22231
|
+
createInfo: createInfo_
|
|
21936
22232
|
}, geometrySetId && /*#__PURE__*/React__default.createElement(GeometrySetNode, {
|
|
21937
22233
|
drawingId: drawingId,
|
|
21938
22234
|
objectId: geometrySetId,
|
|
@@ -21943,7 +22239,7 @@ const AssemblyNodeList = ({
|
|
|
21943
22239
|
drawingId: drawingId,
|
|
21944
22240
|
nodeId: childId,
|
|
21945
22241
|
level: 0
|
|
21946
|
-
}))));
|
|
22242
|
+
})))));
|
|
21947
22243
|
};
|
|
21948
22244
|
|
|
21949
22245
|
const Skeleton = styled(SkeletonImpl)`
|
|
@@ -22405,6 +22701,20 @@ function useContextMenuItems$1(drawingId, setEditName) {
|
|
|
22405
22701
|
|
|
22406
22702
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22407
22703
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22704
|
+
const createSolidInfo = (drawingId, solidId) => {
|
|
22705
|
+
var _drawing$graphic$cont, _drawing$structure$tr;
|
|
22706
|
+
const drawing = getDrawing(drawingId);
|
|
22707
|
+
const solidOwner = (_drawing$graphic$cont = drawing.graphic.containers[solidId]) == null ? void 0 : _drawing$graphic$cont.owner;
|
|
22708
|
+
const curInstanceId = drawing.structure.currentInstance;
|
|
22709
|
+
const curProdId = drawing.structure.currentProduct;
|
|
22710
|
+
const isPart = ccUtils.base.isA(((_drawing$structure$tr = drawing.structure.tree[curProdId]) == null ? void 0 : _drawing$structure$tr.class) || '', CCClasses.CCPart);
|
|
22711
|
+
return createInfo({
|
|
22712
|
+
objectId: solidOwner,
|
|
22713
|
+
graphicId: solidId,
|
|
22714
|
+
containerId: solidId,
|
|
22715
|
+
prodRefId: isPart ? curProdId : curInstanceId
|
|
22716
|
+
});
|
|
22717
|
+
};
|
|
22408
22718
|
const EyeComponent = ({
|
|
22409
22719
|
drawingId,
|
|
22410
22720
|
solidId
|
|
@@ -22441,46 +22751,39 @@ const Solid = ({
|
|
|
22441
22751
|
drawingId,
|
|
22442
22752
|
solidId
|
|
22443
22753
|
}) => {
|
|
22444
|
-
const
|
|
22445
|
-
|
|
22446
|
-
|
|
22447
|
-
})
|
|
22448
|
-
|
|
22449
|
-
|
|
22754
|
+
const {
|
|
22755
|
+
setLastSelected,
|
|
22756
|
+
multiSelect
|
|
22757
|
+
} = React__default.useContext(MultiSelectContext) || {
|
|
22758
|
+
setLastSelected: undefined,
|
|
22759
|
+
multiSelect: undefined
|
|
22760
|
+
};
|
|
22450
22761
|
const solidOwner = useDrawingCCId(drawingId, d => {
|
|
22451
22762
|
var _d$graphic$containers;
|
|
22452
22763
|
return (_d$graphic$containers = d.graphic.containers[solidId]) == null ? void 0 : _d$graphic$containers.owner;
|
|
22453
22764
|
});
|
|
22454
22765
|
const ccSolid = useDrawing(drawingId, d => d.structure.tree[solidOwner]);
|
|
22455
|
-
const isHovered =
|
|
22456
|
-
|
|
22766
|
+
const isHovered = useDrawing(drawingId, d => {
|
|
22767
|
+
var _d$interaction$hovere;
|
|
22768
|
+
return ((_d$interaction$hovere = d.interaction.hovered) == null ? void 0 : _d$interaction$hovere.containerId) === solidId;
|
|
22769
|
+
}) || false;
|
|
22770
|
+
const isSelected = useDrawing(drawingId, d => {
|
|
22771
|
+
var _d$interaction$select;
|
|
22772
|
+
return (_d$interaction$select = d.interaction.selected) == null ? void 0 : _d$interaction$select.some(sel => sel.containerId === solidId);
|
|
22773
|
+
}) || false;
|
|
22457
22774
|
const isHighlighted = isHovered || isSelected;
|
|
22458
22775
|
const [rename, setRename] = React__default.useState(false);
|
|
22459
22776
|
const menuItems = useContextMenuItems$1(drawingId, setRename);
|
|
22460
|
-
const menuInfo = React__default.useMemo(() => {
|
|
22461
|
-
|
|
22462
|
-
|
|
22463
|
-
const curInstanceId = drawing.structure.currentInstance;
|
|
22464
|
-
const curProdId = drawing.structure.currentProduct;
|
|
22465
|
-
const isPart = ccUtils.base.isA(((_drawing$structure$tr = drawing.structure.tree[curProdId]) == null ? void 0 : _drawing$structure$tr.class) || '', CCClasses.CCPart);
|
|
22466
|
-
return {
|
|
22467
|
-
interactionInfo: createInfo({
|
|
22468
|
-
objectId: solidOwner,
|
|
22469
|
-
graphicId: solidId,
|
|
22470
|
-
containerId: solidId,
|
|
22471
|
-
prodRefId: isPart ? curProdId : curInstanceId
|
|
22472
|
-
})
|
|
22473
|
-
};
|
|
22474
|
-
}, [drawingId, solidId, solidOwner]);
|
|
22777
|
+
const menuInfo = React__default.useMemo(() => ({
|
|
22778
|
+
interactionInfo: createSolidInfo(drawingId, solidId)
|
|
22779
|
+
}), [drawingId, solidId]);
|
|
22475
22780
|
const {
|
|
22476
22781
|
isContextMenuActive,
|
|
22477
22782
|
onContextMenu,
|
|
22478
22783
|
onHide
|
|
22479
22784
|
} = useContextMenuInteraction(drawingId);
|
|
22480
22785
|
const onClick = React__default.useCallback(e => {
|
|
22481
|
-
var _drawing$structure$tr2;
|
|
22482
22786
|
const drawing = getDrawing(drawingId);
|
|
22483
|
-
const curInstanceId = drawing.structure.currentInstance;
|
|
22484
22787
|
const curProdId = drawing.structure.currentProduct;
|
|
22485
22788
|
const selId = drawing.selection.active;
|
|
22486
22789
|
if (selId) {
|
|
@@ -22503,29 +22806,18 @@ const Solid = ({
|
|
|
22503
22806
|
}
|
|
22504
22807
|
return;
|
|
22505
22808
|
}
|
|
22809
|
+
setLastSelected == null ? void 0 : setLastSelected(solidId, !e.shiftKey);
|
|
22810
|
+
if (e.shiftKey && multiSelect) {
|
|
22811
|
+
multiSelect(solidId);
|
|
22812
|
+
return;
|
|
22813
|
+
}
|
|
22506
22814
|
const select = drawing.api.interaction.select;
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
select(createInfo({
|
|
22510
|
-
objectId: solidOwner,
|
|
22511
|
-
graphicId: solidId,
|
|
22512
|
-
containerId: solidId,
|
|
22513
|
-
prodRefId: isPart ? curProdId : curInstanceId
|
|
22514
|
-
}), multi);
|
|
22515
|
-
}, [drawingId, solidId, solidOwner]);
|
|
22815
|
+
select(createSolidInfo(drawingId, solidId), e.ctrlKey || e.shiftKey);
|
|
22816
|
+
}, [drawingId, solidId, setLastSelected, multiSelect]);
|
|
22516
22817
|
const onMouseEnter = React__default.useCallback(() => {
|
|
22517
|
-
var _getDrawing$structure;
|
|
22518
22818
|
const setHovered = getDrawing(drawingId).api.interaction.setHovered;
|
|
22519
|
-
|
|
22520
|
-
|
|
22521
|
-
const isPart = ccUtils.base.isA(((_getDrawing$structure = getDrawing(drawingId).structure.tree[curProdId]) == null ? void 0 : _getDrawing$structure.class) || '', CCClasses.CCPart);
|
|
22522
|
-
setHovered(createInfo({
|
|
22523
|
-
objectId: solidOwner,
|
|
22524
|
-
graphicId: solidId,
|
|
22525
|
-
containerId: solidId,
|
|
22526
|
-
prodRefId: isPart ? curProdId : curInstanceId
|
|
22527
|
-
}));
|
|
22528
|
-
}, [drawingId, solidId, solidOwner]);
|
|
22819
|
+
setHovered(createSolidInfo(drawingId, solidId));
|
|
22820
|
+
}, [drawingId, solidId]);
|
|
22529
22821
|
const onMouseLeave = React__default.useCallback(() => {
|
|
22530
22822
|
if (!isContextMenuActive) {
|
|
22531
22823
|
const setHovered = getDrawing(drawingId).api.interaction.setHovered;
|
|
@@ -22586,11 +22878,16 @@ const List = ({
|
|
|
22586
22878
|
solidsIds,
|
|
22587
22879
|
drawingId
|
|
22588
22880
|
}) => {
|
|
22589
|
-
|
|
22881
|
+
const createInfo_ = React__default.useCallback(solidId => createSolidInfo(drawingId, solidId), [drawingId]);
|
|
22882
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(MultiSelect, {
|
|
22883
|
+
drawingId: drawingId,
|
|
22884
|
+
items: solidsIds,
|
|
22885
|
+
createInfo: createInfo_
|
|
22886
|
+
}, solidsIds.map(solidId => /*#__PURE__*/React__default.createElement(Solid, {
|
|
22590
22887
|
key: solidId,
|
|
22591
22888
|
drawingId: drawingId,
|
|
22592
22889
|
solidId: solidId
|
|
22593
|
-
})));
|
|
22890
|
+
}))));
|
|
22594
22891
|
};
|
|
22595
22892
|
|
|
22596
22893
|
/**
|
|
@@ -22696,199 +22993,197 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
22696
22993
|
}
|
|
22697
22994
|
return res;
|
|
22698
22995
|
};
|
|
22699
|
-
return {
|
|
22700
|
-
|
|
22701
|
-
|
|
22702
|
-
|
|
22703
|
-
|
|
22704
|
-
|
|
22705
|
-
|
|
22706
|
-
|
|
22707
|
-
|
|
22708
|
-
|
|
22709
|
-
|
|
22710
|
-
|
|
22711
|
-
|
|
22712
|
-
|
|
22713
|
-
|
|
22714
|
-
|
|
22715
|
-
|
|
22716
|
-
|
|
22717
|
-
|
|
22718
|
-
|
|
22719
|
-
|
|
22720
|
-
|
|
22721
|
-
|
|
22722
|
-
|
|
22723
|
-
|
|
22724
|
-
|
|
22725
|
-
|
|
22726
|
-
|
|
22727
|
-
|
|
22728
|
-
|
|
22729
|
-
|
|
22730
|
-
|
|
22731
|
-
|
|
22732
|
-
|
|
22733
|
-
|
|
22734
|
-
|
|
22735
|
-
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
|
|
22740
|
-
|
|
22741
|
-
|
|
22742
|
-
|
|
22743
|
-
|
|
22744
|
-
|
|
22745
|
-
|
|
22746
|
-
|
|
22747
|
-
|
|
22748
|
-
|
|
22749
|
-
|
|
22750
|
-
|
|
22751
|
-
|
|
22752
|
-
|
|
22753
|
-
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
},
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
|
|
22761
|
-
|
|
22762
|
-
|
|
22763
|
-
|
|
22764
|
-
|
|
22765
|
-
|
|
22766
|
-
|
|
22767
|
-
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
|
|
22775
|
-
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22785
|
-
|
|
22786
|
-
|
|
22787
|
-
|
|
22788
|
-
|
|
22789
|
-
|
|
22790
|
-
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
|
|
22797
|
-
|
|
22798
|
-
|
|
22799
|
-
|
|
22800
|
-
|
|
22801
|
-
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22805
|
-
|
|
22806
|
-
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22811
|
-
|
|
22812
|
-
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
|
|
22821
|
-
|
|
22822
|
-
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22830
|
-
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
22834
|
-
|
|
22835
|
-
|
|
22836
|
-
|
|
22837
|
-
|
|
22838
|
-
|
|
22839
|
-
|
|
22840
|
-
|
|
22841
|
-
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
|
|
22849
|
-
|
|
22850
|
-
|
|
22851
|
-
|
|
22852
|
-
|
|
22853
|
-
},
|
|
22854
|
-
|
|
22855
|
-
|
|
22856
|
-
|
|
22857
|
-
|
|
22858
|
-
|
|
22859
|
-
|
|
22860
|
-
|
|
22861
|
-
|
|
22862
|
-
|
|
22863
|
-
|
|
22864
|
-
|
|
22865
|
-
}),
|
|
22866
|
-
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCEntityDeletion, 'Entity Deletion'))
|
|
22996
|
+
return [{
|
|
22997
|
+
label: 'Sketch',
|
|
22998
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
22999
|
+
url: img$A
|
|
23000
|
+
}),
|
|
23001
|
+
callback: wrapper(() => ccAPI.sketcher.createSketch(drawingId, rootId))
|
|
23002
|
+
}, [{
|
|
23003
|
+
label: 'Workpoint',
|
|
23004
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23005
|
+
url: img$z
|
|
23006
|
+
}),
|
|
23007
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, CCClasses.CCWorkPoint, 'WorkPoint'))
|
|
23008
|
+
}, {
|
|
23009
|
+
label: 'Workaxis',
|
|
23010
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23011
|
+
url: img$y
|
|
23012
|
+
}),
|
|
23013
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, CCClasses.CCWorkAxis, 'WorkAxis'))
|
|
23014
|
+
}, {
|
|
23015
|
+
label: 'Workplane',
|
|
23016
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23017
|
+
url: img$x
|
|
23018
|
+
}),
|
|
23019
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, CCClasses.CCWorkPlane, 'WorkPlane'))
|
|
23020
|
+
}, {
|
|
23021
|
+
label: 'WorkCsys',
|
|
23022
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23023
|
+
url: img$w
|
|
23024
|
+
}),
|
|
23025
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, CCClasses.CCWorkCSys, 'WorkCSys'))
|
|
23026
|
+
}], [{
|
|
23027
|
+
label: 'Extrusion',
|
|
23028
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23029
|
+
url: img$U
|
|
23030
|
+
}),
|
|
23031
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCExtrusion, 'Extrusion'))
|
|
23032
|
+
}, {
|
|
23033
|
+
label: 'Revolve',
|
|
23034
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23035
|
+
url: img$T
|
|
23036
|
+
}),
|
|
23037
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCRevolve, 'Revolve'))
|
|
23038
|
+
}, {
|
|
23039
|
+
label: 'Twist',
|
|
23040
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23041
|
+
url: img$v
|
|
23042
|
+
}),
|
|
23043
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCTwist, 'Twist'))
|
|
23044
|
+
}], {
|
|
23045
|
+
label: 'Boolean',
|
|
23046
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23047
|
+
url: img$u
|
|
23048
|
+
}),
|
|
23049
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCUnion, 'Union'))
|
|
23050
|
+
}, [{
|
|
23051
|
+
label: 'Slice',
|
|
23052
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23053
|
+
url: img$r
|
|
23054
|
+
}),
|
|
23055
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCSlice, 'Slice'))
|
|
23056
|
+
}, {
|
|
23057
|
+
label: 'Slice by sheet',
|
|
23058
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23059
|
+
url: img$r
|
|
23060
|
+
}),
|
|
23061
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCSliceBySheet, 'Slice by sheet'))
|
|
23062
|
+
}], [{
|
|
23063
|
+
label: 'Fillet',
|
|
23064
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23065
|
+
url: img$t
|
|
23066
|
+
}),
|
|
23067
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCConstantRadiusFillet, 'Fillet'))
|
|
23068
|
+
}, {
|
|
23069
|
+
label: 'Chamfer',
|
|
23070
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23071
|
+
url: img$s
|
|
23072
|
+
}),
|
|
23073
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCChamfer, 'Chamfer'))
|
|
23074
|
+
}], [{
|
|
23075
|
+
label: 'Linear pattern',
|
|
23076
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23077
|
+
url: img$q
|
|
23078
|
+
}),
|
|
23079
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCLinearPattern, 'Linear pattern'))
|
|
23080
|
+
}, {
|
|
23081
|
+
label: 'Circular pattern',
|
|
23082
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23083
|
+
url: img$p
|
|
23084
|
+
}),
|
|
23085
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCCircularPattern, 'Circular pattern'))
|
|
23086
|
+
}, {
|
|
23087
|
+
label: 'Mirror',
|
|
23088
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23089
|
+
url: img$F
|
|
23090
|
+
}),
|
|
23091
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCMirror, 'Mirror'))
|
|
23092
|
+
}], [{
|
|
23093
|
+
label: 'Translation',
|
|
23094
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23095
|
+
url: img$o
|
|
23096
|
+
}),
|
|
23097
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCTranslation, 'Translate'))
|
|
23098
|
+
}, {
|
|
23099
|
+
label: 'Rotation',
|
|
23100
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23101
|
+
url: img$n
|
|
23102
|
+
}),
|
|
23103
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCRotation, 'Rotate'))
|
|
23104
|
+
}, {
|
|
23105
|
+
label: 'Transformation by Csys',
|
|
23106
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23107
|
+
url: img$m
|
|
23108
|
+
}),
|
|
23109
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCTransformationByCSys, 'Transform by Csys'))
|
|
23110
|
+
}], [{
|
|
23111
|
+
label: 'Add Box',
|
|
23112
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23113
|
+
url: img$l
|
|
23114
|
+
}),
|
|
23115
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, 'CC_Box', 'Box'))
|
|
23116
|
+
}, {
|
|
23117
|
+
label: 'Add Sphere',
|
|
23118
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23119
|
+
url: img$k
|
|
23120
|
+
}),
|
|
23121
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, 'CC_Sphere', 'Sphere'))
|
|
23122
|
+
}, {
|
|
23123
|
+
label: 'Add Cylinder',
|
|
23124
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23125
|
+
url: img$j
|
|
23126
|
+
}),
|
|
23127
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, 'CC_Cylinder', 'Cylinder'))
|
|
23128
|
+
}, {
|
|
23129
|
+
label: 'Add Cone',
|
|
23130
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23131
|
+
url: img$i
|
|
23132
|
+
}),
|
|
23133
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, 'CC_Cone', 'Cone'))
|
|
23134
|
+
}], {
|
|
23135
|
+
label: 'Import',
|
|
23136
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23137
|
+
url: img$h
|
|
23138
|
+
}),
|
|
23139
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCImport, 'Import'))
|
|
23140
|
+
}, {
|
|
23141
|
+
label: 'Composite Curve',
|
|
23142
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23143
|
+
url: img$f
|
|
23144
|
+
}),
|
|
23145
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCCompositeCurve, 'Composite Curve'))
|
|
23146
|
+
}, {
|
|
23147
|
+
label: 'Delete Entity',
|
|
23148
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23149
|
+
url: img$g
|
|
23150
|
+
}),
|
|
23151
|
+
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCEntityDeletion, 'Entity Deletion'))
|
|
23152
|
+
}, {
|
|
23153
|
+
type: 'divider'
|
|
23154
|
+
}, {
|
|
23155
|
+
label: 'Expressions',
|
|
23156
|
+
icon: /*#__PURE__*/React__default.createElement(FontSizeOutlined, null),
|
|
23157
|
+
callback: async () => {
|
|
23158
|
+
const gPlugins = getDrawing(drawingId).plugin.refs;
|
|
23159
|
+
const exprPlugin = Object.values(gPlugins).find(p => p.name === 'Expressions');
|
|
23160
|
+
const pApi = getDrawing(drawingId).api.plugin;
|
|
23161
|
+
exprPlugin && pApi.setActiveGlobal(exprPlugin.id, true);
|
|
22867
23162
|
}
|
|
22868
|
-
};
|
|
23163
|
+
}];
|
|
22869
23164
|
};
|
|
22870
23165
|
|
|
22871
|
-
var img$e = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100'
|
|
23166
|
+
var img$e = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black' stroke-width='6'%3e %3crect x='32' y='37' width='36' height='36' fill='%239c9c9c' stroke-linecap='square'/%3e %3cpath d='m50 15v35' fill='none'/%3e %3cpath d='m12 75 33-15' fill='none'/%3e %3cpath d='m88 75-33-15' fill='none'/%3e %3c/g%3e%3c/svg%3e";
|
|
22872
23167
|
|
|
22873
|
-
var img$d = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100'
|
|
23168
|
+
var img$d = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg fill='%239c9c9c'%3e %3crect x='7' y='55' width='86' height='38'/%3e %3crect x='32' y='32' width='36' height='36' stroke='black' stroke-linecap='square' stroke-width='6'/%3e %3cpath d='m10 55h30' stroke='black' stroke-linecap='square' stroke-width='6'/%3e %3cpath d='m90 55h-30' stroke='black' stroke-linecap='square' stroke-width='6'/%3e %3c/g%3e%3c/svg%3e";
|
|
22874
23169
|
|
|
22875
|
-
var img$c = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100'
|
|
23170
|
+
var img$c = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xml:space='preserve' xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath d='m20 50h60' fill='%239c9c9c' stroke='black' stroke-linecap='round' stroke-width='5'/%3e%3crect x='37' y='37' width='26' height='26' fill='%239c9c9c' stroke='black' stroke-linecap='round' stroke-width='5'/%3e%3cpath d='m10 50 10-6v12z' stroke='black' stroke-linecap='square' stroke-width='5'/%3e%3cpath d='m90 50-10-6v12z' stroke='black' stroke-linecap='square' stroke-width='5'/%3e%3crect x='10' y='15' width='80' height='10'/%3e%3crect x='10' y='75' width='80' height='10'/%3e%3c/g%3e%3c/svg%3e";
|
|
22876
23171
|
|
|
22877
|
-
var img$b = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100'
|
|
23172
|
+
var img$b = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black' stroke-linecap='square'%3e %3cellipse cx='50' cy='55' rx='25' ry='15' fill='%239c9c9c' stroke-width='6'/%3e %3cellipse cx='50' cy='55' rx='5' ry='2' stroke-width='6'/%3e %3cpath d='m80.642 74.284a40 30 0 0 1-30.642 10.716 40 30 0 0 1-30.642-10.716' fill='none' stroke-width='6'/%3e %3cpath d='m88.503 63.648-0.82085 11.633-9.8298-6.8829z' stroke-width='4'/%3e %3cpath d='m50 55v-35' stroke-width='5'/%3e %3cpath d='m50 10 6 10h-12z' stroke-width='4'/%3e %3c/g%3e%3c/svg%3e";
|
|
22878
23173
|
|
|
22879
|
-
var img$a = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100'
|
|
23174
|
+
var img$a = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black' stroke-linecap='square' stroke-width='5'%3e %3cpath d='m20 50h60' fill='%239c9c9c'/%3e %3cpath d='m50 20v60' fill='%239c9c9c'/%3e %3crect x='37' y='37' width='26' height='26' fill='%239c9c9c'/%3e %3cpath d='m10 50 10-6v12z'/%3e %3cpath d='m90 50-10-6v12z'/%3e %3cpath d='m50 10-6 10h12z'/%3e %3cpath d='m50 90-6-10h12z'/%3e %3c/g%3e%3c/svg%3e";
|
|
22880
23175
|
|
|
22881
|
-
var img$9 = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100'
|
|
23176
|
+
var img$9 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black'%3e %3cpath d='m81.945 25.927-63.891 48.145' fill='%239c9c9c' stroke-linecap='square' stroke-width='5'/%3e %3cpath d='m85.939 22.918-14.792 3.6336 10.416 7.1764z' stroke-linecap='square' stroke-width='4'/%3e %3cpath d='m14.061 77.082 14.792-3.6336-10.416-7.1764z' stroke-linecap='square' stroke-width='4'/%3e %3cpath d='m18.055 25.927 63.891 48.145' fill='%239c9c9c' stroke-linecap='square' stroke-width='5'/%3e %3cpath d='m14.061 22.918 4.3755 10.81 10.416-7.1764z' stroke-linecap='square' stroke-width='4'/%3e %3cpath d='m85.939 77.082-4.3755-10.81-10.416 7.1764z' stroke-linecap='square' stroke-width='4'/%3e %3cpath d='m30 50 20 15 20-15-20-15z' fill='%239c9c9c' stroke-linecap='square' stroke-width='5'/%3e %3cpath d='m50 50v-35' stroke-linecap='round' stroke-width='5'/%3e %3cpath d='m50 10-6 10h12z' stroke-linecap='square' stroke-width='4'/%3e %3c/g%3e%3c/svg%3e";
|
|
22882
23177
|
|
|
22883
|
-
var img$8 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %
|
|
23178
|
+
var img$8 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black'%3e %3ccircle cx='50' cy='50' r='35' fill='%239c9c9c' stroke-linecap='round' stroke-width='5' style='paint-order:normal'/%3e %3cpath d='m74.749 57.071a35 10 0 0 1-38.143 2.1677 35 10 0 0 1-21.606-9.2388' fill='none' stroke-linecap='round' stroke-width='5'/%3e %3cpath d='m50 85a10 35 0 0 1-9.0631-20.208 10 35 0 0 1 1.4026-37.289' fill='none' stroke-width='5'/%3e %3cpath d='m47.767 19.618 2.3872 16.832-16.914-6.1564z' stroke-width='4' style='paint-order:normal'/%3e %3cpath d='m79.586 52.422-10.675 14.527-6.1564-16.914z' stroke-width='4' style='paint-order:normal'/%3e %3c/g%3e%3c/svg%3e";
|
|
22884
23179
|
|
|
22885
|
-
var img$7 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='
|
|
23180
|
+
var img$7 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg%3e %3cpath d='m66 2-3.8555 9.6367a20 20 0 0 0-4.0879 2.3848l-10.305-1.4863-4 6.9297 6.418 8.1543a20 20 0 0 0-0.16992 2.3809 20 20 0 0 0 0.16992 2.3809l-6.418 8.1543 4 6.9297 10.305-1.4863a20 20 0 0 0 4.0879 2.3848l3.8555 9.6367h8l3.8555-9.6367a20 20 0 0 0 4.0879-2.3848l10.305 1.4863 4-6.9297-6.418-8.1543a20 20 0 0 0 0.16992-2.3809 20 20 0 0 0-0.15039-2.4043l6.3984-8.1309-4-6.9297-10.236 1.4766a20 20 0 0 0-4.1699-2.4062l-3.8418-9.6055h-8z'/%3e %3ccircle cx='70' cy='30' r='10' fill='white'/%3e %3cpath d='m26 42-3.8555 9.6367a20 20 0 0 0-4.0879 2.3848l-10.305-1.4863-4 6.9297 6.418 8.1543a20 20 0 0 0-0.16992 2.3809 20 20 0 0 0 0.16992 2.3809l-6.418 8.1543 4 6.9297 10.305-1.4863a20 20 0 0 0 4.0879 2.3848l3.8555 9.6367h8l3.8555-9.6367a20 20 0 0 0 4.0879-2.3848l10.305 1.4863 4-6.9297-6.418-8.1543a20 20 0 0 0 0.16992-2.3809 20 20 0 0 0-0.15039-2.4043l6.3984-8.1309-4-6.9297-10.236 1.4766a20 20 0 0 0-4.1699-2.4062l-3.8418-9.6055h-8z'/%3e %3ccircle cx='30' cy='70' r='10' fill='white'/%3e %3c/g%3e%3c/svg%3e";
|
|
22886
23181
|
|
|
22887
|
-
var img$6 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %
|
|
23182
|
+
var img$6 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black' stroke-linecap='round'%3e %3crect x='12' y='12' width='76' height='76' fill='none' stroke-width='5.0003'/%3e %3crect x='23' y='55' width='22' height='22' fill='%239c9c9c' stroke-width='5'/%3e %3crect x='55' y='55' width='22' height='22' fill='%239c9c9c' stroke-width='5'/%3e %3crect x='39' y='23' width='22' height='22' fill='%239c9c9c' stroke-width='5.0003'/%3e %3ccircle cx='12' cy='12' r='7' fill='white' stroke-width='5.0003'/%3e %3ccircle cx='88' cy='12' r='7' fill='white' stroke-width='5.0003'/%3e %3ccircle cx='12' cy='88' r='7' fill='white' stroke-width='5.0003'/%3e %3ccircle cx='88' cy='88' r='7' fill='white' stroke-width='5.0003'/%3e %3c/g%3e%3c/svg%3e";
|
|
22888
23183
|
|
|
22889
|
-
var img$5 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='
|
|
23184
|
+
var img$5 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black' stroke-linecap='round' stroke-width='5'%3e %3cpath d='m29 71v-44h44v44z' fill='none'/%3e %3crect x='15' y='60' width='26' height='26' fill='%239c9c9c'/%3e %3crect x='15' y='15' width='26' height='26' fill='white'/%3e %3crect x='60' y='60' width='26' height='26' fill='white'/%3e %3crect x='60' y='15' width='26' height='26' fill='white'/%3e %3c/g%3e%3c/svg%3e";
|
|
22890
23185
|
|
|
22891
|
-
var img$4 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %
|
|
23186
|
+
var img$4 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='100' height='100' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3e %3cg stroke='black' stroke-linecap='round' stroke-width='5'%3e %3cpath d='m50 83a33 33 0 0 1-30.488-20.371 33 33 0 0 1 7.1535-35.963 33 33 0 0 1 35.963-7.1535 33 33 0 0 1 20.371 30.488' fill='none'/%3e %3crect x='68' y='38' width='24' height='24' fill='%239c9c9c'/%3e %3crect x='38' y='8' width='24' height='24' fill='white'/%3e %3crect x='8' y='38' width='24' height='24' fill='white'/%3e %3crect x='38' y='68' width='24' height='24' fill='white'/%3e %3ccircle cx='50' cy='50' r='4'/%3e %3c/g%3e%3c/svg%3e";
|
|
22892
23187
|
|
|
22893
23188
|
const AssemblyModeCmds = (drawingId, rootId) => {
|
|
22894
23189
|
const assemblyApi = ccAPI.assemblyBuilder;
|
|
@@ -22922,98 +23217,89 @@ const AssemblyModeCmds = (drawingId, rootId) => {
|
|
|
22922
23217
|
const addLinearPattern = () => assemblyApi.create3DConstraint(drawingId, rootId, CCClasses.CCLinearPatternConstraint, 'Linear Pattern');
|
|
22923
23218
|
const addCircularPattern = () => assemblyApi.create3DConstraint(drawingId, rootId, CCClasses.CCCircularPatternConstraint, 'Circular Pattern');
|
|
22924
23219
|
const addGear = () => assemblyApi.create3DConstraint(drawingId, rootId, CCClasses.CCGearRelation, 'Gear');
|
|
22925
|
-
return {
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
|
|
22934
|
-
|
|
22935
|
-
|
|
22936
|
-
|
|
22937
|
-
|
|
22938
|
-
|
|
22939
|
-
|
|
22940
|
-
|
|
22941
|
-
|
|
22942
|
-
|
|
22943
|
-
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
},
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
22967
|
-
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
|
|
22971
|
-
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
|
|
22975
|
-
|
|
22976
|
-
|
|
22977
|
-
|
|
22978
|
-
|
|
22979
|
-
|
|
22980
|
-
|
|
22981
|
-
|
|
22982
|
-
|
|
22983
|
-
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
|
-
|
|
22988
|
-
|
|
22989
|
-
|
|
22990
|
-
|
|
22991
|
-
|
|
22992
|
-
|
|
22993
|
-
|
|
22994
|
-
|
|
22995
|
-
|
|
22996
|
-
|
|
22997
|
-
|
|
22998
|
-
|
|
22999
|
-
|
|
23000
|
-
|
|
23001
|
-
|
|
23002
|
-
},
|
|
23003
|
-
Gear: {
|
|
23004
|
-
label: 'Add Gear',
|
|
23005
|
-
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23006
|
-
url: img$7
|
|
23007
|
-
}),
|
|
23008
|
-
callback: wrapper(addGear)
|
|
23009
|
-
}
|
|
23010
|
-
};
|
|
23220
|
+
return [{
|
|
23221
|
+
label: 'Add Fastened Origin',
|
|
23222
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23223
|
+
url: img$e
|
|
23224
|
+
}),
|
|
23225
|
+
callback: wrapper(addFastenedOrigin)
|
|
23226
|
+
}, {
|
|
23227
|
+
label: 'Add Fastened',
|
|
23228
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23229
|
+
url: img$d
|
|
23230
|
+
}),
|
|
23231
|
+
callback: wrapper(addFastened)
|
|
23232
|
+
}, {
|
|
23233
|
+
label: 'Add Slider',
|
|
23234
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23235
|
+
url: img$c
|
|
23236
|
+
}),
|
|
23237
|
+
callback: wrapper(addSlider)
|
|
23238
|
+
}, {
|
|
23239
|
+
label: 'Add Revolute',
|
|
23240
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23241
|
+
url: img$D
|
|
23242
|
+
}),
|
|
23243
|
+
callback: wrapper(addRevolute)
|
|
23244
|
+
}, {
|
|
23245
|
+
label: 'Add Cylindrical',
|
|
23246
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23247
|
+
url: img$b
|
|
23248
|
+
}),
|
|
23249
|
+
callback: wrapper(addCylindrical)
|
|
23250
|
+
}, {
|
|
23251
|
+
label: 'Add Planar',
|
|
23252
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23253
|
+
url: img$a
|
|
23254
|
+
}),
|
|
23255
|
+
callback: wrapper(addPlanar)
|
|
23256
|
+
}, {
|
|
23257
|
+
label: 'Add Parallel',
|
|
23258
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23259
|
+
url: img$9
|
|
23260
|
+
}),
|
|
23261
|
+
callback: wrapper(addParallel)
|
|
23262
|
+
}, {
|
|
23263
|
+
label: 'Add Spherical',
|
|
23264
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23265
|
+
url: img$8
|
|
23266
|
+
}),
|
|
23267
|
+
callback: wrapper(addSpherical)
|
|
23268
|
+
}, {
|
|
23269
|
+
type: 'divider'
|
|
23270
|
+
}, {
|
|
23271
|
+
label: 'Add Group',
|
|
23272
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23273
|
+
url: img$6
|
|
23274
|
+
}),
|
|
23275
|
+
callback: wrapper(addGroup)
|
|
23276
|
+
}, {
|
|
23277
|
+
label: 'Add Linear Pattern',
|
|
23278
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23279
|
+
url: img$5
|
|
23280
|
+
}),
|
|
23281
|
+
callback: wrapper(addLinearPattern)
|
|
23282
|
+
}, {
|
|
23283
|
+
label: 'Add Circular Pattern',
|
|
23284
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23285
|
+
url: img$4
|
|
23286
|
+
}),
|
|
23287
|
+
callback: wrapper(addCircularPattern)
|
|
23288
|
+
}, {
|
|
23289
|
+
type: 'divider'
|
|
23290
|
+
}, {
|
|
23291
|
+
label: 'Add Gear',
|
|
23292
|
+
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
23293
|
+
url: img$7
|
|
23294
|
+
}),
|
|
23295
|
+
callback: wrapper(addGear)
|
|
23296
|
+
}];
|
|
23011
23297
|
};
|
|
23012
23298
|
|
|
23013
23299
|
function useCommands(drawingId, curProductClass) {
|
|
23014
23300
|
const curProdId = useDrawing(drawingId, d => d.structure.currentProduct);
|
|
23015
23301
|
const commands = React__default.useMemo(() => {
|
|
23016
|
-
let res =
|
|
23302
|
+
let res = [];
|
|
23017
23303
|
if (curProductClass && ccUtils.base.isA(curProductClass, CCClasses.CCPart)) {
|
|
23018
23304
|
res = PartModeCmds(drawingId, curProdId);
|
|
23019
23305
|
} else if (curProductClass && ccUtils.base.isA(curProductClass, CCClasses.CCAssembly)) {
|
|
@@ -23089,41 +23375,39 @@ const SubGroup = ({
|
|
|
23089
23375
|
const Item = ({
|
|
23090
23376
|
cmd: cmd
|
|
23091
23377
|
}) => {
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
|
|
23378
|
+
if (Array.isArray(cmd)) {
|
|
23379
|
+
return /*#__PURE__*/React__default.createElement(SubGroup, {
|
|
23380
|
+
commands: cmd
|
|
23381
|
+
});
|
|
23382
|
+
}
|
|
23383
|
+
if (cmd.type === 'divider') {
|
|
23384
|
+
return /*#__PURE__*/React__default.createElement(Divider, {
|
|
23385
|
+
style: {
|
|
23386
|
+
height: '18px',
|
|
23387
|
+
marginBottom: '1px',
|
|
23388
|
+
borderColor: 'rgba(32,32,32,0.5)'
|
|
23389
|
+
},
|
|
23390
|
+
type: "vertical"
|
|
23391
|
+
});
|
|
23392
|
+
}
|
|
23393
|
+
return /*#__PURE__*/React__default.createElement(FButton, {
|
|
23095
23394
|
command: cmd
|
|
23096
23395
|
});
|
|
23097
23396
|
};
|
|
23098
|
-
const skeletonItems = Array(
|
|
23397
|
+
const skeletonItems = Array(12).fill(0);
|
|
23099
23398
|
const ToolBar = ({
|
|
23100
23399
|
drawingId
|
|
23101
23400
|
}) => {
|
|
23102
23401
|
const curProductClass = useDrawing(drawingId, d => {
|
|
23103
23402
|
var _d$structure$tree;
|
|
23104
23403
|
return (_d$structure$tree = d.structure.tree[d.structure.currentProduct]) == null ? void 0 : _d$structure$tree.class;
|
|
23105
|
-
})
|
|
23404
|
+
});
|
|
23106
23405
|
const isDefined = curProductClass !== undefined;
|
|
23107
|
-
const isPart = ccUtils.base.isA(curProductClass, CCClasses.CCPart);
|
|
23108
23406
|
const commands = useCommands(drawingId, curProductClass);
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
exprPlugin && pApi.setActiveGlobal(exprPlugin.id, true);
|
|
23114
|
-
}, [drawingId]);
|
|
23115
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Space, null, isDefined && Object.keys(commands).map(key => /*#__PURE__*/React__default.createElement(Item, {
|
|
23116
|
-
key: key,
|
|
23117
|
-
cmd: commands[key]
|
|
23118
|
-
})), isPart && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Divider, {
|
|
23119
|
-
type: "vertical"
|
|
23120
|
-
}), /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
23121
|
-
title: "Expressions"
|
|
23122
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
23123
|
-
size: "small",
|
|
23124
|
-
icon: /*#__PURE__*/React__default.createElement(FontSizeOutlined, null),
|
|
23125
|
-
onClick: () => enableExpressions()
|
|
23126
|
-
}))), !isDefined && skeletonItems.map((a, i) => /*#__PURE__*/React__default.createElement(Skeleton$1.Avatar, {
|
|
23407
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Space, null, isDefined && commands.map((command, i) => /*#__PURE__*/React__default.createElement(Item, {
|
|
23408
|
+
key: i,
|
|
23409
|
+
cmd: command
|
|
23410
|
+
})), !isDefined && skeletonItems.map((a, i) => /*#__PURE__*/React__default.createElement(Skeleton$1.Avatar, {
|
|
23127
23411
|
key: i,
|
|
23128
23412
|
size: "small",
|
|
23129
23413
|
shape: "square",
|
|
@@ -26149,13 +26433,19 @@ const addProduct = (drawingId, prodId) => {
|
|
|
26149
26433
|
}]).catch(console.warn);
|
|
26150
26434
|
};
|
|
26151
26435
|
const deleteProduct = (drawingId, pluginId, prodId) => {
|
|
26152
|
-
const
|
|
26153
|
-
const
|
|
26436
|
+
const drawing = getDrawing(drawingId);
|
|
26437
|
+
const tree = drawing.structure.tree;
|
|
26438
|
+
const selectedInfo = drawing.interaction.selected || [];
|
|
26439
|
+
const selectedProducts = selectedInfo.map(info => info.objectId).filter(id => {
|
|
26440
|
+
var _tree$id;
|
|
26441
|
+
return ccUtils.base.isA((_tree$id = tree[id]) == null ? void 0 : _tree$id.class, CCClasses.CCProduct);
|
|
26442
|
+
});
|
|
26443
|
+
const ids = selectedProducts.indexOf(prodId) === -1 ? [...selectedProducts, prodId] : selectedProducts;
|
|
26154
26444
|
const idsSorted = ids.sort((a, b) => b - a);
|
|
26155
26445
|
ccAPI.baseModeler.deleteObjects(drawingId, idsSorted).catch(console.warn);
|
|
26446
|
+
drawing.api.interaction.setSelected([]);
|
|
26156
26447
|
getPlugin(drawingId, pluginId).set({
|
|
26157
|
-
product: null
|
|
26158
|
-
selected: []
|
|
26448
|
+
product: null
|
|
26159
26449
|
});
|
|
26160
26450
|
};
|
|
26161
26451
|
function useContextMenuItems(drawingId, pluginId, prodId, setEditName) {
|
|
@@ -26231,16 +26521,18 @@ const Prod = ({
|
|
|
26231
26521
|
return (_d$structure$tree$pro = d.structure.tree[prodId]) == null ? void 0 : _d$structure$tree$pro.name;
|
|
26232
26522
|
});
|
|
26233
26523
|
const isCurrent = useDrawing(drawingId, d => d.structure.currentProduct === prodId);
|
|
26234
|
-
const
|
|
26235
|
-
|
|
26524
|
+
const {
|
|
26525
|
+
isGSelected,
|
|
26526
|
+
handlers
|
|
26527
|
+
} = useTreeObjInteraction(drawingId, prodId);
|
|
26528
|
+
const onTreeObjClick = handlers.onClick;
|
|
26236
26529
|
const onClick = React__default.useCallback(e => {
|
|
26530
|
+
onTreeObjClick(e);
|
|
26237
26531
|
const set = getPlugin(drawingId, pluginId).set;
|
|
26238
|
-
|
|
26239
|
-
|
|
26240
|
-
|
|
26241
|
-
|
|
26242
|
-
}));
|
|
26243
|
-
}, [drawingId, pluginId, prodId]);
|
|
26532
|
+
set({
|
|
26533
|
+
product: prodId
|
|
26534
|
+
});
|
|
26535
|
+
}, [drawingId, pluginId, prodId, onTreeObjClick]);
|
|
26244
26536
|
const [rename, setRename] = React__default.useState(false);
|
|
26245
26537
|
const menuItems = useContextMenuItems(drawingId, pluginId, prodId, setRename);
|
|
26246
26538
|
const menuHeaderName = type === 'part' ? 'Part product' : 'Assembly product';
|
|
@@ -26280,7 +26572,7 @@ const Prod = ({
|
|
|
26280
26572
|
height: '32px',
|
|
26281
26573
|
minWidth: '0px'
|
|
26282
26574
|
},
|
|
26283
|
-
hovered:
|
|
26575
|
+
hovered: isGSelected || isContextMenuActive,
|
|
26284
26576
|
onClick: onClick,
|
|
26285
26577
|
onContextMenu: onContextMenu
|
|
26286
26578
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -26368,16 +26660,14 @@ const ProdList = ({
|
|
|
26368
26660
|
return () => {
|
|
26369
26661
|
const plugin = getPlugin(drawingId, pluginId);
|
|
26370
26662
|
plugin && plugin.set({
|
|
26371
|
-
product: null
|
|
26372
|
-
selected: []
|
|
26663
|
+
product: null
|
|
26373
26664
|
});
|
|
26374
26665
|
};
|
|
26375
26666
|
}, [drawingId, pluginId]);
|
|
26376
26667
|
const keyHandler = React__default.useCallback(e => {
|
|
26377
26668
|
if (e.key === 'Escape') {
|
|
26378
26669
|
set({
|
|
26379
|
-
product: null
|
|
26380
|
-
selected: []
|
|
26670
|
+
product: null
|
|
26381
26671
|
});
|
|
26382
26672
|
}
|
|
26383
26673
|
}, [set]);
|
|
@@ -26385,6 +26675,11 @@ const ProdList = ({
|
|
|
26385
26675
|
window.addEventListener('keydown', keyHandler);
|
|
26386
26676
|
return () => window.removeEventListener('keydown', keyHandler);
|
|
26387
26677
|
}, [keyHandler]);
|
|
26678
|
+
const createInfo_ = React__default.useCallback(objId => {
|
|
26679
|
+
return createInfo({
|
|
26680
|
+
objectId: objId
|
|
26681
|
+
});
|
|
26682
|
+
}, []);
|
|
26388
26683
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
26389
26684
|
style: {
|
|
26390
26685
|
minHeight: '145px',
|
|
@@ -26392,13 +26687,17 @@ const ProdList = ({
|
|
|
26392
26687
|
paddingLeft: '8px',
|
|
26393
26688
|
paddingRight: '8px'
|
|
26394
26689
|
}
|
|
26690
|
+
}, /*#__PURE__*/React__default.createElement(MultiSelect, {
|
|
26691
|
+
drawingId: drawingId,
|
|
26692
|
+
items: prodIds,
|
|
26693
|
+
createInfo: createInfo_
|
|
26395
26694
|
}, prodIds.map(prodId => /*#__PURE__*/React__default.createElement(Prod, {
|
|
26396
26695
|
key: prodId,
|
|
26397
26696
|
drawingId: drawingId,
|
|
26398
26697
|
pluginId: pluginId,
|
|
26399
26698
|
prodId: prodId,
|
|
26400
26699
|
type: type
|
|
26401
|
-
})), createMode && /*#__PURE__*/React__default.createElement(NewProd, {
|
|
26700
|
+
}))), createMode && /*#__PURE__*/React__default.createElement(NewProd, {
|
|
26402
26701
|
drawingId: drawingId,
|
|
26403
26702
|
setCreateMode: setCreateMode,
|
|
26404
26703
|
type: type
|