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

Function loadManifestSource

src/hooks/urlLoaderManifestSource.ts:38–84  ·  view source on GitHub ↗
(
  manifest: ColmapManifest,
  source: ManifestLoadSource,
  deps: LoadManifestSourceDeps
)

Source from the content-addressed store, hash-verified

36}
37
38export async function loadManifestSource(
39 manifest: ColmapManifest,
40 source: ManifestLoadSource,
41 deps: LoadManifestSourceDeps
42): Promise<boolean> {
43 const log = deps.log ?? appLogger.info;
44 const fetchColmapFiles = deps.fetchColmapFiles
45 ?? ((targetManifest: ColmapManifest) => fetchManifestColmapFiles(targetManifest, {
46 log: (message) => log(message),
47 setUrlProgress: deps.setUrlProgress,
48 onRemoteSplatCatalog: deps.onRemoteSplatCatalog,
49 }));
50
51 const files = await fetchColmapFiles(manifest);
52 log(`[URL Loader] Downloaded ${files.size} COLMAP files:`, Array.from(files.keys()));
53
54 log('[URL Loader] Skipping image download (images will be loaded lazily)');
55
56 deps.setUrlProgress({ percent: 80, message: 'Parsing reconstruction...' });
57
58 const sourceInfo = getManifestLoadSourceInfo(manifest, source);
59 deps.setSourceInfo(
60 sourceInfo.sourceType,
61 sourceInfo.sourceUrl,
62 sourceInfo.imageUrlBase,
63 sourceInfo.maskUrlBase,
64 sourceInfo.sourceManifest,
65 sourceInfo.imageNameToUrl ?? null
66 );
67 log(`[URL Loader] Image URL base for lazy loading: ${sourceInfo.imageUrlBase}`);
68 log(`[URL Loader] Mask URL base for lazy loading: ${sourceInfo.maskUrlBase}`);
69 if (sourceInfo.imageNameToUrl) {
70 log(
71 `[URL Loader] Per-image URL mapping active for ${Object.keys(sourceInfo.imageNameToUrl).length} images`
72 );
73 }
74
75 log('[URL Loader] Calling processFiles...');
76 await deps.processFiles(files, { start: 80, end: 100 }, { throwOnError: true });
77
78 if (findSplatFileSources(files).length === 0) {
79 deps.setUrlProgress({ percent: 100, message: 'Complete' });
80 }
81 log(`[URL Loader] Successfully loaded ${files.size} files from ${sourceInfo.successLabel}`);
82
83 return true;
84}

Callers 2

useUrlLoaderFunction · 0.90

Calls 3

fetchManifestColmapFilesFunction · 0.90
findSplatFileSourcesFunction · 0.90

Tested by

no test coverage detected