feat(bim): integrate portable IFC viewer, project map and prepared layers
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import {ArchitecturalProjectsWorkspace} from "./data/ArchitecturalProjectsWorkspace";
|
||||
import {SpatialWorkspace} from "./spatial/SpatialWorkspace";
|
||||
import { PlanningSpatialWorkspace } from "./missions/PlanningSpatialWorkspace";
|
||||
import { MissionPlannerWorkspace } from "./missions/MissionPlannerWorkspace";
|
||||
@@ -451,6 +452,8 @@ export function WorkspaceRenderer(props: WorkspaceRendererProps) {
|
||||
return <ComputeModulesWorkspace />;
|
||||
case "network-monitor":
|
||||
return <NetworkWorkspace />;
|
||||
case "architectural-projects":
|
||||
return <ArchitecturalProjectsWorkspace />;
|
||||
case "datasets":
|
||||
return <DatasetGatewayWorkspace />;
|
||||
case "artifact-health":
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import {lazy, Suspense, useCallback, useMemo, useState, type ComponentProps} from 'react';
|
||||
import {Description, ToastStack} from '@nodedc/ui-react';
|
||||
import type {BimHost, Notice} from '@nodedc/bim-viewer';
|
||||
import fragmentsWorker from '@nodedc/bim-viewer/fragments-worker?url';
|
||||
import mapWorker from '@nodedc/bim-viewer/map-worker?url';
|
||||
type NotificationMessage = ComponentProps<typeof ToastStack>['items'][number];
|
||||
|
||||
const Workspace = lazy(async () => {
|
||||
const module = await import('@nodedc/bim-viewer');
|
||||
await import('@nodedc/bim-viewer/style.css');
|
||||
return {default: module.BimWorkspace};
|
||||
});
|
||||
|
||||
/** Host composition only: the module owns its catalog, intake, maps and renderer. */
|
||||
export function ArchitecturalProjectsWorkspace() {
|
||||
const [toasts, setToasts] = useState<NotificationMessage[]>([]);
|
||||
const notify = useCallback((notice: Notice) => {
|
||||
setToasts(items => [...items, {...notice, id: 'bim:' + crypto.randomUUID()}].slice(-5));
|
||||
}, []);
|
||||
const host = useMemo<BimHost>(() => ({
|
||||
apiBase: '/api/v1/bim', assets: {fragmentsWorker, mapWorker}, notify,
|
||||
}), [notify]);
|
||||
return <>
|
||||
<Suspense fallback={<Description role="status">Открываем архитектурные проекты…</Description>}>
|
||||
<Workspace host={host}/>
|
||||
</Suspense>
|
||||
<ToastStack items={toasts} onDismiss={id => setToasts(items => items.filter(item => item.id !== id))}/>
|
||||
</>;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
declare module '@nodedc/bim-viewer/fragments-worker?url' { const url: string; export default url; }
|
||||
declare module '@nodedc/bim-viewer/map-worker?url' { const url: string; export default url; }
|
||||
declare module '@nodedc/bim-viewer/style.css';
|
||||
Reference in New Issue
Block a user