[vtkusers] Why is the text of vtkCaptionWidget displayed at the default position no matter what position value I set?

Liu_tj tjlp at netease.com
Sun Oct 23 11:13:14 EDT 2016


Hi, VTK guys,

When I display a vtkCaptionWidget, I want to set the position of the text. So I call the vtkActor2D:;SetPostion() and SetPosition2(), but when the widget is displayed, the text is alway at the left bottom corner, why? Below is my C# code:

vtkCaptionRepresentation rep = vtkCaptionRepresentation.New();
rep.GetCaptionActor2D().ThreeDimensionalLeaderOff();
           
rep.GetCaptionActor2D().GetTextActor().SetTextScaleModeToNone();
rep.GetCaptionActor2D().GetCaptionTextProperty().SetColor(0.0, 1.0, 0.0);
rep.GetCaptionActor2D().SetCaption(text);
rep.GetCaptionActor2D().GetProperty().SetColor(0.0, 1.0, 0.0);
rep.SetAnchorPosition(pointer);
rep.GetCaptionActor2D().GetTextActor().SetPosition(textPos1[0], textPos1[1]);
rep.GetCaptionActor2D().GetTextActor().SetPosition2(textPos2[0], textPos2[1]);
captionWidget.SetRepresentation(rep);
m_renderWin.Render();

Thanks
Liu Peng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161023/498dfbc0/attachment.html>


More information about the vtkusers mailing list