[vtkusers] Hide non visible labels on a 3d model

Fernando Nellmeldin f.nellmeldin at open-engineering.com
Mon Jan 25 04:39:56 EST 2016


Hello.
I'm trying to show the values of a contour as labels. Each label is fixed
to a point in the contour. I do not want to show the labels that are
anchored to points that are not visible.

To achieve this, I followed these two examples:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/LabelContours
http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Annotation/Python/labeledMesh.py

Unfortunately, the removal of hidden points (and thus, of labels) is not
working as expected. I attach three pictures of the behavior when I move
the camera. Look at the values on the top (365 and 399).

The Pipeline I am using is the following:
vtkUnstructuredGrid -> vtkGeometryFilter -> vtkContourFilter -> vtkStripper
-> (create a vtkPolyData with one point of each contour) ->
vtkSelectVisiblePoints -> vtkLabeledDataMapper -> vtkActor2D.

I am using VTK 5.10 but I tried with VTK 6.3 and the problem is worse
(nothing is hidden). This is under Windows 8.1.

Any ideas?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160125/2fdfcd2c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: contour_labels_problem.png
Type: image/png
Size: 158223 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160125/2fdfcd2c/attachment-0001.png>


More information about the vtkusers mailing list