//
// 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"
#include <SVTK_ViewWindow.h>
+#include <VTKViewer_Algorithm.h>
+
// SALOME KERNEL includes
#include <SALOMEDSClient_Study.hxx>
myGrpTypeGroup->button(grpType)->setChecked(true);
onGrpTypeChanged(grpType);
+ myTypeId = aType;
if ( grpType == 0 ) {
myCurrentLineEdit = 0;
myElements->clear();
setSelectionMode(aType);
- myTypeId = aType;
setShowEntityMode(); // depends on myTypeId
myGeomGroupLine->setText( aShapeName );
myNameChanged = true;
myName->blockSignals(true);
- myName->setText( "Group On " + aShapeName);
+ myName->setText(theGroup->GetName());
myName->blockSignals(false);
}
updateButtons();
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<int> aAddList;
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);
//=================================================================================
void SMESHGUI_GroupDlg::setFilters()
{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
+
SMESH::ElementType aType = SMESH::ALL;
switch ( myTypeId )
{
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMesh );
- myFilterDlg->SetSourceWg( myElements );
+ myFilterDlg->SetSourceWg( myElements, false );
myFilterDlg->show();
}
// 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<nbItems && !isActor; i++)
{
- SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct);
+ SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(aCollection->GetItemAsObject(i));
if (anActor && anActor->hasIO()) {
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
if (aViewWindow->isVisible(anIO)) {