From 068736aef75f23b4ce874a28b16c051c326f1df2 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 28 Jul 2022 11:41:18 +0200 Subject: [PATCH] Clean code --- src/creawxVTKRenderWindowInteractor.mm | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/creawxVTKRenderWindowInteractor.mm b/src/creawxVTKRenderWindowInteractor.mm index 1dab3fa..33f4e84 100644 --- a/src/creawxVTKRenderWindowInteractor.mm +++ b/src/creawxVTKRenderWindowInteractor.mm @@ -270,6 +270,7 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() , RenderWhenDisabled(1) , UseCaptureMouse(0) { + #ifdef VTK_DEBUG_LEAKS vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor"); #endif @@ -284,7 +285,6 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() this->Device=vtkTDxMacDevice::New(); #endif - } //--------------------------------------------------------------------------- wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, @@ -311,6 +311,7 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, , RenderWhenDisabled(1) , UseCaptureMouse(0) { + #ifdef VTK_DEBUG_LEAKS vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor"); #endif @@ -331,8 +332,8 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, this->Device=vtkTDxMacDevice::New(); #endif - } + //--------------------------------------------------------------------------- wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor() { @@ -345,14 +346,15 @@ wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor() #ifdef VTK_USE_TDX this->Device->Delete(); #endif - } + //--------------------------------------------------------------------------- wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New() { // we don't make use of the objectfactory, because we're not registered return new wxVTKRenderWindowInteractor; } + //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::Initialize() { @@ -360,13 +362,11 @@ void wxVTKRenderWindowInteractor::Initialize() // enable everything and start rendering Enable(); //RenderWindow->Start(); - // set the size in the render window interactor Size[0] = size[0]; Size[1] = size[1]; - // this is initialized - Initialized = 1; + Initialized = 1; } //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::Enable() @@ -390,14 +390,12 @@ void wxVTKRenderWindowInteractor::Enable() } #endif - - Modified(); + } //--------------------------------------------------------------------------- bool wxVTKRenderWindowInteractor::Enable(bool enable) { - #ifdef VTK_USE_TDX if(this->UseTDx) { @@ -406,8 +404,6 @@ bool wxVTKRenderWindowInteractor::Enable(bool enable) } #endif - - #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) return wxGLCanvas::Enable(enable); #else @@ -419,8 +415,9 @@ void wxVTKRenderWindowInteractor::Disable() { // if already disabled then done if (!Enabled) + { return; - + } #ifdef VTK_USE_TDX if(this->Device->GetInitialized()) { @@ -472,19 +469,21 @@ int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype)) { // it's a one shot timer if (!timer.Start(10, TRUE)) + { return 0; - + } return 1; - } + #if VTK_MAJOR_VERSION > 5 || (VTK_MAJOR_VERSION == 5 && VTK_MINOR_VERSION >= 2) //------------------------------------------------------------------ int wxVTKRenderWindowInteractor::InternalCreateTimer(int timerId, int timerType, unsigned long duration) { if (!timer.Start(duration, timerType == OneShotTimer)) + { return 0; - + } return ID_wxVTKRenderWindowInteractor_TIMER; } //------------------------------------------------------------------ @@ -494,12 +493,14 @@ int wxVTKRenderWindowInteractor::InternalDestroyTimer(int platformTimerId) return 1; } #endif + //--------------------------------------------------------------------------- int wxVTKRenderWindowInteractor::DestroyTimer() { // do nothing return 1; } + //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event)) { -- 2.47.1