From: eap Date: Wed, 16 Nov 2005 09:18:22 +0000 (+0000) Subject: PAL10501. SetCurrentStudy() to SMESH_Gen in GetSMESHGen() X-Git-Tag: V3_1_0a3~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4fe88e90a7950c1374379297242d9ad57126084f;p=modules%2Fsmesh.git PAL10501. SetCurrentStudy() to SMESH_Gen in GetSMESHGen() --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index d71d522df..15c9c94cd 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -184,7 +184,6 @@ namespace{ if(!filename.isEmpty()) { SUIT_OverrideCursor wc; _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - theComponentMesh->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() ); try { SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; @@ -1063,10 +1062,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if( !mgr ) return false; - if (CORBA::is_nil(GetSMESHGen()->GetCurrentStudy())) { - GetSMESHGen()->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy()); - } - SUIT_ViewWindow* view = application()->desktop()->activeWindow(); SVTK_ViewWindow* vtkwnd = dynamic_cast( view ); @@ -2807,11 +2802,16 @@ void SMESHGUI::OnGUIEvent() SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen() { + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active if ( CORBA::is_nil( myComponentSMESH ) ) { SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH + if ( aStudy ) + aGUI.myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy()); return aGUI.myComponentSMESH; } + if ( aStudy ) + myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy()); return myComponentSMESH; }