[vtkusers] Picking Actors in vtk 4.0/4.2

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Tue Mar 22 04:59:01 EST 2005


[resend - bounced]
What you ought to do is look at the 
RenderwindowInteractor::SetEventPosition, then call OnLeftDown on the 
style class afterwards. (Forgive me if I've forgotten something)

JB


Bill Vogler wrote:

> Hello -
>
> I am porting our application from vtk 4.0 to vtk 4.2 and am having 
> problems
> with some classes that were valid in 4.0 and are now obsolete in 4.2. The
> class that is obsolete is vtkInteractorStyleTrackball.
>
> My present problem is with ::OnLeftButtonDown(). I need to modify the
> following code so it is compatible with 4.2. In our application, the user
> selects an actor by clicking it with "Ctrl Left Button". If the "ctrl"
> button was not used then 
> vtkInteractorStyleTrackball::OnLeftButtonDown() is
> called:
>
> void FaceInteractorStyle::OnLeftButtonDown(int ctrl, int shift, int X,
> intY){
>     if( ctrl ) {
>
>          // If the ctrl left button is pressed, get the actor.
>
>          this->InteractionPicker->Pick( X, Y, 0.0, m_renderer );
>          vtkActor *actor = this->InteractionPicker->GetActor();
>          if( actor == NULL )
>           return;
>
>          m_modelView->ActorSelected( actor );
>     }
>     else {
>      vtkInteractorStyleTrackball::OnLeftButtonDown( ctrl,  shift,  X,  
> Y);
>     }
> } // end of OnLeftButtonDown
>
> It appears that major modifications were made in 4.2 and among other 
> things
> OnLeftButtonDown() does not take any arguments.
>
> Normally I wouldn't be bothering you folks on this list, but I can't find
> any references or documentation on the migration path to 4.2. Can anyone
> point me to any documentation, or provide some hints on how I can modify
> this code segment to bring it up to V4.2?
>
> TIA
>
> Bill Vogler
> Calabazas Creek Research
> (530) 642-1955 Voice
> (530) 642-9614 Fax
> vogler at calcreek.com
>
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the 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/20050322/5cac4b43/attachment.htm>


More information about the vtkusers mailing list