MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / deserializeModel_

Method deserializeModel_

source/MRMesh/MRObjectDistanceMap.cpp:151–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151Expected<void> ObjectDistanceMap::deserializeModel_( const std::filesystem::path& path, ProgressCallback progressCb )
152{
153 auto modelPath = pathFromUtf8( utf8string( path ) + saveDistanceMapFormat_ );
154 std::error_code ec;
155 if ( !std::filesystem::is_regular_file( modelPath, ec ) )
156 {
157 modelPath = findPathWithExtension( path );
158 if ( modelPath.empty() )
159 return unexpected( "No distance map file found: " + utf8string( path ) );
160 }
161
162 auto res = DistanceMapLoad::fromAnySupportedFormat( modelPath, { .progress = progressCb } );
163 if ( !res.has_value() )
164 return unexpected( res.error() );
165
166 dmap_ = std::make_shared<DistanceMap>( res.value() );
167 return {};
168}
169
170Expected<std::future<Expected<void>>> ObjectDistanceMap::serializeModel_( const std::filesystem::path& path ) const
171{

Callers

nothing calls this directly

Calls 8

pathFromUtf8Function · 0.85
utf8stringFunction · 0.85
findPathWithExtensionFunction · 0.85
errorMethod · 0.80
unexpectedFunction · 0.70
fromAnySupportedFormatFunction · 0.70
emptyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected