-
-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vtk threshold point #3081
base: master
Are you sure you want to change the base?
Add vtk threshold point #3081
Conversation
This filter can threshold points with PointData criteria or point coordinates.
outData[0] = output; | ||
|
||
if (model.criterias.length === 0) { | ||
output.shallowCopy(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@floryst @jourdain I was surprised to have to shallow copy.
If I simply do outputData[0] = input, then the shader may not refresh.
This no-refresh happens when the threshold filter has previously generated a new ouput polydata and now it simply returns an old polydata. There must be some kind of time stamp issue. I'm not sure if that should be fixed instead in the mapper. WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably b/c input.getMTime()
is older than output.getMTime()
at that point, so there's probably a shouldUpdate
flag set to false in the vtk algorithm macro. outputData[0] = input
would probably work if input.modified()
was called as well, but that's probably undesirable, so shallowCopy seems fine to me.
Are you planning on adding typescript definitions as well? |
I was not planning to because I do not use typescript. Shall we make it mandatory for new contributions ? |
It's a good idea to do so nowadays, especially since vtk.js is ingested by typescript projects. |
Context
Add vtkThresholdPoints filter.
Results
A new filter with an example are added.
Changes
PR and Code Checklist
npm run reformat
to have correctly formatted codeTesting