[vtkusers] vtkPolyDataConnectivityFilter

Frederic DANESI frederic.danesi at dinccs.com
Thu Oct 9 03:05:23 EDT 2008


Hi,
If you are looking for a full decomposition, you should try this :
	vtkPolyDataConnectivityFilter *connect =
vtkPolyDataConnectivityFilter::New();
	connect->SetInput(........);
	connect->SetExtractionModeToAllRegions();

In both case, you should be able to check the number of extracted regions,
but you have to update your filter first !
	connect->Update();
	int nbregions = connect->GetNumberOfExtractedRegions();

HTH
Fred.

-----Message d'origine-----
De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part
de prabhat246
Envoyé : jeudi 9 octobre 2008 08:12
À : vtkusers at vtk.org
Objet : [vtkusers] vtkPolyDataConnectivityFilter


I am able to find a connected component by providing specified region id(s),
in the following manner....

				vtkPolyDataConnectivityFilter *connect =
vtkPolyDataConnectivityFilter::New();
	
connect->SetExtractionModeToSpecifiedRegions();
				connect->AddSpecifiedRegion(0);
				connect->AddSpecifiedRegion(1);
				connect->AddSpecifiedRegion(2);
				connect->AddSpecifiedRegion(3);
				connect->AddSpecifiedRegion(4);
				connect->ColorRegionsOn();	
				connect->SetInput(mc->GetOutput());
				std::cout<<"GetNumberOfExtractedRegions :
"<<connect->GetNumberOfExtractedRegions();
				polyMapper->SetInput( connect->GetOutput()
);



But How can I get how many regions it has formed ???
GetNumerOfExtractedRegions retuns 0;

How can I see every component in a different color???

Thanks a lot.
Regards,
Prabhat Kumar Gupta

-- 
View this message in context:
http://www.nabble.com/vtkPolyDataConnectivityFilter-tp19892989p19892989.html
Sent from the VTK - Users mailing list archive at Nabble.com.

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list