From: eap Date: Tue, 23 Oct 2012 07:45:56 +0000 (+0000) Subject: 21680: EDF 2288 SMESH: creation of 0D elements from other elements X-Git-Tag: V6_6_0b1~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7bf0e19b3d2b5968395064901aee8d949f655559;p=modules%2Fsmesh.git 21680: EDF 2288 SMESH: creation of 0D elements from other elements --- diff --git a/doc/salome/gui/SMESH/images/dlg_0D_on_all_nodes.png b/doc/salome/gui/SMESH/images/dlg_0D_on_all_nodes.png new file mode 100644 index 000000000..842b3bb5b Binary files /dev/null and b/doc/salome/gui/SMESH/images/dlg_0D_on_all_nodes.png differ diff --git a/doc/salome/gui/SMESH/images/image146.png b/doc/salome/gui/SMESH/images/image146.png index a952f5fcc..06c1c0367 100755 Binary files a/doc/salome/gui/SMESH/images/image146.png and b/doc/salome/gui/SMESH/images/image146.png differ diff --git a/resources/Makefile.am b/resources/Makefile.am index dcbb70ebc..4cb55e810 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -113,6 +113,8 @@ dist_salomeres_DATA = \ mesh_update.png \ mesh_vertex_n.png \ mesh_vertex.png \ + mesh_0D_elem.png \ + mesh_0D_on_all_nodes.png \ mesh_volume_3d.png \ bare_border_volume.png \ bare_border_face.png \ diff --git a/resources/mesh_0D_elem.png b/resources/mesh_0D_elem.png new file mode 100644 index 000000000..be599b554 Binary files /dev/null and b/resources/mesh_0D_elem.png differ diff --git a/resources/mesh_0D_on_all_nodes.png b/resources/mesh_0D_on_all_nodes.png new file mode 100644 index 000000000..823765680 Binary files /dev/null and b/resources/mesh_0D_on_all_nodes.png differ diff --git a/src/SMESHGUI/Makefile.am b/src/SMESHGUI/Makefile.am index 9bfd599b3..e48d1e8d7 100644 --- a/src/SMESHGUI/Makefile.am +++ b/src/SMESHGUI/Makefile.am @@ -97,6 +97,7 @@ salomeinclude_HEADERS = \ SMESHGUI_PreviewDlg.h \ SMESHGUI_ReorientFacesDlg.h \ SMESHGUI_PropertiesDlg.h \ + SMESHGUI_Add0DElemsOnAllNodesDlg.h \ SMESH_SMESHGUI.hxx # Libraries targets @@ -173,7 +174,8 @@ dist_libSMESH_la_SOURCES = \ SMESHGUI_FileValidator.cxx \ SMESHGUI_PreviewDlg.cxx \ SMESHGUI_ReorientFacesDlg.cxx \ - SMESHGUI_PropertiesDlg.cxx + SMESHGUI_PropertiesDlg.cxx \ + SMESHGUI_Add0DElemsOnAllNodesDlg.cxx MOC_FILES = \ SMESHGUI_moc.cxx \ @@ -233,7 +235,8 @@ MOC_FILES = \ SMESHGUI_MeshOrderOp_moc.cxx \ SMESHGUI_PreviewDlg_moc.cxx \ SMESHGUI_ReorientFacesDlg_moc.cxx \ - SMESHGUI_PropertiesDlg_moc.cxx + SMESHGUI_PropertiesDlg_moc.cxx \ + SMESHGUI_Add0DElemsOnAllNodesDlg_moc.cxx nodist_libSMESH_la_SOURCES= \ $(MOC_FILES) diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx new file mode 100644 index 000000000..1f67962f8 --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx @@ -0,0 +1,500 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SMESH SMESHGUI : GUI for SMESH component +// File : SMESHGUI_Add0DElemsOnAllNodesDlg.cxx +// Created : Fri Oct 19 15:51:24 2012 +// Author : Edward AGAPOV (eap) + +#include "SMESHGUI_Add0DElemsOnAllNodesDlg.h" + +#include "SMESHGUI.h" +#include "SMESHGUI_FilterDlg.h" +#include "SMESHGUI_MeshUtils.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_VTKUtils.h" +#include "SMESH_LogicalFilter.hxx" +#include "SMESH_TypeFilter.hxx" + +#include +#include +#include +#include +#include + +// Qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include CORBA_SERVER_HEADER(SMESH_Mesh) +#include CORBA_SERVER_HEADER(SMESH_MeshEditor) + +#define SPACING 6 +#define MARGIN 11 + +enum { SEL_OBJECT, SEL_ELEMENTS, SEL_NODES }; + +//================================================================================ +/*! + * \brief Dialog Constructor + */ +//================================================================================ + +SMESHGUI_Add0DElemsOnAllNodesDlg::SMESHGUI_Add0DElemsOnAllNodesDlg() + : SMESHGUI_Dialog( 0, false, true ), + myIDValidator( this ) +{ + setWindowTitle( tr( "CAPTION" ) ); + + // Seletction type radio buttons + + QGroupBox* selTypeGrBox = new QGroupBox( mainFrame() ); + // + QRadioButton* objBtn = new QRadioButton( tr( "SMESH_SUBMESH_GROUP"),selTypeGrBox ); + QRadioButton* elemBtn = new QRadioButton( tr( "SMESH_ELEMENTS" ),selTypeGrBox ); + QRadioButton* nodeBtn = new QRadioButton( tr( "SMESH_NODES" ),selTypeGrBox ); + // + QHBoxLayout* selTypeLay = new QHBoxLayout( selTypeGrBox ); + selTypeLay->setMargin(MARGIN); + selTypeLay->setSpacing(SPACING); + selTypeLay->addWidget( objBtn ); + selTypeLay->addWidget( elemBtn ); + selTypeLay->addWidget( nodeBtn ); + objBtn->setChecked(true); + // + mySelTypeBtnGrp = new QButtonGroup( mainFrame() ); + mySelTypeBtnGrp->addButton( objBtn , SEL_OBJECT ); + mySelTypeBtnGrp->addButton( elemBtn, SEL_ELEMENTS ); + mySelTypeBtnGrp->addButton( nodeBtn, SEL_NODES ); + + // Label, Select Btn, LineEdit, Filter Btn + + // myLabel = new QLabel(tr("SMESH_NAME"), mainFrame() ); + // QPushButton* selBtn = new QPushButton( mainFrame() ); + // QPixmap imageSelect( resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")) ); + // selBtn->setIcon(image2); + // myLineEdit = new QLineEdit( mainFrame() ); + + setObjectPixmap( "SMESH", tr( "ICON_SELECT" ) ); + createObject( tr( "SMESH_NAME" ), mainFrame(), 0 ); + + myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), mainFrame() ); + + // List of groups + + myGroupBox = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), mainFrame() ); + myGroupBox->setCheckable( true ); + + myGroupLabel = new QLabel( tr( "SMESH_GROUP" ), myGroupBox ); + myGroupListCmBox = new QComboBox( myGroupBox ); + myGroupListCmBox->setEditable( true ); + myGroupListCmBox->setInsertPolicy( QComboBox::NoInsert ); + + QHBoxLayout* groupsLayout = new QHBoxLayout( myGroupBox ); + groupsLayout->setSpacing(SPACING); + groupsLayout->setMargin(MARGIN); + groupsLayout->addWidget( myGroupLabel ); + groupsLayout->addWidget( myGroupListCmBox, 1 ); + + // Main layout + + QGridLayout* aLay = new QGridLayout( mainFrame() ); + aLay->setMargin(MARGIN); + aLay->setSpacing(SPACING); + // + aLay->addWidget( selTypeGrBox, 0, 0, 1, 5 ); + // + aLay->addWidget( objectWg( 0, Label ), 1, 0 ); + aLay->addWidget( objectWg( 0, Btn ), 1, 1 ); + aLay->addWidget( objectWg( 0, Control), 1, 2, 1, 2 ); + aLay->addWidget( myFilterBtn, 1, 4 ); + // + aLay->addWidget( myGroupBox, 2, 0, 1, 5 ); + + // Signals + + connect( myGroupBox, SIGNAL( toggled( bool )), SLOT( onGroupChecked() )); + connect( mySelTypeBtnGrp, SIGNAL( buttonClicked(int) ), SLOT( onSelTypeChange(int))); + + onSelTypeChange( SEL_OBJECT ); +} + +//================================================================================ +/*! + * \brief SLOT to enable/disable groups + */ +//================================================================================ + +void SMESHGUI_Add0DElemsOnAllNodesDlg::onGroupChecked( bool on ) +{ + myGroupLabel->setEnabled( on ); + myGroupListCmBox->setEnabled( on ); +} + +//================================================================================ +/*! + * \brief SLOT to enable/disable groups + */ +//================================================================================ + +void SMESHGUI_Add0DElemsOnAllNodesDlg::onSelTypeChange( int selType ) +{ + setNameIndication( 0, selType == SEL_OBJECT ? OneName : ListOfNames ); + setReadOnly ( 0, selType == SEL_OBJECT ); + + QLabel* label = qobject_cast< QLabel* >( objectWg(0, Label )); + switch( selType ) { + case SEL_OBJECT: label->setText( tr("SMESH_NAME")); break; + case SEL_ELEMENTS: label->setText( tr("ELEMENT_IDS")); break; + case SEL_NODES: label->setText( tr("NODE_IDS")); break; + default:; + } + QLineEdit* lineEdit = qobject_cast< QLineEdit* >( objectWg(0, Control )); + lineEdit->setText(""); + lineEdit->setValidator( selType == SEL_OBJECT ? 0 : & myIDValidator ); + + myFilterBtn->setEnabled( selType != SEL_OBJECT ); + + emit selTypeChanged( selType ); +} + +//================================================================================ +/*! + * \brief Return type of selected object: [SEL_OBJECT, SEL_ELEMENTS, SEL_NODES] + */ +//================================================================================ + +int SMESHGUI_Add0DElemsOnAllNodesDlg::getSelectionType() const +{ + return mySelTypeBtnGrp->checkedId(); +} + +//================================================================================ +/*! + * \brief Checks consistency of data + */ +//================================================================================ + +bool SMESHGUI_Add0DElemsOnAllNodesDlg::isValid() +{ + if( myGroupBox->isChecked() && myGroupListCmBox->currentText().isEmpty() ) { + SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ), tr( "GROUP_NAME_IS_EMPTY" ) ); + return false; + } + return true; +} + +//================================================================================ +/*! + * \brief Operation Constructor + */ +//================================================================================ + +SMESHGUI_Add0DElemsOnAllNodesOp::SMESHGUI_Add0DElemsOnAllNodesOp() + :SMESHGUI_SelectionOp(), + myDlg( new SMESHGUI_Add0DElemsOnAllNodesDlg ), + myFilterDlg( 0 ) +{ + myHelpFileName = "adding_nodes_and_elements_page#adding_0delems_anchor.html"; + + connect( myDlg, SIGNAL( selTypeChanged(int) ), SLOT( onSelTypeChange(int))); + connect( myDlg->myFilterBtn, SIGNAL( clicked()), SLOT( onSetFilter() )); +} + +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +SMESHGUI_Add0DElemsOnAllNodesOp::~SMESHGUI_Add0DElemsOnAllNodesOp() +{ + if ( myFilterDlg ) { + myFilterDlg->setParent( 0 ); + delete myFilterDlg; + myFilterDlg = 0; + } +} + +//================================================================================ +/*! + * \brief Start + */ +//================================================================================ + +void SMESHGUI_Add0DElemsOnAllNodesOp::startOperation() +{ + SMESHGUI_SelectionOp::startOperation(); + + myDlg->myGroupBox->setChecked( false ); + myDlg->activateObject( 0 ); + myDlg->show(); + + selectionDone(); +} + +//================================================================================ +/*! + * \brief Treat changed selection + */ +//================================================================================ + +void SMESHGUI_Add0DElemsOnAllNodesOp::selectionDone() +{ + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dgl active + if (!myDlg->myGroupBox->isEnabled()) return; // inactive + + myIO.Nullify(); + myDlg->setObjectText( 0, ""); + + SALOME_ListIO aList; + selectionMgr()->selectedObjects( aList ); + if ( aList.Extent() == 1 ) + myIO = aList.First(); + else + return; + + QString ids; + switch ( myDlg->getSelectionType() ) { + case SEL_OBJECT: + SMESHGUI_SelectionOp::selectionDone(); + break; + case SEL_ELEMENTS: + SMESH::GetNameOfSelectedElements( selector(), myIO, ids ); + myDlg->setObjectText( 0, ids ); + break; + case SEL_NODES: + SMESH::GetNameOfSelectedNodes( selector(), myIO, ids ); + myDlg->setObjectText( 0, ids ); + break; + default:; + } + + // fill the list of existing groups + myDlg->myGroupListCmBox->clear(); + myDlg->myGroupListCmBox->addItem( QString() ); + if ( !myIO.IsNull() && myIO->hasEntry()) { + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + _PTR(SObject) meshSO = aStudy->FindObjectID( myIO->getEntry() ); + _PTR(SObject) group0DRoot; + if ( meshSO->FindSubObject( SMESH::Tag_0DElementsGroups, group0DRoot )) + { + _PTR(ChildIterator) group0DIter = aStudy->NewChildIterator( group0DRoot ); + for ( ; group0DIter->More(); group0DIter->Next() ) + { + _PTR(SObject) groupSO = group0DIter->Value(); + std::string groupName = groupSO->GetName(); + if ( !groupName.empty() ) + myDlg->myGroupListCmBox->addItem( groupName.c_str() ); + } + } + } +} + +//================================================================================ +/*! + * \brief Return a filter of objects + */ +//================================================================================ + +SUIT_SelectionFilter* SMESHGUI_Add0DElemsOnAllNodesOp::createFilter( const int ) const +{ + if ( myDlg->getSelectionType() == SEL_OBJECT ) + { + // Create a filter of objects: any IDSource except the group of 0D elements + + QList filters; + filters.push_back( new SMESH_TypeFilter( SMESH::GROUP_0D )); + SMESH_LogicalFilter* not0DGroup = new SMESH_LogicalFilter( filters, + SMESH_LogicalFilter::LO_NOT, + /*takeOwnership=*/true); + filters[0] = not0DGroup; + filters.push_back( new SMESH_TypeFilter( SMESH::IDSOURCE )); + return new SMESH_LogicalFilter( filters, + SMESH_LogicalFilter::LO_AND, + /*takeOwnership=*/true); + } + return 0; +} + +//================================================================================ +/*! + * \brief Makes its main job + */ +//================================================================================ + +bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply() +{ + if ( !myDlg->isValid() ) + return false; + + // get a mesh + SMESH::SMESH_IDSource_var meshObject; + SMESH::SMESH_Mesh_var mesh; + if ( !myIO.IsNull() ) + { + CORBA::Object_var obj = SMESH::IObjectToObject( myIO ); + meshObject = SMESH::SMESH_IDSource::_narrow( obj ); + if ( !meshObject->_is_nil() ) + mesh = meshObject->GetMesh(); + } + if ( mesh->_is_nil() ) + { + SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), tr( "SMESH_BAD_SELECTION" ) ); + return false; + } + + try { + SMESH::SMESH_MeshEditor_var editor = mesh->GetMeshEditor(); + + // make SMESH_IDSource holding IDs of selected elements + if ( myDlg->getSelectionType() != SEL_OBJECT ) + { + QString elemIDs = myDlg->objectText( 0 ); + QStringList idList = elemIDs.split( " ", QString::SkipEmptyParts ); + if ( idList.count() == 0 ) + { + SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), tr( "SMESH_BAD_SELECTION" ) ); + return false; + } + SMESH::long_array_var idArray = new SMESH::long_array; + idArray->length( idList.count() ); + QStringList::iterator idIt = idList.begin(); + for ( int i = 0; idIt != idList.end(); ++idIt, ++i ) + idArray[i] = idIt->toLong(); + SMESH::ElementType elemType = + myDlg->getSelectionType() == SEL_NODES ? SMESH::NODE : SMESH::ALL; + meshObject = editor->MakeIDSource( idArray, elemType ); + } + + // Create 0D elements + + int prevNb0D = mesh->Nb0DElements(); + + QString groupName = myDlg->myGroupListCmBox->currentText(); + SMESH::SMESH_IDSource_var newObj = + editor->Create0DElementsOnAllNodes( meshObject, groupName.toLatin1().data() ); + + int newNb0D = mesh->Nb0DElements() - prevNb0D; + SUIT_MessageBox::information( myDlg, tr( "SMESH_INFORMATION" ), + tr( "NB_NEW_0D" ).arg( newNb0D ), + SUIT_MessageBox::Ok, SUIT_MessageBox::Ok); + } + catch ( const SALOME::SALOME_Exception& S_ex ) { + SalomeApp_Tools::QtCatchCorbaException( S_ex ); + return false; + } + catch (...) { + return false; + } + + // clear selection + + if ( myDlg->getSelectionType() == SEL_OBJECT ) + { + selectionMgr()->setSelectedObjects( SALOME_ListIO(), /*append=*/false ); + } + else + { + selector()->ClearIndex(); + } + selectionDone(); + + SMESH::UpdateView(); + SMESHGUI::Modified(); + + if ( myDlg->myGroupBox->isChecked() ) + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + + return true; +} + +//================================================================================ +/*! + * \brief Sets selection mode + */ +//================================================================================ + +void SMESHGUI_Add0DElemsOnAllNodesOp::onSelTypeChange(int selType) +{ + switch ( selType ) { + case SEL_OBJECT: setSelectionMode( ActorSelection ); break; + case SEL_ELEMENTS: setSelectionMode( CellSelection ); break; + case SEL_NODES: setSelectionMode( NodeSelection ); break; + } + + if ( selType != SEL_OBJECT ) + connect( myDlg, SIGNAL( objectChanged( int, const QStringList& )), + this, SLOT ( onTextChanged( int, const QStringList& ))); + else + disconnect( myDlg, SIGNAL( objectChanged( int, const QStringList& )), + this, SLOT ( onTextChanged( int, const QStringList& ))); + + selectionDone(); +} + +//================================================================================ +/*! + * \brief Install + * + * + */ +//================================================================================ + +void SMESHGUI_Add0DElemsOnAllNodesOp::onSetFilter() +{ + SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO( myIO ); + if ( mesh->_is_nil()) { + SUIT_MessageBox::critical( myDlg, tr("SMESH_ERROR"), tr("NO_MESH_SELECTED")); + return; + } + QList types; + if ( myDlg->getSelectionType() == SEL_NODES ) { + types.push_back( SMESH::NODE ); + } + else if ( myDlg->getSelectionType() == SEL_ELEMENTS ) { + types.push_back( SMESH::EDGE ); + types.push_back( SMESH::FACE ); + types.push_back( SMESH::VOLUME ); + } + else + return; + if ( !myFilterDlg ) + myFilterDlg = new SMESHGUI_FilterDlg( getSMESHGUI(), SMESH::ALL ); + + myFilterDlg->Init( types ); + myFilterDlg->SetSelection(); + myFilterDlg->SetMesh( mesh ); + myFilterDlg->SetSourceWg( myDlg->objectWg( 0, LightApp_Dialog::Control )); + + myFilterDlg->show(); +} diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.h b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.h new file mode 100644 index 000000000..c5a6b3f6f --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.h @@ -0,0 +1,110 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SMESH SMESHGUI : GUI for SMESH component + +#ifndef SMESHGUI_ADD0DELEMSONALLNODESDLG_H +#define SMESHGUI_ADD0DELEMSONALLNODESDLG_H + +#include "SMESH_SMESHGUI.hxx" + +#include "SMESHGUI_SelectionOp.h" +#include "SMESHGUI_Dialog.h" +#include "SMESHGUI_IdValidator.h" + +class SMESHGUI_FilterDlg; +class SMESHGUI_Add0DElemsOnAllNodesOp; +class QButtonGroup; +class QPushButton; +class QGroupBox; +class QLabel; +class QComboBox; + +//--------------------------------------------------------------------------------- +/*! + * \brief Dialog creating 0D elements on all nodes of given elements + */ +class SMESHGUI_EXPORT SMESHGUI_Add0DElemsOnAllNodesDlg : public SMESHGUI_Dialog +{ + Q_OBJECT + + public: + SMESHGUI_Add0DElemsOnAllNodesDlg(); + + int getSelectionType() const; + bool isValid(); + +signals: + + void selTypeChanged( int selType ); + + + private slots: + + void onGroupChecked ( bool on ); + void onSelTypeChange( int selType ); + + private: + + friend class SMESHGUI_Add0DElemsOnAllNodesOp; + + QButtonGroup* mySelTypeBtnGrp; + QPushButton* myFilterBtn; + QGroupBox* myGroupBox; + QLabel* myGroupLabel; + QComboBox* myGroupListCmBox; + + SMESHGUI_IdValidator myIDValidator; +}; + +//--------------------------------------------------------------------------------- +/*! + * \brief Operation creating 0D elements on all nodes of given elements + */ +class SMESHGUI_EXPORT SMESHGUI_Add0DElemsOnAllNodesOp : public SMESHGUI_SelectionOp +{ + Q_OBJECT + + public: + SMESHGUI_Add0DElemsOnAllNodesOp(); + ~SMESHGUI_Add0DElemsOnAllNodesOp(); + + virtual LightApp_Dialog* dlg() const { return myDlg; } + + protected: + virtual void startOperation(); + virtual void selectionDone(); + virtual SUIT_SelectionFilter* createFilter( const int ) const; + + protected slots: + virtual bool onApply(); + void onSelTypeChange(int); + void onSetFilter(); + + private: + SMESHGUI_Add0DElemsOnAllNodesDlg* myDlg; + SMESHGUI_FilterDlg* myFilterDlg; + Handle(SALOME_InteractiveObject) myIO; + //SUIT_SelectionFilter* myObjectFilter; +}; + +#endif diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index 6012d758c..42874a52e 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -105,7 +105,11 @@ ICON_DLG_ELEM0D - mesh_vertex.png + mesh_0D_elem.png + + + ICON_0D_ON_ALL_NODES + mesh_0D_on_all_nodes.png ICON_DLG_EDGE diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index c10fa0cf2..a92bd040d 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -160,6 +160,10 @@ ELEMENT_ID Element ID + + ELEMENT_IDS + Element IDs + FREE_BORDERS Free Borders @@ -372,6 +376,10 @@ MEN_ELEMS0D 0D Elements + + MEN_0D_ON_ALL_NODES + 0D Elements on Element Nodes + MEN_BALL Ball @@ -1075,6 +1083,10 @@ Do you want to convert it to the standalone group? NODE_ID Node ID + + NODE_IDS + Node IDs + NON_SMESH_OBJECTS_SELECTED There are objects selected which do not belong to %1 component. @@ -2435,7 +2447,11 @@ Check algorithm documentation for supported geometry SMESH_SELECT_WHOLE_MESH - Select whole mesh, submesh or group + Select whole mesh, sub-mesh or group + + + SMESH_SUBMESH_GROUP + Mesh, sub-mesh, group SMESH_SET_COLOR @@ -2829,6 +2845,10 @@ Please check preferences of Mesh module. STB_ELEM0D 0D Element + + STB_0D_ON_ALL_NODES + Make 0D Elements on Element Nodes + STB_ELEMS0D 0D Elements @@ -3437,6 +3457,10 @@ Please check preferences of Mesh module. TOP_DISP_ENT Display entity + + TOP_0D_ON_ALL_NODES + Make 0D Elements on Element Nodes + TOP_ELEM0D 0D Element @@ -4013,13 +4037,6 @@ Input value precision can be adjusted using It can't be deleted - - SMESHGUI_GroupDlg - - ALLOW_ELEM_LIST_MODIF - Enable manual edition - - SMESHGUI @@ -4328,6 +4345,35 @@ Please, create VTK viewer and try again Sub-shapes preview chunk size + + SMESHGUI_GroupDlg + + ALLOW_ELEM_LIST_MODIF + Enable manual edition + + + + SMESHGUI_Add0DElemsOnAllNodesDlg + + CAPTION + Make 0D Elements on Element Nodes + + + OBJ_BTN + Mesh, sub-mesh, group + + + NB_NEW_0D + %1 0D elements created + + + + SMESHGUI_Add0DElemsOnAllNodesOp + + NB_NEW_0D + %1 0D elements created + + SMESHGUI_AddQuadraticElementDlg