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

de Boer Ingo I.deBoer at polytec.de
Wed Aug 24 03:15:27 EDT 2005


Hi Isabelle,

there are some new sample in the CVS, also at

http://public.kitware.com/Bug/bug.php?op=show&bugid=649

greets
  Ingo



---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255
  
-----Original Message-----
From: vtkusers-bounces+i.deboer=polytec.de at vtk.org [mailto:vtkusers-bounces+i.deboer=polytec.de at vtk.org]On Behalf Of Renaud Isabelle
Sent: Tuesday, August 23, 2005 8:05 PM
To: insight-users at itk.org; vtkusers at public.kitware.com
Subject: [vtkusers] help with renderwindow just a part of MFC window


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 ! 



More information about the vtkusers mailing list