2012-08-09 16:03:55 +06:00
|
|
|
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
2005-01-20 11:25:54 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2005-06-07 19:22:20 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// 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.
|
2005-06-07 19:22:20 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// 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.
|
2005-06-07 19:22:20 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// 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
|
2005-06-07 19:22:20 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2005-01-20 11:25:54 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH SMESHGUI : GUI for SMESH component
|
|
|
|
// File : SMESHGUI_ExtrusionAlongPathDlg.cxx
|
|
|
|
// Author : Vadim SANDLER, Open CASCADE S.A.S.
|
|
|
|
// SMESH includes
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
#include "SMESHGUI_ExtrusionAlongPathDlg.h"
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
#include "SMESHGUI.h"
|
|
|
|
#include "SMESHGUI_Utils.h"
|
|
|
|
#include "SMESHGUI_VTKUtils.h"
|
|
|
|
#include "SMESHGUI_MeshUtils.h"
|
2005-06-07 19:22:20 +06:00
|
|
|
#include "SMESHGUI_SpinBox.h"
|
2005-01-20 11:25:54 +05:00
|
|
|
#include "SMESHGUI_IdValidator.h"
|
2009-02-17 10:27:49 +05:00
|
|
|
#include "SMESHGUI_FilterDlg.h"
|
2012-08-09 16:03:55 +06:00
|
|
|
#include "SMESHGUI_MeshEditPreview.h"
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
#include <SMESH_Actor.h>
|
|
|
|
#include <SMESH_TypeFilter.hxx>
|
|
|
|
#include <SMESH_NumberFilter.hxx>
|
|
|
|
#include <SMESH_LogicalFilter.hxx>
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
#include <SMDS_Mesh.hxx>
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SALOME GEOM includes
|
|
|
|
#include <GEOMBase.h>
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SALOME GUI includes
|
|
|
|
#include <SUIT_ResourceMgr.h>
|
|
|
|
#include <SUIT_OverrideCursor.h>
|
|
|
|
#include <SUIT_Desktop.h>
|
|
|
|
#include <SUIT_MessageBox.h>
|
|
|
|
#include <SUIT_Session.h>
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
#include <LightApp_Application.h>
|
|
|
|
#include <LightApp_SelectionMgr.h>
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
#include <SVTK_ViewWindow.h>
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// OCCT includes
|
2005-01-20 11:25:54 +05:00
|
|
|
#include <BRep_Tool.hxx>
|
|
|
|
#include <TopoDS_Vertex.hxx>
|
|
|
|
#include <gp_Pnt.hxx>
|
2005-06-07 19:22:20 +06:00
|
|
|
#include <TColStd_MapOfInteger.hxx>
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
// Qt includes
|
|
|
|
#include <QButtonGroup>
|
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QToolButton>
|
|
|
|
#include <QRadioButton>
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QListWidget>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
|
|
|
// IDL includes
|
|
|
|
#include <SALOMEconfig.h>
|
2005-01-20 11:25:54 +05:00
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Group)
|
2008-03-07 12:47:05 +05:00
|
|
|
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
#define SPACING 6
|
|
|
|
#define MARGIN 11
|
|
|
|
|
|
|
|
class SMESHGUI_ExtrusionAlongPathDlg::SetBusy
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SetBusy( SMESHGUI_ExtrusionAlongPathDlg* _dlg )
|
|
|
|
{
|
|
|
|
myDlg = _dlg;
|
|
|
|
myDlg->myBusy = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
~SetBusy()
|
|
|
|
{
|
|
|
|
myDlg->myBusy = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SMESHGUI_ExtrusionAlongPathDlg* myDlg;
|
|
|
|
};
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : SMESHGUI_ExtrusionAlongPathDlg()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : constructor
|
|
|
|
//=================================================================================
|
2009-02-17 10:27:49 +05:00
|
|
|
SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
|
2012-08-09 16:03:55 +06:00
|
|
|
: SMESHGUI_PreviewDlg( theModule ),
|
2009-02-17 10:27:49 +05:00
|
|
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
|
|
|
myFilterDlg( 0 )
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
2005-06-08 16:45:19 +06:00
|
|
|
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
|
|
|
QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
|
|
|
|
QPixmap faceImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
|
|
|
|
QPixmap selectImage ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
|
|
|
|
QPixmap addImage ( mgr->loadPixmap("SMESH", tr("ICON_APPEND")));
|
|
|
|
QPixmap removeImage ( mgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
myType = -1;
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
setModal( false );
|
|
|
|
setAttribute( Qt::WA_DeleteOnClose, true );
|
|
|
|
setWindowTitle(tr("EXTRUSION_ALONG_PATH"));
|
|
|
|
setSizeGripEnabled(true);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
QVBoxLayout* topLayout = new QVBoxLayout(this);
|
|
|
|
topLayout->setSpacing(SPACING);
|
|
|
|
topLayout->setMargin(MARGIN);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
// Elements type group box (1d / 2d elements)
|
2009-02-17 10:27:49 +05:00
|
|
|
ConstructorsBox = new QGroupBox(tr("SMESH_EXTRUSION"), this);
|
|
|
|
GroupConstructors = new QButtonGroup(this);
|
|
|
|
QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
|
|
|
|
ConstructorsBoxLayout->setSpacing(SPACING); ConstructorsBoxLayout->setMargin(MARGIN);
|
|
|
|
|
|
|
|
Elements1dRB = new QRadioButton(ConstructorsBox);
|
|
|
|
Elements1dRB->setIcon(edgeImage);
|
|
|
|
Elements2dRB = new QRadioButton(ConstructorsBox);
|
|
|
|
Elements2dRB->setIcon(faceImage);
|
2005-06-07 19:22:20 +06:00
|
|
|
Elements1dRB->setChecked(true);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// layouting
|
2009-02-17 10:27:49 +05:00
|
|
|
ConstructorsBoxLayout->addWidget(Elements1dRB);
|
|
|
|
ConstructorsBoxLayout->addWidget(Elements2dRB);
|
|
|
|
GroupConstructors->addButton(Elements1dRB, 0);
|
|
|
|
GroupConstructors->addButton(Elements2dRB, 1);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
/***************************************************************/
|
|
|
|
// Arguments group box
|
2005-06-07 19:22:20 +06:00
|
|
|
GroupArguments = new QGroupBox(tr("EXTRUSION_1D"), this);
|
2009-02-17 10:27:49 +05:00
|
|
|
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
|
|
|
|
GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN);
|
|
|
|
|
|
|
|
myIdValidator = new SMESHGUI_IdValidator(this);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// Controls for elements selection
|
2005-06-07 19:22:20 +06:00
|
|
|
ElementsLab = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
SelectElementsButton = new QToolButton(GroupArguments);
|
2009-02-17 10:27:49 +05:00
|
|
|
SelectElementsButton->setIcon(selectImage);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
ElementsLineEdit = new QLineEdit(GroupArguments);
|
2009-02-17 10:27:49 +05:00
|
|
|
ElementsLineEdit->setValidator(myIdValidator);
|
2012-08-09 16:03:55 +06:00
|
|
|
ElementsLineEdit->setMaxLength(-1);
|
|
|
|
myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
|
|
|
|
connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// Controls for the whole mesh selection
|
2005-06-07 19:22:20 +06:00
|
|
|
MeshCheck = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// Controls for path selection
|
2005-06-07 19:22:20 +06:00
|
|
|
PathGrp = new QGroupBox(tr("SMESH_PATH"), GroupArguments);
|
2009-02-17 10:27:49 +05:00
|
|
|
QGridLayout* PathGrpLayout = new QGridLayout(PathGrp);
|
|
|
|
PathGrpLayout->setSpacing(SPACING); PathGrpLayout->setMargin(MARGIN);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// Controls for path mesh selection
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* PathMeshLab = new QLabel(tr("SMESH_PATH_MESH"), PathGrp);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
SelectPathMeshButton = new QToolButton(PathGrp);
|
2009-02-17 10:27:49 +05:00
|
|
|
SelectPathMeshButton->setIcon(selectImage);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
PathMeshLineEdit = new QLineEdit(PathGrp);
|
|
|
|
PathMeshLineEdit->setReadOnly(true);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// Controls for path starting point selection
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* StartPointLab = new QLabel(tr("SMESH_PATH_START"), PathGrp);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
SelectStartPointButton = new QToolButton(PathGrp);
|
2009-02-17 10:27:49 +05:00
|
|
|
SelectStartPointButton->setIcon(selectImage);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
StartPointLineEdit = new QLineEdit(PathGrp);
|
|
|
|
StartPointLineEdit->setValidator(new QIntValidator(this));
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// layouting
|
2005-06-07 19:22:20 +06:00
|
|
|
PathGrpLayout->addWidget(PathMeshLab, 0, 0);
|
|
|
|
PathGrpLayout->addWidget(SelectPathMeshButton, 0, 1);
|
|
|
|
PathGrpLayout->addWidget(PathMeshLineEdit, 0, 2);
|
2012-08-09 16:03:55 +06:00
|
|
|
PathGrpLayout->addWidget(StartPointLab, 1, 0);
|
|
|
|
PathGrpLayout->addWidget(SelectStartPointButton, 1, 1);
|
|
|
|
PathGrpLayout->addWidget(StartPointLineEdit, 1, 2);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
BasePointGrp = new QGroupBox(tr("SMESH_BASE_POINT"), GroupArguments);
|
2009-02-17 10:27:49 +05:00
|
|
|
BasePointGrp->setCheckable(true);
|
|
|
|
BasePointGrp->setChecked(false);
|
|
|
|
QHBoxLayout* BasePointGrpLayout = new QHBoxLayout(BasePointGrp);
|
|
|
|
BasePointGrpLayout->setSpacing(SPACING); BasePointGrpLayout->setMargin(MARGIN);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
SelectBasePointButton = new QToolButton(BasePointGrp);
|
2009-02-17 10:27:49 +05:00
|
|
|
SelectBasePointButton->setIcon(selectImage);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* XLab = new QLabel(tr("SMESH_X"), BasePointGrp);
|
2005-06-07 19:22:20 +06:00
|
|
|
XSpin = new SMESHGUI_SpinBox(BasePointGrp);
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* YLab = new QLabel(tr("SMESH_Y"), BasePointGrp);
|
2005-06-07 19:22:20 +06:00
|
|
|
YSpin = new SMESHGUI_SpinBox(BasePointGrp);
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* ZLab = new QLabel(tr("SMESH_Z"), BasePointGrp);
|
2005-06-07 19:22:20 +06:00
|
|
|
ZSpin = new SMESHGUI_SpinBox(BasePointGrp);
|
2005-01-21 16:14:12 +05:00
|
|
|
|
|
|
|
// layouting
|
2009-02-17 10:27:49 +05:00
|
|
|
BasePointGrpLayout->addWidget(SelectBasePointButton);
|
|
|
|
BasePointGrpLayout->addWidget(XLab);
|
|
|
|
BasePointGrpLayout->addWidget(XSpin);
|
|
|
|
BasePointGrpLayout->addWidget(YLab);
|
|
|
|
BasePointGrpLayout->addWidget(YSpin);
|
|
|
|
BasePointGrpLayout->addWidget(ZLab);
|
|
|
|
BasePointGrpLayout->addWidget(ZSpin);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
AnglesGrp = new QGroupBox(tr("SMESH_ANGLES"), GroupArguments);
|
2009-02-17 10:27:49 +05:00
|
|
|
AnglesGrp->setCheckable(true);
|
|
|
|
AnglesGrp->setChecked(false);
|
|
|
|
QGridLayout* AnglesGrpLayout = new QGridLayout(AnglesGrp);
|
|
|
|
AnglesGrpLayout->setSpacing(SPACING); AnglesGrpLayout->setMargin(MARGIN);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
AnglesList = new QListWidget(AnglesGrp);
|
|
|
|
AnglesList->setSelectionMode(QListWidget::ExtendedSelection);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
AddAngleButton = new QToolButton(AnglesGrp);
|
2009-02-17 10:27:49 +05:00
|
|
|
AddAngleButton->setIcon(addImage);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
RemoveAngleButton = new QToolButton(AnglesGrp);
|
2009-02-17 10:27:49 +05:00
|
|
|
RemoveAngleButton->setIcon(removeImage);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
AngleSpin = new SMESHGUI_SpinBox(AnglesGrp);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
LinearAnglesCheck = new QCheckBox(tr("LINEAR_ANGLES"), AnglesGrp);
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// layouting
|
2009-02-17 10:27:49 +05:00
|
|
|
AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
|
|
|
|
AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
|
|
|
|
AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
|
|
|
|
AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
|
|
|
|
AnglesGrpLayout->addWidget(LinearAnglesCheck, 4, 0);
|
|
|
|
AnglesGrpLayout->setRowMinimumHeight(1, 10);
|
|
|
|
AnglesGrpLayout->setRowStretch(3, 10);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
// CheckBox for groups generation
|
|
|
|
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
|
|
|
|
MakeGroupsCheck->setChecked(true);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
//Preview check box
|
|
|
|
myPreviewCheckBox = new QCheckBox(tr("PREVIEW"), GroupArguments);
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// layouting
|
2009-02-17 10:27:49 +05:00
|
|
|
GroupArgumentsLayout->addWidget(ElementsLab, 0, 0);
|
|
|
|
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
|
|
|
|
GroupArgumentsLayout->addWidget(ElementsLineEdit, 0, 2);
|
2012-08-09 16:03:55 +06:00
|
|
|
GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
|
2009-02-17 10:27:49 +05:00
|
|
|
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);
|
2012-08-09 16:03:55 +06:00
|
|
|
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 5, 0, 1, 4);
|
|
|
|
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 6, 0, 1, 4);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
// common buttons group box
|
2005-06-07 19:22:20 +06:00
|
|
|
GroupButtons = new QGroupBox(this);
|
2009-02-17 10:27:49 +05:00
|
|
|
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
|
|
|
|
GroupButtonsLayout->setSpacing(SPACING); GroupButtonsLayout->setMargin(MARGIN);
|
|
|
|
|
|
|
|
OkButton = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
|
2005-06-07 19:22:20 +06:00
|
|
|
OkButton->setAutoDefault(true);
|
|
|
|
OkButton->setDefault(true);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
ApplyButton = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
|
|
|
|
ApplyButton->setAutoDefault(true);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
CloseButton = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
|
|
|
|
CloseButton->setAutoDefault(true);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
HelpButton = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
|
|
|
|
HelpButton->setAutoDefault(true);
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// layouting
|
2009-02-17 10:27:49 +05:00
|
|
|
GroupButtonsLayout->addWidget(OkButton);
|
|
|
|
GroupButtonsLayout->addSpacing(10);
|
|
|
|
GroupButtonsLayout->addWidget(ApplyButton);
|
|
|
|
GroupButtonsLayout->addSpacing(10);
|
|
|
|
GroupButtonsLayout->addStretch();
|
|
|
|
GroupButtonsLayout->addWidget(CloseButton);
|
|
|
|
GroupButtonsLayout->addWidget(HelpButton);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
// layouting
|
2009-02-17 10:27:49 +05:00
|
|
|
topLayout->addWidget(ConstructorsBox);
|
|
|
|
topLayout->addWidget(GroupArguments);
|
|
|
|
topLayout->addWidget(GroupButtons);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
// Initialisations
|
2012-08-09 16:03:55 +06:00
|
|
|
XSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
|
|
|
YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
|
|
|
ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
|
|
|
AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, "angle_precision");
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-07-01 16:42:32 +06:00
|
|
|
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
mySMESHGUI->SetActiveDialogBox(this);
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// Costruction of the logical filter for the elements: mesh/sub-mesh/group
|
2012-12-13 17:41:29 +06:00
|
|
|
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (SMESH::MESHorSUBMESH);
|
|
|
|
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (SMESH::GROUP);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
QList<SUIT_SelectionFilter*> aListOfFilters;
|
2005-06-07 19:22:20 +06:00
|
|
|
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
|
|
|
|
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
|
|
|
|
|
|
|
|
myElementsFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
|
2012-12-13 17:41:29 +06:00
|
|
|
//myPathMeshFilter = new SMESH_TypeFilter (SMESH::MESH);
|
|
|
|
myPathMeshFilter = new SMESH_TypeFilter(SMESH::MESHorSUBMESH);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
myHelpFileName = "extrusion_along_path_page.html";
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
Init();
|
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
// signals-slots connections
|
2005-06-07 19:22:20 +06:00
|
|
|
connect(OkButton, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
|
|
|
connect(CloseButton, SIGNAL(clicked()), this, SLOT(reject()));
|
|
|
|
connect(ApplyButton, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
2006-05-06 14:51:48 +06:00
|
|
|
connect(HelpButton, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded()));
|
|
|
|
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved()));
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
|
|
connect(SelectPathMeshButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
|
|
connect(SelectStartPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
|
|
connect(SelectBasePointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
|
|
|
|
|
|
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
|
|
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
|
|
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
|
|
|
|
|
|
|
connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
|
2012-08-09 16:03:55 +06:00
|
|
|
SLOT(onTextChange(const QString&)));
|
2005-06-07 19:22:20 +06:00
|
|
|
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
|
2012-08-09 16:03:55 +06:00
|
|
|
SLOT(onTextChange(const QString&)));
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
|
|
|
connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
|
|
|
connect(ZSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
|
|
|
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
|
|
|
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
|
|
|
connect(LinearAnglesCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
|
|
|
|
|
|
|
|
|
|
|
|
//To Connect preview check box
|
|
|
|
connectPreviewControl();
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
AnglesList->installEventFilter(this);
|
|
|
|
ElementsLineEdit->installEventFilter(this);
|
|
|
|
StartPointLineEdit->installEventFilter(this);
|
|
|
|
XSpin->editor()->installEventFilter(this);
|
|
|
|
YSpin->editor()->installEventFilter(this);
|
|
|
|
ZSpin->editor()->installEventFilter(this);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : ~SMESHGUI_ExtrusionAlongPathDlg()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : destructor
|
|
|
|
//=================================================================================
|
|
|
|
SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
|
|
|
|
{
|
|
|
|
// no need to delete child widgets, Qt does it all for us
|
2009-02-17 10:27:49 +05:00
|
|
|
if ( myFilterDlg != 0 ) {
|
|
|
|
myFilterDlg->setParent( 0 );
|
|
|
|
delete myFilterDlg;
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : Init()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : initialization
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::Init (bool ResetControls)
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
|
|
|
myBusy = false;
|
|
|
|
myEditCurrentArgument = 0;
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
myMesh = SMESH::SMESH_Mesh::_nil();
|
|
|
|
myIDSource = SMESH::SMESH_IDSource::_nil();
|
|
|
|
myMeshActor = 0;
|
2012-08-09 16:03:55 +06:00
|
|
|
myPath = SMESH::SMESH_IDSource::_nil();
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
ElementsLineEdit->clear();
|
|
|
|
PathMeshLineEdit->clear();
|
|
|
|
StartPointLineEdit->clear();
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
if (ResetControls) {
|
|
|
|
XSpin->SetValue(0.0);
|
|
|
|
YSpin->SetValue(0.0);
|
|
|
|
ZSpin->SetValue(0.0);
|
|
|
|
|
|
|
|
AngleSpin->SetValue(45);
|
|
|
|
MeshCheck->setChecked(false);
|
|
|
|
ConstructorsClicked(0);
|
2005-01-20 11:25:54 +05:00
|
|
|
onSelectMesh();
|
2012-08-09 16:03:55 +06:00
|
|
|
myPreviewCheckBox->setChecked(false);
|
|
|
|
onDisplaySimulation(false);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
SetEditCurrentArgument(0);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : ConstructorsClicked()
|
|
|
|
// purpose : Called when user changes type of elements (1d / 2d)
|
2005-01-20 11:25:54 +05:00
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
if (myType == type) return;
|
|
|
|
|
|
|
|
disconnect(mySelectionMgr, 0, this, 0);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
hidePreview();
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
if (type == 0)
|
|
|
|
GroupArguments->setTitle(tr("EXTRUSION_1D"));
|
|
|
|
else if (type == 1)
|
|
|
|
GroupArguments->setTitle(tr("EXTRUSION_2D"));
|
|
|
|
|
|
|
|
// clear elements ID list
|
|
|
|
if (!MeshCheck->isChecked()) {
|
|
|
|
ElementsLineEdit->clear();
|
|
|
|
}
|
|
|
|
// set selection mode if necessary
|
|
|
|
if (myEditCurrentArgument == ElementsLineEdit) {
|
|
|
|
mySelectionMgr->clearSelected();
|
|
|
|
mySelectionMgr->clearFilters();
|
|
|
|
SMESH::SetPickable();
|
|
|
|
|
|
|
|
SMESH::SetPointRepresentation(false);
|
|
|
|
if (MeshCheck->isChecked()) {
|
2005-07-01 16:42:32 +06:00
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
2012-08-09 16:03:55 +06:00
|
|
|
aViewWindow->SetSelectionMode(ActorSelection);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectionMgr->installFilter(myElementsFilter);
|
|
|
|
} else {
|
|
|
|
if (type == 0)
|
2012-08-09 16:03:55 +06:00
|
|
|
{
|
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
if (type == 1)
|
2012-08-09 16:03:55 +06:00
|
|
|
{
|
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(FaceSelection);
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
myType = type;
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : ClickOnApply()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Called when user presses <Apply> button
|
|
|
|
//=================================================================================
|
|
|
|
bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
if (mySMESHGUI->isActiveStudyLocked())
|
2005-01-20 11:25:54 +05:00
|
|
|
return false;
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
//if (myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() ||
|
|
|
|
// !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil())
|
|
|
|
if ( myMesh->_is_nil() || (MeshCheck->isChecked() && myIDSource->_is_nil()) ||
|
|
|
|
/*!myMeshActor ||*/ myPath->_is_nil() )
|
2005-01-20 11:25:54 +05:00
|
|
|
return false;
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
if (!isValid())
|
|
|
|
return false;
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::long_array_var anElementsId = getSelectedElements();
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
if (StartPointLineEdit->text().trimmed().isEmpty()) {
|
2005-01-20 11:25:54 +05:00
|
|
|
return false;
|
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
bool bOk;
|
2005-06-07 19:22:20 +06:00
|
|
|
long aNodeStart = StartPointLineEdit->text().toLong(&bOk);
|
|
|
|
if (!bOk) {
|
2005-01-20 11:25:54 +05:00
|
|
|
return false;
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
QStringList aParameters;
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
//get angles
|
|
|
|
SMESH::double_array_var anAngles = getAngles();
|
|
|
|
|
|
|
|
for (int i = 0; i < myAnglesList.count(); i++)
|
|
|
|
aParameters << AnglesList->item(i)->text();
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// get base point
|
|
|
|
SMESH::PointStruct aBasePoint;
|
2009-02-17 10:27:49 +05:00
|
|
|
if (BasePointGrp->isChecked()) {
|
2005-01-20 11:25:54 +05:00
|
|
|
aBasePoint.x = XSpin->GetValue();
|
|
|
|
aBasePoint.y = YSpin->GetValue();
|
|
|
|
aBasePoint.z = ZSpin->GetValue();
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
aParameters << XSpin->text();
|
|
|
|
aParameters << YSpin->text();
|
|
|
|
aParameters << ZSpin->text();
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
try {
|
2005-06-07 19:22:20 +06:00
|
|
|
SUIT_OverrideCursor wc;
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
2008-03-07 12:47:05 +05:00
|
|
|
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
|
|
|
|
|
|
bool NeedGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
|
|
|
SMESH::ElementType ElemType = SMESH::FACE;
|
|
|
|
if( GetConstructorId() == 0 )
|
|
|
|
ElemType = SMESH::EDGE;
|
|
|
|
if( !MeshCheck->isChecked() ) {
|
|
|
|
SMESH::ListOfGroups_var groups =
|
|
|
|
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
|
|
|
|
anAngles, LinearAnglesCheck->isChecked(),
|
|
|
|
BasePointGrp->isChecked(), aBasePoint,
|
|
|
|
NeedGroups, ElemType, retVal);
|
2009-02-17 10:27:49 +05:00
|
|
|
}
|
|
|
|
else {
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::ListOfGroups_var groups =
|
|
|
|
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
|
|
|
|
anAngles, LinearAnglesCheck->isChecked(),
|
|
|
|
BasePointGrp->isChecked(), aBasePoint,
|
|
|
|
NeedGroups, ElemType, retVal);
|
2009-02-17 10:27:49 +05:00
|
|
|
}
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
wc.suspend();
|
|
|
|
switch (retVal) {
|
2005-01-20 19:50:37 +05:00
|
|
|
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr("SMESH_ERROR"),
|
|
|
|
tr("NO_ELEMENTS_SELECTED"));
|
2005-01-20 19:50:37 +05:00
|
|
|
return false; break;
|
|
|
|
case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr("SMESH_ERROR"),
|
|
|
|
tr("SELECTED_PATH_IS_NOT_EDGE"));
|
2005-01-20 19:50:37 +05:00
|
|
|
return false; break;
|
|
|
|
case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr("SMESH_ERROR"),
|
|
|
|
tr("BAD_SHAPE_TYPE"));
|
2005-01-20 19:50:37 +05:00
|
|
|
return false; break;
|
|
|
|
case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr("SMESH_ERROR"),
|
|
|
|
tr("EXTR_BAD_STARTING_NODE"));
|
2005-01-20 19:50:37 +05:00
|
|
|
return false; break;
|
|
|
|
case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr("SMESH_ERROR"),
|
|
|
|
tr("WRONG_ANGLES_NUMBER"));
|
2005-01-20 19:50:37 +05:00
|
|
|
return false; break;
|
|
|
|
case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr("SMESH_ERROR"),
|
|
|
|
tr("CANT_GET_TANGENT"));
|
2005-01-20 19:50:37 +05:00
|
|
|
return false; break;
|
|
|
|
case SMESH::SMESH_MeshEditor::EXTR_OK:
|
|
|
|
break;
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
} catch (...) {
|
2005-01-20 11:25:54 +05:00
|
|
|
return false;
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-11-11 13:56:51 +05:00
|
|
|
//mySelectionMgr->clearSelected();
|
2012-08-09 16:03:55 +06:00
|
|
|
if ( myMeshActor )
|
|
|
|
SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
|
|
|
|
|
|
|
|
SMESHGUI::Modified();
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
|
|
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
2005-12-02 15:52:13 +05:00
|
|
|
//SMESH::UpdateView();
|
2005-06-07 19:22:20 +06:00
|
|
|
Init(false);
|
|
|
|
ConstructorsClicked(GetConstructorId());
|
2005-01-20 11:25:54 +05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : ClickOnOk()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Called when user presses <OK> button
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk()
|
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
if (ClickOnApply())
|
|
|
|
reject();
|
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
//=================================================================================
|
|
|
|
// function : ClickOnHelp()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp()
|
|
|
|
{
|
|
|
|
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
|
|
|
|
if (app)
|
|
|
|
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
|
|
|
else {
|
2009-02-17 10:27:49 +05:00
|
|
|
QString platform;
|
2008-03-07 12:47:05 +05:00
|
|
|
#ifdef WIN32
|
2009-02-17 10:27:49 +05:00
|
|
|
platform = "winapplication";
|
2008-03-07 12:47:05 +05:00
|
|
|
#else
|
2009-02-17 10:27:49 +05:00
|
|
|
platform = "application";
|
2008-03-07 12:47:05 +05:00
|
|
|
#endif
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
2012-08-09 16:03:55 +06:00
|
|
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
|
|
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
|
|
|
platform)).
|
|
|
|
arg(myHelpFileName));
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
//=================================================================================
|
|
|
|
// function : reject()
|
|
|
|
// purpose : Called when dialog box is closed
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::reject()
|
|
|
|
{
|
|
|
|
disconnect(mySelectionMgr, 0, this, 0);
|
|
|
|
mySelectionMgr->clearFilters();
|
2005-11-11 13:56:51 +05:00
|
|
|
//mySelectionMgr->clearSelected();
|
2009-02-17 10:27:49 +05:00
|
|
|
if (SMESH::GetCurrentVtkView()) {
|
|
|
|
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
|
|
|
|
SMESH::SetPointRepresentation(false);
|
|
|
|
SMESH::SetPickable();
|
|
|
|
}
|
2005-07-01 16:42:32 +06:00
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(ActorSelection);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySMESHGUI->ResetState();
|
|
|
|
QDialog::reject();
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=======================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : onTextChange()
|
|
|
|
// purpose :
|
2005-01-20 11:25:54 +05:00
|
|
|
//=======================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
|
|
|
QLineEdit* send = (QLineEdit*)sender();
|
|
|
|
|
|
|
|
// return if busy
|
2005-06-07 19:22:20 +06:00
|
|
|
if (myBusy) return;
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// set busy flag
|
2005-06-07 19:22:20 +06:00
|
|
|
SetBusy sb (this);
|
|
|
|
|
|
|
|
if (send != StartPointLineEdit && send != ElementsLineEdit)
|
|
|
|
send = ElementsLineEdit;
|
|
|
|
|
|
|
|
if (send == ElementsLineEdit && myEditCurrentArgument == ElementsLineEdit) {
|
2005-01-20 11:25:54 +05:00
|
|
|
// hilight entered elements
|
|
|
|
SMDS_Mesh* aMesh = 0;
|
2005-06-07 19:22:20 +06:00
|
|
|
if (myMeshActor)
|
2005-01-20 11:25:54 +05:00
|
|
|
aMesh = myMeshActor->GetObject()->GetMesh();
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
if (aMesh) {
|
|
|
|
//mySelectionMgr->clearSelected();
|
|
|
|
//mySelectionMgr->AddIObject(myMeshActor->getIO());
|
|
|
|
SALOME_ListIO aList;
|
|
|
|
aList.Append(myMeshActor->getIO());
|
|
|
|
mySelectionMgr->setSelectedObjects(aList, false);
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
2005-01-20 11:25:54 +05:00
|
|
|
bool bOk;
|
2005-06-07 19:22:20 +06:00
|
|
|
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
|
|
|
|
TColStd_MapOfInteger newIndices;
|
|
|
|
for (int i = 0; i < aListId.count(); i++) {
|
2012-08-09 16:03:55 +06:00
|
|
|
long ind = aListId[ i ].toLong(&bOk);
|
|
|
|
if (bOk) {
|
|
|
|
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
|
|
|
if (e) {
|
|
|
|
// check also type of element
|
|
|
|
bool typeMatch = (Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge) ||
|
|
|
|
(Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face);
|
|
|
|
if (typeMatch)
|
|
|
|
newIndices.Add(e->GetID());
|
|
|
|
}
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2005-06-24 18:42:50 +06:00
|
|
|
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
|
2005-07-01 16:42:32 +06:00
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
2012-08-09 16:03:55 +06:00
|
|
|
aViewWindow->highlight( anIO, true, true );
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
|
|
|
else if (send == StartPointLineEdit &&
|
2005-06-07 19:22:20 +06:00
|
|
|
myEditCurrentArgument == StartPointLineEdit) {
|
2012-08-09 16:03:55 +06:00
|
|
|
if (!myPath->_is_nil()) {
|
|
|
|
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
2005-01-20 11:25:54 +05:00
|
|
|
SMDS_Mesh* aMesh = 0;
|
2005-06-07 19:22:20 +06:00
|
|
|
if (aPathActor)
|
2012-08-09 16:03:55 +06:00
|
|
|
aMesh = aPathActor->GetObject()->GetMesh();
|
2005-06-07 19:22:20 +06:00
|
|
|
if (aMesh) {
|
2012-08-09 16:03:55 +06:00
|
|
|
//mySelectionMgr->clearSelected();
|
|
|
|
//mySelectionMgr->AddIObject(aPathActor->getIO());
|
2005-06-07 19:22:20 +06:00
|
|
|
SALOME_ListIO aList;
|
|
|
|
aList.Append(aPathActor->getIO());
|
|
|
|
mySelectionMgr->setSelectedObjects(aList, false);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
bool bOk;
|
|
|
|
long ind = theNewText.toLong(&bOk);
|
|
|
|
if (bOk) {
|
|
|
|
const SMDS_MeshNode* n = aMesh->FindNode(ind);
|
|
|
|
if (n) {
|
|
|
|
//if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
|
2005-06-07 19:22:20 +06:00
|
|
|
TColStd_MapOfInteger newIndices;
|
2012-08-09 16:03:55 +06:00
|
|
|
newIndices.Add(n->GetID());
|
|
|
|
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
|
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->highlight( aPathActor->getIO(), true, true );
|
|
|
|
}
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : SelectionIntoArgument()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Called when selection as changed or other case
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
if (myBusy) return;
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// return if dialog box is inactive
|
2005-06-07 19:22:20 +06:00
|
|
|
if (!GroupButtons->isEnabled())
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
|
|
|
|
|
|
|
// selected objects count
|
2005-06-07 19:22:20 +06:00
|
|
|
const SALOME_ListIO& aList = mySelector->StoredIObjects();
|
|
|
|
int nbSel = aList.Extent();
|
|
|
|
if (nbSel != 1)
|
|
|
|
return;
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
// set busy flag
|
2005-06-07 19:22:20 +06:00
|
|
|
SetBusy sb (this);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
if (myEditCurrentArgument == ElementsLineEdit) {
|
2005-01-20 11:25:54 +05:00
|
|
|
// we are now selecting mesh elements (or whole mesh/submesh/group)
|
|
|
|
// reset
|
|
|
|
ElementsLineEdit->clear();
|
|
|
|
myMesh = SMESH::SMESH_Mesh::_nil();
|
|
|
|
myIDSource = SMESH::SMESH_IDSource::_nil();
|
|
|
|
myMeshActor = 0;
|
|
|
|
|
|
|
|
// try to get mesh from selection
|
2005-06-07 19:22:20 +06:00
|
|
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
|
|
|
myMesh = SMESH::GetMeshByIO(IO);
|
|
|
|
if (myMesh->_is_nil())
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
2008-03-07 12:47:05 +05:00
|
|
|
|
|
|
|
// MakeGroups is available if there are groups
|
|
|
|
if ( myMesh->NbGroups() == 0 ) {
|
|
|
|
MakeGroupsCheck->setChecked(false);
|
|
|
|
MakeGroupsCheck->setEnabled(false);
|
|
|
|
} else {
|
|
|
|
MakeGroupsCheck->setEnabled(true);
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
// find actor
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshActor = SMESH::FindActorByObject(myMesh);
|
2012-08-09 16:03:55 +06:00
|
|
|
if (!myMeshActor && !MeshCheck->isChecked())
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
if (MeshCheck->isChecked()) {
|
2005-01-20 11:25:54 +05:00
|
|
|
// If "Select whole mesh, submesh or group" check box is on ->
|
|
|
|
// get ID source and put it's name to the edit box
|
|
|
|
QString aString;
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
myIDSource = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
|
|
|
ElementsLineEdit->setText(aString);
|
|
|
|
} else {
|
2005-01-20 11:25:54 +05:00
|
|
|
// If "Select whole mesh, submesh or group" check box is off ->
|
|
|
|
// try to get selected elements IDs
|
|
|
|
QString aString;
|
2005-06-07 19:22:20 +06:00
|
|
|
//int aNbUnits = SMESH::GetNameOfSelectedElements(mySelectionMgr, aString);
|
2008-03-07 12:47:05 +05:00
|
|
|
SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
2005-06-07 19:22:20 +06:00
|
|
|
ElementsLineEdit->setText(aString);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
|
|
|
else if (myEditCurrentArgument == PathMeshLineEdit) {
|
2005-01-20 11:25:54 +05:00
|
|
|
// we are now selecting path mesh
|
|
|
|
// reset
|
|
|
|
PathMeshLineEdit->clear();
|
2012-08-09 16:03:55 +06:00
|
|
|
myPath = SMESH::SMESH_IDSource::_nil();
|
2005-01-20 11:25:54 +05:00
|
|
|
StartPointLineEdit->clear();
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// try to get mesh from selection
|
2005-06-07 19:22:20 +06:00
|
|
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
2012-08-09 16:03:55 +06:00
|
|
|
myPath = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
|
|
|
if( myPath->_is_nil() )
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
QString aString;
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
|
|
|
PathMeshLineEdit->setText(aString);
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
|
|
|
else if (myEditCurrentArgument == StartPointLineEdit) {
|
2005-01-20 11:25:54 +05:00
|
|
|
// we are now selecting start point of path
|
|
|
|
// reset
|
|
|
|
StartPointLineEdit->clear();
|
|
|
|
|
|
|
|
// return if path mesh or path shape is not yet selected
|
2012-08-09 16:03:55 +06:00
|
|
|
if( myPath->_is_nil() )
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
|
|
|
|
|
|
|
// try to get shape from selection
|
2005-06-07 19:22:20 +06:00
|
|
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
2005-12-02 15:52:13 +05:00
|
|
|
if ( !aPathActor )
|
|
|
|
return;
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
QString aString;
|
2005-12-02 15:52:13 +05:00
|
|
|
int aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aPathActor->getIO(), aString);
|
2005-06-07 19:22:20 +06:00
|
|
|
if (aNbUnits == 1)
|
2009-02-17 10:27:49 +05:00
|
|
|
StartPointLineEdit->setText(aString.trimmed());
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
} else if (myEditCurrentArgument == XSpin) {
|
2005-01-20 11:25:54 +05:00
|
|
|
// we are now selecting base point
|
|
|
|
// reset is not performed here!
|
|
|
|
|
|
|
|
// return if is not enabled
|
2009-02-17 10:27:49 +05:00
|
|
|
if (!BasePointGrp->isChecked())
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
|
|
|
|
|
|
|
// try to get shape from selection
|
2005-06-07 19:22:20 +06:00
|
|
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// check if geom vertex is selected
|
2005-06-07 19:22:20 +06:00
|
|
|
GEOM::GEOM_Object_var aGeomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>(IO);
|
2005-01-20 11:25:54 +05:00
|
|
|
TopoDS_Vertex aVertex;
|
2005-06-07 19:22:20 +06:00
|
|
|
if (!aGeomObj->_is_nil()) {
|
|
|
|
if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) {
|
2012-08-09 16:03:55 +06:00
|
|
|
gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
|
|
|
|
XSpin->SetValue(aPnt.X());
|
|
|
|
YSpin->SetValue(aPnt.Y());
|
|
|
|
ZSpin->SetValue(aPnt.Z());
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// check if smesh node is selected
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(IO);
|
|
|
|
if (aMesh->_is_nil())
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
|
|
|
|
|
|
|
QString aString;
|
2005-06-07 19:22:20 +06:00
|
|
|
int aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, myMeshActor->getIO(), aString);
|
2005-01-20 11:25:54 +05:00
|
|
|
// return if more than one node is selected
|
2005-06-07 19:22:20 +06:00
|
|
|
if (aNbUnits != 1)
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
SMESH_Actor* aMeshActor = SMESH::FindActorByObject(aMesh);
|
|
|
|
if (!aMeshActor)
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
|
|
|
|
|
|
|
SMDS_Mesh* mesh = aMeshActor->GetObject()->GetMesh();
|
|
|
|
if (!mesh)
|
|
|
|
return;
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
const SMDS_MeshNode* n = mesh->FindNode(aString.toLong());
|
|
|
|
if (!n)
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
XSpin->SetValue(n->X());
|
|
|
|
YSpin->SetValue(n->Y());
|
|
|
|
ZSpin->SetValue(n->Z());
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
onDisplaySimulation(true);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : SetEditCurrentArgument()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
|
|
|
|
{
|
|
|
|
QToolButton* send = (QToolButton*)sender();
|
2005-06-07 19:22:20 +06:00
|
|
|
if (send != SelectElementsButton &&
|
|
|
|
send != SelectPathMeshButton &&
|
|
|
|
send != SelectStartPointButton &&
|
|
|
|
send != SelectBasePointButton)
|
2005-01-20 11:25:54 +05:00
|
|
|
return;
|
2005-06-07 19:22:20 +06:00
|
|
|
SetEditCurrentArgument(send);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : SetEditCurrentArgument()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button)
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
disconnect(mySelectionMgr, 0, this, 0);
|
2012-08-09 16:03:55 +06:00
|
|
|
// mySelectionMgr->clearSelected();
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectionMgr->clearFilters();
|
2005-01-20 11:25:54 +05:00
|
|
|
SMESH::SetPickable();
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
if (button == SelectElementsButton) {
|
2005-01-20 11:25:54 +05:00
|
|
|
myEditCurrentArgument = ElementsLineEdit;
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::SetPointRepresentation(false);
|
|
|
|
if (MeshCheck->isChecked()) {
|
2005-07-01 16:42:32 +06:00
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
2012-08-09 16:03:55 +06:00
|
|
|
aViewWindow->SetSelectionMode(ActorSelection);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectionMgr->installFilter(myElementsFilter);
|
|
|
|
} else {
|
|
|
|
if (Elements1dRB->isChecked())
|
2012-08-09 16:03:55 +06:00
|
|
|
{
|
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
else if (Elements2dRB->isChecked())
|
2012-08-09 16:03:55 +06:00
|
|
|
{
|
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(FaceSelection);
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
} else if (button == SelectPathMeshButton) {
|
2005-01-20 11:25:54 +05:00
|
|
|
myEditCurrentArgument = PathMeshLineEdit;
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::SetPointRepresentation(false);
|
2005-07-01 16:42:32 +06:00
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(ActorSelection);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectionMgr->installFilter(myPathMeshFilter);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
else if (button == SelectStartPointButton) {
|
2005-01-20 11:25:54 +05:00
|
|
|
myEditCurrentArgument = StartPointLineEdit;
|
2012-08-09 16:03:55 +06:00
|
|
|
//if (!myPathMesh->_is_nil()) {
|
|
|
|
if (!myPath->_is_nil()) {
|
|
|
|
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
2005-06-07 19:22:20 +06:00
|
|
|
if (aPathActor) {
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::SetPointRepresentation(true);
|
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(NodeSelection);
|
|
|
|
SMESH::SetPickable(aPathActor);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
else if (button == SelectBasePointButton) {
|
2005-01-20 11:25:54 +05:00
|
|
|
myEditCurrentArgument = XSpin;
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::SetPointRepresentation(true);
|
2005-07-01 16:42:32 +06:00
|
|
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
|
|
aViewWindow->SetSelectionMode(NodeSelection);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2012-12-13 17:41:29 +06:00
|
|
|
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter(SMESH::MESHorSUBMESH);
|
|
|
|
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter(SMESH::GROUP);
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH_NumberFilter* aVertexFilter = new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE,
|
|
|
|
-1, TopAbs_VERTEX);
|
2009-02-17 10:27:49 +05:00
|
|
|
QList<SUIT_SelectionFilter*> aListOfFilters;
|
2005-06-07 19:22:20 +06:00
|
|
|
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
|
|
|
|
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
|
|
|
|
if (aVertexFilter) aListOfFilters.append(aVertexFilter);
|
|
|
|
|
|
|
|
mySelectionMgr->installFilter(new SMESH_LogicalFilter
|
|
|
|
(aListOfFilters, SMESH_LogicalFilter::LO_OR));
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
if (myEditCurrentArgument && !myEditCurrentArgument->hasFocus())
|
2005-01-20 11:25:54 +05:00
|
|
|
myEditCurrentArgument->setFocus();
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
2005-01-20 11:25:54 +05:00
|
|
|
SelectionIntoArgument();
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : DeactivateActiveDialog()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Deactivates this dialog
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
|
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
if (ConstructorsBox->isEnabled()) {
|
|
|
|
ConstructorsBox->setEnabled(false);
|
2005-06-07 19:22:20 +06:00
|
|
|
GroupArguments->setEnabled(false);
|
|
|
|
GroupButtons->setEnabled(false);
|
|
|
|
mySMESHGUI->ResetState();
|
|
|
|
mySMESHGUI->SetActiveDialogBox(0);
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : ActivateThisDialog()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Activates this dialog
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
|
|
|
|
{
|
|
|
|
// Emit a signal to deactivate the active dialog
|
2005-06-07 19:22:20 +06:00
|
|
|
mySMESHGUI->EmitSignalDeactivateDialog();
|
2009-02-17 10:27:49 +05:00
|
|
|
ConstructorsBox->setEnabled(true);
|
2005-06-07 19:22:20 +06:00
|
|
|
GroupArguments->setEnabled(true);
|
|
|
|
GroupButtons->setEnabled(true);
|
|
|
|
|
|
|
|
mySMESHGUI->SetActiveDialogBox(this);
|
|
|
|
|
|
|
|
ConstructorsClicked(GetConstructorId());
|
2005-01-20 11:25:54 +05:00
|
|
|
SelectionIntoArgument();
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : enterEvent()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Mouse enter event
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
if (!ConstructorsBox->isEnabled())
|
2005-06-07 19:22:20 +06:00
|
|
|
ActivateThisDialog();
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=======================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : onSelectMesh()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose :
|
|
|
|
//=======================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh()
|
|
|
|
{
|
|
|
|
bool toSelectMesh = MeshCheck->isChecked();
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
ElementsLineEdit->setReadOnly(toSelectMesh);
|
2009-02-17 10:27:49 +05:00
|
|
|
ElementsLineEdit->setValidator(toSelectMesh ? 0 : myIdValidator);
|
2005-06-07 19:22:20 +06:00
|
|
|
ElementsLab->setText(toSelectMesh ? tr("SMESH_NAME") : tr("SMESH_ID_ELEMENTS"));
|
2005-01-20 11:25:54 +05:00
|
|
|
ElementsLineEdit->clear();
|
2012-08-09 16:03:55 +06:00
|
|
|
myFilterBtn->setEnabled(!toSelectMesh);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
SetEditCurrentArgument(SelectElementsButton);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : GetConstructorId()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
|
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
return GroupConstructors->checkedId();
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=======================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : OnAngleAdded()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Called when user adds angle to the list
|
|
|
|
//=======================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
|
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
QString msg;
|
|
|
|
if( !AngleSpin->isValid( msg, true ) ) {
|
|
|
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
|
|
|
if ( !msg.isEmpty() )
|
|
|
|
str += "\n" + msg;
|
|
|
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
AnglesList->addItem(AngleSpin->text());
|
|
|
|
myAnglesList.append(AngleSpin->GetValue());
|
|
|
|
|
|
|
|
updateLinearAngles();
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//=======================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : OnAngleRemoved()
|
2005-01-20 11:25:54 +05:00
|
|
|
// purpose : Called when user removes angle(s) from the list
|
|
|
|
//=======================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
|
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
QList<QListWidgetItem*> aList = AnglesList->selectedItems();
|
|
|
|
QListWidgetItem* anItem;
|
|
|
|
foreach(anItem, aList) {
|
|
|
|
myAnglesList.removeAt(AnglesList->row(anItem));
|
|
|
|
delete anItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
updateLinearAngles();
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
//=================================================================================
|
|
|
|
// function : eventFilter()
|
|
|
|
// purpose : event filter ???
|
|
|
|
//=================================================================================
|
|
|
|
bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event)
|
|
|
|
{
|
|
|
|
if (event->type() == QEvent::KeyPress) {
|
|
|
|
QKeyEvent* ke = (QKeyEvent*)event;
|
|
|
|
if (object == AnglesList) {
|
2009-02-17 10:27:49 +05:00
|
|
|
if (ke->key() == Qt::Key_Delete)
|
2012-08-09 16:03:55 +06:00
|
|
|
OnAngleRemoved();
|
2005-06-07 19:22:20 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (event->type() == QEvent::FocusIn) {
|
|
|
|
if (object == ElementsLineEdit) {
|
|
|
|
if (myEditCurrentArgument != ElementsLineEdit)
|
2012-08-09 16:03:55 +06:00
|
|
|
SetEditCurrentArgument(SelectElementsButton);
|
2005-06-07 19:22:20 +06:00
|
|
|
}
|
|
|
|
else if (object == StartPointLineEdit) {
|
|
|
|
if (myEditCurrentArgument != StartPointLineEdit)
|
2012-08-09 16:03:55 +06:00
|
|
|
SetEditCurrentArgument(SelectStartPointButton);
|
2005-06-07 19:22:20 +06:00
|
|
|
}
|
|
|
|
else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) {
|
|
|
|
if (myEditCurrentArgument != XSpin)
|
2012-08-09 16:03:55 +06:00
|
|
|
SetEditCurrentArgument(SelectBasePointButton);
|
2005-06-07 19:22:20 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return QDialog::eventFilter(object, event);
|
|
|
|
}
|
2008-03-07 12:47:05 +05:00
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : keyPressEvent()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::keyPressEvent( QKeyEvent* e )
|
|
|
|
{
|
|
|
|
QDialog::keyPressEvent( e );
|
|
|
|
if ( e->isAccepted() )
|
|
|
|
return;
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
if ( e->key() == Qt::Key_F1 ) {
|
|
|
|
e->accept();
|
|
|
|
ClickOnHelp();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : setFilters()
|
|
|
|
// purpose : SLOT. Called when "Filter" button pressed.
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
if(myMesh->_is_nil()) {
|
|
|
|
SUIT_MessageBox::critical(this,
|
|
|
|
tr("SMESH_ERROR"),
|
|
|
|
tr("NO_MESH_SELECTED"));
|
|
|
|
return;
|
|
|
|
}
|
2009-02-17 10:27:49 +05:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : isValid
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
bool SMESHGUI_ExtrusionAlongPathDlg::isValid()
|
|
|
|
{
|
|
|
|
QString msg;
|
|
|
|
bool ok = true;
|
|
|
|
ok = XSpin->isValid( msg, true ) && ok;
|
|
|
|
ok = YSpin->isValid( msg, true ) && ok;
|
|
|
|
ok = ZSpin->isValid( msg, true ) && ok;
|
|
|
|
|
|
|
|
if( !ok ) {
|
|
|
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
|
|
|
if ( !msg.isEmpty() )
|
|
|
|
str += "\n" + msg;
|
|
|
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : updateLinearAngles
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
|
|
|
|
{
|
|
|
|
bool enableLinear = true;
|
|
|
|
for( int row = 0, nbRows = AnglesList->count(); row < nbRows; row++ ) {
|
|
|
|
if( QListWidgetItem* anItem = AnglesList->item( row ) ) {
|
|
|
|
enableLinear = false;
|
|
|
|
anItem->text().toDouble(&enableLinear);
|
|
|
|
if( !enableLinear )
|
2012-08-09 16:03:55 +06:00
|
|
|
break;
|
2008-03-07 12:47:05 +05:00
|
|
|
}
|
2009-02-17 10:27:49 +05:00
|
|
|
}
|
|
|
|
if( !enableLinear )
|
|
|
|
LinearAnglesCheck->setChecked( false );
|
|
|
|
LinearAnglesCheck->setEnabled( enableLinear );
|
2008-03-07 12:47:05 +05:00
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : isValuesValid()
|
|
|
|
// purpose : Return true in case if values entered into dialog are valid
|
|
|
|
//=================================================================================
|
|
|
|
bool SMESHGUI_ExtrusionAlongPathDlg::isValuesValid() {
|
|
|
|
|
|
|
|
if ( (MeshCheck->isChecked() && myIDSource->_is_nil()) ||
|
|
|
|
myMesh->_is_nil() ||
|
|
|
|
myPath->_is_nil() )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if(!MeshCheck->isChecked()) {
|
|
|
|
QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts);
|
|
|
|
if(aListElementsId.count() <= 0)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool bOk;
|
|
|
|
StartPointLineEdit->text().toLong(&bOk);
|
|
|
|
if (!bOk) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : onDisplaySimulation
|
|
|
|
// purpose : Show/Hide preview
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|
|
|
if (myPreviewCheckBox->isChecked() && toDisplayPreview) {
|
|
|
|
if(isValid() && isValuesValid()) {
|
|
|
|
|
|
|
|
//Get selected elements:
|
|
|
|
SMESH::long_array_var anElementsId = getSelectedElements();
|
|
|
|
|
|
|
|
// get angles
|
|
|
|
SMESH::double_array_var anAngles = getAngles();
|
|
|
|
|
|
|
|
// get base point
|
|
|
|
SMESH::PointStruct aBasePoint;
|
|
|
|
if (BasePointGrp->isChecked()) {
|
|
|
|
aBasePoint.x = XSpin->GetValue();
|
|
|
|
aBasePoint.y = YSpin->GetValue();
|
|
|
|
aBasePoint.z = ZSpin->GetValue();
|
|
|
|
}
|
|
|
|
bool bOk;
|
|
|
|
long aNodeStart = StartPointLineEdit->text().toLong(&bOk);
|
|
|
|
if (bOk) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
SUIT_OverrideCursor wc;
|
|
|
|
|
|
|
|
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
|
|
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
|
|
|
bool NeedGroups = false;
|
|
|
|
SMESH::ElementType ElemType = SMESH::FACE;
|
|
|
|
if( GetConstructorId() == 0 )
|
|
|
|
ElemType = SMESH::EDGE;
|
|
|
|
if( !MeshCheck->isChecked() ) {
|
|
|
|
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
|
|
|
|
anAngles, LinearAnglesCheck->isChecked(),
|
|
|
|
BasePointGrp->isChecked(), aBasePoint,
|
|
|
|
NeedGroups, ElemType, retVal);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
SMESH::ListOfGroups_var groups =
|
|
|
|
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
|
|
|
|
anAngles, LinearAnglesCheck->isChecked(),
|
|
|
|
BasePointGrp->isChecked(), aBasePoint,
|
|
|
|
NeedGroups, ElemType, retVal);
|
|
|
|
}
|
|
|
|
|
|
|
|
wc.suspend();
|
|
|
|
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK ) {
|
|
|
|
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
|
|
|
|
mySimulation->SetData(aMeshPreviewStruct._retn());
|
|
|
|
} else {
|
|
|
|
hidePreview();
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (...) {
|
|
|
|
hidePreview();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
hidePreview();
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
hidePreview();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
hidePreview();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : getSelectedElements
|
|
|
|
// purpose : return list of the selected elements
|
|
|
|
//=================================================================================
|
|
|
|
SMESH::long_array_var SMESHGUI_ExtrusionAlongPathDlg::getSelectedElements() {
|
|
|
|
|
|
|
|
// If "Select whole mesh, submesh or group" check box is off ->
|
|
|
|
// use only elements of given type selected by user
|
|
|
|
SMESH::long_array_var anElementsId = new SMESH::long_array;
|
|
|
|
if (!MeshCheck->isChecked()) {
|
|
|
|
|
|
|
|
SMDS_Mesh* aMesh;
|
|
|
|
if ( myMeshActor )
|
|
|
|
aMesh = myMeshActor->GetObject()->GetMesh();
|
|
|
|
|
|
|
|
if (aMesh) {
|
|
|
|
QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts);
|
|
|
|
anElementsId = new SMESH::long_array;
|
|
|
|
anElementsId->length(aListElementsId.count());
|
|
|
|
bool bOk;
|
|
|
|
int j = 0;
|
|
|
|
for (int i = 0; i < aListElementsId.count(); i++) {
|
|
|
|
long ind = aListElementsId[ i ].toLong(&bOk);
|
|
|
|
if (bOk) {
|
|
|
|
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
|
|
|
if (e) {
|
|
|
|
bool typeMatch = (Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge) ||
|
|
|
|
(Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face);
|
|
|
|
if (typeMatch)
|
|
|
|
anElementsId[ j++ ] = ind;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
anElementsId->length(j);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return anElementsId;
|
|
|
|
}
|
|
|
|
|
|
|
|
SMESH::double_array_var SMESHGUI_ExtrusionAlongPathDlg::getAngles() {
|
|
|
|
SMESH::double_array_var anAngles = new SMESH::double_array;
|
|
|
|
if (AnglesGrp->isChecked()) {
|
|
|
|
anAngles->length(myAnglesList.count());
|
|
|
|
int j = 0;
|
|
|
|
for (int i = 0; i < myAnglesList.count(); i++) {
|
|
|
|
double angle = myAnglesList[i];
|
|
|
|
anAngles[ j++ ] = angle*M_PI/180.;
|
|
|
|
}
|
|
|
|
anAngles->length(j);
|
|
|
|
}
|
|
|
|
return anAngles;
|
|
|
|
}
|