<html>
<body>
Hi Andrea,<br><br>
You can apply vtkExtractCells to your already-built vtkUnstructuredGrid
because vtkUnstructuredGrid is a subclass of vtkDataSet.<br><br>
- Amy<br><br>
At 11:12 AM 3/31/2006, Andrea Gavana wrote:<br>
<blockquote type=cite class=cite cite="">Hello Goodwin,<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; thank you very much for your help. It seems to me (if
I have read correctly the doc), that vtkExtractCells requires a
vtkDataSet, a file in other words... is that correct? <br>
Well, I already have a vtkUnstructuredGrid built by reading an external
file (not VTK format). The idea of extracting cells based on Ids
implemented in vtkExtractCells is very promising... there is nothing
similar but without using a vtkDataSet? <br>
The problem is, I should be able to filter out cells by certain criteria:
for example, at the moment I am trying to exclude inactive cells using
this ACTNUM, but I would like to be able to filter out the cell based on,
i.e., cell centroid depth, cell permeability, cell saturations and so on.
This seems to me something like a vtkFilter*, and if every time I set up
a new filter I have to create a file and re-read it I will end up in
doing slow things. I am too newbie to browse in the right doc places...
<br>
&nbsp;<br>
Thank you very much for your suggestions.<br>
&nbsp;<br>
Andrea.<br><br>
&nbsp;<br>
On 3/31/06, <b>Goodwin Lawlor</b>
&lt;<a href="mailto:goodwin.lawlor@ucd.ie">goodwin.lawlor@ucd.ie</a>&gt;
wrote: <br>

<dl>
<dd>Andrea Gavana wrote:<br>

<dd>&gt; Hello NG,<br>

<dd>&gt;<br>

<dd>&gt;&nbsp;&nbsp;&nbsp;&nbsp; sorry if this question is simple, but I
have searched over the web <br>

<dd>&gt; and I have't found anything close to what I should so.
Basically, I have<br>

<dd>&gt; a vtkUnstructuredGrid in which I set the cell data using some
property.<br>

<dd>&gt; By switching with a wxPython radiobutton I can change on the fly
the <br>

<dd>&gt; property displayed on the grid (like permeability, saturation,
cell<br>

<dd>&gt; centroids and so on). Well, my group of data has also a property
called<br>

<dd>&gt; &quot;ACTNUM&quot;, that tells which cells are active (ACTNUM=1)
and which are not <br>

<dd>&gt; active (ACTNUM=0). Active cells should be displayed while
inactive cells<br>

<dd>&gt; should be hidden.<br>

<dd>&gt; I have succeeded to use vtkThreshold to filter out inactive
cells, but<br>

<dd>&gt; only when I set cell_data=ACTNUM, using something like: <br>

<dd>&gt;<br>

<dd>&gt; grid.GetCellData().SetScalars(ACTNUM)<br>

<dd>&gt;<br>

<dd>&gt; What I would like to do is, whatever property is displayed on
screen, to<br>

<dd>&gt; hide inactive cells based on ACTNUM value. For example, I would
like to <br>

<dd>&gt; display cell centroids property on the grid filtering out
inactive<br>

<dd>&gt; cells. Something like:<br>

<dd>&gt;<br>

<dd>&gt; grid.GetCellData().SetScalars(Whatever)<br>

<dd>&gt; ??? Apply threshold on grid using ACTNUM ???<br>

<dd>&gt; <br>

<dd>&gt; Is there a way to do this?<br>

<dd>&gt;<br>

<dd>&gt; Thank you very much for your help and suggestions.<br>

<dd>&gt;<br>

<dd>&gt; Andrea.<br>

<dd>Hi Andrea,<br><br>

<dd>You could try vtkExtractCells to filter out cells. You would have
to<br>

<dd>loop through ACTNUM and create the appropriate vtkIdList to apply to
the <br>

<dd>filter. Alternatively, you could try to convert your scalars to
RGBA<br>

<dd>values, where ACTNUM determines the A value (the opacity).<br><br>

<dd>hth<br><br>

<dd>Goodwin<br><br>

<dd>_______________________________________________<br>

<dd>This is the private VTK discussion list. <br>

<dd>Please keep messages on-topic. Check the FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>

<dd>Follow this link to subscribe/unsubscribe:<br>

<dd><a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br>

</dl><br><br>
<br>
-- <br>
&quot;Imagination Is The Only Weapon In The War Against
Reality.&quot;<br><br>
<a href="http://xoomer.virgilio.it/infinity77/">
http://xoomer.virgilio.it/infinity77/</a><br>
_______________________________________________<br>
This is the private VTK discussion list. <br>
Please keep messages on-topic. Check the FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ" eudora="autourl">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" eudora="autourl">
http://www.vtk.org/mailman/listinfo/vtkusers</a></blockquote></body>
</html>