-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ExtrusionAlongPathDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S.
-//
-
// SMESH includes
+//
#include "SMESHGUI_ExtrusionAlongPathDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_IdValidator.h"
+#include "SMESHGUI_FilterDlg.h"
#include <SMESH_Actor.h>
#include <SMESH_TypeFilter.hxx>
SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myFilterDlg( 0 )
{
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
ElementsLineEdit = new QLineEdit(GroupArguments);
ElementsLineEdit->setValidator(myIdValidator);
+ QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(filterBtn, 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(MeshCheck, 1, 0, 1, 3);
- GroupArgumentsLayout->addWidget(PathGrp, 2, 0, 1, 3);
- GroupArgumentsLayout->addWidget(BasePointGrp, 3, 0, 1, 3);
- GroupArgumentsLayout->addWidget(AnglesGrp, 4, 0, 1, 3);
- GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(filterBtn, 0, 3);
+ GroupArgumentsLayout->addWidget(MeshCheck, 1, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(PathGrp, 2, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(BasePointGrp, 3, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(AnglesGrp, 4, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0, 1, 4);
/***************************************************************/
// common buttons group box
SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
{
// no need to delete child widgets, Qt does it all for us
+ if ( myFilterDlg != 0 ) {
+ myFilterDlg->setParent( 0 );
+ delete myFilterDlg;
+ }
}
//=================================================================================
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
- SMESH::SetPickable(); // ???
- SMESH::SetPointRepresentation(false);
+ if (SMESH::GetCurrentVtkView()) {
+ SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
+ SMESH::SetPointRepresentation(false);
+ SMESH::SetPickable();
+ }
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
ClickOnHelp();
}
}
+
+//=================================================================================
+// function : setFilters()
+// purpose : SLOT. Called when "Filter" button pressed.
+//=================================================================================
+void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
+{
+ if ( !myFilterDlg )
+ {
+ QList<int> types;
+ types.append( SMESH::EDGE );
+ types.append( SMESH::FACE );
+ myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, types );
+ }
+ myFilterDlg->Init( Elements1dRB->isChecked() ? SMESH::EDGE : SMESH::FACE );
+
+ myFilterDlg->SetSelection();
+ myFilterDlg->SetMesh( myMesh );
+ myFilterDlg->SetSourceWg( ElementsLineEdit );
+
+ myFilterDlg->show();
+}