X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI.cxx;h=1dbcddf33a3b63437d2f0462e4ab52808ec3e1cc;hb=1ddaa28ef368d16dd8c8e7a03b97e38f38844481;hp=fdccc873729485059e0a16cbb55fc133f33721ab;hpb=ea825222ec6cabe30833fb5e3deff17a73f3d5cd;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index fdccc8737..1dbcddf33 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -23,6 +23,8 @@ // File : SMESHGUI.cxx // Author : Nicolas REJNERI, Open CASCADE S.A.S. +#include // E.A. must be included before Python.h to fix compilation on windows +#include "Python.h" // SMESH includes #include "SMESHGUI.h" #include "SMESHGUI_AddMeshElementDlg.h" @@ -824,11 +826,11 @@ if ( selected.Extent() == 1 ) { Handle(SALOME_InteractiveObject) anIO = selected.First(); if ( anIO->hasEntry() ) { - SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ); - if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) { - SMESH_ScalarBarActor *aScalarBarActor = anActor->GetScalarBarActor(); - aScalarBarActor->SetDistributionVisibility(!aScalarBarActor->GetDistributionVisibility()); - } + SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ); + if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) { + SMESH_ScalarBarActor *aScalarBarActor = anActor->GetScalarBarActor(); + aScalarBarActor->SetDistributionVisibility(!aScalarBarActor->GetDistributionVisibility()); + } } } } @@ -3933,6 +3935,21 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) setMenuShown( true ); setToolShown( true ); + // import Python module that manages SMESH plugins (need to be here because SalomePyQt API uses active module) + PyGILState_STATE gstate = PyGILState_Ensure(); + PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager"); + if(pluginsmanager==NULL) + PyErr_Print(); + else + { + PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"smesh",tr("MEN_MESH").toStdString().c_str(),tr("SMESH_PLUGINS_OTHER").toStdString().c_str()); + if(result==NULL) + PyErr_Print(); + Py_XDECREF(result); + } + PyGILState_Release(gstate); + // end of GEOM plugins loading + // Reset actions accelerator keys action(111)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B)); // Import DAT action(112)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U)); // Import UNV