From 14a9d112655d1cf604d52c26442b7839cef24ca2 Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Fri, 17 Jan 2025 16:05:32 +0100 Subject: [PATCH] Test code --- src/creawxVTKRenderWindowInteractor.h | 2 ++ src/creawxVTKRenderWindowInteractor.mm | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/creawxVTKRenderWindowInteractor.h b/src/creawxVTKRenderWindowInteractor.h index 82b463a..f44653e 100644 --- a/src/creawxVTKRenderWindowInteractor.h +++ b/src/creawxVTKRenderWindowInteractor.h @@ -199,6 +199,8 @@ class CREA_EXPORT wxVTKRenderWindowInteractor : public wxWindow, public vtkRende vtkSetMacro(UseCaptureMouse,int); vtkBooleanMacro(UseCaptureMouse,int); + bool firstTimeOnPaint; + #if VTK_MAJOR_VERSION > 5 || (VTK_MAJOR_VERSION == 5 && VTK_MINOR_VERSION >= 2) protected: virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration); diff --git a/src/creawxVTKRenderWindowInteractor.mm b/src/creawxVTKRenderWindowInteractor.mm index edcd531..4aa7210 100644 --- a/src/creawxVTKRenderWindowInteractor.mm +++ b/src/creawxVTKRenderWindowInteractor.mm @@ -285,6 +285,7 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() this->Device=vtkTDxMacDevice::New(); #endif + firstTimeOnPaint=false; } //--------------------------------------------------------------------------- wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, @@ -332,6 +333,8 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, this->Device=vtkTDxMacDevice::New(); #endif + firstTimeOnPaint=false; + } //--------------------------------------------------------------------------- @@ -636,32 +639,33 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) } #endif #endif - + firstTimeOnPaint=true; } + //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event) { //turn off background erase to reduce flickering on MSW event.Skip(false); } + //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event)) { int w, h; GetClientSize(&w, &h); UpdateSize(w, h); - if (!Enabled) - { - return; - } - + { + return; + } #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) InvokeEvent(vtkCommand::ConfigureEvent, NULL); #endif //this will check for Handle //Render(); } + //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event) { -- 2.49.0