mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 18:30:35 +05:00
Automatic assigning of default name for the group at the dialog box initialization
This commit is contained in:
parent
bc65599349
commit
1116b207ea
@ -521,6 +521,22 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
|
|||||||
return aName;
|
return aName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SMESHGUI_GroupDlg::setDefaultName() const
|
||||||
|
{
|
||||||
|
QString aResName;
|
||||||
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
|
int i=1;
|
||||||
|
QString aPrefix ="Group_";
|
||||||
|
_PTR(SObject) anObj;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
aResName = aPrefix + QString::number( i++ );
|
||||||
|
anObj = aStudy->FindObject( aResName.toLatin1().data() );
|
||||||
|
}
|
||||||
|
while ( anObj );
|
||||||
|
myName->setText(aResName);
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : Init()
|
// function : Init()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -543,6 +559,8 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
|
|||||||
SetAppropriateActor();
|
SetAppropriateActor();
|
||||||
|
|
||||||
setDefaultGroupColor();
|
setDefaultGroupColor();
|
||||||
|
setDefaultName();
|
||||||
|
|
||||||
|
|
||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
mySelectionMgr->selectedObjects( aList );
|
mySelectionMgr->selectedObjects( aList );
|
||||||
@ -1112,7 +1130,7 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
||||||
|
|
||||||
/* init for the next operation */
|
/* init for the next operation */
|
||||||
myName->setText( "" );
|
setDefaultName();
|
||||||
myElements->clear();
|
myElements->clear();
|
||||||
myGroup = SMESH::SMESH_Group::_nil();
|
myGroup = SMESH::SMESH_Group::_nil();
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
|
@ -141,7 +141,7 @@ private:
|
|||||||
|
|
||||||
void setGroupQColor( const QColor& );
|
void setGroupQColor( const QColor& );
|
||||||
QColor getGroupQColor() const;
|
QColor getGroupQColor() const;
|
||||||
|
void setDefaultName() const;
|
||||||
void setDefaultGroupColor();
|
void setDefaultGroupColor();
|
||||||
|
|
||||||
void setIsApplyAndClose( const bool theFlag );
|
void setIsApplyAndClose( const bool theFlag );
|
||||||
|
Loading…
Reference in New Issue
Block a user