Above all, I'm really appreciated to this great project.
I used this control to surface plot some function like
f1(x,y) =z
The plot result is very successful.
But If I plot some other function f2 after plot f1 function, I have some problem to update render window. ( the window is only updated after mouse click the window region)
My appraoch is as follows.
1. before plot, clear renderer
ren.RemoveAllViewProps();
ren.Clear();
2. after add all actor, set camera and renderer render()
ren.ResetCamera();
ren.GetActiveCamera().Zoom(1.0);
ren.GetActiveCamera().Elevation(-55);
ren.GetActiveCamera().Azimuth(25);
ren.ResetCameraClippingRange();
ren.Render();
In this case, renWin never update scene before click window region with mouse button.
I tryed renWin.Render(), OK. this update window immediately. But it launched anthor form window, so this is not that I want.
Is there any solution?
--lotus--
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you may just need to call Invalidate() on the control. That will tell Windows that it needs to redraw the screen. Then, inside the control's OnPaint() method, it will ask call RenderWindowInteractor::Render(), which seems to be the current accepted place to call Render().
It is interesting that you could convince the render window to pop up another window. I think the call to Clear() disconnects the render window from the Forms control to which it should be bound.
Drew
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi adolgert.
Above all, I'm really appreciated to this great project.
I used this control to surface plot some function like
f1(x,y) =z
The plot result is very successful.
But If I plot some other function f2 after plot f1 function, I have some problem to update render window. ( the window is only updated after mouse click the window region)
My appraoch is as follows.
1. before plot, clear renderer
ren.RemoveAllViewProps();
ren.Clear();
2. after add all actor, set camera and renderer render()
ren.ResetCamera();
ren.GetActiveCamera().Zoom(1.0);
ren.GetActiveCamera().Elevation(-55);
ren.GetActiveCamera().Azimuth(25);
ren.ResetCameraClippingRange();
ren.Render();
In this case, renWin never update scene before click window region with mouse button.
I tryed renWin.Render(), OK. this update window immediately. But it launched anthor form window, so this is not that I want.
Is there any solution?
--lotus--
Hi Lotus,
I think you may just need to call Invalidate() on the control. That will tell Windows that it needs to redraw the screen. Then, inside the control's OnPaint() method, it will ask call RenderWindowInteractor::Render(), which seems to be the current accepted place to call Render().
It is interesting that you could convince the render window to pop up another window. I think the call to Clear() disconnects the render window from the Forms control to which it should be bound.
Drew
Thank your for your answer.
Your answer is right.
I tried invalidate() method and remove of Clear(). result is good.
If I do not remove Clear(), vtk's scalrbar never refreshed until click windows.
But if I use redWin.Render still generate another window.