X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI.cxx;h=34c82ee213ee397bdc8dea3f004e8e669432c7c2;hb=83f19818fce494a77ddf10b70493abdd9f73e4e0;hp=ca77a9b2c690b9b03b85f309342737b4458d9014;hpb=090aff07266d376ae028ae43434bdea7c0a0f9bb;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index ca77a9b2c..34c82ee21 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -127,6 +127,7 @@ #include #include #include +#include #include "utilities.h" @@ -729,6 +730,8 @@ namespace{ SALOME_Selection *Sel = SALOME_Selection::Selection(anActiveStudy->getSelection()); SALOME_ListIteratorOfListIO It(Sel->StoredIObjects()); + + aStudyBuilder->NewCommand(); // There is a transaction for(; It.More(); It.Next()){ Handle(SALOME_InteractiveObject) IObject = It.Value(); if(IObject->hasEntry()){ @@ -736,7 +739,7 @@ namespace{ /* Erase child graphical objects */ SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(SO); - for(; it->More(); it->Next()){ + for(it->InitEx(true); it->More(); it->Next()){ SALOMEDS::SObject_var CSO = it->Value(); if(CSO->FindAttribute(anAttr, "AttributeIOR")){ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); @@ -784,6 +787,7 @@ namespace{ } /* IObject->hasEntry() */ } /* more/next */ + aStudyBuilder->CommitCommand(); /* Clear any previous selection */ Sel->ClearIObjects(); @@ -1273,6 +1277,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) } CORBA::Long anId = aStudy->StudyId(); TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,IObject->getEntry()); + cout<<"myAutomaticUpdate - "<Update(); SMESH_Actor* anActor = SMESH::FindActorByEntry(IObject->getEntry()); @@ -1526,19 +1531,19 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) // create group for each type o elements QString aName = IObject->getName(); if (aNodes->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName); + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes"); aGroup->Add(aNodes.inout()); } if (aEdges->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName); + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges"); aGroup->Add(aEdges.inout()); } if (aFaces->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName); + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces"); aGroup->Add(aFaces.inout()); } if (aVolumes->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName); + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes"); aGroup->Add(aVolumes.inout()); } myActiveStudy->updateObjBrowser(true); @@ -2583,6 +2588,14 @@ bool SMESHGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString popup->removeItem( 1134 ); // Clipping popup->removeItem( 2000 ); // Scalar Bar } + // VSR 03/02/05 - check if actor is empty ----- start ----- + vtkUnstructuredGrid* vtkGrid = anActor->GetUnstructuredGrid(); + if ( vtkGrid->GetNumberOfPoints() + vtkGrid->GetNumberOfCells() == 0 ) { + popup->removeItem( QAD_Display_Popup_ID ); + popup->removeItem( QAD_DisplayOnly_Popup_ID ); + popup->removeItem( QAD_Erase_Popup_ID ); + } + // VSR 03/02/05 - check if actor is empty ----- finish ----- } else { // object doesn't have actor