| 149 | } |
| 150 | |
| 151 | Expected<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 | |
| 170 | Expected<std::future<Expected<void>>> ObjectDistanceMap::serializeModel_( const std::filesystem::path& path ) const |
| 171 | { |
nothing calls this directly
no test coverage detected