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

Function applyShareConfig

src/hooks/useUrlState.ts:67–97  ·  view source on GitHub ↗
(config: ShareConfig)

Source from the content-addressed store, hash-verified

65 * Automatically applies all fields using setState.
66 */
67export function applyShareConfig(config: ShareConfig): void {
68 if (config.splat?.activeSourceId) {
69 useReconstructionStore.getState().setRequestedSplatSourceId(config.splat.activeSourceId);
70 useImageMetricsStore.getState().clearSplatPsnr();
71 }
72
73 // Point cloud store
74 if (config.pointCloud) {
75 usePointCloudStore.setState(config.pointCloud);
76 }
77
78 // UI store
79 if (config.ui) {
80 useUIStore.setState(config.ui);
81 }
82
83 // Camera store
84 if (config.camera) {
85 useCameraStore.setState(config.camera);
86 }
87
88 // Rig store
89 if (config.rig) {
90 useRigStore.setState(config.rig);
91 }
92
93 // Transform store
94 if (config.transform) {
95 useTransformStore.getState().setTransform(config.transform);
96 }
97}
98
99/**
100 * Hook for bidirectional sync between camera state and URL hash.

Callers 2

checkUrlAndLoadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected