X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupDlg.cxx;h=80e98c0cfe2474c18f935542bdd590c637c2f03e;hb=489c1e114f78a421402e46830949e55f2f4777f2;hp=63b5d395674b05664ab5df3866b6f63bb63f8dd2;hpb=7ce6ef7ee96d7287440bfb25bfc82f24fdcb4c06;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 63b5d3956..80e98c0cf 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -19,11 +19,11 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SMESH SMESHGUI : GUI for SMESH component -// File : SMESHGUI_GroupDlg.cxx -// Author : Natalia KOPNOVA, Open CASCADE S.A.S. -// SMESH includes -// +// SMESH SMESHGUI : GUI for SMESH component +// File : SMESHGUI_GroupDlg.cxx +// Author : Natalia KOPNOVA, Open CASCADE S.A.S. +// SMESH includes + #include "SMESHGUI_GroupDlg.h" #include "SMESHGUI.h" @@ -61,6 +61,8 @@ #include +#include + // SALOME KERNEL includes #include @@ -560,11 +562,11 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, myGrpTypeGroup->button(grpType)->setChecked(true); onGrpTypeChanged(grpType); + myTypeId = aType; if ( grpType == 0 ) { myCurrentLineEdit = 0; myElements->clear(); setSelectionMode(aType); - myTypeId = aType; setShowEntityMode(); // depends on myTypeId @@ -592,7 +594,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, myGeomGroupLine->setText( aShapeName ); myNameChanged = true; myName->blockSignals(true); - myName->setText( "Group On " + aShapeName); + myName->setText(theGroup->GetName()); myName->blockSignals(false); } updateButtons(); @@ -797,8 +799,15 @@ bool SMESHGUI_GroupDlg::onApply() myGroup->SetColor(aColor); _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup); - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) { + anActor->setName(myName->text().toLatin1().data()); + switch ( myTypeId ) { + case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; + case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; + case 2: + case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break; + } + } QList aAddList; @@ -928,8 +937,15 @@ bool SMESHGUI_GroupDlg::onApply() myGroupOnGeom->SetColor(aColor); _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom); - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) { + anActor->setName(myName->text().toLatin1().data()); + switch ( myTypeId ) { + case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; + case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; + case 2: + case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break; + } + } } mySMESHGUI->updateObjBrowser(true); @@ -2192,13 +2208,12 @@ bool SMESHGUI_GroupDlg::SetAppropriateActor() // iterate on all actors in current view window, search for // any visible actor, that belongs to group or submesh of current mesh - vtkActorCollection *aCollection = aViewWindow->getRenderer()->GetActors(); - aCollection->InitTraversal(); - for (vtkActor *anAct = aCollection->GetNextActor(); - anAct && !isActor; - anAct = aCollection->GetNextActor()) + VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors()); + vtkActorCollection *aCollection = aCopy.GetActors(); + int nbItems = aCollection->GetNumberOfItems(); + for (int i=0; i(anAct); + SMESH_Actor *anActor = dynamic_cast(aCollection->GetItemAsObject(i)); if (anActor && anActor->hasIO()) { Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); if (aViewWindow->isVisible(anIO)) {