[vtkusers] vtkPointSpriteMapper details

Paul Harris harris.pc at gmail.com
Mon Jan 19 19:34:14 EST 2009


Hi John,

2009/1/20 John Biddiscombe <biddisco at cscs.ch>

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

I ended up using SetVisibility(0) along with some more code, so thats all
done now.  The mapper works very well :)


I understand why you have the Nc==0 (convenience), but what if a user were
to read in points from one file, colour scalar values from another, and
cells from another file, and then push the data into the SpriteMapper ?

Then it work work perfectly if there was more than zero cells in the file,
but if the cell file was empty, all the points would be plotted.  Its
behaviour is not consistent.   It requires more work on the user's end to
test if they have no cells and to turn the actor off.  That requires an
additional link between the cell array and the actor.   Could be difficult
if someone were using it in an application like Paraview ?

Anyway, its not a problem for me (now), but I wonder if someone else may be
surprised in the future.

thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090120/decc7fed/attachment.htm>


More information about the vtkusers mailing list