Skip to content

[samplestorage] Fixing ClearSurface and ClearVolume keeping the zero-value samples - #46

Merged
sherholz merged 1 commit into
OpenPathGuidingLibrary:develfrom
wantonsushi:fix-clear-zero-value-samples
Nov 8, 2026
Merged

sherholz merged 1 commit into
OpenPathGuidingLibrary:develfrom
wantonsushi:fix-clear-zero-value-samples

Conversation

@wantonsushi

Copy link
Copy Markdown
Contributor

pglSampleStorageClearSurface and pglSampleStorageClearVolume only clears non-zero samples, while pglSampleStorageClear clears both. All three are documented the same way (cpp/SampleStorage.h:86-93: "Clears all internal list of … samples"), so I assume this is a bug.

I added one surface and one volume zero-value sample to a SampleStorage, then called ClearSurface() and ClearVolume(). GetSizeZeroValueSurface() and GetSizeZeroValueVolume() should both return 0. Instead they still return 1. repro.cpp

The fix is to also call clearInvalidSurface() and clearInvalidVolume(), just like pglSampleStorageClear already does.

…value samples

Signed-off-by: Euan Hughes <realeuanhughes@gmail.com>
@sherholz

sherholz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@wantonsushi good catch. The fix looks good.

@sherholz
sherholz merged commit ac4d86f into OpenPathGuidingLibrary:devel Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants