MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / usePointsNode

Function usePointsNode

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

Source from the content-addressed store, hash-verified

3import type { PointsNode } from '../types';
4
5export function usePointsNode(): PointsNode {
6 const showPointCloud = usePointCloudStore((s) => s.showPointCloud);
7 const pointOpacity = usePointCloudStore((s) => s.pointOpacity);
8 const pointSize = usePointCloudStore((s) => s.pointSize);
9 const colorMode = usePointCloudStore((s) => s.colorMode);
10 const minTrackLength = usePointCloudStore((s) => s.minTrackLength);
11 const maxReprojectionError = usePointCloudStore((s) => s.maxReprojectionError);
12 const thinning = usePointCloudStore((s) => s.thinning);
13 const selectedPointId = usePointCloudStore((s) => s.selectedPointId);
14
15 return useMemo<PointsNode>(
16 () => ({
17 nodeType: 'points',
18 visible: showPointCloud,
19 splatsVisible: showPointCloud && isSplatColorMode(colorMode),
20 opacity: pointOpacity,
21 size: pointSize,
22 colorMode,
23 minTrackLength,
24 maxReprojectionError: maxReprojectionError === Infinity ? null : maxReprojectionError,
25 thinning,
26 selectedPointId,
27 }),
28 [
29 showPointCloud,
30 pointOpacity,
31 pointSize,
32 colorMode,
33 minTrackLength,
34 maxReprojectionError,
35 thinning,
36 selectedPointId,
37 ]
38 );
39}

Callers 7

useSplatLayerStoreFacadeFunction · 0.90
usePointCloudStoreFacadeFunction · 0.90
nodes.test.tsFile · 0.90

Calls 1

isSplatColorModeFunction · 0.90

Tested by

no test coverage detected