[vtkusers] edges between moving assemblies
creusot
creusot at cs.york.ac.uk
Thu Nov 4 11:12:21 EDT 2010
Hi Seb,
The idea is to visualize correspondences (lines) between landmarks
(small sphere) on two static 3D objects.
The assemblies content is fixed. I just use the
vtkInteractorStyleTrackballActor functionality to move the two
assemblies relative to each other and get the best view of the
correspondences.
I was hoping there is a way to define position relatively to object
rather than by absolute coordinates. It would be very handy to have
different frames of reference, the absolute one and others attached to
objects.
If it is not possible, can you advise me a good example of code using
observer updating a polydata?
On a different matter I have notice that mouse event observer doesnt
seem to work with vtkInteractorStyleSwitch but works with
vtkInteractorStyleTrackballCamera.
Example of code(python) that doesnt work (the function handle_mouse is
never called):
style = vtk.vtkInteractorStyleSwitch()
style.SetCurrentStyleToTrackballCamera()
style.AddObserver("LeftButtonPressEvent", handle_mouse);
Example that works:
style = vtk.vtkInteractorStyleTrackballCamera();
style.AddObserver("LeftButtonPressEvent", handle_mouse);
Is this a bug or a feature?
Thanks for your help,
Best regards,
Clement.
On 04/11/10 14:32, Sebastien Jourdain wrote:
> Hi Clement,
>
> I guess you will have to use Observer to listen change event on the
> sphere and update the tube/line start/endpoint according to the new
> coordinates.
> Do you change the assembly location, or the dataset itself ?
>
> Seb
>
> On Wed, Nov 3, 2010 at 12:11 PM, creusot<creusot at cs.york.ac.uk> wrote:
>
>> Hi,
>> I have a small problem to design the scene I want with VTK.
>> Basically I would like to have two Assemblies composed of several Actors
>> (small spheres) and a set of edges between the two Assemblies connecting a
>> subset of those spheres.
>> Creating the Assemblies is very easy but I don't know what to do for the
>> edges.
>> If I create an edge as an Actor using the initial position of the sphere
>> then the edges doesnt move when I move one of the Assembly compare to the
>> other.
>> How can I create a line or a tube which extremities are from two different
>> objects and are not fixed?
>> Best regards,
>> Clement.
>>
>> _______________________________________________
>> 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
>>
>>
More information about the vtkusers
mailing list