Need help connecting vtkClipPolyData with vtkSampleFunction

I’m still on the steep part of the vtk learning curve.

I’m following the ImplicitPaneWidget2 example for this. I’m trying to use that methodology for the “clip widget” to clip the result of implicit functions that have been processed by a vtkSampleFunction.

If someone could point me to an existing example for this, that would be great.

Part of what I have is

vtkNew<vtkSampleFunction> sample;
sample->SetSampleDimensions(150, 150, 150);

sample->SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);


// Create the 0 isosurface
contours->GenerateValues(1, 1, 1);

// Map the contours to graphical primitives


When the last line (above) is executed, I get the following error:

vtkAlgorithm.cxx:893 ERR| vtkOpenGLPolyDataMapper (0xb90890): Attempt to get output port index 0 for an algorithm with 0 output ports.

And of course, the implicit function never appears in the render window, but the clipper widget does.

Any thoughts about this would be appreciated.