[vtkusers] vtkPointSpriteMapper details

John Biddiscombe biddisco at cscs.ch
Mon Jan 19 11:11:36 EST 2009


Paul


> 1) More curiousity than anything else: It looks like you have disabled 
> display-lists, and it only works in ImmediateMode rendering.  Will 
> display-lists ever be supported, or do they cause trouble?

Display lists should really be managed by the painter classes. the 
PointSpriteMapper was originally a "mapper" but I wanted to turn it into 
a Painter. Within the new vtk Rendering framework, painters can be 
delegated to do smaller taks than whole mappers.

My intention was to use VertexBufferObjects and use the Painter 
framework, but I've just never had time to do it.

> 2) In this set of code from vtkPointSpriteMapper.cpp line 1522 
>   int Np = points->GetNumberOfPoints();
>   int Nc = input->GetVerts()->GetNumberOfCells();
>   if (this->IgnoreVertexCells || Nc==0 || Nc==Np) {
>     RenderFlags |= VTK_PSM_USE_POINTS;
>   }
>
> Why does the if() include the test for Nc == 0

1) If user has supplied N points and N cells, with one cell per point, 
it's quicker to traverse the points directly than loop over the cells.
2) If there are no cells suplied, then just use the points (Nc==0). I 
sometime read data and just don't bother creating cells at all. The 
spritemapper will just render the points and skip all cell related activity.


> What if I have a static set of points+colours, and I want to plot none 
> of them?  I would like to just set the verticies to an empty cell 
> array, but at the moment it looks like I have to disable or remove the 
> actor from the renderer.
actor->SetVisibility(0) !!

yes?

Sorry the idea of having blanking by using an empty cell array never 
occured to me, you can remove the Nc==0 check if it bothers you. It 
won't break anything else.

JB





More information about the vtkusers mailing list