actor picking with vtkWin32RenderWindowInteractor

Agris Klimkans agris at phc.chalmers.se
Mon May 22 11:32:21 EDT 2000


Thanks, Patric!

When I use the following code in my doc/view app (I don't know how safe it is to use in MFC), both the mouse and keyboard commands works:

> void CMadelungView::PrepareForUnitCellPlot()
> {
> ....
>  m_pRenderer = vtkRenderer::New();
>  m_pRenWin = vtkWin32OpenGLRenderWindow::New();
>  HWND hwnd = this->GetSafeHwnd();
>   m_pRenWin->AddRenderer(m_pRenderer);
>   m_pRenWin->SetWindowId(hwnd);      // instead of m_pRenWin->SetParentId(hwnd);
> 
>  m_pIren = vtkWin32RenderWindowInteractor::New();
>  m_pIren->SetRenderWindow(m_pRenWin);
>...
However, there are some features what I haven't figured out yet, like after picking the actors with keyboard "p". Then at the moment when I exit from my app, it crashes in the vtkCommon.dll function 'vtkCollection::RemoveItem(vtkObject *a)'...

As to picking, I am thinking to use different interactors for different cases, by customizing vtkInteractorStyle.
I hope it will work.


Sincerely,
Agris


----- Original Message ----- 
From: <Patric.Weis at mycrona.de>
To: "Agris Klimkans" <agris at phc.chalmers.se>; <vtkusers at public.kitware.com>
Sent: Monday, May 22, 2000 3:51 PM
Subject: Re: actor picking with vtkWin32RenderWindowInteractor


> 
> Hi Agris!
> 
> Maybe the following can help:
> 
> To 1)
>    Did you try the mfc sample in the ..\sample directory, loading e.g.
> weldedSpheres.vtk? Does this work? It's no problem with Win NT.
> 
> To 2)
>    The easiest way is an explicit call of
> vtkWin32RenderWindowInteractor::OnChar() in your menu command function,
> e.g.
> 
>       m_pIren->OnChar(this->GetSafeHwnd(), int('p'), 1, 0);
> 
> 
> Patric Weis
> MYCRONA GmbH
> 
> 
> - - - Original Message - - -
> 
> 
> 
>                                                                                                                                           
>                     "Agris Klimkans"                                                                                                      
>                     <agris at phc.chalmers.se>        An:     "vtk" <vtkusers at public.kitware.com>                                            
>                     Gesendet von:                  Kopie:                                                                                 
>                     owner-vtkusers at public.k        Thema:  actor picking with vtkWin32RenderWindowInteractor                              
>                     itware.com                                                                                                            
>                                                                                                                                           
>                                                                                                                                           
>                     20.05.00 17:37                                                                                                        
>                     Bitte antworten an                                                                                                    
>                     "Agris Klimkans"                                                                                                      
>                                                                                                                                           
>                                                                                                                                           
> 
> 
> 
> Hi!
> 
> I am writing a MFC doc/view program on a w2k computer and encountered
> difficulties with actor picking.
> To set up the renderer, window and interactor I am using the following code
> 
> void CMadelungView::PrepareForUnitCellPlot()
> {
> ....
>  m_pRenderer = vtkRenderer::New();
>  m_pRenWin = vtkWin32OpenGLRenderWindow::New();
>  HWND hwnd = this->GetSafeHwnd();
>   m_pRenWin->AddRenderer(m_pRenderer);
>   m_pRenWin->SetParentId(hwnd);
> 
>  m_pIren = vtkWin32RenderWindowInteractor::New();
>  m_pIren->SetRenderWindow(m_pRenWin);
> ......
> }
> 
> 1) I can rotate and zoom actors with mouse, but keyboard commands (like "p"
> - picking, "w" - wireframe, etc.) doesn't work. Is there something missing
> in my code?
> 2) I would like also to start picking of actors with a menu command instead
> of "p". Is there an easy way how to do it?
> 
> 
> 
> 
> Thanks in advance!
> ---------------------------------
> Agris Klimkans
> Department of Physical Chemistry
> Chalmers University of Technology
> S-41296 Goteborg
> Sweden
> 
> tel. 46-031-7723051
> fax. 46-031-7723858
> mailto:agris at phc.chalmers.se
> http://www.che.chalmers.se/~agris
> ---------------------------------
> 
> 
> --------------------------------------------------------------------
> This is the private VTK discussion list. Please keep messages on-topic.
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
> <majordomo at public.kitware.com>. For help, send message body containing
> "info vtkusers" to the same address.
> --------------------------------------------------------------------
> 
> 
> 

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list