vtkAlgorithm::Update() have been returning void for a very long time and it has bothered me as soon as I started working with VTK.
It means we cannot do this:
if (!filter->Update())
{
// error processing
}
But instead must do:
if (!filter->GetExecutive()->Update())
{
// error processing
}
Which looks hacky.
Looking into vtkAlgorithm, it would actually be very easy to forward a boolean, it just was not be done before.
However, making this change properly has some impacts and I want to discuss it with the community before hand. we can either:
1. Deprecate it properly and create a new method that returns bool
Indeed, we cant deprecate without renamming when changing a return type.
This is the “proper” way to do it however it will be VERY impactful as everyone is using Update to update their filter will need to switch to a new method (UpdateWithReturn), it also looks ugly to call another method.
This will impact thousands of VTK users.
- “Just” change the return type and break the API
As we go from void to bool, it means that users are NOT impacted, because current usage will still work without issue.
However, VTK developers that inherits vtkAlgorithm and override Update will obviously not be able to build their code, with a very simple fix to adapt the signature of the method.
In order to get a feeling of the number of usages, I created a MR and I found a grand total of 3 overrides in VTK. This will impact a a subset of users with probable enough expertise to fix it swiftly.
- Not do anything and keep using
GetExecutive
As you can already probably tell I’m in favor of 2, but very open to hear arguments for any of the proposed solutions.