<!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> </DIV>
<DIV><FONT size=2>My troubles with vtkSelectVisiblePoints
continues......</FONT></DIV>
<DIV><FONT size=2></FONT> </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> </DIV>
<DIV><FONT
size=2>=============================================================================</FONT></DIV>
<DIV><FONT size=2> void
PolyPost_PresentationMeshRegionNumbers::_ComputeNodeNumbersPrs
(void)<BR> {<BR></FONT><FONT size=2> // Get the grid and
the node ids from the mesh region.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkUnstructuredGrid* grid =
_region->GetGrid();<BR>
vtkIdList* ids
= _region->GetPointIds();</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(grid);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> // Set the scalar data of the PolyData to
the node 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 inode = 0; inode <=
grid->GetNumberOfPoints(); ++inode)<BR>
{<BR>
scalars->InsertScalar(inode,ids->GetId(inode));<BR>
}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
filter->GetOutput()->GetPointData()->SetScalars(scalars);</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(filter->GetOutput());<BR>
mapper->SetLabelFormat("%i");<BR>
mapper->SetLabelModeToLabelScalars();</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
list.</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>
scalars->Delete();<BR>
mapper->Delete();<BR> actor->Delete();<BR>
}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<DIV><FONT
size=2>=============================================================================</FONT></DIV>
<DIV>The error:</DIV>
<DIV> </DIV>
<DIV>ERROR: In D:\vtk-daily\vtk\imaging\vtkLabeledDataMapper.cxx, line
240<BR>vtkLabeledDataMapper (01684DB0): Need input data to render labels</DIV>
<DIV> </DIV>
<DIV>Now I would of thought that line</DIV>
<DIV>
filter->GetOutput()->GetPointData()->SetScalars(scalars);</DIV>
<DIV>has set the scalar values. Am I wrong??? is there some funny referencing
going on here???</DIV>
<DIV> </DIV>
<DIV>Thanks for any help, once this works I can try to use the
vtkSelectVisiblePoints class again.</DIV>
<DIV> </DIV>
<DIV>Simon</DIV></FONT></DIV></FONT></DIV></BODY></HTML>