<div>Hello NG,</div>
<div> </div>
<div> I am sorry to bother you again with dumb questions, but I have some doubt about the way I am using vtkThresold right now...</div>
<div>I have a vtkUnstructuredGrid called "grid", a mapper called "surfaceMapper" and an actor "surfaceActor". The grid is already displayed on a VTK window. Now, suppose that the user changes the property he wishes to view, and this property should be filtered by means of another property. This is what I do:
</div>
<div> </div>
<div># Create the threshold</div>
<div>threshold = vtk.vtkThreshold()</div>
<div> </div>
<div># Give as input my vtkUnstructuredGrid<br>threshold.SetInput(thresh)</div>
<div> </div>
<div># Give the array on which performing the threshold<br>threshold.SetInputArrayToProcess(0, 0, 0, 1, "ACTNUM")</div>
<div> </div>
<div># Do the thresholding<br>threshold.ThresholdBetween(1, 100)</div>
<div> </div>
<div># Get the output<br>thresh = threshold.GetOutput()<br clear="all"></div>
<div># Do the rendering things...</div>
<div># IS THIS CORRECT???</div>
<div>#</div>
<div> </div>
<div>surfaceMapper.SetInput(thresh)<br>data_range = grid.GetScalarRange()<br>surfaceMapper.SetScalarRange(data_range)<br>surfaceMapper.SetResolveCoincidentTopologyToPolygonOffset()</div>
<div> </div>
<div># Refresh the wxPython frame (also Render() the surfaceActor)</div>
<div>MyFrame.Refresh()</div>
<div> </div>
<div>If there is no filter to do, I simply change the line:</div>
<div> </div>
<div>surfaceMapper.SetInput(thresh)<br> </div>
<div>With:</div>
<div> </div>
<div>surfaceMapper.SetInput(grid)<br> </div>
<div>Now, apart of the problem of duplicated cells (which should be filtered out using the threshold, so they should be invisible), every time I do:</div>
<div> </div>
<div>thresh.GetNumberOfCells()</div>
<div> </div>
<div>I get 0 (zero). Well, it seems to me (if I have read correctly the docs) that vtkThreshold should return a vtkUnstructuredGrid. Well, how comes that this output has no cells? The code seems to work and to display the right thing (thresholded OK) until I zoom and rotate...
</div>
<div> </div>
<div>Thank you for your suggestions.</div>
<div> </div>
<div>Andrea.</div>
<div> </div>
<div><br>-- <br>"Imagination Is The Only Weapon In The War Against Reality."<br><br><a href="http://xoomer.virgilio.it/infinity77/">http://xoomer.virgilio.it/infinity77/</a><br> </div>