static PyObject* aVTKModule = 0;
PyObject* aPyClass = 0;
if( !aVTKModule ) {
- aVTKModule = PyImport_ImportModule( "vtk.vtkRenderingCorePython" );
+ aVTKModule = PyImport_ImportModule( "vtk.vtkRenderingCore" );
if( PyErr_Occurred() ) {
PyErr_Print();
}
::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate, myKeepDetached );
if( aVTKViewWindow && aPyClass ) {
vtkRenderer* aVTKObject = aVTKViewWindow->getRenderer();
-#if VTK_XVERSION < 50700
- myResult = PyVTKObject_New( aPyClass, aVTKObject );
-#else
myResult = PyVTKObject_FromPointer( aPyClass, NULL, aVTKObject );
-#endif
}
}
};
::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate, myKeepDetached );
if( aVTKViewWindow && aPyClass ) {
vtkRenderWindow* aVTKObject = aVTKViewWindow->getRenderWindow();
-#if VTK_XVERSION < 50700
- myResult = PyVTKObject_New( aPyClass, aVTKObject );
-#else
myResult = PyVTKObject_FromPointer( aPyClass, NULL, aVTKObject );
-#endif
}
}
};
::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate, myKeepDetached );
if( aVTKViewWindow && aPyClass ) {
vtkRenderWindowInteractor* aVTKObject = aVTKViewWindow->getInteractor();
-#if VTK_XVERSION < 50700
- myResult = PyVTKObject_New( aPyClass, aVTKObject );
-#else
myResult = PyVTKObject_FromPointer( aPyClass, NULL, aVTKObject );
-#endif
}
}
};
--- /dev/null
+import sys
+
+# Try importing the same VTK module as used by libSalomePy
+try:
+ import vtk.vtkRenderingCore
+ ok = True
+except Exception as e:
+ ok = False
+
+# VTK rendering Python module might change in newer versions of ParaView
+# In this case ask developers to modify SalomePy.cxx correspondingly
+if not ok:
+ print("VTK Rendering Python module seems to have changed, libSalomePy may not work, please correct this!")
+ sys.exit(1)