Specify the function to use to generate the source data. Note that the function takes a single (void *) argument.
| 83 | // Specify the function to use to generate the source data. Note |
| 84 | // that the function takes a single (void *) argument. |
| 85 | void vtkProgrammableSource::SetExecuteMethod(void (*f)(void*), void* arg) |
| 86 | { |
| 87 | if (f != this->ExecuteMethod || arg != this->ExecuteMethodArg) |
| 88 | { |
| 89 | // delete the current arg if there is one and a delete meth |
| 90 | if ((this->ExecuteMethodArg) && (this->ExecuteMethodArgDelete)) |
| 91 | { |
| 92 | (*this->ExecuteMethodArgDelete)(this->ExecuteMethodArg); |
| 93 | } |
| 94 | this->ExecuteMethod = f; |
| 95 | this->ExecuteMethodArg = arg; |
| 96 | this->Modified(); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | // Set the arg delete method. This is used to free user memory. |
| 101 | void vtkProgrammableSource::SetExecuteMethodArgDelete(void (*f)(void*)) |