From: dmv Date: Tue, 17 Nov 2009 11:20:10 +0000 (+0000) Subject: IPAL21468 Copmpound is not Shown after its creation. X-Git-Tag: V5_1_3rc3~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7673a0f5a53ee04cca11af84f7b96d9fe21f5c59;p=modules%2Fsmesh.git IPAL21468 Copmpound is not Shown after its creation. --- diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index c26ecf3c5..1e58867d0 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -289,6 +289,8 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() if (!isValid()) return false; + SMESH::SMESH_Mesh_var aCompoundMesh; + if (!myMesh->_is_nil()) { QStringList aParameters; aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" ")); @@ -297,7 +299,6 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); // concatenate meshes - SMESH::SMESH_Mesh_var aCompoundMesh; if(CheckBoxCommon->isChecked()) aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, !(ComboBoxUnion->currentIndex()), @@ -319,8 +320,16 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH"))); - //mySelectionMgr->clearSelected(); - SMESH::UpdateView(); + // IPAL21468 Compound is hidden after creation. + if ( SMESHGUI::automaticUpdate() ) { + mySelectionMgr->clearSelected(); + SMESH::UpdateView(); + + _PTR(SObject) aSO = SMESH::FindSObject(aCompoundMesh.in()); + if ( SMESH_Actor* anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()) ) + SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor); + }// end IPAL21468 + return true; } return false; diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index bf37a72a9..e51f8c578 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2155,6 +2155,17 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray, { SMESH::ListOfGroups_var groups = aNewMesh->GetGroups(); } + + // IPAL21468 Change icon of compound because it need not be computed. + SALOMEDS::SObject_var aMeshSObj = ObjectToSObject( myCurrentStudy, aNewMesh ); + if(aMeshSObj) { + SALOMEDS::GenericAttribute_var anAttr; + SALOMEDS::StudyBuilder_var aBuilder = myCurrentStudy->NewBuilder(); + anAttr = aBuilder->FindOrCreateAttribute( aMeshSObj,"AttributePixMap" ); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + aPixmap->SetPixMap("ICON_SMESH_TREE_MESH"); + } + return aNewMesh._retn(); }