[vtkusers] vtkPropAssembly with vtkInteractorStyleTrackballActor behaviour

Dean Inglis dean.inglis at camris.ca
Mon Feb 22 17:25:23 EST 2010


David, Bill,

Ive looked into vtkAxesActor and wanted to point out a
few things.

- vtkAxesActor is a hybrid object with 2D and 3D actors
and currently only returns the 3D actors in the prop collection, but those 
actors could
be cast to vtkProp3D's, added to a vtkAssembly and then moved by the 
interactorstyle:

  vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();
    vtkSmartPointer<vtkPropCollection> collection = 
vtkSmartPointer<vtkPropCollection>::New();
  axes->GetActors(collection);
   collection->InitTraversal();
   vtkSmartPointer<vtkAssembly> movableAxes = 
vtkSmartPointer<vtkAssembly>::New();

  for(unsigned int i = 0; i < collection->GetNumberOfItems(); i++)
    {
    movableAxes->AddPart((vtkProp3D*)collection->GetNextProp());
    }

  renderer->AddActor(movableAxes);


- I tried to get picking to work properly in the case of 
vtkInteractorStyleTrackballActor
by copying much of the path code from vtkAssembly: it works, but I couldnt
figure out how to move the labels (in a reasonable amount of time). 
vtkAxesActor was originally
intended for use with vtkOrientationMarkerWidget and at the time it was 
added to vtk
I wasnt thinking of the scenario you presented in the MovableAxes example.

Dean



There is a bug (or feature) in vtkAxesActor.

GetActors returns a PropCollection, NOT a Prop3DCollection. The style
requires that the picked prop a a Prop3D, not a Prop.

It gets worse. The AxesActor is actually composed of Actors and
Actor2D's (the text is 2D). So even if we fixed AxesActor, the labels
won't rotate. I suspect that is why GetActors returns a
PropCollection.

Also, we can't fix AvesActor without breaking backward compatibility
unless we add a new method, something like GetProp3Ds().

Bill

On Sun, Feb 21, 2010 at 11:30 AM, David Doria <daviddoria+vtk at gmail.com> 
wrote:
> On Sun, Feb 21, 2010 at 11:01 AM, Bill Lorensen <bill.lorensen at 
> gmail.com>
> wrote:
>>
>> Can you provide a small example that illustrates the problem?
>
> Sure:
> http://www.vtk.org/Wiki/VTK/Examples/MovableAxes
> You'll notice that you can interact with the cone, but not the axes.
> Thanks,
>
> David
> _______________________________________________ 




More information about the vtkusers mailing list