]> Creatis software - crea.git/commitdiff
Test code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 17 Jan 2025 15:05:32 +0000 (16:05 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 17 Jan 2025 15:05:32 +0000 (16:05 +0100)
src/creawxVTKRenderWindowInteractor.h
src/creawxVTKRenderWindowInteractor.mm

index 82b463a681d8bca11044b7cf46705c33e88a79c2..f44653eba8a885d3caf01d1b6ed635dcecbc1426 100644 (file)
@@ -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);
index edcd531cb9121b9849613b652d651fa819ddbc2f..4aa72102268b2705202013a6a7e493965474c965 100644 (file)
@@ -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)
 {