ElementsLineEdit = new QLineEdit(GroupArguments);
ElementsLineEdit->setValidator(myIdValidator);
- QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
- connect(filterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+ myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
// Controls for the whole mesh selection
MeshCheck = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
GroupArgumentsLayout->addWidget(ElementsLab, 0, 0);
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
GroupArgumentsLayout->addWidget(ElementsLineEdit, 0, 2);
- GroupArgumentsLayout->addWidget(filterBtn, 0, 3);
+ GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
GroupArgumentsLayout->addWidget(MeshCheck, 1, 0, 1, 4);
GroupArgumentsLayout->addWidget(PathGrp, 2, 0, 1, 4);
GroupArgumentsLayout->addWidget(BasePointGrp, 3, 0, 1, 4);
ElementsLineEdit->setValidator(toSelectMesh ? 0 : myIdValidator);
ElementsLab->setText(toSelectMesh ? tr("SMESH_NAME") : tr("SMESH_ID_ELEMENTS"));
ElementsLineEdit->clear();
+ myFilterBtn->setEnabled(!toSelectMesh);
SetEditCurrentArgument(SelectElementsButton);
}
//=================================================================================
void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
if ( !myFilterDlg )
{
QList<int> types;
QString myHelpFileName;
+ QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
protected slots:
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
- QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
- connect(filterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+ myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
// Control for the whole mesh selection
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 5);
- GroupArgumentsLayout->addWidget(filterBtn, 0, 7);
+ GroupArgumentsLayout->addWidget(myFilterBtn, 0, 7);
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 8);
GroupArgumentsLayout->addWidget(TextLabelDistance, 2, 0);
GroupArgumentsLayout->addWidget(TextLabelDx, 2, 2);
TextLabelElements->setText(tr("SMESH_NAME"));
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
+ myFilterBtn->setEnabled(!toSelectMesh);
if (myEditCurrentArgument != LineEditElements) {
LineEditElements->clear();
//=================================================================================
void SMESHGUI_ExtrusionDlg::setFilters()
{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
if ( !myFilterDlg )
{
QList<int> types;
QString myHelpFileName;
+ QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
private slots:
const QList<int>& theTypes )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myInitSourceWgOnApply( true )
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = aViewWindow->GetSelector();
const int theType )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myInitSourceWgOnApply( true )
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = aViewWindow->GetSelector();
// Purpose : Set widget of parent dialog containing idsto be filtered if
// user select corresponding source radio button
//=======================================================================
-void SMESHGUI_FilterDlg::SetSourceWg (QWidget* theWg)
+void SMESHGUI_FilterDlg::SetSourceWg (QWidget* theWg,
+ const bool initOnApply)
{
mySourceWg = theWg;
+ myInitSourceWgOnApply = initOnApply;
}
//=======================================================================
if (mySelectionMgr) {
myIObjects.Clear();
- const SALOME_ListIO& anObjs = mySelector->StoredIObjects();
+ const SALOME_ListIO& anObjs = mySelector->StoredIObjects();
SALOME_ListIteratorOfListIO anIter (anObjs);
for ( ; anIter.More(); anIter.Next()) {
TColStd_IndexedMapOfInteger aMap;
if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) {
QList<int> aResultIds;
filterSource(aCurrType, aResultIds);
+ // select in viewer
selectInViewer(aCurrType, aResultIds);
}
+
myInsertState[ aCurrType ] = mySetInViewer->isChecked();
myApplyToState[ aCurrType ] = mySourceGrp->checkedId();
}
for (anIter = aDialogIds.begin(); anIter != aDialogIds.end(); ++ anIter)
if (aPred->IsSatisfy(*anIter))
theResIds.append(*anIter);
-
- // set ids to the dialog
- setIdsToWg(mySourceWg, theResIds);
}
+ // set ids to the dialog
+ if (myInitSourceWgOnApply || aSourceId == Dialog)
+ setIdsToWg(mySourceWg, theResIds);
}
//=======================================================================
void SetSelection();
void SetMesh (SMESH::SMESH_Mesh_var);
- void SetSourceWg( QWidget* );
+ void SetSourceWg( QWidget*, const bool initOnApply = true );
static SMESH::Filter::Criterion createCriterion();
LightApp_SelectionMgr* mySelectionMgr;
SVTK_Selector* mySelector;
SMESH::SMESH_Mesh_var myMesh;
+ bool myInitSourceWgOnApply;
QWidget* mySourceWg;
SALOME_DataMapOfIOMapOfInteger myIObjects;
//=================================================================================
void SMESHGUI_GroupDlg::setFilters()
{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
+
SMESH::ElementType aType = SMESH::ALL;
switch ( myTypeId )
{
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMesh );
- myFilterDlg->SetSourceWg( myElements );
+ myFilterDlg->SetSourceWg( myElements, false );
myFilterDlg->show();
}
//=================================================================================
void SMESHGUI_RemoveElementsDlg::setFilters()
{
+ 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 );
//=================================================================================
void SMESHGUI_RemoveNodesDlg::setFilters()
{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
if ( !myFilterDlg )
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::NODE );
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
- QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
- connect(filterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+ myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
// Control for the whole mesh selection
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
- GroupArgumentsLayout->addWidget(filterBtn, 0, 3);
+ GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4);
GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 4);
GroupArgumentsLayout->addWidget(GroupAngleBox, 3, 0, 1, 4);
TextLabelElements->setText(tr("SMESH_NAME"));
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
+ myFilterBtn->setEnabled(!toSelectMesh);
if (myEditCurrentArgument != LineEditElements) {
LineEditElements->clear();
//=================================================================================
void SMESHGUI_RevolutionDlg::setFilters()
{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
if ( !myFilterDlg )
{
QList<int> types;
QString myHelpFileName;
+ QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
private slots:
SelectElementsButton->setIcon(image1);
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
- QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
- connect(filterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+ myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
// Control for the whole mesh selection
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 1);
- GroupArgumentsLayout->addWidget(filterBtn, 0, 3);
+ GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4);
GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 4);
GroupArgumentsLayout->addWidget(TextLabelAngle, 3, 0, 1, 2);
TextLabelElements->setText(tr("SMESH_NAME"));
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
+ myFilterBtn->setEnabled(!toSelectMesh);
if (myEditCurrentArgument != LineEditElements) {
LineEditElements->clear();
//=================================================================================
void SMESHGUI_RotationDlg::setFilters()
{
+ 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 );
QString myHelpFileName;
+ QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
private slots:
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
- QPushButton* filterElemBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
- connect(filterElemBtn, SIGNAL(clicked()), this, SLOT(setElemFilters()));
+ myElemFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myElemFilterBtn, SIGNAL(clicked()), this, SLOT(setElemFilters()));
// Control for the whole mesh selection
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
- GroupArgumentsLayout->addWidget(filterElemBtn, 0, 3);
+ GroupArgumentsLayout->addWidget(myElemFilterBtn, 0, 3);
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4);
GroupArgumentsLayout->addWidget(TextLabelNodes, 2, 0);
GroupArgumentsLayout->addWidget(SelectNodesButton, 2, 1);
TextLabelElements->setText(tr("SMESH_NAME"));
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
+ myElemFilterBtn->setEnabled(!toSelectMesh);
if (myEditCurrentArgument != LineEditElements &&
myEditCurrentArgument != LineEditNodes) {
//=================================================================================
void SMESHGUI_SmoothingDlg::setFilters( const bool theIsElem )
{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
if ( !myFilterDlg )
{
QList<int> types;
QCheckBox* CheckBoxParametric;
QString myHelpFileName;
-
+
+ QPushButton* myElemFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
private slots:
SelectElementsButton->setIcon(image3);
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
- QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
- connect(filterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+ myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
// Control for the whole mesh selection
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 1);
- GroupArgumentsLayout->addWidget(filterBtn, 0, 3);
+ GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4);
GroupArgumentsLayout->addWidget(GroupMirror, 2, 0, 1, 4);
GroupArgumentsLayout->addWidget(ActionBox, 3, 0, 3, 3);
TextLabelElements->setText(tr("SMESH_NAME"));
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
+ myFilterBtn->setEnabled(!toSelectMesh);
if (myEditCurrentArgument != LineEditElements) {
LineEditElements->clear();
//=================================================================================
void SMESHGUI_SymmetryDlg::setFilters()
{
+ 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 );
QString myHelpFileName;
+ QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
private slots:
SelectElementsButton->setIcon(image2);
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
- QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
- connect(filterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+ myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
// Control for the whole mesh selection
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 5);
- GroupArgumentsLayout->addWidget(filterBtn, 0, 7);
+ GroupArgumentsLayout->addWidget(myFilterBtn, 0, 7);
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 8);
GroupArgumentsLayout->addWidget(TextLabel1, 2, 0);
GroupArgumentsLayout->addWidget(SelectButton1, 2, 1);
TextLabelElements->setText(tr("SMESH_NAME"));
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
+ myFilterBtn->setEnabled(!toSelectMesh);
if (myEditCurrentArgument != LineEditElements) {
LineEditElements->clear();
//=================================================================================
void SMESHGUI_TranslationDlg::setFilters()
{
+ 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 );
QString myHelpFileName;
+ QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
private slots:
<source>SMESH_DRS_SOME_EMPTY</source>
<translation>One or more mesh files were empty, data has not been published</translation>
</message>
+ <message>
+ <source>NO_MESH_SELECTED</source>
+ <translation>No mesh selected</translation>
+ </message>
</context>
<context>
<name>SMESHGUI</name>