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

Function pglFieldArgumentsSetDefaults

openpgl/api/api.cpp:781–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779#endif
780
781extern "C" OPENPGL_DLLEXPORT void pglFieldArgumentsSetDefaults(PGLFieldArguments &fieldArguments, const PGL_SPATIAL_STRUCTURE_TYPE spatialType,
782 const PGL_DIRECTIONAL_DISTRIBUTION_TYPE directionalType, const bool deterministic, const size_t maxSamplesPerLeaf)
783{
784 switch (spatialType)
785 {
786 default:
787 case PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE:
788 fieldArguments.spatialStructureType = PGL_SPATIAL_STRUCTURE_KDTREE;
789 fieldArguments.spatialSturctureArguments = new PGLKDTreeArguments();
790 reinterpret_cast<PGLKDTreeArguments *>(fieldArguments.spatialSturctureArguments)->maxSamples = maxSamplesPerLeaf;
791 break;
792 }
793
794 fieldArguments.deterministic = deterministic;
795 fieldArguments.debugArguments.fitRegions = true;
796
797 switch (directionalType)
798 {
799 default:
800 case PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_PARALLAX_AWARE_VMM:
801 fieldArguments.directionalDistributionType = PGL_DIRECTIONAL_DISTRIBUTION_PARALLAX_AWARE_VMM;
802 fieldArguments.directionalDistributionArguments = new PGLVMMFactoryArguments(maxSamplesPerLeaf);
803 break;
804 case PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_QUADTREE:
805 fieldArguments.directionalDistributionType = PGL_DIRECTIONAL_DISTRIBUTION_QUADTREE;
806 fieldArguments.directionalDistributionArguments = new PGLDQTFactoryArguments();
807 break;
808 case PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_VMM:
809 fieldArguments.directionalDistributionType = PGL_DIRECTIONAL_DISTRIBUTION_VMM;
810 fieldArguments.directionalDistributionArguments = new PGLVMMFactoryArguments(maxSamplesPerLeaf);
811 break;
812 }
813}
814
815///////////////////////////////////////////////////////////////////////////////
816// FieldStatistics ////////////////////////////////////////////////////////////

Callers 1

InitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected