[vtkusers] Re: About WM_PAINT management

xabi riobe xabivtk at gmail.com
Tue Jan 16 11:57:33 EST 2007


oops, another error, it's the call to me->Render() that i commented
out, if CallWindowProc is commented we enter an infinite loop of
renderings...

so to resume we have in vtkWin32RenderWindowInteractor :

LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
                                   LPARAM lParam,
                                   vtkWin32RenderWindowInteractor *me)
{
  if ((uMsg == WM_USER+13)&&(wParam == 26))
    {
    // someone is telling us to set our OldProc
    me->OldProc = (WNDPROC)lParam;
    return 1;
    }

  switch (uMsg)
    {
    case WM_PAINT:
      me->Render();
      return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
      break;


   ...


    default:
      if (me)
        {
        return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
        }
    };
  return 0;
}


and CallWindowProc leads to vtkWin32OpenGLRenderWindow::MessageProc
that does a second raycast, which is unpleasant since my data is
450Mo.

Any suggestion after all those rectifications?


Thanks,

Xabi.

2007/1/15, xabi riobe <xabivtk at gmail.com>:
> sorry, replace "CallMessageProc" by "CallWindowProc" and
> "ProcessMessage" by "MessageProc" in my post.
>
> i think i should drink a big coffee
>
> 2007/1/15, xabi riobe <xabivtk at gmail.com>:
> > Hi,
> >
> > I have an application built with VTK 5.0.2 and wxWidget and I noticed
> > on windowsXP that my views were rendered twice at creation or when
> > resizing. I looked in vtkWin32RenderWindowInteractor and I saw that in
> > vtkHandleMessage2 the code for the WM_PAINT event is a call to
> > Render(), wich implies a first rendering of the view, and then a
> > CallMessageProc.
> > At that point we enter in vtkWin32OpenGLRenderWindow::ProcessMessage
> > and there is another call to Render() on the WM_PAINT event.
> >
> > What I have temporaly done is put in comment the CallMessageProc call
> > and all works fine but it's not a clean solution.
> >
> > Maybe a system of flags or something else could avoid the second
> > rendering if we passed in the first Render() call?
> >
> > Does someone have an advice for that?
> >
> > Thanks
> > X.R.
> >
>



More information about the vtkusers mailing list