mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-05-26 08:00:49 +05:00
Issue 0021055: EDF 1602 STUDY: Object browser reactualisation when creating an object
This commit is contained in:
parent
cacc7209a0
commit
36afbbe8e3
@ -215,6 +215,7 @@
|
|||||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
|
|
||||||
QStringList errors;
|
QStringList errors;
|
||||||
|
QStringList anEntryList;
|
||||||
bool isEmpty = false;
|
bool isEmpty = false;
|
||||||
for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
|
for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
|
||||||
QString filename = *it;
|
QString filename = *it;
|
||||||
@ -276,6 +277,8 @@
|
|||||||
if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
|
if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
|
||||||
SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
|
SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
|
||||||
|
|
||||||
|
anEntryList.append( aMeshSO->GetID().c_str() );
|
||||||
|
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
// obj has been published in study. Its refcount has been incremented.
|
// obj has been published in study. Its refcount has been incremented.
|
||||||
// It is safe to decrement its refcount
|
// It is safe to decrement its refcount
|
||||||
@ -292,6 +295,11 @@
|
|||||||
// update Object browser
|
// update Object browser
|
||||||
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
|
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
|
||||||
|
|
||||||
|
// browse to the published meshes
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList );
|
||||||
|
|
||||||
// show Error message box if there were errors
|
// show Error message box if there were errors
|
||||||
if ( errors.count() > 0 ) {
|
if ( errors.count() > 0 ) {
|
||||||
SUIT_MessageBox::critical( SMESHGUI::desktop(),
|
SUIT_MessageBox::critical( SMESHGUI::desktop(),
|
||||||
@ -2372,24 +2380,33 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
|
SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
|
||||||
// create group for each type o elements
|
// create group for each type o elements
|
||||||
QString aName = IObject->getName();
|
QString aName = IObject->getName();
|
||||||
|
QStringList anEntryList;
|
||||||
if (aNodes->length() > 0) {
|
if (aNodes->length() > 0) {
|
||||||
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
|
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
|
||||||
aGroup->Add(aNodes.inout());
|
aGroup->Add(aNodes.inout());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aGroup ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
}
|
}
|
||||||
if (aEdges->length() > 0) {
|
if (aEdges->length() > 0) {
|
||||||
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
|
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
|
||||||
aGroup->Add(aEdges.inout());
|
aGroup->Add(aEdges.inout());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aGroup ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
}
|
}
|
||||||
if (aFaces->length() > 0) {
|
if (aFaces->length() > 0) {
|
||||||
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
|
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
|
||||||
aGroup->Add(aFaces.inout());
|
aGroup->Add(aFaces.inout());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aGroup ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
}
|
}
|
||||||
if (aVolumes->length() > 0) {
|
if (aVolumes->length() > 0) {
|
||||||
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
|
SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
|
||||||
aGroup->Add(aVolumes.inout());
|
aGroup->Add(aVolumes.inout());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aGroup ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
}
|
}
|
||||||
updateObjBrowser();
|
updateObjBrowser();
|
||||||
|
anApp->browseObjects( anEntryList );
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception & S_ex){
|
catch(const SALOME::SALOME_Exception & S_ex){
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
|
@ -77,7 +77,8 @@
|
|||||||
SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
|
SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
|
||||||
: QDialog(SMESH::GetDesktop(theModule)),
|
: QDialog(SMESH::GetDesktop(theModule)),
|
||||||
mySMESHGUI(theModule),
|
mySMESHGUI(theModule),
|
||||||
mySelectionMgr(SMESH::GetSelectionMgr(theModule))
|
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
|
||||||
|
myIsApplyAndClose( false )
|
||||||
{
|
{
|
||||||
setModal(false);
|
setModal(false);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
@ -298,6 +299,7 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
|||||||
if (!myMesh->_is_nil()) {
|
if (!myMesh->_is_nil()) {
|
||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
|
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
|
||||||
|
QStringList anEntryList;
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
|
|
||||||
@ -316,7 +318,11 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
|||||||
|
|
||||||
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
|
_PTR(SObject) aSO = SMESH::FindSObject( aCompoundMesh );
|
||||||
|
if( aSO ) {
|
||||||
|
SMESH::SetName( aSO, LineEditName->text() );
|
||||||
|
anEntryList.append( aSO->GetID().c_str() );
|
||||||
|
}
|
||||||
mySMESHGUI->updateObjBrowser();
|
mySMESHGUI->updateObjBrowser();
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
return false;
|
return false;
|
||||||
@ -334,6 +340,10 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
|||||||
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
|
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
|
||||||
}// end IPAL21468
|
}// end IPAL21468
|
||||||
|
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
|
||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
|
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
@ -355,6 +365,7 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_BuildCompoundDlg::ClickOnOk()
|
void SMESHGUI_BuildCompoundDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if (ClickOnApply())
|
if (ClickOnApply())
|
||||||
ClickOnCancel();
|
ClickOnCancel();
|
||||||
}
|
}
|
||||||
@ -540,3 +551,23 @@ bool SMESHGUI_BuildCompoundDlg::isValid()
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// function : setIsApplyAndClose
|
||||||
|
// Purpose : Set value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
void SMESHGUI_BuildCompoundDlg::setIsApplyAndClose( const bool theFlag )
|
||||||
|
{
|
||||||
|
myIsApplyAndClose = theFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// function : isApplyAndClose
|
||||||
|
// Purpose : Get value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
bool SMESHGUI_BuildCompoundDlg::isApplyAndClose() const
|
||||||
|
{
|
||||||
|
return myIsApplyAndClose;
|
||||||
|
}
|
||||||
|
@ -74,6 +74,9 @@ private:
|
|||||||
void keyPressEvent( QKeyEvent* );
|
void keyPressEvent( QKeyEvent* );
|
||||||
|
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
|
void setIsApplyAndClose( const bool theFlag );
|
||||||
|
bool isApplyAndClose() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||||
@ -110,6 +113,8 @@ private:
|
|||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
|
bool myIsApplyAndClose;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
void ClickOnCancel();
|
void ClickOnCancel();
|
||||||
|
@ -115,7 +115,8 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
|
|||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
myFilterDlg(0),
|
myFilterDlg(0),
|
||||||
mySelectedObject(SMESH::SMESH_IDSource::_nil())
|
mySelectedObject(SMESH::SMESH_IDSource::_nil()),
|
||||||
|
myIsApplyAndClose( false )
|
||||||
{
|
{
|
||||||
QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH")));
|
QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH")));
|
||||||
|
|
||||||
@ -308,6 +309,7 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply()
|
|||||||
if( !isValid() )
|
if( !isValid() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
QStringList anEntryList;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
@ -334,6 +336,9 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply()
|
|||||||
SMESH::SMESH_Gen_var gen = SMESHGUI::GetSMESHGen();
|
SMESH::SMESH_Gen_var gen = SMESHGUI::GetSMESHGen();
|
||||||
SMESH::SMESH_Mesh_var newMesh =
|
SMESH::SMESH_Mesh_var newMesh =
|
||||||
gen->CopyMesh(aPartToCopy, meshName.constData(), toCopyGroups, toKeepIDs);
|
gen->CopyMesh(aPartToCopy, meshName.constData(), toCopyGroups, toKeepIDs);
|
||||||
|
if( !newMesh->_is_nil() )
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
// obj has been published in study. Its refcount has been incremented.
|
// obj has been published in study. Its refcount has been incremented.
|
||||||
// It is safe to decrement its refcount
|
// It is safe to decrement its refcount
|
||||||
@ -346,6 +351,10 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply()
|
|||||||
mySMESHGUI->updateObjBrowser(true);
|
mySMESHGUI->updateObjBrowser(true);
|
||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
|
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
|
||||||
Init(false);
|
Init(false);
|
||||||
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
@ -359,6 +368,7 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_CopyMeshDlg::ClickOnOk()
|
void SMESHGUI_CopyMeshDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if( ClickOnApply() )
|
if( ClickOnApply() )
|
||||||
ClickOnCancel();
|
ClickOnCancel();
|
||||||
}
|
}
|
||||||
@ -665,3 +675,23 @@ void SMESHGUI_CopyMeshDlg::setFilters()
|
|||||||
|
|
||||||
myFilterDlg->show();
|
myFilterDlg->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// function : setIsApplyAndClose
|
||||||
|
// Purpose : Set value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
void SMESHGUI_CopyMeshDlg::setIsApplyAndClose( const bool theFlag )
|
||||||
|
{
|
||||||
|
myIsApplyAndClose = theFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// function : isApplyAndClose
|
||||||
|
// Purpose : Get value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
bool SMESHGUI_CopyMeshDlg::isApplyAndClose() const
|
||||||
|
{
|
||||||
|
return myIsApplyAndClose;
|
||||||
|
}
|
||||||
|
@ -74,6 +74,9 @@ private:
|
|||||||
|
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
|
void setIsApplyAndClose( const bool theFlag );
|
||||||
|
bool isApplyAndClose() const;
|
||||||
|
|
||||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||||
SMESHGUI_IdValidator* myIdValidator;
|
SMESHGUI_IdValidator* myIdValidator;
|
||||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||||
@ -109,6 +112,8 @@ private:
|
|||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
|
bool myIsApplyAndClose;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
void ClickOnCancel();
|
void ClickOnCancel();
|
||||||
|
@ -123,7 +123,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
|||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
|
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
|
||||||
myIsBusy( false ),
|
myIsBusy( false ),
|
||||||
myNameChanged( false )
|
myNameChanged( false ),
|
||||||
|
myIsApplyAndClose( false )
|
||||||
{
|
{
|
||||||
initDialog( true );
|
initDialog( true );
|
||||||
if ( !theMesh->_is_nil() )
|
if ( !theMesh->_is_nil() )
|
||||||
@ -773,6 +774,8 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
if (myName->text().trimmed().isEmpty())
|
if (myName->text().trimmed().isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
bool anIsOk = false;
|
||||||
|
QStringList anEntryList;
|
||||||
if (myGrpTypeId == 0) { // on mesh elements
|
if (myGrpTypeId == 0) { // on mesh elements
|
||||||
if (!mySelectAll->isChecked() && !myElements->count())
|
if (!mySelectAll->isChecked() && !myElements->count())
|
||||||
return false;
|
return false;
|
||||||
@ -824,6 +827,8 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
myGroup->SetColor(aColor);
|
myGroup->SetColor(aColor);
|
||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
|
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
|
||||||
|
if( aMeshGroupSO )
|
||||||
|
anEntryList.append( aMeshGroupSO->GetID().c_str() );
|
||||||
|
|
||||||
//SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
|
//SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
|
||||||
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
||||||
@ -895,7 +900,7 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
mySMESHGUI->updateObjBrowser(true);
|
mySMESHGUI->updateObjBrowser(true);
|
||||||
SMESH::UpdateView(); // asv: fix of BUG PAL5515
|
SMESH::UpdateView(); // asv: fix of BUG PAL5515
|
||||||
mySelectionMgr->clearSelected();
|
mySelectionMgr->clearSelected();
|
||||||
return true;
|
anIsOk = true;
|
||||||
}
|
}
|
||||||
else if (myGrpTypeId == 1) { // on geom object
|
else if (myGrpTypeId == 1) { // on geom object
|
||||||
if (CORBA::is_nil(myGroupOnGeom)) { // creation
|
if (CORBA::is_nil(myGroupOnGeom)) { // creation
|
||||||
@ -971,6 +976,8 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
myGroupOnGeom->SetColor(aColor);
|
myGroupOnGeom->SetColor(aColor);
|
||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
|
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
|
||||||
|
if( aMeshGroupSO )
|
||||||
|
anEntryList.append( aMeshGroupSO->GetID().c_str() );
|
||||||
|
|
||||||
//SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
|
//SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
|
||||||
SMESH::setFileType ( aMeshGroupSO,"COULEURGROUP" );
|
SMESH::setFileType ( aMeshGroupSO,"COULEURGROUP" );
|
||||||
@ -1000,10 +1007,15 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
mySMESHGUI->updateObjBrowser(true);
|
mySMESHGUI->updateObjBrowser(true);
|
||||||
mySelectionMgr->clearSelected();
|
mySelectionMgr->clearSelected();
|
||||||
return true;
|
anIsOk = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
if( anIsOk )
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
myObjectToSelect = anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
|
||||||
|
return anIsOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -1012,8 +1024,10 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_GroupDlg::onOK()
|
void SMESHGUI_GroupDlg::onOK()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if ( onApply() )
|
if ( onApply() )
|
||||||
onClose();
|
onClose();
|
||||||
|
setIsApplyAndClose( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -1963,7 +1977,13 @@ void SMESHGUI_GroupDlg::onClose()
|
|||||||
restoreShowEntityMode();
|
restoreShowEntityMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelectionMgr->clearSelected();
|
if( isApplyAndClose() && !myObjectToSelect.isEmpty() ) {
|
||||||
|
SUIT_DataOwnerPtrList aList;
|
||||||
|
aList.append( new LightApp_DataOwner( myObjectToSelect ) );
|
||||||
|
mySelectionMgr->setSelected( aList );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mySelectionMgr->clearSelected();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->clearFilters();
|
mySelectionMgr->clearFilters();
|
||||||
@ -2395,3 +2415,23 @@ bool SMESHGUI_GroupDlg::IsActorVisible( SMESH_Actor* theActor )
|
|||||||
return aViewWindow->isVisible(theActor->getIO());
|
return aViewWindow->isVisible(theActor->getIO());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
//function : setIsApplyAndClose
|
||||||
|
//purpose : Set value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
void SMESHGUI_GroupDlg::setIsApplyAndClose( const bool theFlag )
|
||||||
|
{
|
||||||
|
myIsApplyAndClose = theFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
//function : isApplyAndClose
|
||||||
|
//purpose : Get value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
bool SMESHGUI_GroupDlg::isApplyAndClose() const
|
||||||
|
{
|
||||||
|
return myIsApplyAndClose;
|
||||||
|
}
|
||||||
|
@ -141,6 +141,9 @@ private:
|
|||||||
QColor getGroupQColor() const;
|
QColor getGroupQColor() const;
|
||||||
|
|
||||||
void setDefaultGroupColor();
|
void setDefaultGroupColor();
|
||||||
|
|
||||||
|
void setIsApplyAndClose( const bool theFlag );
|
||||||
|
bool isApplyAndClose() const;
|
||||||
|
|
||||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||||
@ -215,6 +218,9 @@ private:
|
|||||||
QMap<QAction*, int> myActions;
|
QMap<QAction*, int> myActions;
|
||||||
|
|
||||||
bool myNameChanged; //added by skl for IPAL19574
|
bool myNameChanged; //added by skl for IPAL19574
|
||||||
|
|
||||||
|
QString myObjectToSelect;
|
||||||
|
bool myIsApplyAndClose;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_GROUPDLG_H
|
#endif // SMESHGUI_GROUPDLG_H
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_OverrideCursor.h>
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
#include <LightApp_Application.h>
|
||||||
#include <LightApp_UpdateFlags.h>
|
#include <LightApp_UpdateFlags.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
|
||||||
@ -318,6 +319,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
|
|||||||
|
|
||||||
// create groups
|
// create groups
|
||||||
SMESH::SMESH_GroupOnGeom_var group;
|
SMESH::SMESH_GroupOnGeom_var group;
|
||||||
|
QStringList anEntryList;
|
||||||
for ( int isNode = 0; isNode < 2; ++isNode ) // elems and then nodes
|
for ( int isNode = 0; isNode < 2; ++isNode ) // elems and then nodes
|
||||||
{
|
{
|
||||||
QStringList::iterator geomID = isNode ? myNodeGeoIDs.begin() : myElemGeoIDs.begin();
|
QStringList::iterator geomID = isNode ? myNodeGeoIDs.begin() : myElemGeoIDs.begin();
|
||||||
@ -346,6 +348,9 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
|
|||||||
|
|
||||||
//printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() );
|
//printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() );
|
||||||
group = mesh->CreateGroupFromGEOM( elemType, name.toLatin1().data(), geom );
|
group = mesh->CreateGroupFromGEOM( elemType, name.toLatin1().data(), geom );
|
||||||
|
if( !group->_is_nil() )
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
@ -362,6 +367,10 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
|
|||||||
myDlg->myNodeGeomBtn->setChecked(false);
|
myDlg->myNodeGeomBtn->setChecked(false);
|
||||||
myDlg->updateButtons();
|
myDlg->updateButtons();
|
||||||
|
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
|
||||||
return !group->_is_nil();
|
return !group->_is_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,9 @@
|
|||||||
#include <SVTK_ViewWindow.h>
|
#include <SVTK_ViewWindow.h>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
|
|
||||||
|
// SALOME KERNEL includes
|
||||||
|
#include <SALOMEDSClient_SObject.hxx>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
@ -75,7 +78,8 @@
|
|||||||
SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule )
|
SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule )
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
|
myIsApplyAndClose( false )
|
||||||
{
|
{
|
||||||
setModal(false);
|
setModal(false);
|
||||||
|
|
||||||
@ -309,8 +313,10 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
|
|||||||
*/
|
*/
|
||||||
void SMESHGUI_GroupOpDlg::onOk()
|
void SMESHGUI_GroupOpDlg::onOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if ( onApply() )
|
if ( onApply() )
|
||||||
onClose();
|
onClose();
|
||||||
|
setIsApplyAndClose( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -525,6 +531,28 @@ bool SMESHGUI_GroupOpDlg::onApply()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Set value of the flag indicating that the dialog is
|
||||||
|
accepted by Apply & Close button
|
||||||
|
\param theFlag value of the flag
|
||||||
|
\sa isApplyAndClose()
|
||||||
|
*/
|
||||||
|
void SMESHGUI_GroupOpDlg::setIsApplyAndClose( const bool theFlag )
|
||||||
|
{
|
||||||
|
myIsApplyAndClose = theFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Get value of the flag indicating that the dialog is
|
||||||
|
accepted by Apply & Close button
|
||||||
|
\return value of the flag
|
||||||
|
\sa setApplyAndClose()
|
||||||
|
*/
|
||||||
|
bool SMESHGUI_GroupOpDlg::isApplyAndClose() const
|
||||||
|
{
|
||||||
|
return myIsApplyAndClose;
|
||||||
|
}
|
||||||
|
|
||||||
// === === === === === === === === === === === === === === === === === === === === ===
|
// === === === === === === === === === === === === === === === === === === === === ===
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -586,6 +614,7 @@ bool SMESHGUI_UnionGroupsDlg::onApply()
|
|||||||
QString aName = getName();
|
QString aName = getName();
|
||||||
|
|
||||||
bool aRes = false;
|
bool aRes = false;
|
||||||
|
QStringList anEntryList;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SMESH::ListOfGroups_var aList = convert( myGroups );
|
SMESH::ListOfGroups_var aList = convert( myGroups );
|
||||||
@ -594,6 +623,8 @@ bool SMESHGUI_UnionGroupsDlg::onApply()
|
|||||||
if ( !CORBA::is_nil( aNewGrp ) )
|
if ( !CORBA::is_nil( aNewGrp ) )
|
||||||
{
|
{
|
||||||
aNewGrp->SetColor( getColor() );
|
aNewGrp->SetColor( getColor() );
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
aRes = true;
|
aRes = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -607,6 +638,9 @@ bool SMESHGUI_UnionGroupsDlg::onApply()
|
|||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
getSMESHGUI()->updateObjBrowser(true);
|
getSMESHGUI()->updateObjBrowser(true);
|
||||||
reset();
|
reset();
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -689,6 +723,7 @@ bool SMESHGUI_IntersectGroupsDlg::onApply()
|
|||||||
QString aName = getName();
|
QString aName = getName();
|
||||||
|
|
||||||
bool aRes = false;
|
bool aRes = false;
|
||||||
|
QStringList anEntryList;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SMESH::ListOfGroups_var aList = convert( myGroups );
|
SMESH::ListOfGroups_var aList = convert( myGroups );
|
||||||
@ -697,6 +732,8 @@ bool SMESHGUI_IntersectGroupsDlg::onApply()
|
|||||||
if ( !CORBA::is_nil( aNewGrp ) )
|
if ( !CORBA::is_nil( aNewGrp ) )
|
||||||
{
|
{
|
||||||
aNewGrp->SetColor( getColor() );
|
aNewGrp->SetColor( getColor() );
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
aRes = true;
|
aRes = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -710,6 +747,9 @@ bool SMESHGUI_IntersectGroupsDlg::onApply()
|
|||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
getSMESHGUI()->updateObjBrowser(true);
|
getSMESHGUI()->updateObjBrowser(true);
|
||||||
reset();
|
reset();
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -855,6 +895,7 @@ bool SMESHGUI_CutGroupsDlg::onApply()
|
|||||||
QString aName = getName();
|
QString aName = getName();
|
||||||
|
|
||||||
bool aRes = false;
|
bool aRes = false;
|
||||||
|
QStringList anEntryList;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SMESH::ListOfGroups_var aList1 = convert( myGroups1 );
|
SMESH::ListOfGroups_var aList1 = convert( myGroups1 );
|
||||||
@ -864,6 +905,8 @@ bool SMESHGUI_CutGroupsDlg::onApply()
|
|||||||
if ( !CORBA::is_nil( aNewGrp ) )
|
if ( !CORBA::is_nil( aNewGrp ) )
|
||||||
{
|
{
|
||||||
aNewGrp->SetColor( getColor() );
|
aNewGrp->SetColor( getColor() );
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
aRes = true;
|
aRes = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -877,6 +920,9 @@ bool SMESHGUI_CutGroupsDlg::onApply()
|
|||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
getSMESHGUI()->updateObjBrowser(true);
|
getSMESHGUI()->updateObjBrowser(true);
|
||||||
reset();
|
reset();
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1007,6 +1053,7 @@ bool SMESHGUI_DimGroupDlg::onApply()
|
|||||||
QString aName = getName();
|
QString aName = getName();
|
||||||
|
|
||||||
bool aRes = false;
|
bool aRes = false;
|
||||||
|
QStringList anEntryList;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SMESH::ListOfGroups_var aList = convert( myGroups );
|
SMESH::ListOfGroups_var aList = convert( myGroups );
|
||||||
@ -1016,6 +1063,8 @@ bool SMESHGUI_DimGroupDlg::onApply()
|
|||||||
if ( !CORBA::is_nil( aNewGrp ) )
|
if ( !CORBA::is_nil( aNewGrp ) )
|
||||||
{
|
{
|
||||||
aNewGrp->SetColor( getColor() );
|
aNewGrp->SetColor( getColor() );
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
aRes = true;
|
aRes = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1029,6 +1078,9 @@ bool SMESHGUI_DimGroupDlg::onApply()
|
|||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
getSMESHGUI()->updateObjBrowser(true);
|
getSMESHGUI()->updateObjBrowser(true);
|
||||||
reset();
|
reset();
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -88,6 +88,9 @@ protected:
|
|||||||
|
|
||||||
SALOMEDS::Color getColor() const;
|
SALOMEDS::Color getColor() const;
|
||||||
|
|
||||||
|
void setIsApplyAndClose( const bool theFlag );
|
||||||
|
bool isApplyAndClose() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void closeEvent( QCloseEvent* );
|
void closeEvent( QCloseEvent* );
|
||||||
void enterEvent( QEvent* );
|
void enterEvent( QEvent* );
|
||||||
@ -119,6 +122,8 @@ private:
|
|||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
|
bool myIsApplyAndClose;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -28,12 +28,14 @@
|
|||||||
#include "SMESH_LogicalFilter.hxx"
|
#include "SMESH_LogicalFilter.hxx"
|
||||||
|
|
||||||
// SALOME GUI includes
|
// SALOME GUI includes
|
||||||
|
#include <LightApp_Application.h>
|
||||||
#include <LightApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include <LightApp_UpdateFlags.h>
|
#include <LightApp_UpdateFlags.h>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
#include <SUIT_Desktop.h>
|
#include <SUIT_Desktop.h>
|
||||||
#include <SUIT_MessageBox.h>
|
#include <SUIT_MessageBox.h>
|
||||||
#include <SUIT_OverrideCursor.h>
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
#include <SUIT_Session.h>
|
||||||
#include <SVTK_ViewModel.h>
|
#include <SVTK_ViewModel.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
@ -337,7 +339,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SMESHGUI_Make2DFrom3DOp::compute2DMesh()
|
bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
|
||||||
{
|
{
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
|
|
||||||
@ -373,6 +375,8 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh()
|
|||||||
tr("SMESH_INFORMATION"),
|
tr("SMESH_INFORMATION"),
|
||||||
tr("NB_ADDED").arg( nbAdded ));
|
tr("NB_ADDED").arg( nbAdded ));
|
||||||
if ( !newMesh->_is_nil() ) {
|
if ( !newMesh->_is_nil() ) {
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) )
|
||||||
|
theEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
newMesh->UnRegister();
|
newMesh->UnRegister();
|
||||||
#endif
|
#endif
|
||||||
@ -403,9 +407,10 @@ bool SMESHGUI_Make2DFrom3DOp::onApply()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList anEntryList;
|
||||||
bool res = false;
|
bool res = false;
|
||||||
try {
|
try {
|
||||||
res = compute2DMesh();
|
res = compute2DMesh( anEntryList );
|
||||||
}
|
}
|
||||||
catch ( const SALOME::SALOME_Exception& S_ex ) {
|
catch ( const SALOME::SALOME_Exception& S_ex ) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException( S_ex );
|
SalomeApp_Tools::QtCatchCorbaException( S_ex );
|
||||||
@ -416,6 +421,9 @@ bool SMESHGUI_Make2DFrom3DOp::onApply()
|
|||||||
if ( res ) {
|
if ( res ) {
|
||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
update( UF_ObjBrowser | UF_Model );
|
update( UF_ObjBrowser | UF_Model );
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
myDlg->setNewMeshName( SMESH::UniqueName( "Mesh_1" ) );
|
myDlg->setNewMeshName( SMESH::UniqueName( "Mesh_1" ) );
|
||||||
myDlg->setGroupName( SMESH::UniqueName( "Group" ) );
|
myDlg->setGroupName( SMESH::UniqueName( "Group" ) );
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ protected slots:
|
|||||||
void onModeChanged();
|
void onModeChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool compute2DMesh();
|
bool compute2DMesh( QStringList& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SMESH::SMESH_Mesh_var mySrcMesh;
|
SMESH::SMESH_Mesh_var mySrcMesh;
|
||||||
|
@ -45,10 +45,12 @@
|
|||||||
// SALOME GUI includes
|
// SALOME GUI includes
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_Application.h>
|
||||||
#include <LightApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include <LightApp_UpdateFlags.h>
|
#include <LightApp_UpdateFlags.h>
|
||||||
#include <SUIT_MessageBox.h>
|
#include <SUIT_MessageBox.h>
|
||||||
#include <SUIT_OverrideCursor.h>
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
#include <SUIT_Session.h>
|
||||||
#include <SALOME_InteractiveObject.hxx>
|
#include <SALOME_InteractiveObject.hxx>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
|
|
||||||
@ -146,16 +148,20 @@ bool SMESHGUI_MeshOp::onApply()
|
|||||||
aMess = "";
|
aMess = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
QStringList anEntryList;
|
||||||
if ( myToCreate && myIsMesh )
|
if ( myToCreate && myIsMesh )
|
||||||
aResult = createMesh( aMess );
|
aResult = createMesh( aMess, anEntryList );
|
||||||
if ( myToCreate && !myIsMesh )
|
if ( myToCreate && !myIsMesh )
|
||||||
aResult = createSubMesh( aMess );
|
aResult = createSubMesh( aMess, anEntryList );
|
||||||
else if ( !myToCreate )
|
else if ( !myToCreate )
|
||||||
aResult = editMeshOrSubMesh( aMess );
|
aResult = editMeshOrSubMesh( aMess );
|
||||||
if ( aResult )
|
if ( aResult )
|
||||||
{
|
{
|
||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
update( UF_ObjBrowser | UF_Model );
|
update( UF_ObjBrowser | UF_Model );
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
myObjectToSelect = anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( const SALOME::SALOME_Exception& S_ex )
|
catch ( const SALOME::SALOME_Exception& S_ex )
|
||||||
@ -246,6 +252,30 @@ void SMESHGUI_MeshOp::startOperation()
|
|||||||
selectionDone();
|
selectionDone();
|
||||||
|
|
||||||
myIgnoreAlgoSelection = false;
|
myIgnoreAlgoSelection = false;
|
||||||
|
|
||||||
|
myObjectToSelect.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Selects a recently created mesh or sub-mesh if necessary
|
||||||
|
*
|
||||||
|
* Virtual method redefined from base class called when operation is commited
|
||||||
|
* selects a recently created mesh or sub-mesh if necessary. Allows to perform
|
||||||
|
* selection when the custom selection filters are removed.
|
||||||
|
*/
|
||||||
|
//=================================================================================
|
||||||
|
void SMESHGUI_MeshOp::commitOperation()
|
||||||
|
{
|
||||||
|
SMESHGUI_SelectionOp::commitOperation();
|
||||||
|
|
||||||
|
if ( !myObjectToSelect.isEmpty() ) {
|
||||||
|
if ( LightApp_SelectionMgr* aSelectionMgr = selectionMgr() ) {
|
||||||
|
SUIT_DataOwnerPtrList aList;
|
||||||
|
aList.append( new LightApp_DataOwner( myObjectToSelect ) );
|
||||||
|
aSelectionMgr->setSelected( aList );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -1558,12 +1588,13 @@ void SMESHGUI_MeshOp::processSet()
|
|||||||
/*!
|
/*!
|
||||||
* \brief Creates mesh
|
* \brief Creates mesh
|
||||||
* \param theMess - Output parameter intended for returning error message
|
* \param theMess - Output parameter intended for returning error message
|
||||||
|
* \param theEntryList - List of entries of published objects
|
||||||
* \retval bool - TRUE if mesh is created, FALSE otherwise
|
* \retval bool - TRUE if mesh is created, FALSE otherwise
|
||||||
*
|
*
|
||||||
* Creates mesh
|
* Creates mesh
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
bool SMESHGUI_MeshOp::createMesh( QString& theMess )
|
bool SMESHGUI_MeshOp::createMesh( QString& theMess, QStringList& theEntryList )
|
||||||
{
|
{
|
||||||
theMess = "";
|
theMess = "";
|
||||||
|
|
||||||
@ -1591,8 +1622,10 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess )
|
|||||||
if ( aMeshVar->_is_nil() )
|
if ( aMeshVar->_is_nil() )
|
||||||
return false;
|
return false;
|
||||||
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar.in() );
|
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar.in() );
|
||||||
if ( aMeshSO )
|
if ( aMeshSO ) {
|
||||||
SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ) );
|
SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ) );
|
||||||
|
theEntryList.append( aMeshSO->GetID().c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ ) {
|
for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ ) {
|
||||||
if ( !isAccessibleDim( aDim )) continue;
|
if ( !isAccessibleDim( aDim )) continue;
|
||||||
@ -1626,12 +1659,13 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess )
|
|||||||
/*!
|
/*!
|
||||||
* \brief Creates sub-mesh
|
* \brief Creates sub-mesh
|
||||||
* \param theMess - Output parameter intended for returning error message
|
* \param theMess - Output parameter intended for returning error message
|
||||||
|
* \param theEntryList - List of entries of published objects
|
||||||
* \retval bool - TRUE if sub-mesh is created, FALSE otherwise
|
* \retval bool - TRUE if sub-mesh is created, FALSE otherwise
|
||||||
*
|
*
|
||||||
* Creates sub-mesh
|
* Creates sub-mesh
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
bool SMESHGUI_MeshOp::createSubMesh( QString& theMess )
|
bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList )
|
||||||
{
|
{
|
||||||
theMess = "";
|
theMess = "";
|
||||||
|
|
||||||
@ -1721,8 +1755,10 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess )
|
|||||||
// create sub-mesh
|
// create sub-mesh
|
||||||
SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.toLatin1().data() );
|
SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.toLatin1().data() );
|
||||||
_PTR(SObject) aSubMeshSO = SMESH::FindSObject( aSubMeshVar.in() );
|
_PTR(SObject) aSubMeshSO = SMESH::FindSObject( aSubMeshVar.in() );
|
||||||
if ( aSubMeshSO )
|
if ( aSubMeshSO ) {
|
||||||
SMESH::SetName( aSubMeshSO, aName.toLatin1().data() );
|
SMESH::SetName( aSubMeshSO, aName.toLatin1().data() );
|
||||||
|
theEntryList.append( aSubMeshSO->GetID().c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ )
|
for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ )
|
||||||
{
|
{
|
||||||
|
@ -66,6 +66,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void startOperation();
|
virtual void startOperation();
|
||||||
|
virtual void commitOperation();
|
||||||
virtual void selectionDone();
|
virtual void selectionDone();
|
||||||
virtual SUIT_SelectionFilter* createFilter( const int ) const;
|
virtual SUIT_SelectionFilter* createFilter( const int ) const;
|
||||||
virtual bool isValid( SUIT_Operation* ) const;
|
virtual bool isValid( SUIT_Operation* ) const;
|
||||||
@ -105,8 +106,8 @@ private:
|
|||||||
void createHypothesis( const int, const int,
|
void createHypothesis( const int, const int,
|
||||||
const QString& );
|
const QString& );
|
||||||
|
|
||||||
bool createMesh( QString& );
|
bool createMesh( QString&, QStringList& );
|
||||||
bool createSubMesh( QString& );
|
bool createSubMesh( QString&, QStringList& );
|
||||||
bool editMeshOrSubMesh( QString& );
|
bool editMeshOrSubMesh( QString& );
|
||||||
|
|
||||||
int currentHyp( const int, const int ) const;
|
int currentHyp( const int, const int ) const;
|
||||||
@ -142,6 +143,8 @@ private:
|
|||||||
bool myIgnoreAlgoSelection;
|
bool myIgnoreAlgoSelection;
|
||||||
HypothesesSet* myHypoSet;
|
HypothesesSet* myHypoSet;
|
||||||
int myDim, myType;
|
int myDim, myType;
|
||||||
|
|
||||||
|
QString myObjectToSelect;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_MESHOP_H
|
#endif // SMESHGUI_MESHOP_H
|
||||||
|
@ -50,7 +50,8 @@
|
|||||||
// Purpose : Constructor
|
// Purpose : Constructor
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESHGUI_Operation::SMESHGUI_Operation()
|
SMESHGUI_Operation::SMESHGUI_Operation()
|
||||||
: LightApp_Operation()
|
: LightApp_Operation(),
|
||||||
|
myIsApplyAndClose( false )
|
||||||
{
|
{
|
||||||
myHelpFileName = "";
|
myHelpFileName = "";
|
||||||
}
|
}
|
||||||
@ -158,8 +159,10 @@ _PTR(Study) SMESHGUI_Operation::studyDS() const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMESHGUI_Operation::onOk()
|
void SMESHGUI_Operation::onOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if( onApply() )
|
if( onApply() )
|
||||||
commit();
|
commit();
|
||||||
|
setIsApplyAndClose( false );
|
||||||
//else
|
//else
|
||||||
// abort();
|
// abort();
|
||||||
}
|
}
|
||||||
@ -214,6 +217,26 @@ void SMESHGUI_Operation::initDialog()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// name : setIsApplyAndClose
|
||||||
|
// Purpose : Set value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
void SMESHGUI_Operation::setIsApplyAndClose( const bool theFlag )
|
||||||
|
{
|
||||||
|
myIsApplyAndClose = theFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// name : isApplyAndClose
|
||||||
|
// Purpose : Get value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
bool SMESHGUI_Operation::isApplyAndClose() const
|
||||||
|
{
|
||||||
|
return myIsApplyAndClose;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Verifies whether study of operation is locked
|
* \brief Verifies whether study of operation is locked
|
||||||
* \param theMess - specifies whether message box must be shown if study is locked
|
* \param theMess - specifies whether message box must be shown if study is locked
|
||||||
|
@ -58,6 +58,9 @@ protected:
|
|||||||
virtual void startOperation();
|
virtual void startOperation();
|
||||||
virtual bool isReadyToStart() const;
|
virtual bool isReadyToStart() const;
|
||||||
|
|
||||||
|
virtual void setIsApplyAndClose( const bool theFlag );
|
||||||
|
virtual bool isApplyAndClose() const;
|
||||||
|
|
||||||
//! Set according dialog active or inactive
|
//! Set according dialog active or inactive
|
||||||
virtual void setDialogActive( const bool );
|
virtual void setDialogActive( const bool );
|
||||||
|
|
||||||
@ -69,6 +72,7 @@ protected:
|
|||||||
virtual bool isValid( SUIT_Operation* ) const;
|
virtual bool isValid( SUIT_Operation* ) const;
|
||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
bool myIsApplyAndClose;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void onOk();
|
virtual void onOk();
|
||||||
|
@ -46,7 +46,9 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
|
SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
|
||||||
mySMESHGUI(theModule),
|
mySMESHGUI(theModule),
|
||||||
QDialog(SMESH::GetDesktop( theModule )) {
|
QDialog(SMESH::GetDesktop( theModule )),
|
||||||
|
myIsApplyAndClose( false )
|
||||||
|
{
|
||||||
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
|
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,3 +103,23 @@ void SMESHGUI_PreviewDlg::toDisplaySimulation() {
|
|||||||
void SMESHGUI_PreviewDlg::onDisplaySimulation(bool toDisplayPreview) {
|
void SMESHGUI_PreviewDlg::onDisplaySimulation(bool toDisplayPreview) {
|
||||||
//Empty implementation here
|
//Empty implementation here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : setIsApplyAndClose
|
||||||
|
// Purpose : Set value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
void SMESHGUI_PreviewDlg::setIsApplyAndClose( const bool theFlag )
|
||||||
|
{
|
||||||
|
myIsApplyAndClose = theFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : isApplyAndClose
|
||||||
|
// Purpose : Get value of the flag indicating that the dialog is
|
||||||
|
// accepted by Apply & Close button
|
||||||
|
//================================================================
|
||||||
|
bool SMESHGUI_PreviewDlg::isApplyAndClose() const
|
||||||
|
{
|
||||||
|
return myIsApplyAndClose;
|
||||||
|
}
|
||||||
|
@ -49,6 +49,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void connectPreviewControl();
|
void connectPreviewControl();
|
||||||
|
|
||||||
|
virtual void setIsApplyAndClose( const bool theFlag );
|
||||||
|
virtual bool isApplyAndClose() const;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void toDisplaySimulation();
|
void toDisplaySimulation();
|
||||||
virtual void onDisplaySimulation( bool );
|
virtual void onDisplaySimulation( bool );
|
||||||
@ -58,6 +61,7 @@ protected:
|
|||||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||||
SMESHGUI_MeshEditPreview* mySimulation;
|
SMESHGUI_MeshEditPreview* mySimulation;
|
||||||
QCheckBox* myPreviewCheckBox;
|
QCheckBox* myPreviewCheckBox;
|
||||||
|
bool myIsApplyAndClose;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -430,6 +430,7 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
|
|
||||||
int actionButton = ActionGroup->checkedId();
|
int actionButton = ActionGroup->checkedId();
|
||||||
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
|
QStringList anEntryList;
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
@ -469,6 +470,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
if (!mesh->_is_nil()) {
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
// obj has been published in study. Its refcount has been incremented.
|
// obj has been published in study. Its refcount has been incremented.
|
||||||
// It is safe to decrement its refcount
|
// It is safe to decrement its refcount
|
||||||
@ -484,8 +487,12 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
||||||
actionButton == MAKE_MESH_BUTTON )
|
actionButton == MAKE_MESH_BUTTON ) {
|
||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
}
|
||||||
Init(false);
|
Init(false);
|
||||||
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
@ -502,6 +509,7 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RotationDlg::ClickOnOk()
|
void SMESHGUI_RotationDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if( ClickOnApply() )
|
if( ClickOnApply() )
|
||||||
ClickOnCancel();
|
ClickOnCancel();
|
||||||
}
|
}
|
||||||
|
@ -472,6 +472,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
|
|
||||||
int actionButton = ActionGroup->checkedId();
|
int actionButton = ActionGroup->checkedId();
|
||||||
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
|
QStringList anEntryList;
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
@ -505,6 +506,8 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
if (!mesh->_is_nil()) {
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
// obj has been published in study. Its refcount has been incremented.
|
// obj has been published in study. Its refcount has been incremented.
|
||||||
// It is safe to decrement its refcount
|
// It is safe to decrement its refcount
|
||||||
@ -520,8 +523,12 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
||||||
actionButton == MAKE_MESH_BUTTON )
|
actionButton == MAKE_MESH_BUTTON ) {
|
||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
}
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
@ -539,6 +546,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_ScaleDlg::ClickOnOk()
|
void SMESHGUI_ScaleDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if( ClickOnApply() )
|
if( ClickOnApply() )
|
||||||
ClickOnCancel();
|
ClickOnCancel();
|
||||||
}
|
}
|
||||||
|
@ -494,7 +494,7 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
|
|
||||||
int actionButton = ActionGroup->checkedId();
|
int actionButton = ActionGroup->checkedId();
|
||||||
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
|
QStringList anEntryList;
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
@ -538,6 +538,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
if (!mesh->_is_nil()) {
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
// obj has been published in study. Its refcount has been incremented.
|
// obj has been published in study. Its refcount has been incremented.
|
||||||
// It is safe to decrement its refcount
|
// It is safe to decrement its refcount
|
||||||
@ -553,8 +555,12 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
||||||
actionButton == MAKE_MESH_BUTTON )
|
actionButton == MAKE_MESH_BUTTON ) {
|
||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
}
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
@ -571,6 +577,7 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_SymmetryDlg::ClickOnOk()
|
void SMESHGUI_SymmetryDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if( ClickOnApply() )
|
if( ClickOnApply() )
|
||||||
ClickOnCancel();
|
ClickOnCancel();
|
||||||
}
|
}
|
||||||
|
@ -504,6 +504,7 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
|
|
||||||
int actionButton = ActionGroup->checkedId();
|
int actionButton = ActionGroup->checkedId();
|
||||||
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
|
QStringList anEntryList;
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
@ -543,6 +544,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
if (!mesh->_is_nil()) {
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
// obj has been published in study. Its refcount has been incremented.
|
// obj has been published in study. Its refcount has been incremented.
|
||||||
// It is safe to decrement its refcount
|
// It is safe to decrement its refcount
|
||||||
@ -556,8 +559,13 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
|
||||||
actionButton == MAKE_MESH_BUTTON )
|
actionButton == MAKE_MESH_BUTTON ) {
|
||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
|
if( LightApp_Application* anApp =
|
||||||
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
|
anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
}
|
||||||
|
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
@ -575,6 +583,7 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_TranslationDlg::ClickOnOk()
|
void SMESHGUI_TranslationDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
|
setIsApplyAndClose( true );
|
||||||
if( ClickOnApply() )
|
if( ClickOnApply() )
|
||||||
ClickOnCancel();
|
ClickOnCancel();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user