0019939: EDF 762 SMESH : Definition of groups from other existing groups

?Union of two groups?, ?Union of two groups? and ?Cut of two groups? dialog boxes are updated for supporting works with several groups instead of two groups only

New ?Create group of underlying entities? dialog box is provided. It is intended for creating groups of entities from existing groups of superior dimensions (groups of nodes from group of faces, for example). Dialog contains
1) line edit for defining name of new group,
2) combo-box for defining dimension of elements (nodes, edges, etc),
3) list-box for defining source groups
This commit is contained in:
sln 2008-11-26 15:29:10 +00:00
parent 893e1c2982
commit 634461f414
5 changed files with 1037 additions and 245 deletions

View File

@ -1879,29 +1879,38 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
} }
break; break;
} }
case 810: // Union Groups case 810: // Union Groups
case 811: // Intersect groups case 811: // Intersect groups
case 812: // Cut groups case 812: // Cut groups
{ {
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
tr( "NOT_A_VTK_VIEWER" ) );
break;
}
if ( checkLock( aStudy ) ) if ( checkLock( aStudy ) )
break; break;
EmitSignalDeactivateDialog(); EmitSignalDeactivateDialog();
int aMode; SMESHGUI_GroupOpDlg* aDlg = 0;
if ( theCommandID == 810 ) aMode = SMESHGUI_GroupOpDlg::UNION; if ( theCommandID == 810 )
else if ( theCommandID == 811 ) aMode = SMESHGUI_GroupOpDlg::INTERSECT; aDlg = new SMESHGUI_UnionGroupsDlg( this );
else aMode = SMESHGUI_GroupOpDlg::CUT; else if ( theCommandID == 811 )
aDlg = new SMESHGUI_IntersectGroupsDlg( this );
else
aDlg = new SMESHGUI_CutGroupsDlg( this );
aDlg->show();
break;
}
case 814: // Create groups of entities from existing groups of superior dimensions
{
if ( checkLock( aStudy ) )
break;
EmitSignalDeactivateDialog();
SMESHGUI_GroupOpDlg* aDlg = new SMESHGUI_DimGroupDlg( this );
aDlg->show();
( new SMESHGUI_GroupOpDlg( this, aMode ) )->show();
break; break;
} }
@ -2605,6 +2614,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( 810, "UN_GROUP", "ICON_UNION" ); createSMESHAction( 810, "UN_GROUP", "ICON_UNION" );
createSMESHAction( 811, "INT_GROUP", "ICON_INTERSECT" ); createSMESHAction( 811, "INT_GROUP", "ICON_INTERSECT" );
createSMESHAction( 812, "CUT_GROUP", "ICON_CUT" ); createSMESHAction( 812, "CUT_GROUP", "ICON_CUT" );
createSMESHAction( 814, "UNDERLYING_ELEMS","ICON_UNDERLYING_ELEMS" );
createSMESHAction( 813, "DEL_GROUP", "ICON_DEL_GROUP" ); createSMESHAction( 813, "DEL_GROUP", "ICON_DEL_GROUP" );
createSMESHAction( 900, "ADV_INFO", "ICON_ADV_INFO" ); createSMESHAction( 900, "ADV_INFO", "ICON_ADV_INFO" );
createSMESHAction( 902, "STD_INFO", "ICON_STD_INFO" ); createSMESHAction( 902, "STD_INFO", "ICON_STD_INFO" );
@ -2741,6 +2751,8 @@ void SMESHGUI::initialize( CAM_Application* app )
createMenu( 811, meshId, -1 ); createMenu( 811, meshId, -1 );
createMenu( 812, meshId, -1 ); createMenu( 812, meshId, -1 );
createMenu( separator(), meshId, -1 ); createMenu( separator(), meshId, -1 );
createMenu( 814, meshId, -1 );
createMenu( separator(), meshId, -1 );
createMenu( 813, meshId, -1 ); createMenu( 813, meshId, -1 );
createMenu( separator(), meshId, -1 ); createMenu( separator(), meshId, -1 );
createMenu( 900, meshId, -1 ); createMenu( 900, meshId, -1 );

File diff suppressed because it is too large Load Diff

View File

@ -37,6 +37,10 @@
#include CORBA_SERVER_HEADER(SMESH_Group) #include CORBA_SERVER_HEADER(SMESH_Group)
class QPushButton; class QPushButton;
class QtxColorButton;
class QComboBox;
class QListWidget;
class QGroupBox;
class QLineEdit; class QLineEdit;
class SMESHGUI; class SMESHGUI;
class LightApp_SelectionMgr; class LightApp_SelectionMgr;
@ -52,14 +56,37 @@ class SMESHGUI_EXPORT SMESHGUI_GroupOpDlg : public QDialog
Q_OBJECT Q_OBJECT
public: public:
enum { UNION, INTERSECT, CUT }; //enum { UNION, INTERSECT, CUT };
public: public:
SMESHGUI_GroupOpDlg( SMESHGUI*, const int ); SMESHGUI_GroupOpDlg( SMESHGUI* );
virtual ~SMESHGUI_GroupOpDlg(); virtual ~SMESHGUI_GroupOpDlg();
void Init(); void Init();
protected slots:
virtual bool onApply();
virtual void onSelectionDone();
virtual void setVisible ( bool visible );
protected:
virtual void reset();
QString getName() const;
void setName( const QString& theName );
QGroupBox* getArgGrp() const;
void setHelpFileName( const QString& theFName );
SMESHGUI* getSMESHGUI() const;
bool isValid( const QList<SMESH::SMESH_GroupBase_var>& theListGrp );
bool getSelectedGroups( QList<SMESH::SMESH_GroupBase_var>& theOutList,
QStringList& theOutNames );
SMESH::ListOfGroups* convert( const QList<SMESH::SMESH_GroupBase_var>& );
SALOMEDS::Color getColor() const;
private: private:
void closeEvent( QCloseEvent* ); void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
@ -67,20 +94,15 @@ private:
private slots: private slots:
void onOk(); void onOk();
bool onApply();
void onClose(); void onClose();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();
void onSelectionDone();
void onFocusChanged();
private: private:
QWidget* createButtonFrame( QWidget* ); QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame ( QWidget* ); QWidget* createMainFrame ( QWidget* );
bool isValid();
void reset();
private: private:
QPushButton* myOkBtn; QPushButton* myOkBtn;
QPushButton* myApplyBtn; QPushButton* myApplyBtn;
@ -88,22 +110,129 @@ private:
QPushButton* myHelpBtn; QPushButton* myHelpBtn;
QLineEdit* myNameEdit; QLineEdit* myNameEdit;
QLineEdit* myEdit1; QGroupBox* myArgGrp;
QLineEdit* myEdit2; QtxColorButton* myColorBtn;
QPushButton* myBtn1;
QPushButton* myBtn2;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
LightApp_SelectionMgr* mySelectionMgr; LightApp_SelectionMgr* mySelectionMgr;
int myMode;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QLineEdit* myFocusWg;
SMESH::SMESH_GroupBase_var myGroup1;
SMESH::SMESH_GroupBase_var myGroup2;
QString myHelpFileName; QString myHelpFileName;
}; };
/*
Class : SMESHGUI_UnionGroupsDlg
Description : Perform union of several groups
*/
class SMESHGUI_EXPORT SMESHGUI_UnionGroupsDlg : public SMESHGUI_GroupOpDlg
{
Q_OBJECT
public:
SMESHGUI_UnionGroupsDlg( SMESHGUI* );
virtual ~SMESHGUI_UnionGroupsDlg();
protected slots:
virtual bool onApply();
virtual void onSelectionDone();
protected:
virtual void reset();
private:
QListWidget* myListWg;
QList<SMESH::SMESH_GroupBase_var> myGroups;
};
/*
Class : SMESHGUI_IntersectGroupsDlg
Description : Perform intersection of several groups
*/
class SMESHGUI_EXPORT SMESHGUI_IntersectGroupsDlg : public SMESHGUI_GroupOpDlg
{
Q_OBJECT
public:
SMESHGUI_IntersectGroupsDlg( SMESHGUI* );
virtual ~SMESHGUI_IntersectGroupsDlg();
protected slots:
virtual bool onApply();
virtual void onSelectionDone();
protected:
virtual void reset();
private:
QListWidget* myListWg;
QList<SMESH::SMESH_GroupBase_var> myGroups;
};
/*
Class : SMESHGUI_CutGroupsDlg
Description : Perform cut of several groups
*/
class SMESHGUI_EXPORT SMESHGUI_CutGroupsDlg : public SMESHGUI_GroupOpDlg
{
Q_OBJECT
public:
SMESHGUI_CutGroupsDlg( SMESHGUI* );
virtual ~SMESHGUI_CutGroupsDlg();
protected slots:
virtual bool onApply();
virtual void onSelectionDone();
protected:
virtual void reset();
private:
QPushButton* myBtn1;
QPushButton* myBtn2;
QListWidget* myListWg1;
QListWidget* myListWg2;
QList<SMESH::SMESH_GroupBase_var> myGroups1;
QList<SMESH::SMESH_GroupBase_var> myGroups2;
};
/*
Class : SMESHGUI_DimGroupDlg
Description : Dialog for creating groups of entities from existing
groups of superior dimensions
*/
class SMESHGUI_EXPORT SMESHGUI_DimGroupDlg : public SMESHGUI_GroupOpDlg
{
Q_OBJECT
public:
SMESHGUI_DimGroupDlg( SMESHGUI* );
virtual ~SMESHGUI_DimGroupDlg();
SMESH::ElementType getElementType() const;
void setElementType( const SMESH::ElementType& theElemType );
protected:
virtual void reset();
protected slots:
virtual bool onApply();
virtual void onSelectionDone();
private:
QComboBox* myCombo;
QListWidget* myListWg;
QList<SMESH::SMESH_GroupBase_var> myGroups;
};
#endif // SMESHGUI_GROUPOPDLG_H #endif // SMESHGUI_GROUPOPDLG_H

View File

@ -402,5 +402,9 @@
<source>ICON_CLEAR_MESH</source> <source>ICON_CLEAR_MESH</source>
<translation>mesh_clear.png</translation> <translation>mesh_clear.png</translation>
</message> </message>
<message>
<source>ICON_UNDERLYING_ELEMS</source>
<translation>mesh_extractGroup.png</translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -586,6 +586,10 @@
<source>MEN_UN_GROUP</source> <source>MEN_UN_GROUP</source>
<translation>Union Groups</translation> <translation>Union Groups</translation>
</message> </message>
<message>
<source>MEN_UNDERLYING_ELEMS</source>
<translation>Group of underlying entities</translation>
</message>
<message> <message>
<source>MEN_UPDATE</source> <source>MEN_UPDATE</source>
<translation>Update</translation> <translation>Update</translation>
@ -2276,6 +2280,10 @@ Consider saving your work before application crash</translation>
<source>STB_UN_GROUP</source> <source>STB_UN_GROUP</source>
<translation>Union Groups</translation> <translation>Union Groups</translation>
</message> </message>
<message>
<source>STB_UNDERLYING_ELEMS</source>
<translation>Create groups of entities from existing groups of superior dimensions</translation>
</message>
<message> <message>
<source>STB_UPDATE</source> <source>STB_UPDATE</source>
<translation>Update</translation> <translation>Update</translation>
@ -2736,6 +2744,10 @@ Consider saving your work before application crash</translation>
<source>TOP_UN_GROUP</source> <source>TOP_UN_GROUP</source>
<translation>Union Groups</translation> <translation>Union Groups</translation>
</message> </message>
<message>
<source>TOP_UNDERLYING_ELEMS</source>
<translation>Create groups of entities from existing groups of superior dimensions</translation>
</message>
<message> <message>
<source>TOP_UPDATE</source> <source>TOP_UPDATE</source>
<translation>Update</translation> <translation>Update</translation>
@ -3754,10 +3766,6 @@ Please enter correct value and try again</translation>
<source>ARGUMENTS</source> <source>ARGUMENTS</source>
<translation>Arguments</translation> <translation>Arguments</translation>
</message> </message>
<message>
<source>CUT_OF_TWO_GROUPS</source>
<translation>Cut of two groups</translation>
</message>
<message> <message>
<source>DIFF_MESHES</source> <source>DIFF_MESHES</source>
<translation>Arguments of operation are not correctly specified <translation>Arguments of operation are not correctly specified
@ -3780,14 +3788,6 @@ Please specify non-empty name and try again</translation>
<translation>Arguments of operation are not specified <translation>Arguments of operation are not specified
Please specify them and try again</translation> Please specify them and try again</translation>
</message> </message>
<message>
<source>INTERSECTION_OF_TWO_GROUPS</source>
<translation>Intersection of two groups</translation>
</message>
<message>
<source>MAIN_OBJECT</source>
<translation>Main object</translation>
</message>
<message> <message>
<source>NAME</source> <source>NAME</source>
<translation>Name</translation> <translation>Name</translation>
@ -3813,6 +3813,62 @@ Please specify them and try again</translation>
<translation>Union of two groups</translation> <translation>Union of two groups</translation>
</message> </message>
</context> </context>
<context>
<name>SMESHGUI_UnionGroupsDlg</name>
<message>
<source>UNION_OF_GROUPS</source>
<translation>Union of groups</translation>
</message>
</context>
<context>
<name>SMESHGUI_DimGroupDlg</name>
<message>
<source>CREATE_GROUP_OF_UNDERLYING_ELEMS</source>
<translation>Create group of underlying entities</translation>
</message>
<message>
<source>ELEMENTS_TYPE</source>
<translation>Elements type</translation>
</message>
<message>
<source>NODE</source>
<translation>Node</translation>
</message>
<message>
<source>EDGE</source>
<translation>Edge</translation>
</message>
<message>
<source>FACE</source>
<translation>Face</translation>
</message>
<message>
<source>VOLUME</source>
<translation>Volume</translation>
</message>
</context>
<context>
<name>SMESHGUI_IntersectGroupsDlg</name>
<message>
<source>INTERSECTION_OF_GROUPS</source>
<translation>Intersection of groups</translation>
</message>
</context>
<context>
<name>SMESHGUI_CutGroupsDlg</name>
<message>
<source>CUT_OF_GROUPS</source>
<translation>Cut of groups</translation>
</message>
<message>
<source>MAIN_OBJECT</source>
<translation>Main object</translation>
</message>
<message>
<source>TOOL_OBJECT</source>
<translation>Tool object</translation>
</message>
</context>
<context> <context>
<name>SMESHGUI_MakeNodeAtPointDlg</name> <name>SMESHGUI_MakeNodeAtPointDlg</name>
<message> <message>