[vtkusers] modify a text in the renderer with the mose move event

Jérôme jerome.velut at gmail.com
Wed Nov 18 14:40:52 EST 2009


Hi,
Please "Reply all" when you answer, so that me, David and anybody interested
could follow the *whole* thread!

Well, if you remove your text actor after creating it, you certainly won't
have text displayed...
For the first solution, you obviously have to memorize the previous added
actor, then you can remove it when you want:
It seems that you dont use the Object Oriented capability of python, so you
can forget the second solution.

Jerome

2009/11/18 Rim AYARI <rim.ayari at gmail.com>

> Thanks a lot for your reply,
>
> I tried to remove the actor before adding a new one but when i add
> renderer.RemoveActor(textActor) after creating a new one the result is no
> text in the renderer
>
>  for the second solution i use python not C++ i will try to make a list of
> actor.
>
> thanks agin
> ----------------
> Rim AYARI
> Computer Science Engineer, Master ATS Student
> Focus of Interest: Medical Image Processing
> Ecole Nationale d'Ingénieurs de Tunis
>
>
>
> 2009/11/18 Jérôme <jerome.velut at gmail.com>
>
> Hi,
>>
>> If this part of code is inside your MoveMouse callback function, then you
>> create a new actor as soon as you move, without hiding/removing the previous
>> one.
>>
>> 2 solutions, if this is the problem:
>> - remove the actor before adding a new one
>> - make Tactorx a member and instanciate it only once
>>
>> HTH
>> Jerome
>>
>> 2009/11/18 RimAY <rim.ayari at gmail.com>
>>
>>>
>>> Dear All ,
>>> Can someone give me an idea how can i change a text in the renderer with
>>> the
>>> mouse move event.
>>> I try with vtktextactor this is the part of my code:
>>>
>>> Tactorx = vtkTextActor()
>>> Tactorx.SetInput(cx)
>>> Tactorx.SetDisplayPosition(70,170)
>>> Tactorx.GetTextProperty().SetJustificationToCentered()
>>> renderer.AddActor(Tactorx)
>>> Tactorx.Modified()
>>>
>>> cx change its value with the mose move, i get the new value above the
>>> ancien
>>> one, the result is an illegible text :(
>>>
>>> Thanks a lot
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/modify-a-text-in-the-renderer-with-the-mose-move-event-tp26403090p26403090.html
>>> Sent from the VTK - Users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091118/0e73293e/attachment.htm>


More information about the vtkusers mailing list