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

SMESHGUI_CopyMeshDlg Class Reference

#include <SMESHGUI_CopyMeshDlg.h>

Inheritance diagram for SMESHGUI_CopyMeshDlg:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_CopyMeshDlg (SMESHGUI *)
 Constructor.
 ~SMESHGUI_CopyMeshDlg ()

Private Slots

void ClickOnOk ()
void ClickOnCancel ()
bool ClickOnApply ()
void ClickOnHelp ()
void SelectionIntoArgument ()
void DeactivateActiveDialog ()
void ActivateThisDialog ()
void onTextChange (const QString &)
void onSelectIdSource (bool)
void setFilters ()

Private Member Functions

void Init (bool=true)
void closeEvent (QCloseEvent *)
void enterEvent (QEvent *)
void hideEvent (QHideEvent *)
void keyPressEvent (QKeyEvent *)
int GetConstructorId ()
void setNewMeshName ()
bool isValid ()
void setIsApplyAndClose (const bool theFlag)
bool isApplyAndClose () const

Private Attributes

SMESHGUImySMESHGUI
SMESHGUI_IdValidatormyIdValidator
LightApp_SelectionMgr * mySelectionMgr
int myNbOkElements
SVTK_Selector * mySelector
bool myBusy
SMESH::SMESH_Mesh_var myMesh
SMESH_ActormyActor
SUIT_SelectionFiltermyIdSourceFilter
SMESH::SMESH_IDSource_var mySelectedObject
QGroupBoxConstructorsBox
QGroupBoxGroupArguments
QGroupBoxGroupButtons
QPushButton * buttonOk
QPushButton * buttonCancel
QPushButton * buttonApply
QPushButton * buttonHelp
QLabel * myTextLabelElements
QLineEdit * myLineEditElements
QLineEdit * myMeshNameEdit
QCheckBox * myIdSourceCheck
QCheckBox * myCopyGroupsCheck
QCheckBox * myKeepIdsCheck
QPushButton * myFilterBtn
SMESHGUI_FilterDlgmyFilterDlg
QString myHelpFileName
bool myIsApplyAndClose

Detailed Description

Definition at line 58 of file SMESHGUI_CopyMeshDlg.h.


Constructor & Destructor Documentation

SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg ( SMESHGUI theModule)

Constructor.

Definition at line 112 of file SMESHGUI_CopyMeshDlg.cxx.

References buttonApply, buttonCancel, buttonHelp, buttonOk, ClickOnApply(), ClickOnCancel(), ClickOnHelp(), ClickOnOk(), ConstructorsBox, DeactivateActiveDialog(), SMESH.GetResourceMgr(), SMESH.GetSelector(), SMESH.GetViewWindow(), GroupArguments, GroupButtons, IDSOURCE, Init(), MARGIN, myCopyGroupsCheck, myFilterBtn, myHelpFileName, myIdSourceCheck, myIdSourceFilter, myIdValidator, myKeepIdsCheck, myLineEditElements, myMeshNameEdit, mySelectionMgr, mySelector, mySMESHGUI, myTextLabelElements, onSelectIdSource(), onTextChange(), SelectionIntoArgument(), SMESHGUI.SetActiveDialogBox(), setFilters(), and SPACING.

  : QDialog( SMESH::GetDesktop( theModule ) ),
    mySMESHGUI( theModule ),
    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
    myFilterDlg(0),
    mySelectedObject(SMESH::SMESH_IDSource::_nil()),
    myIsApplyAndClose( false )
{
  QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH")));

  setModal(false);
  setAttribute(Qt::WA_DeleteOnClose, true);
  setWindowTitle(tr("SMESH_COPY_MESH_TITLE"));
  setSizeGripEnabled(true);

  QVBoxLayout* SMESHGUI_CopyMeshDlgLayout = new QVBoxLayout(this);
  SMESHGUI_CopyMeshDlgLayout->setSpacing(SPACING);
  SMESHGUI_CopyMeshDlgLayout->setMargin(MARGIN);

  /***************************************************************/
  ConstructorsBox = new QGroupBox(tr("SMESH_COPY_MESH_TITLE"), this);
  QButtonGroup* GroupConstructors = new QButtonGroup(this);
  QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
  ConstructorsBoxLayout->setSpacing(SPACING);
  ConstructorsBoxLayout->setMargin(MARGIN);

  QRadioButton* RadioButton1= new QRadioButton(ConstructorsBox);
  RadioButton1->setIcon(image);
  GroupConstructors->addButton(RadioButton1, 0);

  ConstructorsBoxLayout->addWidget(RadioButton1);
  RadioButton1->setChecked(true);
  GroupConstructors->addButton(RadioButton1, 0);

  /***************************************************************/
  GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
  QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
  GroupArgumentsLayout->setSpacing(SPACING);
  GroupArgumentsLayout->setMargin(MARGIN);

  myIdValidator = new SMESHGUI_IdValidator(this);

  // Controls for idSource/elements selection
  myTextLabelElements = new QLabel(tr("OBJECT_NAME"), GroupArguments);
  myLineEditElements = new QLineEdit(GroupArguments);
  myLineEditElements->setValidator(myIdValidator);
  myLineEditElements->setMaxLength(-1);
  myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
  connect(myFilterBtn,   SIGNAL(clicked()), this, SLOT(setFilters()));

  // Control for the mesh objects selection
  myIdSourceCheck = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);

  // Name of a mesh to create
  QLabel* meshNameLabel = new QLabel(tr("NEW_NAME"), GroupArguments);
  myMeshNameEdit = new QLineEdit(GroupArguments);

  // CheckBox for copying groups
  myCopyGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
  myCopyGroupsCheck->setChecked(false);

  // CheckBox for keeping ids
  myKeepIdsCheck = new QCheckBox(tr("SMESH_KEEP_IDS"), GroupArguments);
  myKeepIdsCheck->setChecked(true);

  // layout
  GroupArgumentsLayout->addWidget(myTextLabelElements,  0, 0);
  GroupArgumentsLayout->addWidget(myLineEditElements,   0, 1, 1, 5);
  GroupArgumentsLayout->addWidget(myFilterBtn,          0, 6);
  GroupArgumentsLayout->addWidget(myIdSourceCheck,      1, 0, 1, 6);
  GroupArgumentsLayout->addWidget(meshNameLabel,        2, 0);
  GroupArgumentsLayout->addWidget(myMeshNameEdit,       2, 1, 1, 5);
  GroupArgumentsLayout->addWidget(myCopyGroupsCheck,    3, 0, 1, 6);
  GroupArgumentsLayout->addWidget(myKeepIdsCheck,       4, 0, 1, 6);

  /***************************************************************/
  GroupButtons = new QGroupBox(this);
  QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
  GroupButtonsLayout->setSpacing(SPACING);
  GroupButtonsLayout->setMargin(MARGIN);

  buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
  buttonOk->setAutoDefault(true);
  buttonOk->setDefault(true);
  buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
  buttonApply->setAutoDefault(true);
  buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
  buttonCancel->setAutoDefault(true);
  buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
  buttonHelp->setAutoDefault(true);

  GroupButtonsLayout->addWidget(buttonOk);
  GroupButtonsLayout->addSpacing(10);
  GroupButtonsLayout->addWidget(buttonApply);
  GroupButtonsLayout->addSpacing(10);
  GroupButtonsLayout->addStretch();
  GroupButtonsLayout->addWidget(buttonCancel);
  GroupButtonsLayout->addWidget(buttonHelp);

  /***************************************************************/
  SMESHGUI_CopyMeshDlgLayout->addWidget(ConstructorsBox);
  SMESHGUI_CopyMeshDlgLayout->addWidget(GroupArguments);
  SMESHGUI_CopyMeshDlgLayout->addWidget(GroupButtons);

  /* Initialisations */
  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();

  mySMESHGUI->SetActiveDialogBox((QDialog*)this);

  // Selection filter
  myIdSourceFilter = new SMESH_TypeFilter( IDSOURCE );

  myHelpFileName = "copy_mesh_page.html";

  Init();

  /* signals and slots connections */
  connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
  connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));

  connect(mySMESHGUI,     SIGNAL (SignalDeactivateActiveDialog()),
          this,           SLOT   (DeactivateActiveDialog()));
  connect(mySelectionMgr, SIGNAL (currentSelectionChanged()),
          this,           SLOT   (SelectionIntoArgument()));
  connect(mySMESHGUI,     SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */
          this,           SLOT   (ClickOnCancel()));

  connect(myLineEditElements, SIGNAL(textChanged(const QString&)),
          this,               SLOT  (onTextChange(const QString&)));
  connect(myIdSourceCheck,    SIGNAL(toggled(bool)),
          this,               SLOT  (onSelectIdSource(bool)));

  SelectionIntoArgument();
}
SMESHGUI_CopyMeshDlg::~SMESHGUI_CopyMeshDlg ( )

Definition at line 254 of file SMESHGUI_CopyMeshDlg.cxx.

References myFilterDlg, myIdSourceFilter, and mySelectionMgr.

{
  if ( myFilterDlg )
  {
    myFilterDlg->setParent( 0 );
    delete myFilterDlg; myFilterDlg = 0;
  }
  if ( myIdSourceFilter )
  {
    if ( mySelectionMgr )
      mySelectionMgr->removeFilter( myIdSourceFilter );
    delete myIdSourceFilter; myIdSourceFilter=0;
  }
}

Member Function Documentation

void SMESHGUI_CopyMeshDlg::ActivateThisDialog ( ) [private, slot]
bool SMESHGUI_CopyMeshDlg::ClickOnApply ( ) [private, slot]

Definition at line 303 of file SMESHGUI_CopyMeshDlg.cxx.

References _PTR(), SMESH.ALL, SMESHGUI.GetSMESHGen(), Init(), SMESHGUI.isActiveStudyLocked(), isApplyAndClose(), isValid(), SMESHGUI.Modified(), myCopyGroupsCheck, myIdSourceCheck, myKeepIdsCheck, myLineEditElements, myMesh, myMeshNameEdit, mySelectedObject, mySMESHGUI, and SelectionIntoArgument().

Referenced by ClickOnOk(), and SMESHGUI_CopyMeshDlg().

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

  if( !isValid() )
    return false;

  QStringList anEntryList;
  try
  {
    SUIT_OverrideCursor aWaitCursor;
    SMESH::SMESH_IDSource_var aPartToCopy;
    if ( myIdSourceCheck->isChecked())
    {
      aPartToCopy = mySelectedObject;
    }
    else
    {
      QStringList aListElementsId = myLineEditElements->text().split(" ", QString::SkipEmptyParts);
      SMESH::long_array_var anElementsId = new SMESH::long_array;
      anElementsId->length(aListElementsId.count());
      for (int i = 0; i < aListElementsId.count(); i++)
        anElementsId[i] = aListElementsId[i].toInt();

      SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
      aPartToCopy = aMeshEditor->MakeIDSource( anElementsId, SMESH::ALL );
    }
    QByteArray meshName = myMeshNameEdit->text().toLatin1();
    bool toCopyGroups = ( myCopyGroupsCheck->isChecked() );
    bool toKeepIDs    = ( myKeepIdsCheck->isChecked() );

    SMESH::SMESH_Gen_var gen = SMESHGUI::GetSMESHGen();
    SMESH::SMESH_Mesh_var newMesh =
      gen->CopyMesh(aPartToCopy, meshName.constData(), toCopyGroups, toKeepIDs);
    if( !newMesh->_is_nil() )
      if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) )
        anEntryList.append( aSObject->GetID().c_str() );
#ifdef WITHGENERICOBJ
    // obj has been published in study. Its refcount has been incremented.
    // It is safe to decrement its refcount
    // so that it will be destroyed when the entry in study will be removed
    newMesh->UnRegister();
#endif
  } catch (...) {
  }

  mySMESHGUI->updateObjBrowser(true);
  SMESHGUI::Modified();

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

  Init(false);
  mySelectedObject = SMESH::SMESH_IDSource::_nil();
  SelectionIntoArgument();

  return true;
}
void SMESHGUI_CopyMeshDlg::ClickOnCancel ( ) [private, slot]

Definition at line 379 of file SMESHGUI_CopyMeshDlg.cxx.

References SMESH.GetViewWindow(), myIdSourceFilter, mySelectionMgr, mySMESHGUI, and SMESHGUI.ResetState().

Referenced by ClickOnOk(), closeEvent(), hideEvent(), and SMESHGUI_CopyMeshDlg().

{
  disconnect(mySelectionMgr, 0, this, 0);
  if ( mySelectionMgr )
    mySelectionMgr->removeFilter( myIdSourceFilter );
  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
    aViewWindow->SetSelectionMode( ActorSelection );
  mySMESHGUI->ResetState();
  reject();
}
void SMESHGUI_CopyMeshDlg::ClickOnHelp ( ) [private, slot]

Definition at line 394 of file SMESHGUI_CopyMeshDlg.cxx.

References myHelpFileName, and mySMESHGUI.

Referenced by keyPressEvent(), and SMESHGUI_CopyMeshDlg().

{
  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_CopyMeshDlg::ClickOnOk ( ) [private, slot]

Definition at line 368 of file SMESHGUI_CopyMeshDlg.cxx.

References ClickOnApply(), ClickOnCancel(), and setIsApplyAndClose().

Referenced by SMESHGUI_CopyMeshDlg().

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

Definition at line 624 of file SMESHGUI_CopyMeshDlg.cxx.

References ClickOnCancel().

{
  /* same than click on cancel button */
  ClickOnCancel();
}
void SMESHGUI_CopyMeshDlg::DeactivateActiveDialog ( ) [private, slot]
void SMESHGUI_CopyMeshDlg::enterEvent ( QEvent *  ) [private]

Definition at line 614 of file SMESHGUI_CopyMeshDlg.cxx.

References ActivateThisDialog(), and ConstructorsBox.

{
  if (!ConstructorsBox->isEnabled())
    ActivateThisDialog();
}
int SMESHGUI_CopyMeshDlg.GetConstructorId ( ) [private]
void SMESHGUI_CopyMeshDlg::hideEvent ( QHideEvent *  ) [private]

Definition at line 634 of file SMESHGUI_CopyMeshDlg.cxx.

References ClickOnCancel().

{
  if (!isMinimized())
    ClickOnCancel();
}
void SMESHGUI_CopyMeshDlg::Init ( bool  ResetControls = true) [private]

Definition at line 273 of file SMESHGUI_CopyMeshDlg.cxx.

References buttonApply, buttonOk, myActor, myBusy, myCopyGroupsCheck, myIdSourceCheck, myKeepIdsCheck, myLineEditElements, myMesh, myMeshNameEdit, myNbOkElements, onSelectIdSource(), and SMESH.UniqueMeshName().

Referenced by ClickOnApply(), and SMESHGUI_CopyMeshDlg().

{
  myBusy = false;

  myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh"));
  if ( ResetControls )
  {
    myLineEditElements->clear();
    //myElementsId = "";
    myNbOkElements = 0;

    buttonOk->setEnabled(false);
    buttonApply->setEnabled(false);

    myActor = 0;
    myMesh = SMESH::SMESH_Mesh::_nil();

    myIdSourceCheck->setChecked(true);
    myCopyGroupsCheck->setChecked(false);
    myKeepIdsCheck->setChecked(false);

    onSelectIdSource( myIdSourceCheck->isChecked() );
  }
}
bool SMESHGUI_CopyMeshDlg::isApplyAndClose ( ) const [private]

Definition at line 693 of file SMESHGUI_CopyMeshDlg.cxx.

References myIsApplyAndClose.

Referenced by ClickOnApply().

{
  return myIsApplyAndClose;
}
bool SMESHGUI_CopyMeshDlg::isValid ( ) [private]

Definition at line 566 of file SMESHGUI_CopyMeshDlg.cxx.

References myIdSourceCheck, myNbOkElements, and mySelectedObject.

Referenced by ClickOnApply().

{
  if ( myIdSourceCheck->isChecked() )
    return !mySelectedObject->_is_nil();

  return myNbOkElements > 0;
}
void SMESHGUI_CopyMeshDlg::keyPressEvent ( QKeyEvent *  e) [private]

Definition at line 644 of file SMESHGUI_CopyMeshDlg.cxx.

References ClickOnHelp().

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

  if ( e->key() == Qt::Key_F1 ) {
    e->accept();
    ClickOnHelp();
  }
}
void SMESHGUI_CopyMeshDlg::onSelectIdSource ( bool  toSelectMesh) [private, slot]

Definition at line 528 of file SMESHGUI_CopyMeshDlg.cxx.

References SMESH.GetViewWindow(), myIdSourceFilter, myIdValidator, myLineEditElements, mySelectionMgr, mySMESHGUI, myTextLabelElements, onTextChange(), SelectionIntoArgument(), and SMESH.SetPointRepresentation().

Referenced by ActivateThisDialog(), Init(), and SMESHGUI_CopyMeshDlg().

{
  if (toSelectMesh)
    myTextLabelElements->setText(tr("OBJECT_NAME"));
  else
    myTextLabelElements->setText(tr("ELEM_IDS"));

  if (toSelectMesh) {
    myLineEditElements->clear();
  }

  mySelectionMgr->clearFilters();
  mySelectionMgr->installFilter(myIdSourceFilter);
  SMESH::SetPointRepresentation(false);

  if (toSelectMesh) {
    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
      aViewWindow->SetSelectionMode( ActorSelection );
    myLineEditElements->setReadOnly(true);
    myLineEditElements->setValidator(0);
  }
  else
  {
    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
      aViewWindow->SetSelectionMode( CellSelection );
    myLineEditElements->setReadOnly(false);
    myLineEditElements->setValidator(myIdValidator);
    onTextChange(myLineEditElements->text());
  }

  SelectionIntoArgument();
}
void SMESHGUI_CopyMeshDlg::onTextChange ( const QString &  theNewText) [private, slot]

Definition at line 419 of file SMESHGUI_CopyMeshDlg.cxx.

References buttonApply, buttonOk, SMDS_Mesh.FindElement(), SMESH_Actor.GetObject(), SMESH.GetViewWindow(), Handle(), myActor, myBusy, myLineEditElements, myNbOkElements, mySelector, and mySMESHGUI.

Referenced by onSelectIdSource(), and SMESHGUI_CopyMeshDlg().

{
  QLineEdit* send = (QLineEdit*)sender();

  if (myBusy) return;
  BusyLocker lock( myBusy );

  //if (send == myLineEditElements)
  myNbOkElements = 0;

  buttonOk->setEnabled(false);
  buttonApply->setEnabled(false);

  // hilight entered elements
  SMDS_Mesh* aMesh = 0;
  if (myActor)
    aMesh = myActor->GetObject()->GetMesh();

  QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
  if (myActor && aMesh)
  {
    TColStd_MapOfInteger newIndices;
    if (send == myLineEditElements) {
      for (int i = 0; i < aListId.count(); i++)
        if ( const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()))
        {
          newIndices.Add(e->GetID());
        }
    }
    myNbOkElements = newIndices.Extent();

    Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
    mySelector->AddOrRemoveIndex( anIO, newIndices, false );
    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
      aViewWindow->highlight( anIO, true, true );
  }
  else
  {
    myNbOkElements = aListId.count();
  }

  if (myNbOkElements) {
    buttonOk->setEnabled(true);
    buttonApply->setEnabled(true);
  }
}
void SMESHGUI_CopyMeshDlg::SelectionIntoArgument ( ) [private, slot]

Definition at line 471 of file SMESHGUI_CopyMeshDlg.cxx.

References buttonApply, buttonOk, SMESH.FindActorByEntry(), SMESH.FindActorByObject(), SMESH.GetMeshByIO(), SMESH.GetNameOfSelectedElements(), SMESH.GetNameOfSelectedIObjects(), Handle(), myActor, myBusy, myFilterBtn, myIdSourceCheck, myLineEditElements, myMesh, myNbOkElements, mySelectedObject, mySelectionMgr, and mySelector.

Referenced by ActivateThisDialog(), ClickOnApply(), onSelectIdSource(), and SMESHGUI_CopyMeshDlg().

{
  if (myBusy) return;
  BusyLocker lock( myBusy );

  // clear
  myActor = 0;
  QString aString = "";

  myLineEditElements->setText(aString);
  myNbOkElements = 0;
  buttonOk->setEnabled(false);
  buttonApply->setEnabled(false);
  myFilterBtn->setEnabled(false);

  // get selected mesh
  SALOME_ListIO aList;
  mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
  int nbSel = aList.Extent();
  if (nbSel != 1)
    return;

  Handle(SALOME_InteractiveObject) IO = aList.First();
  mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
  if ( mySelectedObject->_is_nil() )
    return;

  myMesh = SMESH::GetMeshByIO(IO);
  if (myMesh->_is_nil())
    return;

  myActor = SMESH::FindActorByEntry(IO->getEntry());
  if (!myActor)
    myActor = SMESH::FindActorByObject(myMesh);

  if (myIdSourceCheck->isChecked())
  {
    SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
    if ( aString.isEmpty() ) aString = " ";
  }
  else
  {
    SMESH::GetNameOfSelectedElements( mySelector, IO, aString );
    myNbOkElements = aString.size();
    myFilterBtn->setEnabled(true);
  }
  myLineEditElements->setText( aString );
  bool ok = !aString.isEmpty();

  buttonOk->setEnabled(ok);
  buttonApply->setEnabled(ok);
}
void SMESHGUI_CopyMeshDlg::setFilters ( ) [private, slot]

Definition at line 660 of file SMESHGUI_CopyMeshDlg.cxx.

References SMESH.ALL, myFilterDlg, myLineEditElements, myMesh, mySMESHGUI, SMESHGUI_FilterDlg.SetMesh(), SMESHGUI_FilterDlg.SetSelection(), and SMESHGUI_FilterDlg.SetSourceWg().

Referenced by SMESHGUI_CopyMeshDlg().

{
  if(myMesh->_is_nil()) {
    SUIT_MessageBox::critical(this,
                              tr("SMESH_ERROR"),
                              tr("NO_MESH_SELECTED"));
   return;
  }
  if ( !myFilterDlg )
    myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );

  myFilterDlg->SetSelection();
  myFilterDlg->SetMesh( myMesh );
  myFilterDlg->SetSourceWg( myLineEditElements );

  myFilterDlg->show();
}
void SMESHGUI_CopyMeshDlg::setIsApplyAndClose ( const bool  theFlag) [private]

Definition at line 683 of file SMESHGUI_CopyMeshDlg.cxx.

References myIsApplyAndClose.

Referenced by ClickOnOk().

{
  myIsApplyAndClose = theFlag;
}
void SMESHGUI_CopyMeshDlg.setNewMeshName ( ) [private]

Field Documentation

QPushButton* SMESHGUI_CopyMeshDlg.buttonApply [private]
QPushButton* SMESHGUI_CopyMeshDlg.buttonCancel [private]

Definition at line 99 of file SMESHGUI_CopyMeshDlg.h.

Referenced by SMESHGUI_CopyMeshDlg().

QPushButton* SMESHGUI_CopyMeshDlg.buttonHelp [private]

Definition at line 101 of file SMESHGUI_CopyMeshDlg.h.

Referenced by SMESHGUI_CopyMeshDlg().

QPushButton* SMESHGUI_CopyMeshDlg.buttonOk [private]

Definition at line 89 of file SMESHGUI_CopyMeshDlg.h.

Referenced by Init(), onTextChange(), and SelectionIntoArgument().

Definition at line 87 of file SMESHGUI_CopyMeshDlg.h.

Referenced by Init(), onTextChange(), and SelectionIntoArgument().

Definition at line 107 of file SMESHGUI_CopyMeshDlg.h.

Referenced by ClickOnApply(), Init(), and SMESHGUI_CopyMeshDlg().

QPushButton* SMESHGUI_CopyMeshDlg.myFilterBtn [private]

Definition at line 110 of file SMESHGUI_CopyMeshDlg.h.

Referenced by SelectionIntoArgument(), and SMESHGUI_CopyMeshDlg().

Definition at line 111 of file SMESHGUI_CopyMeshDlg.h.

Referenced by setFilters(), and ~SMESHGUI_CopyMeshDlg().

Definition at line 113 of file SMESHGUI_CopyMeshDlg.h.

Referenced by ClickOnHelp(), and SMESHGUI_CopyMeshDlg().

Definition at line 81 of file SMESHGUI_CopyMeshDlg.h.

Referenced by onSelectIdSource(), and SMESHGUI_CopyMeshDlg().

Definition at line 115 of file SMESHGUI_CopyMeshDlg.h.

Referenced by isApplyAndClose(), and setIsApplyAndClose().

Definition at line 108 of file SMESHGUI_CopyMeshDlg.h.

Referenced by ClickOnApply(), Init(), and SMESHGUI_CopyMeshDlg().

SMESH::SMESH_Mesh_var SMESHGUI_CopyMeshDlg.myMesh [private]

Definition at line 88 of file SMESHGUI_CopyMeshDlg.h.

Referenced by ClickOnApply(), Init(), SelectionIntoArgument(), and setFilters().

Definition at line 105 of file SMESHGUI_CopyMeshDlg.h.

Referenced by ClickOnApply(), Init(), and SMESHGUI_CopyMeshDlg().

Definition at line 83 of file SMESHGUI_CopyMeshDlg.h.

Referenced by Init(), isValid(), onTextChange(), and SelectionIntoArgument().

SMESH::SMESH_IDSource_var SMESHGUI_CopyMeshDlg.mySelectedObject [private]

Definition at line 92 of file SMESHGUI_CopyMeshDlg.h.

Referenced by ClickOnApply(), isValid(), and SelectionIntoArgument().

LightApp_SelectionMgr* SMESHGUI_CopyMeshDlg.mySelectionMgr [private]
SVTK_Selector* SMESHGUI_CopyMeshDlg.mySelector [private]

Definition at line 103 of file SMESHGUI_CopyMeshDlg.h.

Referenced by onSelectIdSource(), and SMESHGUI_CopyMeshDlg().

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