<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4611.1300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Ok, I am now happily displaying my point ids using the
vtkSelectVisiblePoints class. :-)</FONT></DIV>
<DIV><FONT size=2>Now I want to do the same for the cell ids. This is part
of my code</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<DIV><FONT
size=2>------------------------------------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV> </DIV></FONT><FONT size=2></FONT></DIV>
<DIV><FONT size=2> vtkUnstructuredGrid* grid =
_region->GetGrid();<BR>
vtkIdList* ids
= _region->GetCellIds();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Set the cell scalar data of the grid to
the element numbers of the mesh region.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkScalars* scalars =
vtkScalars::New(VTK_INT);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> for (int icell = 0; icell <=
grid->GetNumberOfCells(); ++icell)<BR>
{<BR>
scalars->InsertScalar(icell,ids->GetId(icell));<BR>
}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
grid->GetCellData()->SetScalars(scalars);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> vtkCellCenters* cellCentres =
vtkCellCenters::New();<BR>
cellCentres->SetInput(grid);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkSelectVisiblePoints* visCells =
vtkSelectVisiblePoints::New();<BR>
visCells->SetInput(cellCentres->GetOutput());<BR>
visCells->SetRenderer(canvas->GetRenderer());<BR>
visCells->SelectionWindowOn();</FONT></DIV>
<DIV><FONT size=2>
visCells->SetSelection(minx,maxx,miny,maxy);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Create a labeled data
mapper.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkLabeledDataMapper* mapper =
vtkLabeledDataMapper::New();<BR>
mapper->SetInput(visCells->GetOutput());<BR>
mapper->SetLabelFormat("%g");<BR>
mapper->SetLabelModeToLabelScalars();<BR>
mapper->SetFontSize(14);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Create an actor.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkActor2D* actor =
vtkActor2D::New();<BR>
actor->SetMapper(mapper);<BR>
actor->GetProperty()->SetColor(_elementNumberColor.r,_elementNumberColor.g,_elementNumberColor.b);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>
<DIV><FONT
size=2>------------------------------------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If I omit the vtkSelectVisiblePoints class and set the input
for the mapper with the output from vtkCellCenters</FONT></DIV>
<DIV><FONT size=2>then I see the cell numbers displayed as expected. However
when I include the vtkSelectVisiblePoints I do not</FONT></DIV>
<DIV><FONT size=2>see any numbers.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Any ideas???</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Sorry to be a nuisance.</FONT></DIV>
<DIV><FONT size=2>Simon</FONT></DIV></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>================================<BR>S.D.Bulman.<BR>Senior
Research Officer.<BR>University of Wales Swansea.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><A
href="mailto:S.D.Bulman@swansea.ac.uk">S.D.Bulman@swansea.ac.uk</A></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>(W) +44 (0)1792 513179<BR>(H) +44 (0)1792
511144<BR>================================<BR></FONT></DIV></BODY></HTML>