3d tooltip

This commit is contained in:
iv_vuytsik
2025-12-05 00:17:21 +03:00
parent 2456f21929
commit 60e8ef921d
18 changed files with 382 additions and 50 deletions

View File

@@ -21,12 +21,17 @@ export default function Home() {
setError(errorMessage)
}
const handleSelectModel = (path: string) => {
console.log('Model selected:', path)
}
return (
<div className="relative h-screen">
<ModelViewer
modelPath="/models/your_model_name.gltf" //пока что передаем модель через navigation page
onModelLoaded={handleModelLoaded}
onError={handleError}
onSelectModel={handleSelectModel}
/>
{error && (

View File

@@ -261,7 +261,6 @@ const NavigationPage: React.FC = () => {
<div className="absolute left-0 top-[73px] bottom-0 bg-[#161824] border-r border-gray-700 z-20 w-[500px]">
<div className="h-full overflow-auto p-4">
<Monitoring
objectId={objectId || undefined}
onClose={closeMonitoring}
onSelectModel={(path) => {
console.log('[NavigationPage] Model selected:', path);
@@ -416,7 +415,14 @@ const NavigationPage: React.FC = () => {
</div>
) : (
<ModelViewer
key={selectedModelPath || 'no-model'}
modelPath={selectedModelPath}
onSelectModel={(path) => {
console.log('[NavigationPage] Model selected:', path);
setSelectedModelPath(path)
setModelError(null)
setIsModelReady(false)
}}
onModelLoaded={handleModelLoaded}
onError={handleModelError}
focusSensorId={selectedDetector?.serial_number ?? selectedAlert?.detector_id?.toString() ?? null}

View File

@@ -54,6 +54,7 @@ export interface NavigationStore {
currentObject: { id: string | undefined; title: string | undefined }
navigationHistory: string[]
currentSubmenu: string | null
currentModelPath: string | null
showMonitoring: boolean
showFloorNavigation: boolean
@@ -72,6 +73,7 @@ export interface NavigationStore {
clearCurrentObject: () => void
addToHistory: (path: string) => void
goBack: () => string | null
setCurrentModelPath: (path: string) => void
setCurrentSubmenu: (submenu: string | null) => void
clearSubmenu: () => void
@@ -86,8 +88,7 @@ export interface NavigationStore {
closeListOfDetectors: () => void
openSensors: () => void
closeSensors: () => void
// Close all menus and submenus
closeAllMenus: () => void
setSelectedDetector: (detector: DetectorType | null) => void
@@ -100,6 +101,7 @@ export interface NavigationStore {
isOnNavigationPage: () => boolean
getCurrentRoute: () => string | null
getActiveSidebarItem: () => number
PREFERRED_MODEL: string
}
const useNavigationStore = create<NavigationStore>()(
@@ -111,6 +113,7 @@ const useNavigationStore = create<NavigationStore>()(
},
navigationHistory: [],
currentSubmenu: null,
currentModelPath: null,
showMonitoring: false,
showFloorNavigation: false,
@@ -124,6 +127,8 @@ const useNavigationStore = create<NavigationStore>()(
showNotificationDetectorInfo: false,
selectedAlert: null,
showAlertMenu: false,
PREFERRED_MODEL: 'AerBIM-Monitor_ASM-HT-Viewer_Expo2017Astana_20250910',
setCurrentObject: (id: string | undefined, title: string | undefined) =>
set({ currentObject: { id, title } }),
@@ -131,6 +136,8 @@ const useNavigationStore = create<NavigationStore>()(
clearCurrentObject: () =>
set({ currentObject: { id: undefined, title: undefined } }),
setCurrentModelPath: (path: string) => set({ currentModelPath: path }),
addToHistory: (path: string) => {
const { navigationHistory } = get()
const newHistory = [...navigationHistory, path]
@@ -247,8 +254,7 @@ const useNavigationStore = create<NavigationStore>()(
selectedDetector: null,
currentSubmenu: null
}),
// Close all menus and submenus
closeAllMenus: () => set({
showMonitoring: false,
showFloorNavigation: false,