vtkClipClosedSurface GenerateOutline - Width

Hi All,
I am using vtkClipClosedSurface filter to clip and close the polydata and also to generate the outline where ever the planes intersect with the polydata. I managed to give a separate color to outline by overridding RequestData(…) method of vtkClipClosedSurface class. The resulted outline looks very thin. Is there any way to increase the line width of the Ouline without running the vtkClipClosedSurface filter 2 times ? (one time to get only outline by generateFacesOFF and another time to get the output with faces ON).
Any pointers would be much appreciated.
Thank you.

vtkSmartPointer<vtkClipClosedSurface> clip1 = vtkSmartPointer<vtkClipClosedSurface>::New();
clip1->SetInputData(polydata);
clip1->SetClippingPlanes(planeCollection);
clip1->SetBaseColor(1.0,1.0,1.0);
clip1->SetClipColor(1.0,1.0,1.0);
clip1->SetScalarModeToColors();
clip1->GenerateOutlineOn();
clip1->Update();

You can apply vtkTubeFilter to the output of vtkClipClosedSurface. This will generate a new dataset with just the lines, where each line is thickened to form a tube.

Thank you @dgobbi for replying. I am looking for outline(different color than cut surface) along with faces as an output of vtkClipClosedSurface. Whatever the clipcolor I set, that is being taken as outline color as well. For that I had to subclass and set the different color to the outline. Is there anyway to set the outline color without subclassing?
Tubefilter gives me thickened outline but I have to run the vtkClipClosedSurface filter 2 times(with generateFacesOn and Off).
If the dataset is big, then running the filter 2 times adds some extra time on the performance I guess.

Thank you.

No, vtkClipClosedSurface cannot set a different color for the outline. But VTK has other ways of setting colors, for example in the property of the actor:

// tell the mapper to ignore scalars on the data
mapper->ScalarVisibilityOff();
// set the actor to use a specific color
actor->GetProperty()->SetColor(1.0, 0.0, 0.0);

So, if you have an actor with only lines, you can control its property independent of the faces.

// create a new data set with only lines
auto lineData = vtkSmartPointer<vtkPolyData>::New();
lineData->SetPoints(clip1->GetOutput()->GetPoints());
lineData->SetLines(clip1->GetOutput()->GetLines());
lineData->BuildLinks();

So, you only have to execute vtkClipClosedSurface once. Note that vtkTubeFilter will also extract only the lines from the output, which is why I recommended it (also because you asked for thicker lines).

// stripper will improve the result of vtkTubeFilter
auto stripper = vtkSmartPointer<vtkStripper>::New();
stripper->SetInputData(clip1->GetOutput());
stripper->Update();

auto tube = vtkSmartPointer<vtkTubeFilter>::New();
tube->SetInputData(stripper->GetOutput());
tube->SetRadius(0.01);
tube->SetNumberOfSides(11);
tube->Update();

That is my recommendation. Do not use clip1->SetScalarModeToColors(), instead use the actors to set the color. And of course, do not execute vtkClipClosedSurface twice.

Ok.

I got it. Thank you very much @dgobbi . I appreciate your help. This works well for me.