mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 02:00:34 +05:00
issue 22082 note 017956. Hide controls of Filter dialog useless for creating the Group on filter
Hide "Insert filter in viewer" and "Source" button group.
This commit is contained in:
parent
7e9e8a237d
commit
ce9a69a9b8
@ -2654,7 +2654,9 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule,
|
|||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
myInitSourceWgOnApply( true )
|
myInitSourceWgOnApply( true ),
|
||||||
|
myInsertEnabled( true ),
|
||||||
|
myDiffSourcesEnabled( true )
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
mySelector = aViewWindow->GetSelector();
|
mySelector = aViewWindow->GetSelector();
|
||||||
@ -2671,7 +2673,9 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule,
|
|||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
myInitSourceWgOnApply( true )
|
myInitSourceWgOnApply( true ),
|
||||||
|
myInsertEnabled( true ),
|
||||||
|
myDiffSourcesEnabled( true )
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
mySelector = aViewWindow->GetSelector();
|
mySelector = aViewWindow->GetSelector();
|
||||||
@ -2730,6 +2734,7 @@ QWidget* SMESHGUI_FilterDlg::createMainFrame (QWidget* theParent)
|
|||||||
int rows = aLay->rowCount();
|
int rows = aLay->rowCount();
|
||||||
int cols = aLay->columnCount();
|
int cols = aLay->columnCount();
|
||||||
|
|
||||||
|
// This line looks strange when all additional parameters and mySetInViewer are hidden
|
||||||
QFrame* aLine = new QFrame(aGrp);
|
QFrame* aLine = new QFrame(aGrp);
|
||||||
aLine->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
aLine->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
||||||
aLay->addWidget(aLine, rows++, 0, 1, cols);
|
aLay->addWidget(aLine, rows++, 0, 1, cols);
|
||||||
@ -3215,6 +3220,21 @@ void SMESHGUI_FilterDlg::SetSourceWg (QWidget* theWg,
|
|||||||
myInitSourceWgOnApply = initOnApply;
|
myInitSourceWgOnApply = initOnApply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : EnableFiltering
|
||||||
|
//purpose : Enables "Insert filter in the viewer"
|
||||||
|
// and different "Source"s (Mesh, Initial Selection, Current Group)
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void SMESHGUI_FilterDlg::SetEnabled( bool setInViewer, bool diffSources )
|
||||||
|
{
|
||||||
|
myInsertEnabled = setInViewer;
|
||||||
|
myDiffSourcesEnabled = diffSources;
|
||||||
|
|
||||||
|
mySetInViewer->setVisible( myInsertEnabled );
|
||||||
|
mySourceGrp->button(0)->parentWidget()->setVisible( myDiffSourcesEnabled );
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// name : SMESHGUI_FilterDlg::SetMesh
|
// name : SMESHGUI_FilterDlg::SetMesh
|
||||||
// Purpose : Set mesh
|
// Purpose : Set mesh
|
||||||
@ -3397,8 +3417,10 @@ void SMESHGUI_FilterDlg::insertFilterInViewer()
|
|||||||
SMESH::ElementType anEntType = (SMESH::ElementType)myTable->GetType();
|
SMESH::ElementType anEntType = (SMESH::ElementType)myTable->GetType();
|
||||||
|
|
||||||
if (myFilter[ myTable->GetType() ]->_is_nil() ||
|
if (myFilter[ myTable->GetType() ]->_is_nil() ||
|
||||||
myFilter[ myTable->GetType() ]->GetPredicate()->_is_nil() ||
|
myFilter[ myTable->GetType() ]->GetPredicate()->_is_nil() ||
|
||||||
!mySetInViewer->isChecked()) {
|
!mySetInViewer->isChecked() ||
|
||||||
|
!myInsertEnabled )
|
||||||
|
{
|
||||||
SMESH::RemoveFilter(getFilterId(anEntType), aSelector);
|
SMESH::RemoveFilter(getFilterId(anEntType), aSelector);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -3423,7 +3445,7 @@ void SMESHGUI_FilterDlg::filterSource (const int theType,
|
|||||||
|
|
||||||
int aSourceId = mySourceGrp->checkedId();
|
int aSourceId = mySourceGrp->checkedId();
|
||||||
|
|
||||||
if (aSourceId == Mesh)
|
if (aSourceId == Mesh || !myDiffSourcesEnabled )
|
||||||
{
|
{
|
||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return;
|
return;
|
||||||
|
@ -229,6 +229,7 @@ public:
|
|||||||
void SetSelection();
|
void SetSelection();
|
||||||
void SetMesh (SMESH::SMESH_Mesh_var);
|
void SetMesh (SMESH::SMESH_Mesh_var);
|
||||||
void SetSourceWg( QWidget*, const bool initOnApply = true );
|
void SetSourceWg( QWidget*, const bool initOnApply = true );
|
||||||
|
void SetEnabled( bool setInViewer, bool diffSources );
|
||||||
|
|
||||||
static SMESH::Filter::Criterion createCriterion();
|
static SMESH::Filter::Criterion createCriterion();
|
||||||
|
|
||||||
@ -297,6 +298,8 @@ private:
|
|||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
SMESH::SMESH_Mesh_var myMesh;
|
SMESH::SMESH_Mesh_var myMesh;
|
||||||
bool myInitSourceWgOnApply;
|
bool myInitSourceWgOnApply;
|
||||||
|
bool myInsertEnabled;
|
||||||
|
bool myDiffSourcesEnabled;
|
||||||
QWidget* mySourceWg;
|
QWidget* mySourceWg;
|
||||||
|
|
||||||
SALOME_DataMapOfIOMapOfInteger myIObjects;
|
SALOME_DataMapOfIOMapOfInteger myIObjects;
|
||||||
|
@ -447,16 +447,17 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
mySMESHGUI->SetActiveDialogBox(this);
|
mySMESHGUI->SetActiveDialogBox(this);
|
||||||
mySMESHGUI->SetState(800);
|
mySMESHGUI->SetState(800);
|
||||||
|
|
||||||
|
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
|
||||||
mySelectionMode = grpNoSelection;
|
mySelectionMode = grpNoSelection;
|
||||||
myMeshFilter = new SMESH_TypeFilter(SMESH::MESH);
|
|
||||||
|
myMeshFilter = new SMESH_TypeFilter(SMESH::MESH);
|
||||||
mySubMeshFilter = new SMESH_LogicalFilter(QList<SUIT_SelectionFilter*>(),
|
mySubMeshFilter = new SMESH_LogicalFilter(QList<SUIT_SelectionFilter*>(),
|
||||||
SMESH_LogicalFilter::LO_OR,
|
SMESH_LogicalFilter::LO_OR,
|
||||||
/*takeOwnership=*/true);
|
/*takeOwnership=*/true);
|
||||||
myGroupFilter = new SMESH_LogicalFilter(QList<SUIT_SelectionFilter*>(),
|
myGroupFilter = new SMESH_LogicalFilter(QList<SUIT_SelectionFilter*>(),
|
||||||
SMESH_LogicalFilter::LO_OR,
|
SMESH_LogicalFilter::LO_OR,
|
||||||
/*takeOwnership=*/true);
|
/*takeOwnership=*/true);
|
||||||
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
|
myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
|
||||||
myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
|
|
||||||
|
|
||||||
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
|
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
|
||||||
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
||||||
@ -1648,7 +1649,7 @@ void SMESHGUI_GroupDlg::onSelectGroup(bool on)
|
|||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : (onSelectGeomGroup)
|
// function : (onSelectGeomGroup)
|
||||||
// purpose : Called when group type changed. on == "on group" or "on filter"
|
// purpose : Called when group type changed. on == "on geometry" or "on filter"
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
|
void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
|
||||||
{
|
{
|
||||||
@ -1659,7 +1660,7 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
|
|||||||
else if (mySelectGroup->isChecked()) {
|
else if (mySelectGroup->isChecked()) {
|
||||||
mySelectGroup->setChecked(false);
|
mySelectGroup->setChecked(false);
|
||||||
}
|
}
|
||||||
if ( myGrpTypeId == 1 ) { // on group
|
if ( myGrpTypeId == 1 ) { // on geometry
|
||||||
myCurrentLineEdit = myGeomGroupLine;
|
myCurrentLineEdit = myGeomGroupLine;
|
||||||
updateGeomPopup();
|
updateGeomPopup();
|
||||||
}
|
}
|
||||||
@ -1747,10 +1748,14 @@ void SMESHGUI_GroupDlg::setFilters()
|
|||||||
myFilterDlg->Init( aType );
|
myFilterDlg->Init( aType );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isStandalone = ( sender() == myFilterBtn );
|
||||||
|
myFilterDlg->SetEnabled( /*setInViewer=*/isStandalone,
|
||||||
|
/*diffSources=*/isStandalone );
|
||||||
myFilterDlg->SetMesh( myMesh );
|
myFilterDlg->SetMesh( myMesh );
|
||||||
myFilterDlg->SetSelection();
|
myFilterDlg->SetSelection();
|
||||||
myFilterDlg->SetSourceWg( myElements, false );
|
myFilterDlg->SetSourceWg( myElements, false );
|
||||||
|
|
||||||
|
|
||||||
myFilterDlg->show();
|
myFilterDlg->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user