mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-31 04:30:33 +05:00
PAL9524 - unassign a hypothesis when Edit/Delete called for it
This commit is contained in:
parent
dc3a0a1310
commit
452107403b
@ -767,7 +767,7 @@ namespace{
|
|||||||
if(!obj->_is_nil()){
|
if(!obj->_is_nil()){
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(obj->GetObject());
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(obj->GetObject());
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(obj->GetObject());
|
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(obj->GetObject());
|
||||||
|
QString objType = CheckTypeObject(IObject);
|
||||||
if ( !aGroup->_is_nil() ) { // DELETE GROUP
|
if ( !aGroup->_is_nil() ) { // DELETE GROUP
|
||||||
SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh();
|
SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh();
|
||||||
aMesh->RemoveGroup( aGroup );
|
aMesh->RemoveGroup( aGroup );
|
||||||
@ -776,6 +776,10 @@ namespace{
|
|||||||
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
|
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
|
||||||
aMesh->RemoveSubMesh( aSubMesh );
|
aMesh->RemoveSubMesh( aSubMesh );
|
||||||
}
|
}
|
||||||
|
else if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS
|
||||||
|
SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
|
||||||
|
aStudyBuilder->RemoveObjectWithChildren( obj );
|
||||||
|
}
|
||||||
else {// default action: remove SObject from the study
|
else {// default action: remove SObject from the study
|
||||||
// san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH
|
// san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH
|
||||||
//QAD_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy);
|
//QAD_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy);
|
||||||
|
@ -411,10 +411,11 @@ namespace SMESH{
|
|||||||
int res = SMESH::HYP_UNKNOWN_FATAL;
|
int res = SMESH::HYP_UNKNOWN_FATAL;
|
||||||
QAD_WaitCursor wc;
|
QAD_WaitCursor wc;
|
||||||
|
|
||||||
if (IObject->hasReference()) {
|
try {
|
||||||
try {
|
SALOMEDS::Study_var aStudy = GetActiveStudyDocument();
|
||||||
SALOMEDS::Study_var aStudy = GetActiveStudyDocument();
|
SMESH_Hypothesis_var anHyp = IObjectToInterface<SMESH_Hypothesis>(IObject);
|
||||||
SMESH_Hypothesis_var anHyp = IObjectToInterface<SMESH_Hypothesis>(IObject);
|
if (IObject->hasReference())
|
||||||
|
{
|
||||||
SALOMEDS::SObject_var aHypSObj = aStudy->FindObjectID(IObject->getReference());
|
SALOMEDS::SObject_var aHypSObj = aStudy->FindObjectID(IObject->getReference());
|
||||||
if (!aHypSObj->_is_nil()) {
|
if (!aHypSObj->_is_nil()) {
|
||||||
SALOMEDS::SObject_var MorSM = SMESH::GetMeshOrSubmesh(aHypSObj);
|
SALOMEDS::SObject_var MorSM = SMESH::GetMeshOrSubmesh(aHypSObj);
|
||||||
@ -446,14 +447,31 @@ namespace SMESH{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( const SALOME::SALOME_Exception& S_ex ) {
|
else if (IObject->hasEntry())
|
||||||
wc.stop();
|
{
|
||||||
QtCatchCorbaException( S_ex );
|
if(MYDEBUG) MESSAGE("IObject entry " << IObject->getEntry());
|
||||||
res = SMESH::HYP_UNKNOWN_FATAL;
|
SALOMEDS::Study::ListOfSObject_var meshList = GetMeshesUsingAlgoOrHypothesis(anHyp);
|
||||||
|
for ( int i = 0; i < meshList->length(); ++i ) {
|
||||||
|
SMESH::SMESH_Mesh_var aMesh =
|
||||||
|
SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( meshList[ i ]);
|
||||||
|
GEOM::GEOM_Object_var aShape = SMESH::GetShapeOnMeshOrSubMesh( meshList[ i ]);
|
||||||
|
if ( ! aMesh->_is_nil() && !aShape->_is_nil() ) {
|
||||||
|
res = aMesh->RemoveHypothesis(aShape, anHyp);
|
||||||
|
if ( res < SMESH::HYP_UNKNOWN_FATAL )
|
||||||
|
SMESH::ModifiedMesh( meshList[ i ], false);
|
||||||
|
if ( res > SMESH::HYP_OK ) {
|
||||||
|
wc.stop();
|
||||||
|
processHypothesisStatus( res, anHyp, false );
|
||||||
|
wc.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IObject->hasEntry()) {
|
catch( const SALOME::SALOME_Exception& S_ex ) {
|
||||||
if(MYDEBUG) MESSAGE("IObject entry " << IObject->getEntry());
|
wc.stop();
|
||||||
|
QtCatchCorbaException( S_ex );
|
||||||
|
res = SMESH::HYP_UNKNOWN_FATAL;
|
||||||
}
|
}
|
||||||
return res < SMESH::HYP_UNKNOWN_FATAL;
|
return res < SMESH::HYP_UNKNOWN_FATAL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user