Skip to content

Instantly share code, notes, and snippets.

@fran6co
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fran6co/593ddbeebf72de7f255e to your computer and use it in GitHub Desktop.
Save fran6co/593ddbeebf72de7f255e to your computer and use it in GitHub Desktop.
--- a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm 2015-04-07 17:06:23.000000000 -0300
+++ b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm 2015-04-07 17:10:59.000000000 -0300
@@ -185,11 +185,19 @@
vtkCocoaRenderWindow *renWin = vtkCocoaRenderWindow::SafeDownCast (this->GetRenderWindow ());
if (renWin != NULL)
{
+#if ((VTK_MAJOR_VERSION == 6) && (VTK_MINOR_VERSION >= 2) || (VTK_MAJOR_VERSION > 7))
+ vtkCocoaServerFix *server = reinterpret_cast<vtkCocoaServerFix*> (renWin->GetCocoaServer ());
+#else
vtkCocoaServerFix *server = reinterpret_cast<vtkCocoaServerFix*> (this->GetCocoaServer ());
- if (!this->GetCocoaServer ())
+#endif
+ if (!server)
{
server = [vtkCocoaServerFix cocoaServerWithRenderWindow:renWin];
+#if ((VTK_MAJOR_VERSION == 6) && (VTK_MINOR_VERSION >= 2) || (VTK_MAJOR_VERSION > 7))
+ renWin->SetCocoaServer (reinterpret_cast<void*> (server));
+#else
this->SetCocoaServer (reinterpret_cast<void*> (server));
+#endif
}
[server start];
@@ -203,7 +211,11 @@
vtkCocoaRenderWindow *renWin = vtkCocoaRenderWindow::SafeDownCast (this->RenderWindow);
if (renWin)
{
+#if ((VTK_MAJOR_VERSION == 6) && (VTK_MINOR_VERSION >= 2) || (VTK_MAJOR_VERSION > 7))
+ vtkCocoaServerFix *server = reinterpret_cast<vtkCocoaServerFix*> (renWin->GetCocoaServer ());
+#else
vtkCocoaServerFix *server = reinterpret_cast<vtkCocoaServerFix*> (this->GetCocoaServer ());
+#endif
[server stop];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment