[vtkusers] Connectivity Filter
R K Shyam Prakash
ramakrishna.prakash at quest-global.com
Wed Jun 23 09:45:12 EDT 2004
Sean,
The bset solution would be to iterate over each
polydata(unconnected) and create actors. Following is the pseudo code.
I have used Java below.
//set the extraction to all regions
conFilter.SetExtractionModeToAllRegions();
conFilter.Update();
//extract total number of regions
int numRegions = conFilter.GetNumberOfExtractedRegions();
//now change the extraction mode
conFilter.SetExtractionModeToSpecifiedRegions();
conFilter.Modified();
conFilter.Update();
//iterate over the number of regions
for(int i=0;i<numRegions;i++){
conFilter.InitializeSpecifiedRegionList();
conFilter.AddSpecifiedRegion(i);
conFilter.Modified();
conFilter.Update();
//copy the output
vtkPolyData output = new vtkPolyData();
output.DeepCopy(conFilter.GetOutput());
//now create the actor from output
}
--Shyam
> -----Original Message-----
> From: vtkusers-bounces at vtk.org
> [mailto:vtkusers-bounces at vtk.org] On Behalf Of Sean Richards
> Sent: Wednesday, June 23, 2004 6:56 PM
> To: vtkusers at vtk.org
> Subject: [vtkusers] Connectivity Filter
>
>
> Hello all!
>
> I am using vtkPolyDataConnectivityFilter to mark all the
> independent regions of my scene.
>
> Does anyone know an easy way to turn all the individual
> connected pieces into distinct actors?
>
> Thanks!
>
> Sean
>
More information about the vtkusers
mailing list