[vtkusers] How to Recover vtkPolyData from vtkThreshold

John Platt jcplatt at lineone.net
Thu Jun 17 03:57:31 EDT 2004


Hi Mathieu,

Sorry, I wrote vtkThresholdPolyData instead!

It was a bad idea to try and write a threshold filter based on
vtkDataSetToDataSetFilter. I had assumed that the output would be the
same as the input but I couldn't get hold of the output as anything
other than vtkDataSet. It seems that this class is for manipulating the
field data.

It did strike me, however, that template versions of some filters would
be very useful

	vtkThresholdCells< vtkDataSet, vtkUnstructuredGrid >
	vtkThresholdCells< vtkDataSet, vtkPolyData >
 	vtkThresholdCells< vtkPolyData, vtkPolyData >

That shouldn't take you very long :-)

Thanks for your support.

John.

-----Original Message-----
From: Mathieu Malaterre [mailto:mathieu.malaterre at kitware.com] 
Sent: 16 June 2004 17:27
To: John Platt
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] How to Recover vtkPolyData from vtkThreshold

John,

	I don't know why vtkThreshold has an output of
vtkUnstructuredGrid, 
this is generic enough for all type of dataset containing cells (it 
should fail on vtkPointSet though).

	Anyway if you have time you can surely write your own 
vtkPolyDataToPolyDataThresholdFilter.

HTH
Mathieu
Ps: vtkUnstructuredGridToPolyDataFilter is an abstract class you 
shouldn't use it (only if you want to hide the ShallowCopy inside a nice

class)

John Platt wrote:
> Hi Mathieu,
> 
> That must rate as one of the quickest replies ever!
> 
> The polydata just contains surface edges of cells. Since I am trying
to
> speed up an animation, I would like to avoid going through
> vtkDataSetSurfaceFilter therefore it looks like the ShallowCopy()
> option.
> 
> I nearly got excited when I saw vtkUnstructuredGridToPolyDataFilter...
> 
> Would it be more beneficial to write a threshold filter with the
output
> the same as the input derived from vtkDataSetToDataSetFilter? Or are
> there some complications which explain why this has not been done.
> 
> Many thanks.
> 
> John. 
> 
> -----Original Message-----
> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
> Behalf Of Mathieu Malaterre
> Sent: 15 June 2004 22:03
> To: John Platt
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] How to Recover vtkPolyData from vtkThreshold
> 
> John Platt wrote:
> 
>>Hi Users,
>>
>> 
>>
>>I would like to render selective cells from vtkPolyData. I tried
>>
>> 
>>
>>            vtkPolyData > vtkThreshold > vtkPolyDataMapper
>>
>> 
>>
>>but this does not compile because the output of vtkThreshold is of
> 
> type 
> 
>>vtkUnstructuredGrid.
>>
>> 
>>
>>Is there anyway of recovering the output of vtkThreshold as
> 
> vtkPolyData 
> 
>>or an alternative filter?
> 
> 
> You can use vtkDataSetMapper or vtkGeometryFilter to display a 
> vtkUnstructuredGrid.
> 
> Otherwise if you know the types of elements you are using you can
create
> 
> your own vtkPolyData after the vtkThreshold (don't forget to call 
> Update) and shallow copy all triangles/quad/strips/points...
> 
> HTH
> Mathieu
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 








More information about the vtkusers mailing list