MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / useSelectionNode

Function useSelectionNode

src/nodes/hooks/useSelectionNode.ts:5–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import type { SelectionNode } from '../types';
4
5export function useSelectionNode(): SelectionNode {
6 const showSelectionHighlight = useCameraStore((s) => s.showSelectionHighlight);
7 const selectionColorMode = useCameraStore((s) => s.selectionColorMode);
8 const selectionColor = useCameraStore((s) => s.selectionColor);
9 const selectionAnimationSpeed = useCameraStore((s) => s.selectionAnimationSpeed);
10 const selectionPlaneOpacity = useCameraStore((s) => s.selectionPlaneOpacity);
11 const unselectedCameraOpacity = useCameraStore((s) => s.unselectedCameraOpacity);
12 const selectedImageId = useCameraStore((s) => s.selectedImageId);
13
14 return useMemo<SelectionNode>(
15 () => ({
16 nodeType: 'selection',
17 visible: showSelectionHighlight,
18 colorMode: selectionColorMode,
19 color: selectionColor,
20 animationSpeed: selectionAnimationSpeed,
21 planeOpacity: selectionPlaneOpacity,
22 unselectedOpacity: unselectedCameraOpacity,
23 selectedImageId,
24 }),
25 [
26 showSelectionHighlight,
27 selectionColorMode,
28 selectionColor,
29 selectionAnimationSpeed,
30 selectionPlaneOpacity,
31 unselectedCameraOpacity,
32 selectedImageId,
33 ]
34 );
35}

Callers 8

CameraMatchesFunction · 0.90
TrackballControlsFunction · 0.90
RigConnectionsFunction · 0.90
usePointCloudStoreFacadeFunction · 0.90
nodes.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected