Search code examples
vtkparaview

paraview RequestData called once


I have created a paraview filter in C++. The problem is when I press apply button the filter works and show me the result but if I try it again (after any change in properties input), the RequestData function is not called anymore. This problem never appear when I used Python programmable filter. Any idea?


Solution

  • Make sure you're calling this->Modified() in the method that gets called after the property is changed e.g.

    void SetMyValue(double value)
    {
       ...
       this->Modified();
    }
    

    You probably want to check that the value or some other state of your filter is changed which could potentially change the output of the filter before calling this->Modified(). Otherwise the filter may unnecessarily update and produce the exact same result. You can look at vtkSetGet.h for macros that do that (look at #define vtkSetMacro(name,type) ).