[vtkusers] General question to vtkAssembly
Will Schroeder
will.schroeder at kitware.com
Fri Jul 7 07:03:13 EDT 2000
Hi Jan-
Recent changes to the assembly infrastructure (within the last month)
eliminate the need for copies. This was done to unify picking, and in
general to improve assembly support. You'll have to download or CVS
the latest stuff to get this functionality.
There are currently two types of assemblies: vtkPropAssembly and
vtkAssembly. vtkPropAssembly is useful for turning on/off visibility on
groups of vtkProps (any type of prop, 2D, 3D, volume, etc.), or adding
a group of props to a renderer. vtkAssembly can do the same thing with
the added bonus that it propagates transformations through the hierarchy.
vtkAssembly can now handle (as parts) any combination of vtkProp3D's,
including volumes, actors, and other assemblies.
Intimately connected with assembly management is picking, which has been
heavily reworked as well. The basic idea when you pick now is that you get
a vtkAssemblyPath, which is an ordered collection of vtkAssemblyNodes,
where each node holds a reference to a vtkProp plus an optional vtkMatrix4x4.
(The matrices are concatenated along the path.) When you pick, you can still
ask for the actor (vtkAbstractPropPicker::GetActor()) or whatever else you
want,
but these are really just convenience methods that ask the picked assembly
path
for the leaf node (casting to the correct type as appropriate) or the root
node
(if asking for an assembly with GetAssembly()).
This functionality is still not as stable as I'd like. If you look at the
quality dashboard http://public.kitware.com/vtk/quality/MostRecentResults/
you'll see that several tests related to assemblies/picking are failing on some
systems. I am actively cleaning this up now, and hope to have everything
settled by next week. I would enjoy your continuing feedback if and when
you try to use this functionality.
Will
At 11:13 AM 7/7/2000 +0200, Jan Ehrhardt wrote:
>we try to implement our own classes for objects in a 3D-scene basing
>on vtkActors. Among other things we want to group such objects
>(dynamically).
>Those object groups are implemented using vtkAssembly -- but strange
>things
>happen:
>I can select a group from the menu and move (translate/rotate) the whole
>
>group--
>well this works.
>But when I pick an actor (not the whole group! [vtkPicker::GetActor()])
>the returned
>actor isn´t the actor I have previously added to the assembly !!! Why
>actors are copied
>internally? Further all transformations (translation/rotation), which I
>interactively perform
>to the actor (the picked one) are again removed, as soon as I move
>another actor.
>This seems a bit strange.
>
>I want to do the following:
>- dynamically grouping objects (creating groups, deleting groups)
>- picking a group and moving the whole group (maybe picking by a menu)
>- picking an actor from a group and moving this actor relative to the
>group (picking by vtkPicker)
>
>How does vtkAssembly work for these purposes ??
More information about the vtkusers
mailing list