@pascal-app/editor 0.9.2 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -7
- package/src/components/editor/bake-exporter.tsx +3 -1
- package/src/components/editor/bake-thumbnail.tsx +95 -0
- package/src/components/editor/camera-dragging-lifecycle.test.ts +49 -0
- package/src/components/editor/camera-dragging-lifecycle.ts +41 -0
- package/src/components/editor/custom-camera-controls.tsx +307 -212
- package/src/components/editor/delete-confirmation-dialog.tsx +54 -0
- package/src/components/editor/elevation-3d-guide-layer.tsx +120 -0
- package/src/components/editor/first-person/build-collider-world.test.ts +66 -2
- package/src/components/editor/first-person/build-collider-world.ts +20 -0
- package/src/components/editor/first-person/terrain-collider.test.ts +132 -0
- package/src/components/editor/first-person/terrain-collider.ts +212 -0
- package/src/components/editor/first-person-controls.tsx +295 -132
- package/src/components/editor/floating-action-menu.tsx +59 -65
- package/src/components/editor/floorplan-background-selection.test.ts +16 -2
- package/src/components/editor/floorplan-background-selection.ts +4 -18
- package/src/components/editor/floorplan-camera-sync.test.ts +249 -0
- package/src/components/editor/floorplan-camera-sync.ts +213 -0
- package/src/components/editor/floorplan-mode-coordinator.tsx +82 -0
- package/src/components/editor/floorplan-navigation-presentation.test.ts +142 -0
- package/src/components/editor/floorplan-navigation-presentation.ts +156 -0
- package/src/components/editor/floorplan-panel.tsx +931 -861
- package/src/components/editor/group-actions.ts +155 -15
- package/src/components/editor/group-floating-action-menu.tsx +1 -1
- package/src/components/editor/group-rotate-handle.tsx +1 -1
- package/src/components/editor/group-selection-box-3d.tsx +1 -1
- package/src/components/editor/handles/handle-drag-history.test.ts +96 -0
- package/src/components/editor/handles/handle-drag-history.ts +14 -0
- package/src/components/editor/handles/preview-overrides.test.ts +26 -0
- package/src/components/editor/handles/preview-overrides.ts +13 -0
- package/src/components/editor/handles/resize-snap.test.ts +52 -0
- package/src/components/editor/handles/resize-snap.ts +23 -0
- package/src/components/editor/handles/use-handle-drag.ts +17 -7
- package/src/components/editor/index.tsx +42 -9
- package/src/components/editor/measurement-pill.tsx +6 -1
- package/src/components/editor/node-arrow-handles.tsx +51 -15
- package/src/components/editor/quick-measurement-card.tsx +9 -3
- package/src/components/editor/quick-measurement-hud.tsx +7 -1
- package/src/components/editor/selection-manager.tsx +3 -1
- package/src/components/editor/site-edge-labels.tsx +24 -2
- package/src/components/editor/snapshot-capture-overlay.tsx +4 -1
- package/src/components/editor/thumbnail-generator.tsx +66 -294
- package/src/components/editor/use-floorplan-hit-testing.test.ts +82 -0
- package/src/components/editor/use-floorplan-hit-testing.ts +144 -161
- package/src/components/editor/use-mesh-settle-epoch.ts +1 -0
- package/src/components/editor/wall-measurement-label.tsx +8 -16
- package/src/components/editor/wall-move-side-handles.tsx +193 -18
- package/src/components/editor/wall-opening-highlights.tsx +63 -32
- package/src/components/editor/wall-snap-beacon-layer.tsx +6 -4
- package/src/components/editor-2d/floorplan-alignment-guide-layer.tsx +2 -1
- package/src/components/editor-2d/floorplan-cursor-indicator-overlay.tsx +39 -8
- package/src/components/editor-2d/floorplan-cursor-indicator-position.test.ts +31 -0
- package/src/components/editor-2d/floorplan-cursor-indicator-position.ts +39 -0
- package/src/components/editor-2d/floorplan-group-move.tsx +47 -4
- package/src/components/editor-2d/floorplan-measurement-tool-layer.tsx +21 -5
- package/src/components/editor-2d/floorplan-registered-tool-layer.tsx +72 -0
- package/src/components/editor-2d/floorplan-registry-action-menu.tsx +93 -59
- package/src/components/editor-2d/floorplan-registry-move-overlay.tsx +27 -0
- package/src/components/editor-2d/floorplan-render-context.test.ts +27 -0
- package/src/components/editor-2d/floorplan-render-context.tsx +113 -8
- package/src/components/editor-2d/renderers/floorplan-annotation-layout.test.ts +285 -0
- package/src/components/editor-2d/renderers/floorplan-annotation-layout.ts +516 -0
- package/src/components/editor-2d/renderers/floorplan-dimension-renderer.test.tsx +236 -0
- package/src/components/editor-2d/renderers/floorplan-dimension-renderer.tsx +618 -0
- package/src/components/editor-2d/renderers/floorplan-geometry-renderer.test.tsx +369 -0
- package/src/components/editor-2d/renderers/floorplan-geometry-renderer.tsx +431 -32
- package/src/components/editor-2d/renderers/floorplan-label-angle.test.ts +75 -1
- package/src/components/editor-2d/renderers/floorplan-label-angle.ts +92 -0
- package/src/components/editor-2d/renderers/floorplan-placement-preview-layer.tsx +93 -28
- package/src/components/editor-2d/renderers/floorplan-registry-layer.test.ts +279 -0
- package/src/components/editor-2d/renderers/floorplan-registry-layer.tsx +621 -281
- package/src/components/editor-2d/renderers/floorplan-stair-layer.tsx +20 -10
- package/src/components/systems/ceiling/ceiling-selection-affordance-system.tsx +12 -7
- package/src/components/tools/fence/fence-drafting.ts +27 -0
- package/src/components/tools/item/use-draft-node.ts +131 -72
- package/src/components/tools/item/use-placement-coordinator.tsx +52 -4
- package/src/components/tools/registry/move-registry-node-tool.tsx +75 -4
- package/src/components/tools/roof/roof-tool.tsx +16 -0
- package/src/components/tools/shared/floor-stack-preview.ts +4 -0
- package/src/components/tools/shared/horizontal-construction-plane.ts +123 -0
- package/src/components/tools/shared/pointer-support-cap.test.ts +98 -0
- package/src/components/tools/shared/pointer-support-cap.ts +273 -0
- package/src/components/tools/site/site-boundary-editor.tsx +13 -6
- package/src/components/tools/site/stroke-pointer-ownership.test.ts +91 -0
- package/src/components/tools/site/stroke-pointer-ownership.ts +57 -0
- package/src/components/tools/site/terrain-brush-cursor.tsx +247 -0
- package/src/components/tools/site/terrain-sculpt-grid.tsx +192 -0
- package/src/components/tools/site/terrain-sculpt-tool.tsx +356 -0
- package/src/components/tools/stair/stair-click-guard.test.ts +58 -0
- package/src/components/tools/stair/stair-click-guard.ts +72 -0
- package/src/components/tools/stair/stair-tool.tsx +98 -47
- package/src/components/tools/tool-manager.tsx +67 -9
- package/src/components/tools/wall/wall-drafting.test.ts +118 -1
- package/src/components/tools/wall/wall-drafting.ts +128 -9
- package/src/components/tools/wall/wall-snap-geometry.test.ts +8 -0
- package/src/components/tools/wall/wall-snap-geometry.ts +70 -3
- package/src/components/tools/zone/zone-tool.tsx +16 -0
- package/src/components/ui/action-menu/control-modes.tsx +4 -1
- package/src/components/ui/action-menu/measurement-control.tsx +107 -28
- package/src/components/ui/command-palette/editor-commands.tsx +14 -1
- package/src/components/ui/controls/material-paint-panel.tsx +7 -1
- package/src/components/ui/controls/material-picker.tsx +86 -7
- package/src/components/ui/controls/terrain-sculpt-panel.tsx +193 -0
- package/src/components/ui/floating-level-selector.tsx +73 -19
- package/src/components/ui/helpers/helper-manager.tsx +46 -0
- package/src/components/ui/panels/multi-selection-panel.tsx +57 -0
- package/src/components/ui/panels/panel-manager.tsx +14 -1
- package/src/components/ui/panels/parametric-inspector.tsx +4 -2
- package/src/components/ui/panels/selection-breakdown.test.ts +24 -0
- package/src/components/ui/panels/selection-breakdown.ts +20 -0
- package/src/components/ui/sidebar/panels/settings-panel/index.tsx +14 -4
- package/src/components/ui/sidebar/panels/settings-panel/keyboard-shortcuts-dialog.tsx +16 -0
- package/src/components/ui/sidebar/panels/site-panel/building-tree-node.tsx +2 -1
- package/src/components/ui/sidebar/panels/site-panel/index.tsx +2 -0
- package/src/components/viewer/viewer-controls-bar.tsx +466 -0
- package/src/components/viewer/viewer-scene-header.tsx +235 -0
- package/src/components/viewer-overlay.tsx +20 -655
- package/src/components/walkthrough-hud.tsx +111 -0
- package/src/hooks/use-grid-events.ts +24 -0
- package/src/hooks/use-keyboard.ts +53 -30
- package/src/index.tsx +137 -4
- package/src/lib/active-placement-surface.test.ts +24 -0
- package/src/lib/active-placement-surface.ts +8 -1
- package/src/lib/camera-pose.test.ts +237 -0
- package/src/lib/camera-pose.ts +172 -0
- package/src/lib/direct-manipulation.test.ts +83 -0
- package/src/lib/direct-manipulation.ts +9 -0
- package/src/lib/door-interaction.ts +1 -1
- package/src/lib/elevation-guides.test.ts +107 -0
- package/src/lib/elevation-guides.ts +236 -0
- package/src/lib/floorplan/annotation-visibility.test.ts +327 -0
- package/src/lib/floorplan/annotation-visibility.ts +133 -0
- package/src/lib/floorplan/drawing-coordination.test.ts +46 -0
- package/src/lib/floorplan/drawing-coordination.ts +13 -0
- package/src/lib/floorplan/floorplan-export.test.ts +319 -0
- package/src/lib/floorplan/floorplan-export.tsx +745 -131
- package/src/lib/floorplan/floorplan-extension.test.ts +43 -0
- package/src/lib/floorplan/floorplan-extension.ts +181 -0
- package/src/lib/floorplan/floorplan-mode.test.ts +120 -0
- package/src/lib/floorplan/floorplan-mode.ts +73 -0
- package/src/lib/floorplan/floorplan-pdfkit-document.ts +194 -0
- package/src/lib/floorplan/floorplan-pdfkit-renderer.test.ts +107 -0
- package/src/lib/floorplan/floorplan-pdfkit-renderer.ts +680 -0
- package/src/lib/floorplan/geometry.ts +2 -3
- package/src/lib/fresh-planar-placement.test.ts +44 -1
- package/src/lib/fresh-planar-placement.ts +21 -4
- package/src/lib/glb-export.test.ts +116 -1
- package/src/lib/glb-export.ts +204 -7
- package/src/lib/ground-surface.ts +95 -0
- package/src/lib/history.test.ts +96 -0
- package/src/lib/history.ts +22 -0
- package/src/lib/interaction/overlay-policy.test.ts +2 -1
- package/src/lib/interaction/scope.ts +40 -8
- package/src/lib/level-duplication.test.ts +2 -1
- package/src/lib/measurements.test.ts +5 -0
- package/src/lib/measurements.ts +12 -1
- package/src/lib/quick-action-feedback.ts +33 -0
- package/src/lib/quick-action-nodes.test.ts +94 -0
- package/src/lib/quick-action-nodes.ts +47 -0
- package/src/lib/scene-clipboard.test.ts +130 -1
- package/src/lib/scene-clipboard.ts +237 -13
- package/src/lib/selection-routing.test.ts +16 -1
- package/src/lib/selection-routing.ts +5 -0
- package/src/lib/sfx-bus.ts +33 -2
- package/src/lib/sfx-player.test.ts +148 -6
- package/src/lib/sfx-player.ts +156 -8
- package/src/lib/site-boundary.test.ts +53 -0
- package/src/lib/site-boundary.ts +27 -0
- package/src/lib/snapping-mode.test.ts +29 -2
- package/src/lib/snapping-mode.ts +15 -3
- package/src/lib/stair-duplication.test.ts +103 -0
- package/src/lib/stair-duplication.ts +57 -85
- package/src/lib/stair-levels.ts +2 -0
- package/src/lib/terrain-sculpt.test.ts +429 -0
- package/src/lib/terrain-sculpt.ts +301 -0
- package/src/lib/terrain-verb-color.test.ts +51 -0
- package/src/lib/terrain-verb-color.ts +58 -0
- package/src/lib/touch-gesture-priority.test.ts +45 -0
- package/src/lib/touch-gesture-priority.ts +30 -0
- package/src/lib/window-interaction.ts +1 -1
- package/src/store/camera-pose-store.test.ts +29 -0
- package/src/store/camera-pose-store.ts +27 -0
- package/src/store/live-draft-preview-stores.test.ts +136 -0
- package/src/store/navigation-sync-pose-store.test.ts +34 -0
- package/src/store/navigation-sync-pose-store.ts +27 -0
- package/src/store/terrain-sculpt-mode.test.ts +223 -0
- package/src/store/use-delete-confirmation.ts +27 -0
- package/src/store/use-drawing-view.test.ts +23 -0
- package/src/store/use-drawing-view.ts +84 -0
- package/src/store/use-editor.tsx +184 -15
- package/src/store/use-elevation-guides.ts +40 -0
- package/src/store/use-fence-curve-draft.ts +38 -8
- package/src/store/use-first-person-hud.ts +40 -0
- package/src/store/use-floorplan-annotation-visibility.ts +60 -0
- package/src/store/use-floorplan-draft-preview.ts +54 -4
- package/src/store/use-floorplan-mode.ts +110 -0
- package/src/store/use-interaction-scope.test.ts +23 -3
- package/src/store/use-interaction-scope.ts +8 -0
- package/src/store/use-measurement-draft.test.ts +29 -0
- package/src/store/use-measurement-draft.ts +33 -6
- package/src/store/use-path-draft-preview.ts +90 -0
- package/src/store/use-stair-build-preview.ts +12 -2
- package/src/lib/floorplan/selection-tool.ts +0 -271
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
CeilingNode,
|
|
3
|
-
ColumnNode,
|
|
4
|
-
DoorNode,
|
|
5
|
-
ElevatorNode,
|
|
6
|
-
ItemNode,
|
|
7
|
-
Point2D,
|
|
8
|
-
RoofNode,
|
|
9
|
-
RoofSegmentNode,
|
|
10
|
-
SlabNode,
|
|
11
|
-
StairNode,
|
|
12
|
-
WallNode,
|
|
13
|
-
WindowNode,
|
|
14
|
-
} from '@pascal-app/core'
|
|
15
|
-
import {
|
|
16
|
-
doesPolygonIntersectSelectionBounds,
|
|
17
|
-
getDistanceToWallSegment,
|
|
18
|
-
isPointInsidePolygon,
|
|
19
|
-
isPointInsidePolygonWithHoles,
|
|
20
|
-
} from './geometry'
|
|
21
|
-
import type { FloorplanSelectionBounds } from './types'
|
|
22
|
-
|
|
23
|
-
type OpeningNode = WindowNode | DoorNode
|
|
24
|
-
|
|
25
|
-
type OpeningPolygonEntry = {
|
|
26
|
-
opening: OpeningNode
|
|
27
|
-
polygon: Point2D[]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
type ItemEntry = {
|
|
31
|
-
item: ItemNode
|
|
32
|
-
polygon: Point2D[]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
type StairEntry = {
|
|
36
|
-
hitPolygons: Point2D[][]
|
|
37
|
-
stair: StairNode
|
|
38
|
-
segments: Array<{ polygon: Point2D[] }>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
type WallEntry = {
|
|
42
|
-
wall: WallNode
|
|
43
|
-
polygon: Point2D[]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
type SlabEntry = {
|
|
47
|
-
slab: SlabNode
|
|
48
|
-
polygon: Point2D[]
|
|
49
|
-
holes: Point2D[][]
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type CeilingEntry = {
|
|
53
|
-
ceiling: CeilingNode
|
|
54
|
-
polygon: Point2D[]
|
|
55
|
-
holes: Point2D[][]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type ColumnEntry = {
|
|
59
|
-
column: ColumnNode
|
|
60
|
-
polygon: Point2D[]
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
type ElevatorEntry = {
|
|
64
|
-
elevator: ElevatorNode
|
|
65
|
-
polygon: Point2D[]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
type RoofEntry = {
|
|
69
|
-
roof: RoofNode
|
|
70
|
-
segments: Array<{
|
|
71
|
-
polygon: Point2D[]
|
|
72
|
-
segment: RoofSegmentNode
|
|
73
|
-
}>
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
type FloorplanSelectionToolContext = {
|
|
77
|
-
point: Point2D
|
|
78
|
-
phase: 'site' | 'structure' | 'furnish'
|
|
79
|
-
isItemContextActive: boolean
|
|
80
|
-
items: ItemEntry[]
|
|
81
|
-
openings: OpeningPolygonEntry[]
|
|
82
|
-
stairs: StairEntry[]
|
|
83
|
-
walls: WallEntry[]
|
|
84
|
-
slabs: SlabEntry[]
|
|
85
|
-
ceilings: CeilingEntry[]
|
|
86
|
-
columns: ColumnEntry[]
|
|
87
|
-
elevators: ElevatorEntry[]
|
|
88
|
-
roofs: RoofEntry[]
|
|
89
|
-
openingHitTolerance: number
|
|
90
|
-
wallHitTolerance: number
|
|
91
|
-
getOpeningCenterLine: (polygon: Point2D[]) => { start: Point2D; end: Point2D } | null
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function getItemHitId(context: FloorplanSelectionToolContext) {
|
|
95
|
-
if (!context.isItemContextActive) {
|
|
96
|
-
return null
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const itemHit = context.items.find(({ polygon }) => isPointInsidePolygon(context.point, polygon))
|
|
100
|
-
return itemHit?.item.id ?? null
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function getStairHitPolygons(stair: StairEntry) {
|
|
104
|
-
return stair.hitPolygons.length > 0
|
|
105
|
-
? stair.hitPolygons
|
|
106
|
-
: stair.segments.map(({ polygon }) => polygon)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export function getFloorplanHitNodeId(context: FloorplanSelectionToolContext) {
|
|
110
|
-
if (context.phase === 'structure') {
|
|
111
|
-
const openingHit = context.openings.find(({ polygon }) => {
|
|
112
|
-
if (isPointInsidePolygon(context.point, polygon)) {
|
|
113
|
-
return true
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const centerLine = context.getOpeningCenterLine(polygon)
|
|
117
|
-
if (!centerLine) {
|
|
118
|
-
return false
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
getDistanceToWallSegment(
|
|
123
|
-
context.point,
|
|
124
|
-
[centerLine.start.x, centerLine.start.y],
|
|
125
|
-
[centerLine.end.x, centerLine.end.y],
|
|
126
|
-
) <= context.openingHitTolerance
|
|
127
|
-
)
|
|
128
|
-
})
|
|
129
|
-
if (openingHit) {
|
|
130
|
-
return openingHit.opening.id
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const stairHit = context.stairs.find((stair) =>
|
|
134
|
-
getStairHitPolygons(stair).some((polygon) => isPointInsidePolygon(context.point, polygon)),
|
|
135
|
-
)
|
|
136
|
-
if (stairHit) {
|
|
137
|
-
return stairHit.stair.id
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const elevatorHit = context.elevators.find(({ polygon }) =>
|
|
141
|
-
isPointInsidePolygon(context.point, polygon),
|
|
142
|
-
)
|
|
143
|
-
if (elevatorHit) {
|
|
144
|
-
return elevatorHit.elevator.id
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const columnHit = context.columns.find(({ polygon }) =>
|
|
148
|
-
isPointInsidePolygon(context.point, polygon),
|
|
149
|
-
)
|
|
150
|
-
if (columnHit) {
|
|
151
|
-
return columnHit.column.id
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const wallHit = context.walls.find(
|
|
155
|
-
({ wall, polygon }) =>
|
|
156
|
-
isPointInsidePolygon(context.point, polygon) ||
|
|
157
|
-
getDistanceToWallSegment(context.point, wall.start, wall.end) <= context.wallHitTolerance,
|
|
158
|
-
)
|
|
159
|
-
if (wallHit) {
|
|
160
|
-
return wallHit.wall.id
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const roofHit = context.roofs.find(({ segments }) =>
|
|
164
|
-
segments.some(({ polygon }) => isPointInsidePolygon(context.point, polygon)),
|
|
165
|
-
)
|
|
166
|
-
if (roofHit) {
|
|
167
|
-
return roofHit.roof.id
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const ceilingHit = context.ceilings.find(({ polygon, holes }) =>
|
|
171
|
-
isPointInsidePolygonWithHoles(context.point, polygon, holes),
|
|
172
|
-
)
|
|
173
|
-
if (ceilingHit) {
|
|
174
|
-
return ceilingHit.ceiling.id
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const slabHit = context.slabs.find(({ polygon, holes }) =>
|
|
178
|
-
isPointInsidePolygonWithHoles(context.point, polygon, holes),
|
|
179
|
-
)
|
|
180
|
-
if (slabHit) {
|
|
181
|
-
return slabHit.slab.id
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return getItemHitId(context)
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
type FloorplanSelectionBoundsContext = {
|
|
189
|
-
bounds: FloorplanSelectionBounds
|
|
190
|
-
phase: 'site' | 'structure' | 'furnish'
|
|
191
|
-
isItemContextActive: boolean
|
|
192
|
-
items: ItemEntry[]
|
|
193
|
-
walls: WallEntry[]
|
|
194
|
-
openings: OpeningPolygonEntry[]
|
|
195
|
-
slabs: SlabEntry[]
|
|
196
|
-
ceilings: CeilingEntry[]
|
|
197
|
-
columns: ColumnEntry[]
|
|
198
|
-
elevators: ElevatorEntry[]
|
|
199
|
-
stairs: StairEntry[]
|
|
200
|
-
roofs: RoofEntry[]
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export function getFloorplanSelectionIdsInBounds({
|
|
204
|
-
bounds,
|
|
205
|
-
phase,
|
|
206
|
-
isItemContextActive,
|
|
207
|
-
items,
|
|
208
|
-
walls,
|
|
209
|
-
openings,
|
|
210
|
-
slabs,
|
|
211
|
-
ceilings,
|
|
212
|
-
columns,
|
|
213
|
-
elevators,
|
|
214
|
-
stairs,
|
|
215
|
-
roofs,
|
|
216
|
-
}: FloorplanSelectionBoundsContext) {
|
|
217
|
-
const itemIds = isItemContextActive
|
|
218
|
-
? items
|
|
219
|
-
.filter(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds))
|
|
220
|
-
.map(({ item }) => item.id)
|
|
221
|
-
: []
|
|
222
|
-
|
|
223
|
-
if (phase !== 'structure') {
|
|
224
|
-
return itemIds
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const wallIds = walls
|
|
228
|
-
.filter(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds))
|
|
229
|
-
.map(({ wall }) => wall.id)
|
|
230
|
-
const openingIds = openings
|
|
231
|
-
.filter(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds))
|
|
232
|
-
.map(({ opening }) => opening.id)
|
|
233
|
-
const slabIds = slabs
|
|
234
|
-
.filter(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds))
|
|
235
|
-
.map(({ slab }) => slab.id)
|
|
236
|
-
const ceilingIds = ceilings
|
|
237
|
-
.filter(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds))
|
|
238
|
-
.map(({ ceiling }) => ceiling.id)
|
|
239
|
-
const columnIds = columns
|
|
240
|
-
.filter(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds))
|
|
241
|
-
.map(({ column }) => column.id)
|
|
242
|
-
const elevatorIds = elevators
|
|
243
|
-
.filter(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds))
|
|
244
|
-
.map(({ elevator }) => elevator.id)
|
|
245
|
-
const stairIds = stairs
|
|
246
|
-
.filter((stair) =>
|
|
247
|
-
getStairHitPolygons(stair).some((polygon) =>
|
|
248
|
-
doesPolygonIntersectSelectionBounds(polygon, bounds),
|
|
249
|
-
),
|
|
250
|
-
)
|
|
251
|
-
.map(({ stair }) => stair.id)
|
|
252
|
-
const roofIds = roofs
|
|
253
|
-
.filter(({ segments }) =>
|
|
254
|
-
segments.some(({ polygon }) => doesPolygonIntersectSelectionBounds(polygon, bounds)),
|
|
255
|
-
)
|
|
256
|
-
.map(({ roof }) => roof.id)
|
|
257
|
-
|
|
258
|
-
return Array.from(
|
|
259
|
-
new Set([
|
|
260
|
-
...itemIds,
|
|
261
|
-
...wallIds,
|
|
262
|
-
...openingIds,
|
|
263
|
-
...slabIds,
|
|
264
|
-
...ceilingIds,
|
|
265
|
-
...columnIds,
|
|
266
|
-
...elevatorIds,
|
|
267
|
-
...stairIds,
|
|
268
|
-
...roofIds,
|
|
269
|
-
]),
|
|
270
|
-
)
|
|
271
|
-
}
|