[vtkusers] vtkSelectVisiblePoints

L.J. van Ruijven (ACTA) L.J.vanRuijven at amc.uva.nl
Wed Apr 4 04:57:13 EDT 2001


Hello Simon,

I was interested in vtkLabeledDataMapper and vtkIdFilter, so I 
checked your program. It's still not OK, but insertion of the line 

   ids->FieldDataOn();

solves several problems. At least with my dataset.
 
Leo

> 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
> ================================
> 
> 


***************************************************************************
* drs L.J. van Ruijven                 Tel: 31 (0)20 566 5357               *
* Dept. of Functional Anatomy, ACTA    FAX: 31 (0)20 691 1856               *
* Meibergdreef 15                      email: L.J.vanRuijven at AMC.UvA.Nl   *
* 1105 AZ Amsterdam                                                       *
***************************************************************************





More information about the vtkusers mailing list