MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / fit_field

Function fit_field

tools/openpgl_debug/openpgl_debug.cpp:489–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487}
488
489void fit_field(DebugParams &debugParams)
490{
491 openpgl::cpp::Device device(debugParams.device_type);
492 openpgl::cpp::FieldConfig fieldSettings;
493 fieldSettings.Init(PGL_SPATIAL_STRUCTURE_KDTREE, PGL_DIRECTIONAL_DISTRIBUTION_PARALLAX_AWARE_VMM, true, 32000);
494
495 fieldSettings.SetDebugArgFitRegions(true);
496 openpgl::cpp::Field field(&device, fieldSettings);
497
498 for (int i = 0; i < debugParams.samples_file_names.size(); i++)
499 {
500 std::cout << "Validate Samples[" << i << "]:" << std::endl;
501 openpgl::cpp::SampleStorage sampleStorage(debugParams.samples_file_names[i]);
502 bool samplesValidate = sampleStorage.Validate();
503 std::cout << " -samples: " << debugParams.samples_file_names[i] << " is " << (samplesValidate ? "valid" : "NOT valid") << std::endl;
504
505 field.Update(sampleStorage);
506 std::cout << "Validate Updated Field[" << i << "]:" << std::endl;
507 bool fieldUpdatedValid = field.Validate();
508 std::cout << " updated field[" << i << "]: is " << (fieldUpdatedValid ? "valid" : "NOT valid") << std::endl;
509 }
510 if (debugParams.field_file_name_out != "")
511 {
512 std::cout << "stroe field: " << debugParams.field_file_name_out << std::endl;
513 field.Store(debugParams.field_file_name_out);
514 }
515}
516
517void update_field(DebugParams &debugParams)
518{

Callers 1

mainFunction · 0.85

Calls 6

SetDebugArgFitRegionsMethod · 0.80
InitMethod · 0.45
sizeMethod · 0.45
ValidateMethod · 0.45
UpdateMethod · 0.45
StoreMethod · 0.45

Tested by

no test coverage detected