[vtkusers] vtkSelectVisiblePoints

Simon Bulman S.D.Bulman at swansea.ac.uk
Tue Apr 3 10:59:41 EDT 2001


Hello again,

I'm trying to figure out how to use vtkSelectVisiblePoints. This is part of my code....

==============================================================================

  void PolyPost_PresentationMeshRegionNumbers::_ComputeNodeNumbersPrs (void)
  {
    vtkRenderer* renderer = PolyPost_PresentationManager::GetManager()->GetCanvas()->GetRenderer();

    // Convert the regions unstructured mesh to polygonal data.

    vtkGeometryFilter* filter = vtkGeometryFilter::New();
    filter->SetInput(_region->GetGrid()); // GetGrid() returns a vtkUnstructuredGrid !!

    // Create an id filter.

    vtkIdFilter* ids = vtkIdFilter::New();
    ids->SetInput(filter->GetOutput());
    ids->PointIdsOn();

    vtkSelectVisiblePoints* visPts = vtkSelectVisiblePoints::New();
    visPts->SetInput(ids->GetOutput());
    visPts->SetRenderer(renderer);

    // Create a labeled data mapper.

    vtkLabeledDataMapper* mapper = vtkLabeledDataMapper::New();
    mapper->SetInput(visPts->GetOutput());
    mapper->SetLabelFormat("%g");
    mapper->SetLabelModeToLabelIds();

    // Create an actor.

    vtkActor2D* actor = vtkActor2D::New();
    actor->SetMapper(mapper);

    // Add the actor to the props collection.

    _props->AddItem(actor);

    // Clean up.

    filter->Delete();
    ids->Delete();
    visPts->Delete();
    mapper->Delete();
    actor->Delete();
  }

==============================================================================

When I try to display the numbers I get this error message (using VC++ 6.0)
 The exception Integer division by zero..........

Does anyone have any ideas what I am doing wrong ??

Thanks

Simon


================================
S.D.Bulman.
Senior Research Officer.
University of Wales Swansea.

S.D.Bulman at swansea.ac.uk

(W) +44 (0)1792 513179
(H)  +44 (0)1792 511144
================================

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010403/727b7a13/attachment.htm>


More information about the vtkusers mailing list