<!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>Hello again,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I'm trying to figure out how to use vtkSelectVisiblePoints.
This is part of my code....</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT
size=2>==============================================================================</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> void
PolyPost_PresentationMeshRegionNumbers::_ComputeNodeNumbersPrs (void)<BR>
{<BR> vtkRenderer* renderer =
PolyPost_PresentationManager::GetManager()->GetCanvas()->GetRenderer();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Convert the regions unstructured mesh to
polygonal data.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkGeometryFilter* filter =
vtkGeometryFilter::New();<BR>
filter->SetInput(_region->GetGrid()); // GetGrid() returns a
vtkUnstructuredGrid !!</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Create an id filter.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkIdFilter* ids =
vtkIdFilter::New();<BR>
ids->SetInput(filter->GetOutput());<BR>
ids->PointIdsOn();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkSelectVisiblePoints* visPts =
vtkSelectVisiblePoints::New();<BR>
visPts->SetInput(ids->GetOutput());<BR>
visPts->SetRenderer(renderer);</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(visPts->GetOutput());<BR>
mapper->SetLabelFormat("%g");<BR>
mapper->SetLabelModeToLabelIds();</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);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Add the actor to the props
collection.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> _props->AddItem(actor);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Clean up.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> filter->Delete();<BR>
ids->Delete();<BR>
visPts->Delete();<BR>
mapper->Delete();<BR> actor->Delete();</FONT></DIV>
<DIV><FONT size=2> }</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<DIV><FONT
size=2>==============================================================================</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV></FONT></DIV>
<DIV><FONT size=2>When I try to display the numbers I get this error message
(using VC++ 6.0)</FONT></DIV>
<DIV><FONT size=2> The exception Integer division by
zero..........</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Does anyone have any ideas what I am doing wrong
??</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Thanks</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Simon</DIV>
<DIV><BR></DIV></FONT>
<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>