| 303 | } |
| 304 | |
| 305 | Expected<ObjectPoints> makeObjectPointsFromFile( const std::filesystem::path& file, ProgressCallback callback ) |
| 306 | { |
| 307 | MR_TIMER; |
| 308 | |
| 309 | VertColors colors; |
| 310 | AffineXf3f xf; |
| 311 | auto pointsCloud = PointsLoad::fromAnySupportedFormat( file, { |
| 312 | .colors = &colors, |
| 313 | .outXf = &xf, |
| 314 | .callback = callback, |
| 315 | } ); |
| 316 | if ( !pointsCloud.has_value() ) |
| 317 | { |
| 318 | return unexpected( pointsCloud.error() ); |
| 319 | } |
| 320 | |
| 321 | ObjectPoints objectPoints; |
| 322 | objectPoints.setName( utf8string( file.stem() ) ); |
| 323 | objectPoints.setPointCloud( std::make_shared<PointCloud>( std::move( pointsCloud.value() ) ) ); |
| 324 | objectPoints.setXf( xf ); |
| 325 | if ( !colors.empty() ) |
| 326 | { |
| 327 | objectPoints.setVertsColorMap( std::move( colors ) ); |
| 328 | objectPoints.setColoringType( ColoringType::VertsColorMap ); |
| 329 | } |
| 330 | |
| 331 | return objectPoints; |
| 332 | } |
| 333 | |
| 334 | Expected<ObjectDistanceMap> makeObjectDistanceMapFromFile( const std::filesystem::path& file, ProgressCallback callback ) |
| 335 | { |
no test coverage detected