[vtkusers] help with renderwindow just a part of MFC window

Renaud Isabelle renauisa at yahoo.fr
Tue Aug 23 14:04:49 EDT 2005


Hi, 
 
I got some problems with handling interaction between MFC interface and vtkRenderWindow.
 
The main problem that I have, lies in the fact that my render window is just a small part of my MFC window (CView). Indeed, when left button mouse is pressed in the MFC window, my function renderWindow->SelectPoint() is called only when clicked point is not in the render window. I checked out if my interactor size was set to correct dimensions and it is actually the case. But I can't figure out why my function is called only when I clicked outside the render window. 
 
- Maybe the origin of the problem is that I am missing something with SetParentId, SetWindowId and so on... 
 
Most of the examples that I read deal with a vtkRenderWindow's size the same than CView's size: in this case, myRenderWindow->SetParentId(this->h_Wnd) seems to fit exactly. 
 
 
Here is what I did: 
 
 // setup the parent window
 myRenderWindow->SetParentId(this->m_hWnd);
 myRenderWindow->WindowInitialize();
 
 CRect rect;
 GetDlgItem(IDC_RECT)->GetWindowRect(rect);
myRenderWindow->SetPosition(rect.left,rect.top);
myRenderWindow->SetSize(rect.Width(),rect.Height());

 
- Now, I saw an example where: 
 
HWND hWndRenderer = ::CreateWindowEx(WS_EX_CLIENTEDGE, OCT3DRENDERCLASS, NULL, WS_CHILD|WS_VISIBLE|WS_TABSTOP, 7, 7, nWidth, nHeight, m_hWnd, NULL, AfxGetInstanceHandle(), NULL);
 
 myRenderWindow->SetParentId(hWndRenderer);
 
Does someone try this kind of thing? Do you think this could be the solution? Or maybe someone has examples where, like me, the render window is just a part of a MFC window.
 
- Or, maybe, my problem comes from somewhere else: timer, interactor->Start()... because after a while everything works fine.
 
I hope someone can help me.....
 
Isabelle
 

		
---------------------------------
 Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
 Téléchargez le ici !  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050823/9090a3ab/attachment.htm>


More information about the vtkusers mailing list