]> Creatis software - bbtk.git/blobdiff - packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx
#3107 BBTK Bug New Normal - branch vtk7itk4 compilation with vtk7
[bbtk.git] / packages / wxvtk / src / wxVTKRenderWindowInteractor.cxx
index 0435d9f99ce69957cd6f57c0dad6f1705d1cc4a3..2e58ec634d418100a745519632c075d2c0200372 100644 (file)
@@ -193,9 +193,12 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxWindow(), vtkRend
 #ifdef VTK_DEBUG_LEAKS
   vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor");
 #endif
+
   this->RenderWindow = NULL;
   this->SetRenderWindow(vtkRenderWindow::New());
   this->RenderWindow->Delete();
+  this->SetBackgroundStyle( wxBG_STYLE_COLOUR );
+  this->SetBackgroundColour( wxColor(0,0,0,0) );
 }
 //---------------------------------------------------------------------------
 wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
@@ -229,6 +232,8 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
   // so we update the size information of the interactor/renderwindow here
   this->UpdateSize(size.x, size.y);
 #endif
+  this->SetBackgroundStyle( wxBG_STYLE_COLOUR );
+  this->SetBackgroundColour( wxColor(0,0,0,0) );
 }
 //---------------------------------------------------------------------------
 wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor()
@@ -311,15 +316,17 @@ void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
       Size[1] = y;
       // and our RenderWindow's size
       RenderWindow->SetSize(x, y);
-    }
-  }
+    } // if x y
+  } // if RenderWindow
 }
 //---------------------------------------------------------------------------
 int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
 {
   // it's a one shot timer
   if (!timer.Start(10, TRUE))
-    assert(false);
+       {
+       assert(false);
+       }
 
   return 1;
   
@@ -333,9 +340,11 @@ int wxVTKRenderWindowInteractor::DestroyTimer()
 //---------------------------------------------------------------------------
 void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
 {
-  if (!Enabled)
-    return;
-    
+       if (!Enabled)
+       {
+           return;
+    }
+
 #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
     // new style
     InvokeEvent(vtkCommand::TimerEvent, NULL);
@@ -417,6 +426,7 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
     rwin->UpdateGLRegion();
   }
 #endif
+
 }
 //---------------------------------------------------------------------------
 void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
@@ -445,18 +455,17 @@ void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
 //---------------------------------------------------------------------------
 void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
 {
- if (!Enabled) 
+       this->Render();
+
+       if (!Enabled) 
     {
-    return;
+       return;
     }
 #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-  SetEventInformationFlipY(event.GetX(), event.GetY(), 
-    event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-
+  SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
   InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
 #else
-  InteractorStyle->OnMouseMove(event.ControlDown(), event.ShiftDown(),
-    event.GetX(), Size[1] - event.GetY() - 1);
+  InteractorStyle->OnMouseMove(event.ControlDown(), event.ShiftDown(), event.GetX(), Size[1] - event.GetY() - 1);
 #endif
 }
 //---------------------------------------------------------------------------
@@ -470,14 +479,11 @@ void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
 
 #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
     // new style
-  SetEventInformationFlipY(event.GetX(), event.GetY(), 
-      event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-
+  SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
   InvokeEvent(vtkCommand::EnterEvent, NULL);
 #else
     // old style
-  InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);  
+  InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(), event.GetX(), Size[1] - event.GetY() - 1);  
 #endif
 }
 //---------------------------------------------------------------------------