[vtkusers] Why vtkPolyDataConnectivityFilter fails to return connected components

Dr Zeto dr_zeato at yahoo.com
Thu Nov 11 11:16:29 EST 2004


Hi,
I am running into this weird problem, which I am
unable to solve. I have a surface, which is composed
of two sub-surfaces, say M1 & M2, which are mutually
exclusive. M1 & M2 are extracted using
vtkClipPolyData.


pvtkClipper->SetClipFunction( pvtkSphere );
pvtkClipper->Update();

vtkPolyDataConnectivityFilter* pvtkConnFilter;
pvtkConnFilter->ScalarConnectivityOff();
pvtkConnFilter->SetExtractionModeToAllRegions();
pvtkConnFilter->InitializeSpecifiedRegionList();
pvtkConnFilter->SetInput( pvtkClipper->GetOutput() );
pvtkConnFilter->Update();
int nConnComp =
pvtkConnFilter->GetNumberOfExtractedRegions();

So far it works fine, and "nConnComp" is set to two,
indicating that there are indeed two connected
components. The problem arises, when I ask
connectivity filter to give me each of the connected
component, using the following:

for( int k = 0; k < nConnComp; k++ )
{
    pvtkConnFilter->AddSpecifiedRegion( k );
    pvtkConnFilter->Update();
    RenderSurface( pvtkConnFilter->GetOuput() );
}

where "RenderSurface" is a function that renders a
given surface. But after rendering, I get both
surfaces M1 & M2, which means that connectivity filer
is not returning individual surfaces.

Could someone please help.
Thanks
Zeato


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 




More information about the vtkusers mailing list