Hi John,<br><br><div class="gmail_quote">2009/1/20 John Biddiscombe <span dir="ltr"><biddisco@cscs.ch></span><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2) In this set of code from vtkPointSpriteMapper.cpp line 1522 int Np = points->GetNumberOfPoints();<br>
int Nc = input->GetVerts()->GetNumberOfCells();<br>
if (this->IgnoreVertexCells || Nc==0 || Nc==Np) {<br>
RenderFlags |= VTK_PSM_USE_POINTS;<br>
}<br>
<br>
Why does the if() include the test for Nc == 0<br>
</blockquote>
<br></div>
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.<br>
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.<div class="Ih2E3d">
<br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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.<br>
</blockquote></div>
actor->SetVisibility(0) !!<br>
<br>
yes?<br>
<br>
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.<br><font color="#888888">
</font></blockquote><div><br>I ended up using SetVisibility(0) along with some more code, so thats all done now. The mapper works very well :)<br><br><br>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 ?<br>
<br>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 ?<br>
</div></div><br>Anyway, its not a problem for me (now), but I wonder if someone else may be surprised in the future.<br><br>thanks,<br>Paul<br><br>