[vtkusers] Slow rendering by vtkLabeledDataMapper... How to increase speed??
Jeff Baumes
jeff.baumes at kitware.com
Mon Feb 22 14:33:14 EST 2010
You may want to take a look at vtkLabelPlacementMapper, which will
only render a subset of non-overlapping labels. From doxygen:
vtkLabelPlacementMapper
Places and renders non-overlapping labels. To use this mapper, first
send your data through vtkPointSetToLabelHierarchy, which takes a set
of points, associates special arrays to the points (label, priority,
etc.), and produces a prioritized spatial tree of labels. This mapper
then takes that hierarchy (or hierarchies) as input, and every frame
will decide which labels and/or icons to place in order of priority,
and will render only those labels/icons. A label render strategy is
used to render the labels, and can use e.g. FreeType or Qt for
rendering.
Jeff
On Sat, Feb 20, 2010 at 3:28 AM, Rakesh Patil <rakeshthp at in.com> wrote:
> Hello,
>
> I want to display the elevation values at each and every node in the grid. I
> found, the class
>
> vtkLabeledDataMapper
>
> that suits to my task. I was able to get the labels with elevation values
> printed at each and every nodes.
> But i found that by doing so, the rendering becomes very slow.. If i scroll
> just a one unit, it takes around 4-5 seconds to display the zoomed data.
> What can i do to improve the speed of rendering..?? Or to get fast
> rendering..?? Here is my code,
>
> vtkIdFilter *ids = vtkIdFilter::New();
> ids->SetInput(unGrid);
> ids->PointIdsOn();
> ids->FieldDataOn();
>
> vtkLabeledDataMapper *lbm = vtkLabeledDataMapper::New();
> lbm->SetInputConnection( ids->GetOutputPort());
> lgm->SetLabelModeToLabelScalar();
>
> vtkActor2D *act = vtkActor2D::New();
> act->SetMapper(lbm);
>
> pRenderer->AddActor2D(act);
>
> Any thing to be changed or added to improve the speed ..??
>
> Thanks
>
> R egards
> Rakesh Patil
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list