[vtkusers] BUG in vtkLeaderActor2D?

Dean Inglis dean.inglis at camris.ca
Wed May 16 11:19:00 EDT 2007


Hi,

I am trying to use vtkAngleWidget
and I also want to see the length
of the two rays, which are vtkLeaderActor2D's.
I do:
vtkAngleRepresentation2D* rep =
(vtkAngleRepresentation2D*)widget->GetRepresentation();
rep->GetRay1()->AutoLabelOn();
rep->GetRay2()->AutoLabelOn();

However, although the leader lines are clearly
cropped around where the text should be,
the text is not there.  Can anyone confirm
with the tcl script below???

Dean

package require vtk
package require vtkinteraction

  #  Create the RenderWindow, Renderer and both Actors
  #
  vtkRenderer ren1
  vtkRenderWindow renWin
  renWin AddRenderer ren1

  vtkInteractorStyleImage istyle

  vtkRenderWindowInteractor iren
  iren SetRenderWindow renWin
  iren SetInteractorStyle istyle

  #  Create a test pipeline
  #
vtkTIFFReader reader
reader SetFileName "$VTK_DATA_ROOT/Data/beach.tif"

vtkImageActor ia
ia SetInput [reader GetOutput]


  vtkPointHandleRepresentation2D handle
  [handle GetProperty] SetColor 1 0 0

  #  Create the widget and its representation
  vtkAngleRepresentation2D rep
  rep SetHandleRepresentation handle
  rep InstantiateHandleRepresentation
  [ rep GetRay1 ] AutoLabelOn
  [[ rep GetRay1 ] GetProperty ] SetColor 0 0 1


  vtkAngleWidget widget
  widget SetInteractor iren
  widget SetRepresentation rep


  #  Add the actors to the renderer, set the background and size
  #
  ren1 AddActor ia
  ren1 SetBackground 0.1 0.2 0.4
  renWin SetSize 300 300

# render the image
#
iren AddObserver UserEvent {wm deiconify .vtkInteract}
iren Initialize

# prevent the tk window from showing up then start the event loop
wm withdraw .






More information about the vtkusers mailing list