[vtkusers] hiding far labels

Murat Aydın murat.aydin at netcad.com.tr
Tue Nov 10 11:33:14 EST 2009


Hi,

Thanks for your help. I dont have vtkLabelPlacementMapper class in vtk 5.4.2. I am using vtkLabelPlacer and i couldnt find something similar to
UseDepthBufferOn in vtkLabelPlacer. When i compile with vtk_use_qt, i cant wrap some classes and methods (i am use .net wrapper for vtk).

Kind Regards,

murat


  ----- Original Message ----- 
  From: Jeff Baumes 
  To: Murat Aydın 
  Cc: vtkusers at vtk.org 
  Sent: Tuesday, November 10, 2009 3:58 PM
  Subject: Re: [vtkusers] hiding far labels


  2009/11/9 Murat Aydın <murat.aydin at netcad.com.tr>

    Hi,

    I am trying this example : 
    http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Rendering/Testing/Cxx/TestLabelPlacerCoincidentPoints.cxx?root=VTK&content-type=text/plain

    How can i hide far labels ? There are many labels and its hard to understand which label belongs to which object.


  You can hide labels that are behind other objects with UseDepthBufferOn(). There is no explicit way to turn off far labels, except that the labeler should automatically try to place labels close to the camera first, so far labels should be less frequent.


    Whats MaximumLabelFraction of vtkLabelPlacer?


  Maximum amount of screen space labels can take up before placement stops. I've checked in a documentation fix.


    Another question is how can i display labels vertical. i set LabelGravity to    VerticalBottomBit , VerticalBaselineBit 
      but labels are not displayed vertical.


  These flags just adjust the where the text is vertically aligned, not the rotation. The default text rendering strategy (freetype) does not support nicely rotated text. To get rotated text labels, you would need:


  1. Compile VTK with VTK_USE_QT.
  2. Use vtkLabelPlacementMapper instead of vtkLabelPlacer (it has similar API but a few more features).
  3. Set the label rendering strategy to an instance of vtkQtLabelRenderStrategy.
  4. Set the orientation of the text property in vtkPointSetToLabelHierarchy to the angle you desire (e.g. 90.0).


  Most of this code to do this is in
  Views/Testing/Cxx/TestQtLabelStrategy.cxx


  Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091110/016df08e/attachment.htm>


More information about the vtkusers mailing list