mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-15 11:20:35 +05:00
PAL13473 (Build repetitive mesh):
1) desable myDlg when edit/create a hyp as now dlg of MESHGUI_GenericHypothesisCreator is non modal 2) fix pb that changing algo MEFISTO+hyp -> Quad(mapping) does not unassign hyp of MEFISTO
This commit is contained in:
parent
6bd62e2312
commit
b6766b8ebd
@ -401,7 +401,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
void SMESHGUI_MeshOp::selectionDone()
|
void SMESHGUI_MeshOp::selectionDone()
|
||||||
{
|
{
|
||||||
if ( !dlg()->isShown() )
|
if ( !dlg()->isShown() || !myDlg->isEnabled() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SMESHGUI_SelectionOp::selectionDone();
|
SMESHGUI_SelectionOp::selectionDone();
|
||||||
@ -904,7 +904,9 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim,
|
|||||||
// with values used to mesh a subshape
|
// with values used to mesh a subshape
|
||||||
SMESH::SMESH_Hypothesis_var initParamHyp =
|
SMESH::SMESH_Hypothesis_var initParamHyp =
|
||||||
getInitParamsHypothesis(theTypeName, aData->ServerLibName);
|
getInitParamsHypothesis(theTypeName, aData->ServerLibName);
|
||||||
|
myDlg->setEnabled( false );
|
||||||
aCreator->create(initParamHyp, myDlg);
|
aCreator->create(initParamHyp, myDlg);
|
||||||
|
myDlg->setEnabled( true );
|
||||||
} else {
|
} else {
|
||||||
SMESH::CreateHypothesis(theTypeName, aData->Label, false);
|
SMESH::CreateHypothesis(theTypeName, aData->Label, false);
|
||||||
}
|
}
|
||||||
@ -947,8 +949,11 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
|
|||||||
|
|
||||||
char* aTypeName = aHyp->GetName();
|
char* aTypeName = aHyp->GetName();
|
||||||
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aTypeName );
|
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aTypeName );
|
||||||
if ( aCreator )
|
if ( aCreator ) {
|
||||||
|
myDlg->setEnabled( false );
|
||||||
aCreator->edit( aHyp.in(), dlg() );
|
aCreator->edit( aHyp.in(), dlg() );
|
||||||
|
myDlg->setEnabled( true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -1756,36 +1761,39 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )
|
|||||||
{
|
{
|
||||||
int aNewHypIndex = currentHyp( dim, hypType );
|
int aNewHypIndex = currentHyp( dim, hypType );
|
||||||
int anOldHypIndex = -1;
|
int anOldHypIndex = -1;
|
||||||
|
|
||||||
|
// remove old hypotheses
|
||||||
if ( myObjHyps[ dim ][ hypType ].count() > 0 )
|
if ( myObjHyps[ dim ][ hypType ].count() > 0 )
|
||||||
|
{
|
||||||
anOldHypIndex = find( myObjHyps[ dim ][ hypType ].first(),
|
anOldHypIndex = find( myObjHyps[ dim ][ hypType ].first(),
|
||||||
myExistingHyps[ dim ][ hypType ] );
|
myExistingHyps[ dim ][ hypType ] );
|
||||||
if ( aNewHypIndex != anOldHypIndex )
|
if ( aNewHypIndex != anOldHypIndex || // different hyps
|
||||||
|
anOldHypIndex == -1 ) // hyps of different algos
|
||||||
{
|
{
|
||||||
// remove old hypotheses
|
SMESH::RemoveHypothesisOrAlgorithmOnMesh
|
||||||
if ( anOldHypIndex >= 0 ) {
|
( pObj, myObjHyps[ dim ][ hypType ].first() );
|
||||||
SMESH::RemoveHypothesisOrAlgorithmOnMesh(
|
|
||||||
pObj, myExistingHyps[ dim ][ hypType ][ anOldHypIndex ] );
|
|
||||||
myObjHyps[ dim ][ hypType ].clear();
|
myObjHyps[ dim ][ hypType ].clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// assign new hypotheses
|
// assign new hypotheses
|
||||||
if ( aNewHypIndex != -1 )
|
if ( aNewHypIndex != anOldHypIndex && aNewHypIndex != -1 )
|
||||||
{
|
{
|
||||||
SMESH::SMESH_Mesh_var aMeshVar =
|
SMESH::SMESH_Mesh_var aMeshVar =
|
||||||
SMESH::SMESH_Mesh::_narrow( _CAST(SObject,pObj)->GetObject() );
|
SMESH::SMESH_Mesh::_narrow( _CAST(SObject,pObj)->GetObject() );
|
||||||
bool isMesh = !aMeshVar->_is_nil();
|
bool isMesh = !aMeshVar->_is_nil();
|
||||||
if ( isMesh )
|
if ( isMesh )
|
||||||
{
|
{
|
||||||
SMESH::AddHypothesisOnMesh(
|
SMESH::AddHypothesisOnMesh
|
||||||
aMeshVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] );
|
(aMeshVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SMESH::SMESH_subMesh_var aVar =
|
SMESH::SMESH_subMesh_var aVar =
|
||||||
SMESH::SMESH_subMesh::_narrow( _CAST(SObject,pObj)->GetObject() );
|
SMESH::SMESH_subMesh::_narrow( _CAST(SObject,pObj)->GetObject() );
|
||||||
if ( !aVar->_is_nil() )
|
if ( !aVar->_is_nil() )
|
||||||
SMESH::AddHypothesisOnSubMesh(
|
SMESH::AddHypothesisOnSubMesh
|
||||||
aVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] );
|
( aVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// reread all hypotheses of mesh if necessary
|
// reread all hypotheses of mesh if necessary
|
||||||
@ -1793,7 +1801,6 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )
|
|||||||
existingHyps( dim, hypType, pObj, anExisting, myObjHyps[ dim ][ hypType ] );
|
existingHyps( dim, hypType, pObj, anExisting, myObjHyps[ dim ][ hypType ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user