# include "vtkVersion.h"
#endif
+
#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
# include "vtkCommand.h"
#else
#ifdef VTK_USE_TDX
-// #import "vtkTDxMacDevice.h"
-#import "/Users/davila/Creatis/C11/tpli/include/vtk-8.2/vtkTDxMacDevice.h"
+#import "vtkTDxMacDevice.h"
#endif
// To access objc calls on cocoa
#ifdef __WXCOCOA__
-#ifdef VTK_USE_COCOA
-// This trick is no longer need in VTK CVS, should get rid of that:
+
#define id Id
-#else
-#error Build mismatch you need both wxWidgets and VTK to be configure against Cocoa to work
-#endif //VTK_USE_COCOA
+
+// #ifdef VTK_USE_COCOA
+// // This trick is no longer need in VTK CVS, should get rid of that:
+// #define id Id
+// #else
+// #error Build mismatch you need both wxWidgets and VTK to be configure against Cocoa to work
+// #endif //VTK_USE_COCOA
+
#endif //__WXCOCOA__
#if wxMAJOR_VERSION <= 2
, RenderWhenDisabled(1)
, UseCaptureMouse(0)
{
+
#ifdef VTK_DEBUG_LEAKS
vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor");
#endif
this->Device=vtkTDxMacDevice::New();
#endif
-
}
//---------------------------------------------------------------------------
wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
, RenderWhenDisabled(1)
, UseCaptureMouse(0)
{
+
#ifdef VTK_DEBUG_LEAKS
vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor");
#endif
this->Device=vtkTDxMacDevice::New();
#endif
-
}
+
//---------------------------------------------------------------------------
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()
{
// 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()
}
#endif
-
-
Modified();
+
}
//---------------------------------------------------------------------------
bool wxVTKRenderWindowInteractor::Enable(bool enable)
{
-
#ifdef VTK_USE_TDX
if(this->UseTDx)
{
}
#endif
-
-
#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
return wxGLCanvas::Enable(enable);
#else
{
// if already disabled then done
if (!Enabled)
+ {
return;
-
+ }
#ifdef VTK_USE_TDX
if(this->Device->GetInitialized())
{
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
{
-//printf("EED wxVTKRenderWindowInteractor::UpdateSize Start\n");
if( RenderWindow )
{
// if the size changed tell render window
// and our RenderWindow's size
#ifdef __WXCOCOA__
- #ifdef VTK_USE_COCOA
- #else
- #endif //VTK_USE_COCOA
+// #ifdef VTK_USE_COCOA
+// #else
+// #endif //VTK_USE_COCOA
#else
RenderWindow->SetSize(x, y);
#endif //__WXCOCOA__
#endif //__WXMSW__
} // if x y
} // if RenderWindow
-printf("EED wxVTKRenderWindowInteractor::UpdateSize End\n");
}
//---------------------------------------------------------------------------
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;
}
//------------------------------------------------------------------
return 1;
}
#endif
+
//---------------------------------------------------------------------------
int wxVTKRenderWindowInteractor::DestroyTimer()
{
// do nothing
return 1;
}
+
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
{
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
{
-printf("EED wxVTKRenderWindowInteractor::OnPaint Start\n");
-
//must always be here
//EED2021-08-26
#ifdef __WXCOCOA__
#endif
#endif
-printf("EED wxVTKRenderWindowInteractor::OnPaint End\n");
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
{
- if (!Enabled)
+ if (!Enabled)
{
return;
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
{
-printf("EED wxVTKRenderWindowInteractor::OnKeyUp Start\n");
if (!Enabled)
{
return;
event.GetKeyCode(), 1);
#endif
event.Skip();
-printf("EED wxVTKRenderWindowInteractor::OnKeyUp End\n");
}
#endif //!(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnChar(wxKeyEvent &event)
{
-printf("EED wxVTKRenderWindowInteractor::OnKeyUp Start\n");
- if (!Enabled)
+ if (!Enabled)
{
return;
}
InvokeEvent(vtkCommand::CharEvent, NULL);
#endif
event.Skip();
-printf("EED wxVTKRenderWindowInteractor::OnKeyUp End\n");
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
{
-printf("EED wxVTKRenderWindowInteractor::OnButtonDown Start\n");
if (!Enabled || (ActiveButton != wxEVT_NULL))
{
return;
{
CaptureMouse();
}
-printf("EED wxVTKRenderWindowInteractor::OnButtonDown End\n");
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event)
{
-printf("EED wxVTKRenderWindowInteractor::OnButtonDown Start\n");
//EVT_xxx_DOWN == EVT_xxx_UP - 1
//This is only needed if two mouse buttons are pressed at the same time.
//In wxWindows 2.4 and later: better use of wxMOUSE_BTN_RIGHT or
ReleaseMouse();
}
ActiveButton = wxEVT_NULL;
-printf("EED wxVTKRenderWindowInteractor::OnButtonDown End\n");
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event)
{
-printf("EED wxVTKRenderWindowInteractor::OnMouseWheel Start\n");
// Mouse wheel was only added after VTK 4.4 (I think...)
#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 4)
// new style
InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL);
}
#endif
- printf("EED wxVTKRenderWindowInteractor::OnMouseWheel End\n");
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::Render()
{
-printf("EED wxVTKRenderWindowInteractor::Render Start\n");
#if wxCHECK_VERSION(2, 8, 0)
int renderAllowed = !IsFrozen();
#else
}
#endif
} // if renderAllowed
-printf("EED wxVTKRenderWindowInteractor::Render Start\n");
}
//---------------------------------------------------------------------------
void wxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)