+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: wxVTKRenderWindowInteractor.cxx,v $
Language: C++
- Date: $Date: 2011/02/17 11:01:27 $
- Version: $Revision: 1.4 $
-
- Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
- All rights reserved.
- See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notice for more information.
+ Date: $Date: 2012/11/16 08:52:36 $
+ Version: $Revision: 1.5 $
=========================================================================*/
EVT_SIZE (wxVTKRenderWindowInteractor::OnSize)
END_EVENT_TABLE()
-vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision: 1.4 $")
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision: 1.5 $")
+#else
+ //...
+#endif
+
vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor)
//---------------------------------------------------------------------------
#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,
// 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()
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;
//---------------------------------------------------------------------------
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);
rwin->UpdateGLRegion();
}
#endif
+
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &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
}
//---------------------------------------------------------------------------
#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
}
//---------------------------------------------------------------------------