Version: 6.3.1
Public Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes

SMESHGUI_GroupDlg Class Reference

#include <SMESHGUI_GroupDlg.h>

Inheritance diagram for SMESHGUI_GroupDlg:
Inheritance graph
[legend]

Public Slots

void onAdd ()
void onRemove ()

Public Member Functions

 SMESHGUI_GroupDlg (SMESHGUI *, SMESH::SMESH_Mesh_ptr=SMESH::SMESH_Mesh::_nil())
 SMESHGUI_GroupDlg (SMESHGUI *, SMESH::SMESH_GroupBase_ptr, const bool theIsConvert=false)
 ~SMESHGUI_GroupDlg ()

Static Public Member Functions

static QString GetDefaultName (const QString &)

Private Slots

void onTypeChanged (int)
void onGrpTypeChanged (int)
void onColorChanged (QColor)
void onOK ()
void onClose ()
bool onApply ()
void onHelp ()
void onDeactivate ()
void onVisibilityChanged ()
void onListSelectionChanged ()
void onObjectSelectionChanged ()
void onSelectAll ()
void onSelectSubMesh (bool)
void onSelectGroup (bool)
void onSelectGeomGroup (bool)
void setCurrentSelection ()
void setFilters ()
void onSort ()
void onNameChanged (const QString &)
void onFilterAccepted ()
void onGeomPopup (QAction *)
void onGeomSelectionButton (bool)
void onPublishShapeByMeshDlg (SUIT_Operation *)
 SLOT.
void onCloseShapeByMeshDlg (SUIT_Operation *)
 SLOT.

Private Member Functions

void initDialog (bool)
void init (SMESH::SMESH_Mesh_ptr)
void init (SMESH::SMESH_GroupBase_ptr, const bool theIsConvert=false)
void closeEvent (QCloseEvent *)
void enterEvent (QEvent *)
void hideEvent (QHideEvent *)
void keyPressEvent (QKeyEvent *)
void setSelectionMode (int)
void updateButtons ()
void updateGeomPopup ()
bool SetAppropriateActor ()
void setShowEntityMode ()
void restoreShowEntityMode ()
bool IsActorVisible (SMESH_Actor *)
void setGroupColor (const SALOMEDS::Color &)
SALOMEDS::Color getGroupColor () const
void setGroupQColor (const QColor &)
QColor getGroupQColor () const
void setDefaultGroupColor ()
void setIsApplyAndClose (const bool theFlag)
bool isApplyAndClose () const

Private Attributes

SMESHGUImySMESHGUI
LightApp_SelectionMgr * mySelectionMgr
int myGrpTypeId
int myTypeId
int myStoredShownEntity
QLineEdit * myCurrentLineEdit
SVTK_Selector * mySelector
QPushButton * myMeshGroupBtn
QLineEdit * myMeshGroupLine
QButtonGroup * myTypeGroup
QLineEdit * myName
QString myOldName
QButtonGroup * myGrpTypeGroup
QStackedWidget * myWGStack
QCheckBox * mySelectAll
QLabel * myElementsLab
QListWidget * myElements
QPushButton * myFilter
QPushButton * myAddBtn
QPushButton * myRemoveBtn
QPushButton * mySortBtn
QGroupBoxmySelectBox
QCheckBox * mySelectSubMesh
QPushButton * mySubMeshBtn
QLineEdit * mySubMeshLine
QCheckBox * mySelectGroup
QPushButton * myGroupBtn
QLineEdit * myGroupLine
QtxColorButton * myColorBtn
QCheckBox * mySelectGeomGroup
QToolButton * myGeomGroupBtn
QLineEdit * myGeomGroupLine
QMenu * myGeomPopup
QPushButton * myOKBtn
QPushButton * myApplyBtn
QPushButton * myCloseBtn
QPushButton * myHelpBtn
SMESHGUI_ShapeByMeshOpmyShapeByMeshOp
SMESH::SMESH_Mesh_var myMesh
QList< SMESH_Actor * > myActorsList
SMESH::SMESH_Group_var myGroup
SMESH::SMESH_GroupOnGeom_var myGroupOnGeom
QList< intmyIdList
GEOM::ListOfGO_var myGeomObjects
int mySelectionMode
SUIT_SelectionFiltermyMeshFilter
SUIT_SelectionFiltermySubMeshFilter
SUIT_SelectionFiltermyGroupFilter
SUIT_SelectionFiltermyGeomFilter
SMESHGUI_FilterDlgmyFilterDlg
bool myCreate
bool myIsBusy
QString myHelpFileName
QMap< QAction *, intmyActions
bool myNameChanged
QString myObjectToSelect
bool myIsApplyAndClose

Detailed Description

Definition at line 68 of file SMESHGUI_GroupDlg.h.


Constructor & Destructor Documentation

SMESHGUI_GroupDlg::SMESHGUI_GroupDlg ( SMESHGUI theModule,
SMESH::SMESH_Mesh_ptr  theMesh = SMESH::SMESH_Mesh::_nil() 
)

Definition at line 119 of file SMESHGUI_GroupDlg.cxx.

References init(), initDialog(), myGeomGroupBtn, myGeomGroupLine, mySelectGroup, and mySelectSubMesh.

  : QDialog( SMESH::GetDesktop( theModule ) ),
    mySMESHGUI( theModule ),
    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
    mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
    myIsBusy( false ),
    myNameChanged( false ),
    myIsApplyAndClose( false )
{
  initDialog( true );
  if ( !theMesh->_is_nil() )
    init( theMesh );
  else
  {
    mySelectSubMesh->setEnabled( false );
    mySelectGroup->setEnabled( false );
    myGeomGroupBtn->setEnabled( false );
    myGeomGroupLine->setEnabled( false );
  }
}
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg ( SMESHGUI theModule,
SMESH::SMESH_GroupBase_ptr  theGroup,
const bool  theIsConvert = false 
)

Definition at line 145 of file SMESHGUI_GroupDlg.cxx.

References grpGroupSelection, init(), initDialog(), myCurrentLineEdit, myMeshGroupLine, mySelectGroup, mySelectSubMesh, and setSelectionMode().

  : QDialog( SMESH::GetDesktop( theModule ) ),
    mySMESHGUI( theModule ),
    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
    mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
    myIsBusy( false ),
    myNameChanged( false )
{
  initDialog( false );
  if ( !theGroup->_is_nil() )
    init( theGroup, theIsConvert );
  else
  {
    mySelectSubMesh->setEnabled( false );
    mySelectGroup->setEnabled( false );

    myCurrentLineEdit = myMeshGroupLine;
    setSelectionMode( grpGroupSelection );
  }
}
SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg ( )

Definition at line 450 of file SMESHGUI_GroupDlg.cxx.

References myFilterDlg.

{
  // no need to delete child widgets, Qt does it all for us
  if ( myFilterDlg != 0 ) {
    myFilterDlg->setParent( 0 );
    delete myFilterDlg;
  }
}

Member Function Documentation

void SMESHGUI_GroupDlg::closeEvent ( QCloseEvent *  ) [private]

Definition at line 1954 of file SMESHGUI_GroupDlg.cxx.

References onClose().

{
  onClose();
}
void SMESHGUI_GroupDlg::enterEvent ( QEvent *  ) [private]
QString SMESHGUI_GroupDlg::GetDefaultName ( const QString &  theOperation) [static]

Definition at line 463 of file SMESHGUI_GroupDlg.cxx.

References _PTR().

{
  QString aName = "";

  // collect all object names of SMESH component
  SalomeApp_Study* appStudy =
    dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
  if ( !appStudy ) return aName;
  _PTR(Study) aStudy = appStudy->studyDS();

  std::set<std::string> aSet;
  _PTR(SComponent) aMeshCompo (aStudy->FindComponent( "SMESH" ));
  if (aMeshCompo) {
    _PTR(ChildIterator) it (aStudy->NewChildIterator(aMeshCompo));
    _PTR(SObject) obj;
    for (it->InitEx(true); it->More(); it->Next()) {
      obj = it->Value();
      aSet.insert(obj->GetName());
    }
  }

  // build a unique name
  int aNumber = 0;
  bool isUnique = false;
  while (!isUnique) {
    aName = theOperation + "_" + QString::number(++aNumber);
    isUnique = (aSet.count(aName.toLatin1().data()) == 0);
  }

  return aName;
}
SALOMEDS::Color SMESHGUI_GroupDlg::getGroupColor ( ) const [private]

Definition at line 2216 of file SMESHGUI_GroupDlg.cxx.

References getGroupQColor().

Referenced by onApply().

{
  QColor aQColor = getGroupQColor();

  SALOMEDS::Color aColor;
  aColor.R = (float)aQColor.red() / 255.0;
  aColor.G = (float)aQColor.green() / 255.0;
  aColor.B = (float)aQColor.blue() / 255.0;

  return aColor;
}
QColor SMESHGUI_GroupDlg::getGroupQColor ( ) const [private]

Definition at line 2242 of file SMESHGUI_GroupDlg.cxx.

References myColorBtn.

Referenced by getGroupColor().

{
  return myColorBtn->color();
}
void SMESHGUI_GroupDlg::hideEvent ( QHideEvent *  ) [private]

Definition at line 2051 of file SMESHGUI_GroupDlg.cxx.

References myIsBusy, and onClose().

{
  if (!isMinimized() && !myIsBusy)
    onClose();
}
void SMESHGUI_GroupDlg::init ( SMESH::SMESH_Mesh_ptr  theMesh) [private]

Definition at line 499 of file SMESHGUI_GroupDlg.cxx.

References myCurrentLineEdit, myGroup, myGroupOnGeom, myMesh, myMeshFilter, myMeshGroupLine, mySelectionMgr, myTypeGroup, onTypeChanged(), restoreShowEntityMode(), SetAppropriateActor(), setDefaultGroupColor(), and setShowEntityMode().

Referenced by onObjectSelectionChanged(), and SMESHGUI_GroupDlg().

{
  mySelectionMgr->installFilter(myMeshFilter);

  /* init data from current selection */
  restoreShowEntityMode();
  myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
  setShowEntityMode();
  myGroup = SMESH::SMESH_Group::_nil();
  myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();

  // NPAL19389: create a group with a selection in another group
  // set actor of myMesh, if it is visible, else try
  // any visible actor of group or submesh of myMesh
  SetAppropriateActor();

  setDefaultGroupColor();

  SALOME_ListIO aList;
  mySelectionMgr->selectedObjects( aList );
  if( !aList.IsEmpty() )
  {
    QString aName = aList.First()->getName();
    myMeshGroupLine->setText(aName);
    myMeshGroupLine->home( false );
  }

  myCurrentLineEdit = 0;

  myTypeGroup->button(0)->setChecked(true);
  onTypeChanged(0);
}
void SMESHGUI_GroupDlg::init ( SMESH::SMESH_GroupBase_ptr  theGroup,
const bool  theIsConvert = false 
) [private]

Definition at line 536 of file SMESHGUI_GroupDlg.cxx.

References _PTR(), SMESH.EDGE, SMESH.FACE, myCurrentLineEdit, myElements, myGeomGroupLine, myGroup, myGroupOnGeom, myGrpTypeGroup, myIdList, myMesh, myMeshGroupLine, myName, myNameChanged, myTypeGroup, myTypeId, SMESH.NODE, onGrpTypeChanged(), restoreShowEntityMode(), SetAppropriateActor(), setGroupColor(), setSelectionMode(), setShowEntityMode(), updateButtons(), and SMESH.VOLUME.

{
  restoreShowEntityMode();
  myMesh = theGroup->GetMesh();
  setShowEntityMode();

  myNameChanged = true;
  myName->blockSignals(true);
  myName->setText(theGroup->GetName());
  myName->blockSignals(false);
  myName->home(false);

  SALOMEDS::Color aColor = theGroup->GetColor();
  setGroupColor( aColor );

  myMeshGroupLine->setText(theGroup->GetName());

  int aType = 0;
  switch(theGroup->GetType()) {
  case SMESH::NODE: aType= 0; break;
  case SMESH::EDGE: aType = 1; break;
  case SMESH::FACE: aType = 2; break;
  case SMESH::VOLUME: aType = 3; break;
  }
  myTypeGroup->button(aType)->setChecked(true);

  myGroup = SMESH::SMESH_Group::_narrow( theGroup );
  myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup );

  if (myGroup->_is_nil() && myGroupOnGeom->_is_nil())
    return;

  // NPAL19389: create a group with a selection in another group
  // set actor of myMesh, if it is visible, else set
  // actor of theGroup, if it is visible, else try
  // any visible actor of group or submesh of myMesh
  // commented, because an attempt to set selection on not displayed cells leads to error
  SetAppropriateActor();

  /*  SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
  if ( !anActor )
    anActor = SMESH::FindActorByObject(theGroup);
  SMESH::SetPickable(anActor);*/

  int grpType = (!myGroup->_is_nil() ? 0 : (theIsConvert ? 0 : 1));
  myGrpTypeGroup->button(grpType)->setChecked(true);
  onGrpTypeChanged(grpType);

  myTypeId = aType;
  if ( grpType == 0 ) {
    myCurrentLineEdit = 0;
    myElements->clear();
    setSelectionMode(aType);

    setShowEntityMode(); // depends on myTypeId

    myIdList.clear();
    if (!theGroup->IsEmpty()) {
      SMESH::long_array_var anElements = theGroup->GetListOfID();
      int k = anElements->length();
      for (int i = 0; i < k; i++) {
        myIdList.append(anElements[i]);
        myElements->addItem(QString::number(anElements[i]));
      }
      myElements->selectAll();
    }
  }
  else
  {
    QString aShapeName( "" );
    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape();
    if (!aGroupShape->_is_nil())
    {
      _PTR(SObject) aGroupShapeSO = aStudy->FindObjectID(aGroupShape->GetStudyEntry());
      if ( aGroupShapeSO )
        aShapeName = aGroupShapeSO->GetName().c_str();
    }
    myGeomGroupLine->setText( aShapeName );
    myNameChanged = true;
    myName->blockSignals(true);
    myName->setText(theGroup->GetName());
    myName->blockSignals(false);
  }
  updateButtons();
}
void SMESHGUI_GroupDlg::initDialog ( bool  create) [private]

Definition at line 172 of file SMESHGUI_GroupDlg.cxx.

References SMESHGUI.activeStudy(), SMESH.GetResourceMgr(), GROUP, grpNoSelection, MARGIN, myAddBtn, myApplyBtn, myCloseBtn, myColorBtn, myCreate, myCurrentLineEdit, myElements, myElementsLab, myFilter, myFilterDlg, myGeomFilter, myGeomGroupBtn, myGeomGroupLine, myGeomObjects, myGeomPopup, myGroupBtn, myGroupFilter, myGroupLine, myGrpTypeGroup, myGrpTypeId, myHelpBtn, myHelpFileName, myMesh, myMeshFilter, myMeshGroupBtn, myMeshGroupLine, myName, myOKBtn, myRemoveBtn, mySelectAll, mySelectBox, mySelectGroup, mySelectionMgr, mySelectionMode, mySelectSubMesh, myShapeByMeshOp, mySMESHGUI, mySortBtn, mySubMeshBtn, mySubMeshFilter, mySubMeshLine, myTypeGroup, myTypeId, myWGStack, onAdd(), onApply(), onClose(), onColorChanged(), onDeactivate(), onGeomSelectionButton(), onGrpTypeChanged(), onHelp(), onListSelectionChanged(), onNameChanged(), onObjectSelectionChanged(), onOK(), onRemove(), onSelectAll(), onSelectGeomGroup(), onSelectGroup(), onSelectSubMesh(), onSort(), onTypeChanged(), onVisibilityChanged(), SMESHGUI.SetActiveDialogBox(), setCurrentSelection(), setFilters(), SMESHGUI.SetState(), SPACING, SUBMESH, and updateButtons().

Referenced by SMESHGUI_GroupDlg().

{
  setModal( false );
  setAttribute( Qt::WA_DeleteOnClose, true );

  myFilterDlg = 0;
  myCreate = create;
  myCurrentLineEdit = 0;

  myShapeByMeshOp = 0;
  myGeomPopup = 0;
  myGeomObjects = new GEOM::ListOfGO();
  myGeomObjects->length( 0 );

  QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );

  setWindowTitle( create ? tr( "SMESH_CREATE_GROUP_TITLE" ) : tr( "SMESH_EDIT_GROUP_TITLE" ) );
  myHelpFileName = create ? "creating_groups_page.html" : "editing_groups_page.html";

  setSizeGripEnabled( true);

  QGridLayout* aMainLayout = new QGridLayout( this );
  aMainLayout->setMargin( MARGIN );
  aMainLayout->setSpacing( SPACING );

  /***************************************************************/
  QLabel* meshGroupLab = new QLabel( create ? tr( "SMESH_MESH" ) : tr( "SMESH_GROUP" ), this );
  myMeshGroupBtn = new QPushButton( this );
  myMeshGroupBtn->setIcon( image0 );
  myMeshGroupLine = new QLineEdit( this );
  myMeshGroupLine->setReadOnly( true );

  /***************************************************************/
  QGroupBox* aTypeBox = new QGroupBox( tr( "SMESH_ELEMENTS_TYPE" ), this );
  myTypeGroup = new QButtonGroup( this );
  QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( aTypeBox );
  aTypeBoxLayout->setMargin( MARGIN );
  aTypeBoxLayout->setSpacing( SPACING );

  QStringList types;
  types.append( tr( "MESH_NODE" ) );
  types.append( tr( "SMESH_EDGE" ) );
  types.append( tr( "SMESH_FACE" ) );
  types.append( tr( "SMESH_VOLUME" ) );
  QRadioButton* rb;
  for ( int i = 0; i < types.count(); i++ )
  {
    rb = new QRadioButton( types[i], aTypeBox );
    myTypeGroup->addButton( rb, i );
    aTypeBoxLayout->addWidget( rb );
  }
  aTypeBox->setEnabled( create );
  myTypeId = -1;

  /***************************************************************/
  QLabel* aName = new QLabel( tr( "SMESH_NAME" ), this );
  aName->setMinimumWidth( 50 );
  myName = new QLineEdit( this );

  /***************************************************************/
  QGroupBox* aGrpTypeBox = new QGroupBox( tr( "SMESH_GROUP_TYPE" ), this );
  myGrpTypeGroup = new QButtonGroup( this );
  QHBoxLayout* aGrpTypeBoxLayout = new QHBoxLayout( aGrpTypeBox );
  aGrpTypeBoxLayout->setMargin( MARGIN );
  aGrpTypeBoxLayout->setSpacing( SPACING );

  QRadioButton* rb1 = new QRadioButton( tr( "SMESH_GROUP_STANDALONE" ), aGrpTypeBox );
  QRadioButton* rb2 = new QRadioButton( tr( "SMESH_GROUP_GEOMETRY" ),   aGrpTypeBox );
  myGrpTypeGroup->addButton( rb1, 0 );
  myGrpTypeGroup->addButton( rb2, 1 );
  aGrpTypeBoxLayout->addWidget( rb1 );
  aGrpTypeBoxLayout->addWidget( rb2 );
  aGrpTypeBox->setEnabled( create );
  myGrpTypeId = -1;

  /***************************************************************/
  myWGStack = new QStackedWidget( this );
  QWidget* wg1 = new QWidget( myWGStack );
  QWidget* wg2 = new QWidget( myWGStack );

  /***************************************************************/
  QGroupBox* aContentBox = new QGroupBox( tr( "SMESH_CONTENT" ), wg1 );
  QGridLayout* aContentBoxLayout = new QGridLayout( aContentBox );
  aContentBoxLayout->setMargin( MARGIN );
  aContentBoxLayout->setSpacing( SPACING );

  mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), aContentBox );

  myElementsLab = new QLabel( tr( "SMESH_ID_ELEMENTS" ), aContentBox );
  myElements = new QListWidget( aContentBox );
  myElements->setSelectionMode( QListWidget::ExtendedSelection );

  myFilter = new QPushButton( tr( "SMESH_BUT_FILTER" ), aContentBox );
  myAddBtn = new QPushButton( tr( "SMESH_BUT_ADD" ), aContentBox );
  myRemoveBtn = new QPushButton( tr( "SMESH_BUT_REMOVE" ), aContentBox );
  mySortBtn = new QPushButton( tr( "SMESH_BUT_SORT" ), aContentBox );

  aContentBoxLayout->addWidget( mySelectAll,   0, 0 );
  aContentBoxLayout->addWidget( myElementsLab, 1, 0 );
  aContentBoxLayout->addWidget( myElements,    2, 0, 6, 1 );
  aContentBoxLayout->addWidget( myFilter,      2, 1 );
  aContentBoxLayout->addWidget( myAddBtn,      4, 1 );
  aContentBoxLayout->addWidget( myRemoveBtn,   5, 1 );
  aContentBoxLayout->addWidget( mySortBtn,     7, 1 );

  aContentBoxLayout->setColumnStretch( 0, 1 );
  aContentBoxLayout->setRowStretch( 3, 1 );
  aContentBoxLayout->setRowStretch( 6, 1 );

  /***************************************************************/
  mySelectBox = new QGroupBox( tr( "SMESH_SELECT_FROM" ), wg1 );
  QGridLayout* mySelectBoxLayout = new QGridLayout( mySelectBox );
  mySelectBoxLayout->setMargin( MARGIN );
  mySelectBoxLayout->setSpacing( SPACING );

  mySelectSubMesh = new QCheckBox( tr( "SMESH_SUBMESH" ), mySelectBox );
  mySubMeshBtn = new QPushButton( mySelectBox );
  mySubMeshBtn->setIcon( image0 );
  mySubMeshLine = new QLineEdit( mySelectBox );
  mySubMeshLine->setReadOnly( true );
  onSelectSubMesh( false );

  mySelectGroup = new QCheckBox( tr( "SMESH_GROUP" ), mySelectBox );
  myGroupBtn = new QPushButton( mySelectBox );
  myGroupBtn->setIcon( image0 );
  myGroupLine = new QLineEdit( mySelectBox );
  myGroupLine->setReadOnly( true );
  onSelectGroup( false );

  mySelectBoxLayout->addWidget( mySelectSubMesh, 0, 0 );
  mySelectBoxLayout->addWidget( mySubMeshBtn,    0, 1 );
  mySelectBoxLayout->addWidget( mySubMeshLine,   0, 2 );
  mySelectBoxLayout->addWidget( mySelectGroup,   1, 0 );
  mySelectBoxLayout->addWidget( myGroupBtn,      1, 1 );
  mySelectBoxLayout->addWidget( myGroupLine,     1, 2 );

  /***************************************************************/
  QVBoxLayout* wg1Layout = new QVBoxLayout( wg1 );
  wg1Layout->setMargin( 0 );
  wg1Layout->setSpacing( SPACING );
  wg1Layout->addWidget( aContentBox );
  wg1Layout->addWidget( mySelectBox );
  wg1Layout->setStretchFactor( aContentBox, 10 );

  /***************************************************************/
  QLabel* geomObject = new QLabel( tr( "SMESH_OBJECT_GEOM" ), wg2 );
  myGeomGroupBtn = new QToolButton( wg2 );
  myGeomGroupBtn->setIcon( image0 );
  myGeomGroupBtn->setCheckable( true );
  myGeomGroupLine = new QLineEdit( wg2 );
  myGeomGroupLine->setReadOnly( true ); //VSR ???
  onSelectGeomGroup( false );

  myGeomGroupBtn->setEnabled( create );
  myGeomGroupLine->setEnabled( create );

  /***************************************************************/
  QGridLayout* wg2Layout = new QGridLayout( wg2 );
  wg2Layout->setMargin( 0 );
  wg1Layout->setSpacing( SPACING );
  wg2Layout->addWidget( geomObject,     0, 0 );
  wg2Layout->addWidget( myGeomGroupBtn, 0, 1 );
  wg2Layout->addWidget( myGeomGroupLine,0, 2 );
  wg2Layout->setRowStretch( 1, 5 );

  /***************************************************************/
  myWGStack->insertWidget( 0, wg1 );
  myWGStack->insertWidget( 1, wg2 );

  /***************************************************************/
  QGroupBox* aColorBox = new QGroupBox(tr( "SMESH_SET_COLOR" ), this);
  QHBoxLayout* aColorBoxLayout = new QHBoxLayout(aColorBox);
  aColorBoxLayout->setMargin(MARGIN);
  aColorBoxLayout->setSpacing(SPACING);

  QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
  myColorBtn = new QtxColorButton(aColorBox);
  myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, 
                             myColorBtn->sizePolicy().verticalPolicy() );

  aColorBoxLayout->addWidget(aColorLab);
  aColorBoxLayout->addWidget(myColorBtn);

  /***************************************************************/

  QFrame* aButtons = new QFrame(this);
  aButtons->setFrameStyle( QFrame::Box | QFrame::Sunken );
  QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons);
  aBtnLayout->setMargin(MARGIN);
  aBtnLayout->setSpacing(SPACING);

  myOKBtn = new QPushButton(tr( "SMESH_BUT_APPLY_AND_CLOSE" ), aButtons);
  myOKBtn->setAutoDefault(true);
  myOKBtn->setDefault(true);
  myApplyBtn = new QPushButton(tr( "SMESH_BUT_APPLY" ), aButtons);
  myApplyBtn->setAutoDefault(true);
  myCloseBtn = new QPushButton(tr( "SMESH_BUT_CLOSE" ), aButtons);
  myCloseBtn->setAutoDefault(true);
  myHelpBtn = new QPushButton(tr( "SMESH_BUT_HELP" ), aButtons);
  myHelpBtn->setAutoDefault(true);

  aBtnLayout->addWidget(myOKBtn);
  aBtnLayout->addSpacing(10);
  aBtnLayout->addWidget(myApplyBtn);
  aBtnLayout->addSpacing(10);
  aBtnLayout->addStretch();
  aBtnLayout->addWidget(myCloseBtn);
  aBtnLayout->addWidget(myHelpBtn);

  /***************************************************************/
  aMainLayout->addWidget(meshGroupLab,    0, 0);
  aMainLayout->addWidget(myMeshGroupBtn,  0, 1);
  aMainLayout->addWidget(myMeshGroupLine, 0, 2);
  aMainLayout->addWidget(aTypeBox,        1, 0, 1, 3);
  aMainLayout->addWidget(aName,           2, 0);
  aMainLayout->addWidget(myName,          2, 2);
  aMainLayout->addWidget(aGrpTypeBox,     3, 0, 1, 3);
  aMainLayout->addWidget(myWGStack,       4, 0, 1, 3);
  aMainLayout->addWidget(aColorBox,       5, 0, 1, 3);
  aMainLayout->addWidget(aButtons,        6, 0, 1, 3);

  /* signals and slots connections */
  connect(myMeshGroupBtn,  SIGNAL(clicked()),          this, SLOT(setCurrentSelection()));
  connect(myGrpTypeGroup,  SIGNAL(buttonClicked(int)), this, SLOT(onGrpTypeChanged(int)));
  connect(myTypeGroup,     SIGNAL(buttonClicked(int)), this, SLOT(onTypeChanged(int)));

  connect(myName,          SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
  connect(myElements,      SIGNAL(itemSelectionChanged()),      this, SLOT(onListSelectionChanged()));

  connect(myFilter,        SIGNAL(clicked()),     this, SLOT(setFilters()));
  connect(mySelectAll,     SIGNAL(toggled(bool)), this, SLOT(onSelectAll()));
  connect(myAddBtn,        SIGNAL(clicked()),     this, SLOT(onAdd()));
  connect(myRemoveBtn,     SIGNAL(clicked()),     this, SLOT(onRemove()));
  connect(mySortBtn,       SIGNAL(clicked()),     this, SLOT(onSort()));

  connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool)));
  connect(mySelectGroup,   SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
  connect(mySubMeshBtn,    SIGNAL(clicked()),     this, SLOT(setCurrentSelection()));
  connect(myGroupBtn,      SIGNAL(clicked()),     this, SLOT(setCurrentSelection()));
  connect(myGeomGroupBtn,  SIGNAL(toggled(bool)), this, SLOT(onGeomSelectionButton(bool)));

  connect(myColorBtn,      SIGNAL(changed( QColor )),  this, SLOT(onColorChanged( QColor )));

  connect(myOKBtn,         SIGNAL(clicked()), this, SLOT(onOK()));
  connect(myApplyBtn,      SIGNAL(clicked()), this, SLOT(onApply()));
  connect(myCloseBtn,      SIGNAL(clicked()), this, SLOT(onClose()));
  connect(myHelpBtn,       SIGNAL(clicked()), this, SLOT(onHelp()));

  /* Init selection */
  mySMESHGUI->SetActiveDialogBox(this);
  mySMESHGUI->SetState(800);

  mySelectionMode = grpNoSelection;
  myMeshFilter = new SMESH_TypeFilter(MESH);
  mySubMeshFilter = new SMESH_TypeFilter(SUBMESH);
  myGroupFilter = new SMESH_TypeFilter(GROUP);
  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
  myGeomFilter = new GEOM_SelectionFilter( aStudy, true );

  connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(onClose()));
  connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),  this, SLOT(onObjectSelectionChanged()));
  connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()),      this, SLOT(onVisibilityChanged()));

  rb1->setChecked(true); // VSR !!!
  onGrpTypeChanged(0); // VSR!!!

  if (myMesh->_is_nil() )
    myTypeGroup->button(0)->setChecked(true);

  updateButtons();
  //myName->setText(GetDefaultName(tr( "SMESH_GROUP" )));
}
bool SMESHGUI_GroupDlg::IsActorVisible ( SMESH_Actor theActor) [private]

Definition at line 2412 of file SMESHGUI_GroupDlg.cxx.

References SMESH.GetCurrentVtkView().

Referenced by onObjectSelectionChanged(), and SetAppropriateActor().

{
  SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView();
  if (theActor && aViewWindow)
    return aViewWindow->isVisible(theActor->getIO());
  return false;
}
bool SMESHGUI_GroupDlg::isApplyAndClose ( ) const [private]

Definition at line 2435 of file SMESHGUI_GroupDlg.cxx.

References myIsApplyAndClose.

Referenced by onApply(), and onClose().

{
  return myIsApplyAndClose;
}
void SMESHGUI_GroupDlg::keyPressEvent ( QKeyEvent *  e) [private]

Definition at line 2061 of file SMESHGUI_GroupDlg.cxx.

References onHelp().

{
  QDialog::keyPressEvent( e );
  if ( e->isAccepted() )
    return;

  if ( e->key() == Qt::Key_F1 )
    {
      e->accept();
      onHelp();
    }
}
void SMESHGUI_GroupDlg::onAdd ( ) [slot]

Definition at line 1575 of file SMESHGUI_GroupDlg.cxx.

References _PTR(), SMESH_controls.aGroup, SMESH.ALL, EDGE, FACE, SMESH.GetFilterManager(), SMESH.GetGEOMGen(), SMESH.GetNameOfSelectedElements(), SMESH.GetNameOfSelectedNodes(), myActorsList, myCurrentLineEdit, myElements, myGeomGroupLine, myGeomObjects, myGroupLine, myIsBusy, myMesh, mySelectGroup, mySelectionMgr, mySelector, mySelectSubMesh, mySubMeshLine, myTypeId, SMESH.NODE, onListSelectionChanged(), updateButtons(), and VOLUME.

Referenced by initDialog(), and SMESHGUI.OnGUIEvent().

{
  SALOME_ListIO aList;
  mySelectionMgr->selectedObjects( aList );

  int aNbSel = aList.Extent();

  if (aNbSel == 0 || myActorsList.count() == 0 || myMesh->_is_nil()) return;

  myIsBusy = true;

  SMESH::ElementType aType = SMESH::ALL;
  switch(myTypeId) {
  case 0:
    aType = SMESH::NODE;
    mySelector->SetSelectionMode(NodeSelection);
    break;
  case 1:
    aType = SMESH::EDGE;
    mySelector->SetSelectionMode(EdgeSelection);
    break;
  case 2:
    aType = SMESH::FACE;
    mySelector->SetSelectionMode(FaceSelection);
    break;
  case 3:
    aType = SMESH::VOLUME;
    mySelector->SetSelectionMode(VolumeSelection);
    break;
  default:
    mySelector->SetSelectionMode(ActorSelection);
  }

  QListWidgetItem* anItem = 0;
  QList<QListWidgetItem*> listItemsToSel;

  if (myCurrentLineEdit == 0) {
    //if (aNbSel != 1) { myIsBusy = false; return; }
    QString aListStr = "";
    int aNbItems = 0;
    if (myTypeId == 0) {
      QListIterator<SMESH_Actor*> it( myActorsList );
      while ( it.hasNext() ) {
        QString tmpStr;
        aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr);
        aListStr += tmpStr;
      }
    }
    else {
      QListIterator<SMESH_Actor*> it( myActorsList );
      while ( it.hasNext() ) {
        QString tmpStr;
        aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr);
        aListStr += tmpStr;
      }
    }
    if (aNbItems > 0) {
      QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
      for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
        QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
        if (found.count() == 0) {
          anItem = new QListWidgetItem(*it);
          myElements->addItem(anItem);
          if (!anItem->isSelected())
            listItemsToSel.push_back(anItem);
        }
        else {
          foreach(anItem, found)
            if (!anItem->isSelected())
              listItemsToSel.push_back(anItem);
        }
      }
      bool blocked = myElements->signalsBlocked();
      myElements->blockSignals(true);
      foreach(anItem, listItemsToSel) anItem->setSelected(true);
      myElements->blockSignals(blocked);
      onListSelectionChanged();
      listItemsToSel.clear();
    }
  } else if (myCurrentLineEdit == mySubMeshLine) {
    //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());

    SALOME_ListIO aList;
    mySelectionMgr->selectedObjects( aList );

    SALOME_ListIteratorOfListIO anIt (aList);
    for ( ; anIt.More(); anIt.Next()) {
      SMESH::SMESH_subMesh_var aSubMesh =
        SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
      if (!aSubMesh->_is_nil()) {
        // check if mesh is the same
        if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
          try {
            SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
            int k = anElements->length();
            for (int i = 0; i < k; i++) {
              QString aText = QString::number(anElements[i]);
              QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
              if (found.count() == 0) {
                anItem = new QListWidgetItem(aText);
                myElements->addItem(anItem);
                if (!anItem->isSelected())
                  listItemsToSel.push_back(anItem);
              }
              else {
                foreach(anItem, found)
                  if (!anItem->isSelected())
                    listItemsToSel.push_back(anItem);
              }
            }
            bool blocked = myElements->signalsBlocked();
            myElements->blockSignals(true);
            foreach(anItem, listItemsToSel) anItem->setSelected(true);
            myElements->blockSignals(blocked);
            onListSelectionChanged();
            listItemsToSel.clear();
          }
          catch (const SALOME::SALOME_Exception& ex) {
            SalomeApp_Tools::QtCatchCorbaException(ex);
          }
        }
      }
    }
    mySelectSubMesh->setChecked(false);
    myIsBusy = false;
    onListSelectionChanged();

  } else if (myCurrentLineEdit == myGroupLine) {
    //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
    SALOME_ListIO aList;
    mySelectionMgr->selectedObjects( aList );

    SALOME_ListIteratorOfListIO anIt (aList);
    for ( ; anIt.More(); anIt.Next()) {
      SMESH::SMESH_GroupBase_var aGroup =
        SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIt.Value());
      if (!aGroup->_is_nil()) {
        // check if mesh is the same
        if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
          SMESH::long_array_var anElements = aGroup->GetListOfID();
          int k = anElements->length();
          for (int i = 0; i < k; i++) {
            QString aText = QString::number(anElements[i]);
            QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
            if (found.count() == 0) {
              anItem = new QListWidgetItem(aText);
              myElements->addItem(anItem);
              if (!anItem->isSelected())
                listItemsToSel.push_back(anItem);
            }
            else {
              foreach(anItem, found)
                if (!anItem->isSelected())
                  listItemsToSel.push_back(anItem);
            }
          }
          bool blocked = myElements->signalsBlocked();
          myElements->blockSignals(true);
          foreach(anItem, listItemsToSel) anItem->setSelected(true);
          myElements->blockSignals(blocked);
          onListSelectionChanged();
          listItemsToSel.clear();
        }
      }
    }
    mySelectGroup->setChecked(false);
    myIsBusy = false;
    onListSelectionChanged();

  } else if (myCurrentLineEdit == myGeomGroupLine && myGeomObjects->length() == 1) {
    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    GEOM::GEOM_IGroupOperations_var aGroupOp =
      SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());

    SMESH::ElementType aGroupType = SMESH::ALL;
    switch(aGroupOp->GetType(myGeomObjects[0])) {
    case 7: aGroupType = SMESH::NODE; break;
    case 6: aGroupType = SMESH::EDGE; break;
    case 4: aGroupType = SMESH::FACE; break;
    case 2: aGroupType = SMESH::VOLUME; break;
    default: myIsBusy = false; return;
    }

    if (aGroupType == aType) {
      _PTR(SObject) aGroupSO =
        //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
        aStudy->FindObjectID(myGeomObjects[0]->GetStudyEntry());
      // Construct filter
      SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
      SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
      SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
      aBelongToGeom->SetGeom(myGeomObjects[0]);
      aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
      aBelongToGeom->SetElementType(aType);
      aFilter->SetPredicate(aBelongToGeom);

      SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);

      int k = anElements->length();
      for (int i = 0; i < k; i++) {
        QString aText = QString::number(anElements[i]);
        QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
        if (found.count() == 0) {
          anItem = new QListWidgetItem(aText);
          myElements->addItem(anItem);
          if (!anItem->isSelected())
            listItemsToSel.push_back(anItem);
        }
        else {
          foreach(anItem, found)
            if (!anItem->isSelected())
              listItemsToSel.push_back(anItem);
        }
      }
      bool blocked = myElements->signalsBlocked();
      myElements->blockSignals(true);
      foreach(anItem, listItemsToSel) anItem->setSelected(true);
      myElements->blockSignals(blocked);
      onListSelectionChanged();
      listItemsToSel.clear();
    }

    //VSR: mySelectGeomGroup->setChecked(false);
    myIsBusy = false;
    onListSelectionChanged();
  }
  myIsBusy = false;
  //  mySelectionMgr->clearSelected();
  updateButtons();
}
bool SMESHGUI_GroupDlg::onApply ( ) [private, slot]

Definition at line 769 of file SMESHGUI_GroupDlg.cxx.

References _PTR(), SMESH.AddGroup(), SMESH.ALL, EDGE, FACE, SMESH.FindActorByEntry(), SMESH.GetGEOMGen(), getGroupColor(), SMESHGUI.GetSMESHGen(), SMESHGUI.isActiveStudyLocked(), isApplyAndClose(), SMESHGUI.Modified(), myElements, myGeomObjects, myGroup, myGroupOnGeom, myGrpTypeId, myIdList, myMesh, myName, myObjectToSelect, mySelectAll, mySelectionMgr, mySMESHGUI, myTypeId, SMESH.NODE, SMESH.setFileType(), SMESH.UpdateView(), and VOLUME.

Referenced by initDialog(), and onOK().

{
  if (mySMESHGUI->isActiveStudyLocked())
    return false;

  if (myName->text().trimmed().isEmpty())
    return false;

  bool anIsOk = false;
  QStringList anEntryList;
  if (myGrpTypeId == 0) { // on mesh elements
    if (!mySelectAll->isChecked() && !myElements->count())
      return false;

    mySelectionMgr->clearSelected();

    if (myGroup->_is_nil()) { // creation or conversion
      // check if group on geometry is not null
      if (!CORBA::is_nil(myGroupOnGeom)) {
        if (myMesh->_is_nil())
          return false;
        myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
        // nullify pointer, because object become dead
        myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
      }
    }

    if (myGroup->_is_nil()) { // creation
      if (myMesh->_is_nil())
        return false;

      SMESH::ElementType aType = SMESH::ALL;
      switch (myTypeId) {
      case 0: aType = SMESH::NODE; break;
      case 1: aType = SMESH::EDGE; break;
      case 2: aType = SMESH::FACE; break;
      case 3: aType = SMESH::VOLUME; break;
      }

      myGroup = SMESH::AddGroup(myMesh, aType, myName->text());

      if ( mySelectAll->isChecked() ) {
        // select all
        myGroup->AddFrom(myMesh.in());
      }
      else {
        // select manually
        SMESH::long_array_var anIdList = new SMESH::long_array;
        int i, k = myElements->count();
        anIdList->length(k);
        for (i = 0; i < k; i++) {
          anIdList[i] = myElements->item(i)->text().toInt();
        }
        
        myGroup->Add(anIdList.inout());
      }

      SALOMEDS::Color aColor = getGroupColor();
      myGroup->SetColor(aColor);

      _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
      if( aMeshGroupSO )
        anEntryList.append( aMeshGroupSO->GetID().c_str() );

      //SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
      SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );

      /* init for next operation */
      myName->setText( "" );
      myElements->clear();
      myGroup = SMESH::SMESH_Group::_nil();

    } else { // edition
      myGroup->SetName(myName->text().toLatin1().data());

      SALOMEDS::Color aColor = getGroupColor();
      myGroup->SetColor(aColor);

      _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
      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;
        }
      }

      if ( mySelectAll->isChecked() ) {
        // select all
        myGroup->Clear();
        myGroup->AddFrom(myMesh.in());
      }
      else {
        QList<int> aAddList;
        
        int i, total = myElements->count();
        for (i = 0; i < total; i++) {
          int anId = myElements->item(i)->text().toInt();
          int idx = myIdList.indexOf(anId);
          if ( idx == -1 )
            aAddList.append(anId);
          else
            myIdList.removeAt(idx);
        }
        if (!aAddList.empty()) {
          SMESH::long_array_var anIdList = new SMESH::long_array;
          int added = aAddList.count();
          anIdList->length(added);
          for (i = 0; i < added; i++)
            anIdList[i] = aAddList[i];
          myGroup->Add(anIdList.inout());
        }
        if (!myIdList.empty()) {
          SMESH::long_array_var anIdList = new SMESH::long_array;
          int removed = myIdList.count();
          anIdList->length(removed);
          for (i = 0; i < removed; i++)
            anIdList[i] = myIdList[i];
          myGroup->Remove(anIdList.inout());
        }
        /* init for next operation */
        myIdList.clear();
        for (i = 0; i < total; i++) {
          myIdList.append(myElements->item(i)->text().toInt());
        }
      }
    }

    SMESHGUI::Modified();
    mySMESHGUI->updateObjBrowser(true);
    SMESH::UpdateView(); // asv: fix of BUG PAL5515
    mySelectionMgr->clearSelected();
    anIsOk = true;
  }
  else if (myGrpTypeId == 1) { // on geom object
    if (CORBA::is_nil(myGroupOnGeom)) { // creation
      if (myMesh->_is_nil() || !myGeomObjects->length())
        return false;

      SMESH::ElementType aType = SMESH::ALL;
      switch (myTypeId) {
      case 0: aType = SMESH::NODE; break;
      case 1: aType = SMESH::EDGE; break;
      case 2: aType = SMESH::FACE; break;
      case 3: aType = SMESH::VOLUME; break;
      }

      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
      GEOM::GEOM_IGroupOperations_var aGroupOp =
        SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());

      if (myGeomObjects->length() == 1) {
        myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
                                                    myName->text().toLatin1().data(),
                                                    myGeomObjects[0]);
      }
      else {
        SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
        if ( aSMESHGen->_is_nil() )
          return false;

        // create a geometry group
        GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();

        if (geomGen->_is_nil() || !aStudy)
          return false;

        GEOM::GEOM_IGroupOperations_var op =
          geomGen->GetIGroupOperations(aStudy->StudyId());
        if (op->_is_nil())
          return false;

        // check and add all selected GEOM objects: they must be
        // a sub-shapes of the main GEOM and must be of one type
        TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
        for ( int i =0; i < myGeomObjects->length(); i++) {
          TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)myGeomObjects[i]->GetShapeType();
          if (i == 0)
            aGroupType = aSubShapeType;
          else if (aSubShapeType != aGroupType) {
            aGroupType = TopAbs_SHAPE;
            break;
          }
        }

        GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
        GEOM::GEOM_Object_var aGroupVar = op->CreateGroup(aMeshShape, aGroupType);
        op->UnionList(aGroupVar, myGeomObjects);

        if (op->IsDone()) {
          // publish the GEOM group in study
          QString aNewGeomGroupName ( "Auto_group_for_" );
          aNewGeomGroupName += myName->text();
          SALOMEDS::SObject_var aNewGroupSO =
            geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
                                aNewGeomGroupName.toLatin1().data(), aMeshShape);
        }

        myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
                                                    myName->text().toLatin1().data(),
                                                    aGroupVar);
      }

      SALOMEDS::Color aColor = getGroupColor();
      myGroupOnGeom->SetColor(aColor);

      _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
      if( aMeshGroupSO )
        anEntryList.append( aMeshGroupSO->GetID().c_str() );

      //SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
      SMESH::setFileType ( aMeshGroupSO,"COULEURGROUP" );

      /* init for next operation */
      myName->setText( "" );
      myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
    }
    else { // edition
      myGroupOnGeom->SetName(myName->text().toLatin1().data());

      SALOMEDS::Color aColor = getGroupColor();
      myGroupOnGeom->SetColor(aColor);

      _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
      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;
        }
      }
    }

    SMESHGUI::Modified();
    mySMESHGUI->updateObjBrowser(true);
    mySelectionMgr->clearSelected();
    anIsOk = true;
  }

  if( anIsOk )
    if( LightApp_Application* anApp =
        dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
      myObjectToSelect = anApp->browseObjects( anEntryList, isApplyAndClose() );

  return anIsOk;
}
void SMESHGUI_GroupDlg::onClose ( ) [private, slot]

Definition at line 1972 of file SMESHGUI_GroupDlg.cxx.

References SMESH.GetCurrentVtkView(), SMESH.GetViewWindow(), isApplyAndClose(), myObjectToSelect, mySelectionMgr, mySMESHGUI, SMESH.RemoveFilters(), SMESHGUI.ResetState(), restoreShowEntityMode(), SMESH.SetPickable(), and SMESH.SetPointRepresentation().

Referenced by closeEvent(), hideEvent(), initDialog(), and onOK().

{
  if (SMESH::GetCurrentVtkView()) {
    SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
    SMESH::SetPointRepresentation(false);
    SMESH::SetPickable();
    restoreShowEntityMode();
  }

  if( isApplyAndClose() && !myObjectToSelect.isEmpty() ) {
    SUIT_DataOwnerPtrList aList;
    aList.append( new LightApp_DataOwner( myObjectToSelect ) );
    mySelectionMgr->setSelected( aList );
  }
  else
    mySelectionMgr->clearSelected();
  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
    aViewWindow->SetSelectionMode(ActorSelection);
  mySelectionMgr->clearFilters();
  mySMESHGUI->ResetState();

  reject();
}
void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg ( SUIT_Operation *  op) [private, slot]

SLOT.

Is called when Close is pressed in SMESHGUI_ShapeByMeshDlg

Definition at line 2191 of file SMESHGUI_GroupDlg.cxx.

References grpGeomSelection, myShapeByMeshOp, and setSelectionMode().

Referenced by onGeomPopup().

{
  if ( myShapeByMeshOp == op )
    {
      show();
      setSelectionMode(grpGeomSelection);
    }
}
void SMESHGUI_GroupDlg::onColorChanged ( QColor  theColor) [private, slot]

Definition at line 692 of file SMESHGUI_GroupDlg.cxx.

References updateButtons().

Referenced by initDialog().

void SMESHGUI_GroupDlg::onDeactivate ( ) [private, slot]

Definition at line 2024 of file SMESHGUI_GroupDlg.cxx.

References mySMESHGUI, and SMESHGUI.ResetState().

Referenced by initDialog().

{
  mySMESHGUI->ResetState();
  setEnabled(false);
}
void SMESHGUI_GroupDlg::onFilterAccepted ( ) [private, slot]

Definition at line 1561 of file SMESHGUI_GroupDlg.cxx.

References mySelectGroup, mySelectionMode, mySelectSubMesh, and myTypeId.

Referenced by setFilters().

{
  if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() )
  {
    mySelectionMode = myTypeId;
    mySelectSubMesh->setChecked( false );
    mySelectGroup->setChecked( false );
  }
}
void SMESHGUI_GroupDlg::onGeomPopup ( QAction *  a) [private, slot]

Definition at line 2130 of file SMESHGUI_GroupDlg.cxx.

References SMESH_demo_hexa2_upd.a, GEOM_BY_MESH_INDEX, grpNoSelection, myActions, myIsBusy, myMesh, mySelectionMode, myShapeByMeshOp, mySMESHGUI, onCloseShapeByMeshDlg(), onPublishShapeByMeshDlg(), and SMESHGUI_ShapeByMeshOp.SetMesh().

Referenced by updateGeomPopup().

{
  int index = myActions[a];
  if ( index == GEOM_BY_MESH_INDEX )
    {
      mySelectionMode = grpNoSelection;
      if ( !myShapeByMeshOp ) {
        myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
        connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
                SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
        connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
                SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
      }
      // set mesh object to SMESHGUI_ShapeByMeshOp and start it
      if ( !myMesh->_is_nil() ) {
        myIsBusy = true;
        hide(); // stop processing selection
        myIsBusy = false;
        myShapeByMeshOp->setModule( mySMESHGUI );
        myShapeByMeshOp->setStudy( 0 ); // it's really necessary
        myShapeByMeshOp->SetMesh( myMesh );
        myShapeByMeshOp->start();
      }
    }
}
void SMESHGUI_GroupDlg::onGeomSelectionButton ( bool  isBtnOn) [private, slot]
void SMESHGUI_GroupDlg::onGrpTypeChanged ( int  id) [private, slot]

Definition at line 676 of file SMESHGUI_GroupDlg.cxx.

References myGrpTypeId, myName, myOldName, myWGStack, and onSelectGeomGroup().

Referenced by init(), and initDialog().

{
  if (myGrpTypeId != id) {
    myWGStack->setCurrentIndex( id );
    myName->blockSignals(true);
    myName->setText(myOldName);
    myName->blockSignals(false);
    onSelectGeomGroup(id == 1);
  }
  myGrpTypeId = id;
}
void SMESHGUI_GroupDlg::onHelp ( ) [private, slot]

Definition at line 2000 of file SMESHGUI_GroupDlg.cxx.

References myHelpFileName, and mySMESHGUI.

Referenced by initDialog(), and keyPressEvent().

{
  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
  if (app)
    app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString( "" ), myHelpFileName);
  else {
    QString platform;
#ifdef WIN32
    platform = "winapplication";
#else
    platform = "application";
#endif
    SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
                             tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
                             arg(app->resourceMgr()->stringValue( "ExternalBrowser",
                                                                 platform)).
                             arg(myHelpFileName));
  }
}
void SMESHGUI_GroupDlg::onListSelectionChanged ( ) [private, slot]

Definition at line 1037 of file SMESHGUI_GroupDlg.cxx.

References myActorsList, myCurrentLineEdit, myElements, myIsBusy, mySelectionMgr, and mySelector.

Referenced by initDialog(), onAdd(), and onObjectSelectionChanged().

{
  //MESSAGE( "SMESHGUI_GroupDlg::onListSelectionChanged(); myActorsList.count() = " << myActorsList.count());
  if( myIsBusy || myActorsList.count() == 0 ) return;
  myIsBusy = true;

  if (myCurrentLineEdit == 0) {
    mySelectionMgr->clearSelected();
    TColStd_MapOfInteger aIndexes;
    QList<QListWidgetItem*> selItems = myElements->selectedItems();
    QListWidgetItem* anItem;
    foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt());
    mySelector->AddOrRemoveIndex(myActorsList.first()->getIO(), aIndexes, false);
    SALOME_ListIO aList;
    aList.Append(myActorsList.first()->getIO());
    mySelectionMgr->setSelectedObjects(aList,false);
  }
  myIsBusy = false;
}
void SMESHGUI_GroupDlg::onNameChanged ( const QString &  text) [private, slot]

Definition at line 650 of file SMESHGUI_GroupDlg.cxx.

References myName, myNameChanged, myOldName, and updateButtons().

Referenced by initDialog().

{
  myOldName = myName->text();
  updateButtons();
  myNameChanged = !myName->text().trimmed().isEmpty();
}
void SMESHGUI_GroupDlg::onObjectSelectionChanged ( ) [private, slot]

Definition at line 1061 of file SMESHGUI_GroupDlg.cxx.

References _PTR(), SMESH_controls.aGroup, SMESH.FindActorByObject(), SMESH.GetGEOMGen(), SMESH.GetNameOfSelectedElements(), SMESH.GetNameOfSelectedNodes(), Handle(), init(), IsActorVisible(), myActorsList, myCreate, myCurrentLineEdit, myElements, myFilterDlg, myGeomGroupBtn, myGeomGroupLine, myGeomObjects, myGroup, myGroupLine, myGroupOnGeom, myGrpTypeId, myIsBusy, myMesh, myMeshGroupLine, myName, myNameChanged, myOldName, mySelectGroup, mySelectionMgr, mySelector, mySelectSubMesh, mySubMeshLine, myTypeId, onListSelectionChanged(), onTypeChanged(), restoreShowEntityMode(), SetAppropriateActor(), SMESHGUI_FilterDlg.SetMesh(), setSelectionMode(), setShowEntityMode(), updateButtons(), and updateGeomPopup().

Referenced by initDialog(), onPublishShapeByMeshDlg(), and setCurrentSelection().

{
  if ( myIsBusy || !isEnabled()) return;
  if (myCurrentLineEdit == myGeomGroupLine && !myGeomGroupBtn->isChecked()) return;

  myIsBusy = true;

  SALOME_ListIO aList;
  mySelectionMgr->selectedObjects( aList );

  int aNbSel = aList.Extent();
  myElements->clearSelection();

  if (myCurrentLineEdit)
  {
    myCurrentLineEdit->setText( "" );
    QString aString = "";

    if (myCurrentLineEdit == myMeshGroupLine)
    {
      mySelectSubMesh->setEnabled(false);
      mySelectGroup->setEnabled(false);
      myGroupLine->setText( "" );
      mySubMeshLine->setText( "" );

      myGeomGroupBtn->setEnabled(false);
      myGeomGroupLine->setEnabled(false);
      myGeomGroupLine->setText( "" );
      myGeomObjects = new GEOM::ListOfGO();
      myGeomObjects->length(0);

      if (myGeomGroupBtn->isChecked())
        myGeomGroupBtn->setChecked(false);
      if (!myCreate)
        myName->setText( "" );

      myElements->clear();

      if (aNbSel != 1 ) {
        myGroup = SMESH::SMESH_Group::_nil();
        myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
        restoreShowEntityMode();
        myMesh = SMESH::SMESH_Mesh::_nil();
        updateGeomPopup();
        updateButtons();
        myIsBusy = false;
        return;
      }
      Handle(SALOME_InteractiveObject) IO = aList.First();

      if (myCreate) {
        restoreShowEntityMode();
        myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
        setShowEntityMode();
        updateGeomPopup();
        if (myMesh->_is_nil())
        {
          updateButtons();
          myIsBusy = false;
          return;
        }

        if ( myFilterDlg && !myMesh->_is_nil()){
          myFilterDlg->SetMesh( myMesh );
        }
        myGroup = SMESH::SMESH_Group::_nil();

        // NPAL19389: create a group with a selection in another group
        // set actor of myMesh, if it is visible, else try
        // any visible actor of group or submesh of myMesh
        SetAppropriateActor();

        aString = aList.First()->getName();
        myMeshGroupLine->setText(aString);
        myMeshGroupLine->home( false );

        mySelectSubMesh->setEnabled(true);
        mySelectGroup->setEnabled(true);
        myGeomGroupBtn->setEnabled(true);
        myGeomGroupLine->setEnabled(true);
        updateButtons();
      }
      else {
        SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
        if (aGroup->_is_nil())
        {
          myIsBusy = false;
          return;
        }
        myIsBusy = false;

        myGroup = SMESH::SMESH_Group::_nil();
        myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();

        init(aGroup);
        myIsBusy = true;
        mySelectSubMesh->setEnabled(true);
        mySelectGroup->setEnabled(true);
      }
      myCurrentLineEdit = 0;
      myIsBusy = false;
      if (!myCreate)
        return;

      if (myGrpTypeId == 0)
      {
        if (myTypeId == -1)
          onTypeChanged(0);
        else
        {
          myElements->clear();
          setSelectionMode(myTypeId);
        }
      }

      myIsBusy = false;
      return;

    }
    else if (myCurrentLineEdit == myGeomGroupLine)
    {
      myGeomObjects = new GEOM::ListOfGO();

      // The mesh SObject
      _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);

      if (aNbSel == 0 || !aMeshSO)
      {
        myGeomObjects->length(0);
        updateButtons();
        myIsBusy = false;
        return;
      }

      myGeomObjects->length(aNbSel);

      GEOM::GEOM_Object_var aGeomGroup;
      int i = 0;

      SALOME_ListIteratorOfListIO anIt (aList);
      for (; anIt.More(); anIt.Next())
      {
        aGeomGroup = GEOMBase::ConvertIOinGEOMObject(anIt.Value());

        // Check if the object is a geometry group
        if (CORBA::is_nil(aGeomGroup))
          continue;

        // Check if group constructed on the same shape as a mesh or on its child
        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
        GEOM::GEOM_IGroupOperations_var anOp =
          SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());

        // The main shape of the group
        GEOM::GEOM_Object_var aGroupMainShape;
        if (aGeomGroup->GetType() == 37)
          aGroupMainShape = anOp->GetMainShape(aGeomGroup);
        else
          aGroupMainShape = GEOM::GEOM_Object::_duplicate(aGeomGroup);
        _PTR(SObject) aGroupMainShapeSO =
          //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
          aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());

        _PTR(SObject) anObj, aRef;
        bool isRefOrSubShape = false;
        if (aMeshSO->FindSubObject(1, anObj) &&  anObj->ReferencedObject(aRef)) {
          //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
          if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
            isRefOrSubShape = true;
          } else {
            _PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
            _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
            //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
            while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
              //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
              if (aRef->GetID() == aFather->GetID())
                isRefOrSubShape = true;
              else
                aFather = aFather->GetFather();
            }
          }
        }
        if (isRefOrSubShape)
          myGeomObjects[i++] = aGeomGroup;
      }

      myGeomObjects->length(i);
      if ( i == 0 )
        {
          myIsBusy = false;
          return;
        }

      aNbSel = i;
    }

    if (aNbSel >= 1) {
      if (aNbSel > 1) {
        if (myCurrentLineEdit == mySubMeshLine)
          aString = tr( "SMESH_SUBMESH_SELECTED" ).arg(aNbSel);
        else if (myCurrentLineEdit == myGroupLine)
          aString = tr( "SMESH_GROUP_SELECTED" ).arg(aNbSel);
        else if (myCurrentLineEdit == myGeomGroupLine)
          aString = tr( "%1 Objects" ).arg(aNbSel);
      }
      else {
        aString = aList.First()->getName();
      }
    }

    myCurrentLineEdit->setText(aString);
    myCurrentLineEdit->home(false);
    // 07.06.2008 skl for IPAL19574:
    // change name of group only if it is empty
    if( myName->text().trimmed().isEmpty() || !myNameChanged ) {
      myOldName = myName->text();
      myName->blockSignals(true);
      myName->setText(aString);
      myName->blockSignals(false);
    }

    updateButtons();
  }
  else // !myCurrentLineEdit: local selection of nodes or elements
  {
    if (aNbSel == 1 && myActorsList.count() > 0 )
    {
      // NPAL19389: create a group with a selection in another group
      // Switch myActor to the newly selected one, if the last
      // is visible and belongs to group or submesh of myMesh
      /*      Handle(SALOME_InteractiveObject) curIO = myActor->getIO();
      Handle(SALOME_InteractiveObject) selIO = aList.First();
      if (curIO->hasEntry() && selIO->hasEntry()) {
        const char* selEntry = selIO->getEntry();
        if (strcmp(curIO->getEntry(), selEntry) != 0) {
          // different objects: selected and myActor
          SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView();
          if (aViewWindow && aViewWindow->isVisible(selIO)) {
            // newly selected actor is visible

            // mesh entry
            _PTR(SObject) aSObject = SMESH::FindSObject(myMesh);
            if (aSObject) {
              CORBA::String_var meshEntry = aSObject->GetID().c_str();
              int len = strlen(meshEntry);

              if (strncmp(selEntry, meshEntry, len) == 0) {
                // selected object is myMesh or a part of it
                SMESH_Actor* anActor = SMESH::FindActorByEntry(selEntry);
                if (anActor) {
                  myActor = anActor;
                  SMESH::SetPickable(myActor);
                }
              }
            }
          }
        }
      }*/
      // NPAL19389 END

      QString aListStr = "";
      int aNbItems = 0;
      if (myTypeId == 0) {
        QListIterator<SMESH_Actor*> it( myActorsList );
        while ( it.hasNext() ) {
          QString tmpStr;
          aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr);
          aListStr += tmpStr;
        }
      } else {
        QListIterator<SMESH_Actor*> it( myActorsList );
        while ( it.hasNext() ) {
          QString tmpStr;
          aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr);
          aListStr += tmpStr;
        }
      }
      if (aNbItems > 0) {
        QListWidgetItem* anItem;
        QList<QListWidgetItem*> listItemsToSel;
        QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
        for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
          QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
          foreach(anItem, found)
            if (!anItem->isSelected())
              listItemsToSel.push_back(anItem);
        }
        bool blocked = myElements->signalsBlocked();
        myElements->blockSignals(true);
        foreach(anItem, listItemsToSel) anItem->setSelected(true);
        myElements->blockSignals(blocked);
        onListSelectionChanged();
        listItemsToSel.clear();
      }
    }
  }
  
  if (myActorsList.count() == 0) {
    if (!myGroup->_is_nil()) {
      SMESH_Actor* anActor = SMESH::FindActorByObject(myGroup);
      if ( anActor )
        myActorsList.append( anActor  );
    }
    else if(!myGroupOnGeom->_is_nil()) {
      SMESH_Actor* anActor = SMESH::FindActorByObject(myGroupOnGeom);
      if ( anActor )
        myActorsList.append( anActor );
    }
    else {
      SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh );
      if ( anActor )
        myActorsList.append( anActor );
    }
  }

  // somehow, if we display the mesh, while selecting from another actor,
  // the mesh becomes pickable, and there is no way to select any element
  if (myActorsList.count() > 0) {
    QListIterator<SMESH_Actor*> it( myActorsList );
    while ( it.hasNext() ) {
      SMESH_Actor* anActor = it.next();
      if ( IsActorVisible(anActor) )
        anActor->SetPickable(true);
    }
  }

  myIsBusy = false;
}
void SMESHGUI_GroupDlg::onOK ( ) [private, slot]

Definition at line 1025 of file SMESHGUI_GroupDlg.cxx.

References onApply(), onClose(), and setIsApplyAndClose().

Referenced by initDialog().

{
  setIsApplyAndClose( true );
  if ( onApply() )
    onClose();
  setIsApplyAndClose( false );
}
void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg ( SUIT_Operation *  op) [private, slot]

SLOT.

Is called when Ok is pressed in SMESHGUI_ShapeByMeshDlg

Definition at line 2162 of file SMESHGUI_GroupDlg.cxx.

References _PTR(), SMESHGUI_ShapeByMeshOp.GetShape(), Handle(), mySelectionMgr, myShapeByMeshOp, mySMESHGUI, and onObjectSelectionChanged().

Referenced by onGeomPopup().

{
  if ( myShapeByMeshOp == op ) {
    mySMESHGUI->getApp()->updateObjectBrowser();
    show();
    // Select a found geometry object
    GEOM::GEOM_Object_var aGeomVar = myShapeByMeshOp->GetShape();
    if ( !aGeomVar->_is_nil() )
    {
      QString ID = aGeomVar->GetStudyEntry();
      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
      if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
        SALOME_ListIO anIOList;
        Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
          ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
        anIOList.Append( anIO );
        mySelectionMgr->setSelectedObjects( anIOList, false );
        onObjectSelectionChanged();
      }
    }
  }
}
void SMESHGUI_GroupDlg::onRemove ( ) [slot]

Definition at line 1810 of file SMESHGUI_GroupDlg.cxx.

References SMESH_controls.aGroup, SMESH.ALL, EDGE, FACE, myCurrentLineEdit, myElements, myGroupLine, myIsBusy, myMesh, mySelectionMgr, mySubMeshLine, myTypeId, SMESH.NODE, updateButtons(), and VOLUME.

Referenced by initDialog(), and SMESHGUI.OnGUIEvent().

{
  myIsBusy = true;
  if (myCurrentLineEdit == 0) {
    QList<QListWidgetItem*> selItems = myElements->selectedItems();
    QListWidgetItem* item;
    foreach(item, selItems) delete item;
  } else {
    SALOME_ListIO aList;
    mySelectionMgr->selectedObjects( aList );

    int aNbSel = aList.Extent();

    if (aNbSel == 0) { myIsBusy = false; return; }

    SMESH::ElementType aType = SMESH::ALL;
    switch(myTypeId) {
    case 0: aType = SMESH::NODE; break;
    case 1: aType = SMESH::EDGE; break;
    case 2: aType = SMESH::FACE; break;
    case 3: aType = SMESH::VOLUME; break;
    }

    if (myCurrentLineEdit == mySubMeshLine) {
      //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
      SALOME_ListIO aList;
      mySelectionMgr->selectedObjects( aList );

      SALOME_ListIteratorOfListIO anIt (aList);
      for ( ; anIt.More(); anIt.Next()) {
        SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
        if (!aSubMesh->_is_nil()) {
          // check if mesh is the same
          if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
            if (aType == SMESH::NODE) {
              try {
                SMESH::long_array_var anElements = aSubMesh->GetNodesId();
                int k = anElements->length();
                for (int i = 0; i < k; i++) {
                  QList<QListWidgetItem*> found = 
                    myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
                  QListWidgetItem* anItem;
                  foreach(anItem, found) delete anItem;
                }
              }
              catch (const SALOME::SALOME_Exception& ex) {
                SalomeApp_Tools::QtCatchCorbaException(ex);
              }
            }
            else {
              try {
                SMESH::long_array_var anElements = aSubMesh->GetElementsId();
                int k = anElements->length();
                for (int i = 0; i < k; i++) {
                  QList<QListWidgetItem*> found = 
                    myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
                  QListWidgetItem* anItem;
                  foreach(anItem, found) delete anItem;
                }
              }
              catch (const SALOME::SALOME_Exception& ex) {
                SalomeApp_Tools::QtCatchCorbaException(ex);
              }
            }
          }
        }
      }
    }
    else if (myCurrentLineEdit == myGroupLine) {
      Standard_Boolean aRes;
      //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
      SALOME_ListIO aList;
      mySelectionMgr->selectedObjects( aList );

      SALOME_ListIteratorOfListIO anIt (aList);
      for ( ; anIt.More(); anIt.Next()) {
        SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
        if (aRes && !aGroup->_is_nil()) {
          // check if mesh is the same
          if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
            SMESH::long_array_var anElements = aGroup->GetListOfID();
            int k = anElements->length();
            for (int i = 0; i < k; i++) {
              QList<QListWidgetItem*> found = 
                myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
              QListWidgetItem* anItem;
              foreach(anItem, found) delete anItem;
            }
          }
        }
      }
    }
  }
  myIsBusy = false;
  updateButtons();
}
void SMESHGUI_GroupDlg::onSelectAll ( ) [private, slot]

Definition at line 1394 of file SMESHGUI_GroupDlg.cxx.

References grpNoSelection, myAddBtn, myElements, myElementsLab, myFilter, myRemoveBtn, mySelectAll, mySelectBox, mySelectionMode, mySortBtn, setSelectionMode(), and updateButtons().

Referenced by initDialog().

{
  myElementsLab->setEnabled( !mySelectAll->isChecked() );
  myElements->setEnabled( !mySelectAll->isChecked() );
  myFilter->setEnabled( !mySelectAll->isChecked() );
  myAddBtn->setEnabled( !mySelectAll->isChecked() );
  myRemoveBtn->setEnabled( !mySelectAll->isChecked() );
  mySortBtn->setEnabled( !mySelectAll->isChecked() );
  mySelectBox->setEnabled( !mySelectAll->isChecked() );
  int selMode = mySelectionMode;
  mySelectionMode = grpNoSelection;
  setSelectionMode( selMode );
  updateButtons();
}
void SMESHGUI_GroupDlg::onSelectGeomGroup ( bool  on) [private, slot]

Definition at line 1464 of file SMESHGUI_GroupDlg.cxx.

References grpAllSelection, myCurrentLineEdit, myGeomGroupBtn, myGeomGroupLine, myGeomObjects, mySelectGroup, mySelectSubMesh, myTypeId, setSelectionMode(), and updateGeomPopup().

Referenced by initDialog(), and onGrpTypeChanged().

{
  if (on) {
    if (mySelectSubMesh->isChecked()) {
      mySelectSubMesh->setChecked(false);
    }
    else if (mySelectGroup->isChecked()) {
      mySelectGroup->setChecked(false);
    }
    myCurrentLineEdit = myGeomGroupLine;
    updateGeomPopup();
    setSelectionMode(grpAllSelection);
  }
  else {
    myGeomGroupBtn->setChecked(false);
    myGeomObjects->length(0);
    myGeomGroupLine->setText( "" );
    myCurrentLineEdit = 0;
    if (myTypeId != -1)
      setSelectionMode(myTypeId);
  }
}
void SMESHGUI_GroupDlg::onSelectGroup ( bool  on) [private, slot]

Definition at line 1440 of file SMESHGUI_GroupDlg.cxx.

References grpGroupSelection, myCurrentLineEdit, myGroupBtn, myGroupLine, mySelectSubMesh, myTypeId, and setSelectionMode().

Referenced by initDialog().

{
  if (on) {
    if (mySelectSubMesh->isChecked()) {
      mySelectSubMesh->setChecked(false);
    }
    myCurrentLineEdit = myGroupLine;
    setSelectionMode(grpGroupSelection);
  }
  else {
    myGroupLine->setText( "" );
    myCurrentLineEdit = 0;
    if (myTypeId != -1)
      setSelectionMode(myTypeId);
  }
  myGroupBtn->setEnabled(on);
  myGroupLine->setEnabled(on);
}
void SMESHGUI_GroupDlg::onSelectSubMesh ( bool  on) [private, slot]

Definition at line 1413 of file SMESHGUI_GroupDlg.cxx.

References grpSubMeshSelection, myCurrentLineEdit, mySelectGroup, mySubMeshBtn, mySubMeshLine, myTypeId, and setSelectionMode().

Referenced by initDialog().

{
  if (on) {
    if (mySelectGroup->isChecked()) {
      mySelectGroup->setChecked(false);
    }
    //VSR: else if (mySelectGeomGroup->isChecked()) {
    //VSR:   mySelectGeomGroup->setChecked(false);
    //VSR: }
    myCurrentLineEdit = mySubMeshLine;
    setSelectionMode(grpSubMeshSelection);
  }
  else {
    mySubMeshLine->setText( "" );
    myCurrentLineEdit = 0;
    if (myTypeId != -1)
      setSelectionMode(myTypeId);
  }
  mySubMeshBtn->setEnabled(on);
  mySubMeshLine->setEnabled(on);
}
void SMESHGUI_GroupDlg::onSort ( ) [private, slot]

Definition at line 1911 of file SMESHGUI_GroupDlg.cxx.

References myElements, and myIsBusy.

Referenced by initDialog().

{
  // PAL5412: sorts items in ascending by "string" value
  // myElements->sort(true);
  // myElements->update();
  int i, k = myElements->count();
  if (k > 0) {
    myIsBusy = true;
    QList<int> aSelected;
    std::vector<int> anArray(k);
    //    QMemArray<int> anArray(k);
    // fill the array
    for (i = 0; i < k; i++) {
      int id = myElements->item(i)->text().toInt();
      anArray[i] = id;
      if (myElements->item(i)->isSelected())
        aSelected.append(id);
    }
    // sort & update list
    std::sort(anArray.begin(), anArray.end());
    //    anArray.sort();
    myElements->clear();
    QListWidgetItem* anItem;
    QList<QListWidgetItem*> listItemsToSel;
    for (i = 0; i < k; i++) {
      anItem = new QListWidgetItem(QString::number(anArray[i]));
      myElements->addItem(anItem);
      if (aSelected.contains(anArray[i]))
        listItemsToSel.push_back(anItem);
    }
    bool blocked = myElements->signalsBlocked();
    myElements->blockSignals(true);
    foreach(anItem, listItemsToSel) anItem->setSelected(true);
    myElements->blockSignals(blocked);
    listItemsToSel.clear();
    myIsBusy = false;
  }
}
void SMESHGUI_GroupDlg::onTypeChanged ( int  id) [private, slot]
void SMESHGUI_GroupDlg::onVisibilityChanged ( ) [private, slot]

Definition at line 1963 of file SMESHGUI_GroupDlg.cxx.

References SetAppropriateActor().

Referenced by initDialog().

void SMESHGUI_GroupDlg::restoreShowEntityMode ( ) [private]

Definition at line 2398 of file SMESHGUI_GroupDlg.cxx.

References SMESH.FindActorByObject(), myMesh, and myStoredShownEntity.

Referenced by init(), onClose(), onObjectSelectionChanged(), and setShowEntityMode().

{
  if ( myStoredShownEntity && !myMesh->_is_nil() ) {
    if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) {
      actor->SetEntityMode(myStoredShownEntity);
    }
  }
  myStoredShownEntity = 0;
}
bool SMESHGUI_GroupDlg::SetAppropriateActor ( ) [private]

Definition at line 2293 of file SMESHGUI_GroupDlg.cxx.

References _PTR(), SMESH.FindActorByObject(), SMESH.GetCurrentVtkView(), Handle(), IsActorVisible(), myActorsList, myGeomGroupBtn, myGroup, myGroupOnGeom, and myMesh.

Referenced by init(), onObjectSelectionChanged(), and onVisibilityChanged().

{
  bool isActor = false;
  myActorsList.clear();

  if (myMesh->_is_nil()) return false;

  SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView();

  if (myGeomGroupBtn->isChecked()) {   // try current group on geometry actor
    if (!isActor) {
      if (!myGroupOnGeom->_is_nil()) {
        SMESH_Actor* anActor = SMESH::FindActorByObject(myGroupOnGeom);
        if (anActor && anActor->hasIO())
          {
            isActor = true;
            if (aViewWindow && !aViewWindow->isVisible(anActor->getIO()))
              isActor = false;
            else
              myActorsList.append(anActor);
          }
      }
    }
  } else {
    // try mesh actor
    SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
    if (anActor && anActor->hasIO()) {
      isActor = true;
      if (aViewWindow && !aViewWindow->isVisible(anActor->getIO()))
        isActor = false;
      else
        myActorsList.append(anActor);
    }
    
    // try group actor
    if (!isActor && !myGroup->_is_nil()) {
      SMESH_Actor* anActor = SMESH::FindActorByObject(myGroup);
      if (anActor && anActor->hasIO())
        myActorsList.append(anActor);
    }
    
    // try any visible actor of group or submesh of current mesh
    if (aViewWindow) {
      // mesh entry
      _PTR(SObject) aSObject = SMESH::FindSObject(myMesh);
      if (aSObject) {
        CORBA::String_var meshEntry = aSObject->GetID().c_str();
        int len = strlen(meshEntry);
        
        // iterate on all actors in current view window, search for
        // any visible actor, that belongs to group or submesh of current mesh
        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*>(aCollection->GetItemAsObject(i));
            if (anActor && anActor->hasIO()) {
              Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
              if (aViewWindow->isVisible(anIO)) {
                if (anIO->hasEntry() && strncmp(anIO->getEntry(), meshEntry, len) == 0 && !myActorsList.contains(anActor) )
                  myActorsList.append(anActor);
              }
            }
          }
      }
    }
  }
  
  if (myActorsList.count() > 0) {
    QListIterator<SMESH_Actor*> it( myActorsList );
    while ( it.hasNext() ) {
      SMESH_Actor* anActor = it.next();
      if ( IsActorVisible(anActor) )
        anActor->SetPickable(true);
    }
  }
  
  return ( isActor || (myActorsList.count() > 0) );
}
void SMESHGUI_GroupDlg::setCurrentSelection ( ) [private, slot]
void SMESHGUI_GroupDlg::setDefaultGroupColor ( ) [private]

Definition at line 2251 of file SMESHGUI_GroupDlg.cxx.

References GetColor(), getUniqueColor(), myMesh, and setGroupQColor().

Referenced by init().

{
  if( myMesh->_is_nil() )
    return;

  bool isAutoColor = myMesh->GetAutoColor();

  QColor aQColor;
  if( !isAutoColor )
  {
    int r = 0, g = 0, b = 0;
    SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
    aQColor.setRgb( r, g, b );
  }
  else
  {
    SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups();

    QList<SALOMEDS::Color> aReservedColors;
    for( int i = 0, n = aListOfGroups.length(); i < n; i++ )
    {
      SMESH::SMESH_GroupBase_var aGroupObject = aListOfGroups[i];
      SALOMEDS::Color aReservedColor = aGroupObject->GetColor();
      aReservedColors.append( aReservedColor );
    }

    SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors );
    aQColor.setRgb( (int)( aColor.R * 255.0 ),
                    (int)( aColor.G * 255.0 ),
                    (int)( aColor.B * 255.0 ) );

  }

  setGroupQColor( aQColor );
}
void SMESHGUI_GroupDlg::setFilters ( ) [private, slot]

Definition at line 1522 of file SMESHGUI_GroupDlg.cxx.

References SMESH.ALL, EDGE, FACE, SMESHGUI_FilterDlg.Init(), myElements, myFilterDlg, myMesh, mySMESHGUI, myTypeId, SMESH.NODE, onFilterAccepted(), SMESHGUI_FilterDlg.SetMesh(), SMESHGUI_FilterDlg.SetSelection(), SMESHGUI_FilterDlg.SetSourceWg(), and VOLUME.

Referenced by initDialog().

{
  if(myMesh->_is_nil()) {
    SUIT_MessageBox::critical(this,
                              tr("SMESH_ERROR"),
                              tr("NO_MESH_SELECTED"));
   return;
  }

  SMESH::ElementType aType = SMESH::ALL;
  switch ( myTypeId )
  {
    case 0 : aType = SMESH::NODE; break;
    case 1 : aType = SMESH::EDGE; break;
    case 2 : aType = SMESH::FACE; break;
    case 3 : aType = SMESH::VOLUME; break;
    default: return;
  }

  if ( myFilterDlg == 0 )
  {
    myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType );
    connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) );
  }
  else
    myFilterDlg->Init( aType );

  myFilterDlg->SetSelection();
  myFilterDlg->SetMesh( myMesh );
  myFilterDlg->SetSourceWg( myElements, false );

  myFilterDlg->show();
}
void SMESHGUI_GroupDlg::setGroupColor ( const SALOMEDS::Color &  theColor) [private]

Definition at line 2204 of file SMESHGUI_GroupDlg.cxx.

References setGroupQColor().

Referenced by init().

{
  QColor aQColor( (int)( theColor.R * 255.0 ),
                  (int)( theColor.G * 255.0 ),
                  (int)( theColor.B * 255.0 ) );
  setGroupQColor( aQColor );
}
void SMESHGUI_GroupDlg::setGroupQColor ( const QColor &  theColor) [private]

Definition at line 2232 of file SMESHGUI_GroupDlg.cxx.

References myColorBtn.

Referenced by setDefaultGroupColor(), and setGroupColor().

{
  if( theColor.isValid() )
    myColorBtn->setColor( theColor );
}
void SMESHGUI_GroupDlg::setIsApplyAndClose ( const bool  theFlag) [private]

Definition at line 2425 of file SMESHGUI_GroupDlg.cxx.

References myIsApplyAndClose.

Referenced by onOK().

{
  myIsApplyAndClose = theFlag;
}
void SMESHGUI_GroupDlg::setSelectionMode ( int  theMode) [private]

Definition at line 701 of file SMESHGUI_GroupDlg.cxx.

References SMESH.GetViewWindow(), grpEdgeSelection, grpFaceSelection, grpGeomSelection, grpGroupSelection, grpMeshSelection, grpNodeSelection, grpSubMeshSelection, grpVolumeSelection, myActorsList, myGeomFilter, myGroupFilter, myMesh, myMeshFilter, mySelectAll, mySelectionMgr, mySelectionMode, mySMESHGUI, mySubMeshFilter, and SMESH.SetPointRepresentation().

Referenced by enterEvent(), init(), onCloseShapeByMeshDlg(), onGeomSelectionButton(), onObjectSelectionChanged(), onSelectAll(), onSelectGeomGroup(), onSelectGroup(), onSelectSubMesh(), onTypeChanged(), setCurrentSelection(), and SMESHGUI_GroupDlg().

{
  // PAL7314
  if (myMesh->_is_nil())
    return;
  SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
  bool isSelectAll = mySelectAll->isChecked();
  if (mySelectionMode != theMode) {
    // [PAL10408] mySelectionMgr->clearSelected();
    mySelectionMgr->clearFilters();
    if (myActorsList.count() > 0) {
      QListIterator<SMESH_Actor*> it( myActorsList );
      while ( it.hasNext() )
        it.next()->SetPointRepresentation(false);
    }
    else {
      SMESH::SetPointRepresentation(false);
    }
    switch (theMode) {
    case grpNodeSelection:
      if (myActorsList.count() > 0) {
        QListIterator<SMESH_Actor*> it( myActorsList );
        while ( it.hasNext() )
          it.next()->SetPointRepresentation(true);
      }
      else {
        SMESH::SetPointRepresentation(true);
      }
      if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : NodeSelection);
      break;
    case grpEdgeSelection:
      if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : EdgeSelection);
      break;
    case grpFaceSelection:
      if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : FaceSelection);
      break;
    case grpVolumeSelection:
      if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : VolumeSelection);
      break;
    case grpSubMeshSelection:
      mySelectionMgr->installFilter(mySubMeshFilter);
      if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
      break;
    case grpGroupSelection:
      mySelectionMgr->installFilter(myGroupFilter);
      if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
      break;
    case grpMeshSelection:
      mySelectionMgr->installFilter(myMeshFilter);
      if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
      break;
    case grpGeomSelection:
      mySelectionMgr->installFilter(myGeomFilter);
      if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
      break;
    default:
      if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
      break;
    }
    if ( aViewWindow ) aViewWindow->Repaint();
    mySelectionMode = theMode;
  }
}
void SMESHGUI_GroupDlg::setShowEntityMode ( ) [private]

Definition at line 2378 of file SMESHGUI_GroupDlg.cxx.

References SMESH_Actor.eEdges, SMESH_Actor.eFaces, SMESH_Actor.eVolumes, SMESH.FindActorByObject(), myMesh, myStoredShownEntity, myTypeId, and restoreShowEntityMode().

Referenced by init(), onObjectSelectionChanged(), and onTypeChanged().

{
  if ( !myMesh->_is_nil() ) {
    if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) {
      if (!myStoredShownEntity)
        myStoredShownEntity = actor->GetEntityMode();
      switch ( myTypeId ) {
      case 0: restoreShowEntityMode(); break;
      case 1: actor->SetEntityMode( SMESH_Actor::eEdges ); break;
      case 2: actor->SetEntityMode( SMESH_Actor::eFaces ); break;
      case 3: actor->SetEntityMode( SMESH_Actor::eVolumes ); break;
      }
    }
  }
}
void SMESHGUI_GroupDlg::updateButtons ( ) [private]

Definition at line 628 of file SMESHGUI_GroupDlg.cxx.

References myApplyBtn, myElements, myGeomObjects, myGroup, myGroupOnGeom, myGrpTypeId, myMesh, myName, myOKBtn, and mySelectAll.

Referenced by init(), initDialog(), onAdd(), onColorChanged(), onNameChanged(), onObjectSelectionChanged(), onRemove(), and onSelectAll().

{
  bool enable = !myName->text().trimmed().isEmpty();

  if (myGrpTypeId == 0) {
    enable = enable && (mySelectAll->isChecked() || myElements->count() > 0);
    enable = enable && (!myGroup->_is_nil() || !myMesh->_is_nil());
  }
  else if (myGrpTypeId == 1) {
    if (CORBA::is_nil(myGroupOnGeom)) { // creation mode
      enable = enable && myGeomObjects->length() > 0 && !myMesh->_is_nil();
    }
  }
  
  myOKBtn->setEnabled(enable);
  myApplyBtn->setEnabled(enable);
}
void SMESHGUI_GroupDlg::updateGeomPopup ( ) [private]

Definition at line 2083 of file SMESHGUI_GroupDlg.cxx.

References DIRECT_GEOM_INDEX, GEOM_BY_MESH_INDEX, myActions, myGeomGroupBtn, myGeomPopup, myMesh, onGeomPopup(), and onGeomSelectionButton().

Referenced by onObjectSelectionChanged(), and onSelectGeomGroup().

{
  bool enable = false;

  if ( !myMesh->_is_nil() )
    enable = myMesh->NbEdges() > 0;

  if ( myGeomGroupBtn )
  {
    disconnect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
    if ( enable ) {
      if ( !myGeomPopup ) {
        myGeomPopup = new QMenu(this);
        myActions[myGeomPopup->addAction( tr( "DIRECT_GEOM_SELECTION" ) )] = DIRECT_GEOM_INDEX;
        myActions[myGeomPopup->addAction( tr( "GEOM_BY_MESH_ELEM_SELECTION" ) )] = GEOM_BY_MESH_INDEX;
        connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
      }
      connect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
    }
  }
}

Field Documentation

QMap<QAction*, int> SMESHGUI_GroupDlg.myActions [private]

Definition at line 218 of file SMESHGUI_GroupDlg.h.

Referenced by onGeomPopup(), onGeomSelectionButton(), and updateGeomPopup().

QPushButton* SMESHGUI_GroupDlg.myAddBtn [private]

Definition at line 170 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onSelectAll().

QPushButton* SMESHGUI_GroupDlg.myApplyBtn [private]

Definition at line 190 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and updateButtons().

QPushButton* SMESHGUI_GroupDlg.myCloseBtn [private]

Definition at line 191 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog().

QtxColorButton* SMESHGUI_GroupDlg.myColorBtn [private]

Definition at line 182 of file SMESHGUI_GroupDlg.h.

Referenced by getGroupQColor(), initDialog(), and setGroupQColor().

Definition at line 214 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), onObjectSelectionChanged(), and setCurrentSelection().

QListWidget* SMESHGUI_GroupDlg.myElements [private]

Definition at line 167 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onSelectAll().

QPushButton* SMESHGUI_GroupDlg.myFilter [private]

Definition at line 169 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onSelectAll().

Definition at line 210 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and setSelectionMode().

QToolButton* SMESHGUI_GroupDlg.myGeomGroupBtn [private]
QLineEdit* SMESHGUI_GroupDlg.myGeomGroupLine [private]
GEOM::ListOfGO_var SMESHGUI_GroupDlg.myGeomObjects [private]

Definition at line 187 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), onGeomSelectionButton(), and updateGeomPopup().

SMESH::SMESH_Group_var SMESHGUI_GroupDlg.myGroup [private]
QPushButton* SMESHGUI_GroupDlg.myGroupBtn [private]

Definition at line 179 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), onSelectGroup(), and setCurrentSelection().

Definition at line 209 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and setSelectionMode().

QLineEdit* SMESHGUI_GroupDlg.myGroupLine [private]
SMESH::SMESH_GroupOnGeom_var SMESHGUI_GroupDlg.myGroupOnGeom [private]
QButtonGroup* SMESHGUI_GroupDlg.myGrpTypeGroup [private]

Definition at line 163 of file SMESHGUI_GroupDlg.h.

Referenced by init(), and initDialog().

QPushButton* SMESHGUI_GroupDlg.myHelpBtn [private]

Definition at line 192 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog().

Definition at line 216 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onHelp().

QList<int> SMESHGUI_GroupDlg.myIdList [private]

Definition at line 200 of file SMESHGUI_GroupDlg.h.

Referenced by init(), and onApply().

Definition at line 223 of file SMESHGUI_GroupDlg.h.

Referenced by isApplyAndClose(), and setIsApplyAndClose().

SMESH::SMESH_Mesh_var SMESHGUI_GroupDlg.myMesh [private]

Definition at line 207 of file SMESHGUI_GroupDlg.h.

Referenced by init(), initDialog(), and setSelectionMode().

QPushButton* SMESHGUI_GroupDlg.myMeshGroupBtn [private]

Definition at line 156 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and setCurrentSelection().

QLineEdit* SMESHGUI_GroupDlg.myMeshGroupLine [private]
QLineEdit* SMESHGUI_GroupDlg.myName [private]

Definition at line 220 of file SMESHGUI_GroupDlg.h.

Referenced by init(), onNameChanged(), and onObjectSelectionChanged().

Definition at line 222 of file SMESHGUI_GroupDlg.h.

Referenced by onApply(), and onClose().

QPushButton* SMESHGUI_GroupDlg.myOKBtn [private]

Definition at line 189 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and updateButtons().

QString SMESHGUI_GroupDlg.myOldName [private]

Definition at line 161 of file SMESHGUI_GroupDlg.h.

Referenced by onGrpTypeChanged(), onNameChanged(), and onObjectSelectionChanged().

QPushButton* SMESHGUI_GroupDlg.myRemoveBtn [private]

Definition at line 171 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onSelectAll().

QCheckBox* SMESHGUI_GroupDlg.mySelectAll [private]

Definition at line 174 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onSelectAll().

Definition at line 184 of file SMESHGUI_GroupDlg.h.

QCheckBox* SMESHGUI_GroupDlg.mySelectGroup [private]
LightApp_SelectionMgr* SMESHGUI_GroupDlg.mySelectionMgr [private]
SVTK_Selector* SMESHGUI_GroupDlg.mySelector [private]

Definition at line 154 of file SMESHGUI_GroupDlg.h.

Referenced by onAdd(), onListSelectionChanged(), and onObjectSelectionChanged().

QCheckBox* SMESHGUI_GroupDlg.mySelectSubMesh [private]
QPushButton* SMESHGUI_GroupDlg.mySortBtn [private]

Definition at line 172 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onSelectAll().

Definition at line 152 of file SMESHGUI_GroupDlg.h.

Referenced by restoreShowEntityMode(), and setShowEntityMode().

QPushButton* SMESHGUI_GroupDlg.mySubMeshBtn [private]

Definition at line 176 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), onSelectSubMesh(), and setCurrentSelection().

Definition at line 208 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and setSelectionMode().

QLineEdit* SMESHGUI_GroupDlg.mySubMeshLine [private]
QButtonGroup* SMESHGUI_GroupDlg.myTypeGroup [private]

Definition at line 159 of file SMESHGUI_GroupDlg.h.

Referenced by init(), and initDialog().

QStackedWidget* SMESHGUI_GroupDlg.myWGStack [private]

Definition at line 165 of file SMESHGUI_GroupDlg.h.

Referenced by initDialog(), and onGrpTypeChanged().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS