[vtk-developers] proposed change for vtkImplicitFunction

Michael Halle halazar at media.mit.edu
Thu Jan 31 07:30:20 EST 2002


Hey there,

I'm writing a Perlin noise generator for vtk, and that had led me to
wanting to make a small change to vtkImplicitFunction.  

Right now, subclasses implement the methods "EvaluateFunction" and
"EvaluateGradient".  For many different functions, though, the
gradient is a byproduct of the computation of the function value; the
two methods needlessly require extra computation. In addition, classes
like vtkImplicitBoolean have to do even more work because that have to
perform an operation for each value for both functional and gradient
evaluation.

To fix this problem, I propose the addition of a virtual
"EvaluateFunctionAndGradient" method to vtkImplicitFunction.  It will
call EvaluateFunction and EvaluateGradient.  Subclasses can override
the method and provide their own method that will compute both
function and gradient simultaneously.  In addition, vtkImplicitFunction
will get a new "FunctionValueAndGradient" method that will use this
implementation method.

No subclasses will have to be changed, but at a later point those
that would benefit from it can be optimized to use the new combined
method.

Questions, comments?  The changes are pretty small....

Thanks.

							--Mike





More information about the vtk-developers mailing list