[vtkusers] Change position of text in vtkImagePlaneWidget

Jothybasu Selvaraj jothybasu at gmail.com
Tue Mar 22 19:20:10 EDT 2016


Thanks Inglis

TextActor is protected so you can't use TextActor->getPositionCoordinate()

Jothy

On Wed, Mar 23, 2016 at 3:52 AM, DL I <inglis.dl at gmail.com> wrote:

> Hi Jothy
>
> When the widget it first instantiate it calls GenerateText() and sets its
> default position to the lower left corner of the renderer:
>   vtkCoordinate* coord = this->TextActor->GetPositionCoordinate();
>   coord->SetCoordinateSystemToNormalizedViewport();
>   coord->SetValue(.01, .01);
>
> so after instantiating the widget, you could do once:
> - search the renderer's props for a vtkTextActor, since there is no API to
> get it directly from the widget
> - then get the position coordinate and change its value as shown above or
> per Cory's comments in this thread
>
> Dean
>
>
>
> On Tue, Mar 22, 2016 at 9:45 AM, Cory Quammen <cory.quammen at kitware.com>
> wrote:
>
>>
>> http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#aaca4703dddf59c9bdcf5773f5025a508
>>
>> or
>>
>>
>> http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#afb72d3b2dbb0a5860f6fc7d46943b637
>>
>>
>> On Tue, Mar 22, 2016 at 1:29 AM, Jothybasu Selvaraj <jothybasu at gmail.com>
>> wrote:
>> > Hi All
>> >
>> > I want to change the position of the vtkTextActor (which displays the
>> image
>> > data value and window level/width). By default its on the lower left
>> corner,
>> > I already have something displayed there. How can I do this?
>> >
>> > Any hints?
>> >
>> > Thanks
>> >
>> >
>> > Jothy
>> >
>> > _______________________________________________
>> > 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
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> R&D Engineer
>> Kitware, Inc.
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160323/aa99f52d/attachment.html>


More information about the vtkusers mailing list