<!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>
<DIV><FONT size=2>Hello all,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>My troubles with vtkSelectVisiblePoints 
continues......</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>So I have tried to go back to basics, but alas anouther 
problem occurs. Here is my code.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT 
size=2>=============================================================================</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;void 
PolyPost_PresentationMeshRegionNumbers::_ComputeNodeNumbersPrs 
(void)<BR>&nbsp;&nbsp;{<BR></FONT><FONT size=2>&nbsp;&nbsp; // Get the grid and 
the node ids from the mesh region.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; vtkUnstructuredGrid* grid = 
_region-&gt;GetGrid();<BR>&nbsp;&nbsp;&nbsp; 
vtkIdList*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ids&nbsp; 
= _region-&gt;GetPointIds();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Convert the regions unstructured mesh to 
polygonal data.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; vtkGeometryFilter* filter = 
vtkGeometryFilter::New();<BR>&nbsp;&nbsp;&nbsp; 
filter-&gt;SetInput(grid);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Set the scalar data of the PolyData to 
the node numbers of the mesh region.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; vtkScalars*&nbsp; scalars = 
vtkScalars::New(VTK_INT);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; for (int inode = 0; inode &lt;= 
grid-&gt;GetNumberOfPoints(); ++inode)<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
scalars-&gt;InsertScalar(inode,ids-&gt;GetId(inode));<BR>&nbsp;&nbsp;&nbsp; 
}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; 
filter-&gt;GetOutput()-&gt;GetPointData()-&gt;SetScalars(scalars);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Create a labeled data 
mapper.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; vtkLabeledDataMapper* mapper = 
vtkLabeledDataMapper::New();<BR>&nbsp;&nbsp;&nbsp; 
mapper-&gt;SetInput(filter-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
mapper-&gt;SetLabelFormat("%i");<BR>&nbsp;&nbsp;&nbsp; 
mapper-&gt;SetLabelModeToLabelScalars();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Create an actor.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; vtkActor2D* actor = 
vtkActor2D::New();<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetMapper(mapper);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Add the actor to the props 
list.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; _props-&gt;AddItem(actor);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Clean up.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; filter-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
scalars-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
mapper-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; actor-&gt;Delete();<BR>&nbsp; 
}</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>
<DIV><FONT 
size=2>=============================================================================</FONT></DIV>
<DIV>The error:</DIV>
<DIV>&nbsp;</DIV>
<DIV>ERROR: In D:\vtk-daily\vtk\imaging\vtkLabeledDataMapper.cxx, line 
240<BR>vtkLabeledDataMapper (01684DB0): Need input data to render labels</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now I would of thought that line</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
filter-&gt;GetOutput()-&gt;GetPointData()-&gt;SetScalars(scalars);</DIV>
<DIV>has set the scalar values. Am I wrong??? is there some funny referencing 
going on here???</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for any help, once this works I can try to use the 
vtkSelectVisiblePoints class again.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Simon</DIV></FONT></DIV></FONT></DIV></BODY></HTML>