mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-28 11:30:33 +05:00
Don't drop the control mode when a mesh becomes empty
+ Update mesh when unassign hypothesis
This commit is contained in:
parent
55a627cc62
commit
a3b465189d
@ -817,7 +817,8 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
|
|||||||
if( !mgr )
|
if( !mgr )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myControlMode = eNone;
|
//myControlMode = eNone;
|
||||||
|
myControlMode = theMode;
|
||||||
theCheckEntityMode &= mgr->booleanValue( "SMESH", "display_entity", false );
|
theCheckEntityMode &= mgr->booleanValue( "SMESH", "display_entity", false );
|
||||||
|
|
||||||
my0DActor->GetMapper()->SetScalarVisibility(false);
|
my0DActor->GetMapper()->SetScalarVisibility(false);
|
||||||
@ -1003,7 +1004,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
|
|||||||
int aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0;
|
int aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0;
|
||||||
bool aShowOnlyScalarBarTitle = false;
|
bool aShowOnlyScalarBarTitle = false;
|
||||||
if(aNbCells) {
|
if(aNbCells) {
|
||||||
myControlMode = theMode;
|
//myControlMode = theMode;
|
||||||
switch(myControlMode){
|
switch(myControlMode){
|
||||||
case eFreeNodes:
|
case eFreeNodes:
|
||||||
case eCoincidentNodes:
|
case eCoincidentNodes:
|
||||||
@ -1097,7 +1098,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
|
|||||||
if (isLogarithmic && range[0] > 1e-07 && range[1] > 1e-07)
|
if (isLogarithmic && range[0] > 1e-07 && range[1] > 1e-07)
|
||||||
lookupTable->SetScale(VTK_SCALE_LOG10);
|
lookupTable->SetScale(VTK_SCALE_LOG10);
|
||||||
|
|
||||||
Update();
|
//Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SMESH_ActorDef::GetNumberControlEntities()
|
int SMESH_ActorDef::GetNumberControlEntities()
|
||||||
|
@ -319,11 +319,10 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
|
|||||||
_PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
|
_PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
|
||||||
SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
|
SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
|
||||||
SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() );
|
SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() );
|
||||||
if( actor ) {
|
if( actor && actor->GetVisibility() )
|
||||||
actor->Update();
|
actor->Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
|
SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
|
||||||
myHypo->UnRegister();
|
myHypo->UnRegister();
|
||||||
myHypo = SMESH::SMESH_Hypothesis::_nil();
|
myHypo = SMESH::SMESH_Hypothesis::_nil();
|
||||||
|
@ -28,10 +28,13 @@
|
|||||||
#include "SMESHGUI_HypothesesUtils.h"
|
#include "SMESHGUI_HypothesesUtils.h"
|
||||||
|
|
||||||
#include "SMESHGUI.h"
|
#include "SMESHGUI.h"
|
||||||
#include "SMESHGUI_Hypotheses.h"
|
|
||||||
#include "SMESHGUI_XmlHandler.h"
|
|
||||||
#include "SMESHGUI_Utils.h"
|
|
||||||
#include "SMESHGUI_GEOMGenUtils.h"
|
#include "SMESHGUI_GEOMGenUtils.h"
|
||||||
|
#include "SMESHGUI_Hypotheses.h"
|
||||||
|
#include "SMESHGUI_Utils.h"
|
||||||
|
#include "SMESHGUI_VTKUtils.h"
|
||||||
|
#include "SMESHGUI_XmlHandler.h"
|
||||||
|
|
||||||
|
#include "SMESH_Actor.h"
|
||||||
|
|
||||||
// SALOME GUI includes
|
// SALOME GUI includes
|
||||||
#include <SUIT_Desktop.h>
|
#include <SUIT_Desktop.h>
|
||||||
@ -745,26 +748,24 @@ namespace SMESH
|
|||||||
if (!aMesh->_is_nil()) {
|
if (!aMesh->_is_nil()) {
|
||||||
if (aMesh->HasShapeToMesh() && !aShapeObject->_is_nil()) {
|
if (aMesh->HasShapeToMesh() && !aShapeObject->_is_nil()) {
|
||||||
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
|
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
|
||||||
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
|
||||||
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
|
|
||||||
if (meshSO)
|
|
||||||
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(!aMesh->HasShapeToMesh()){
|
else if(!aMesh->HasShapeToMesh()){
|
||||||
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
|
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
|
||||||
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
|
||||||
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
|
|
||||||
if (meshSO)
|
|
||||||
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (res > SMESH::HYP_OK) {
|
if (res > SMESH::HYP_OK) {
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
processHypothesisStatus(res, anHyp, false);
|
processHypothesisStatus(res, anHyp, false);
|
||||||
wc.resume();
|
wc.resume();
|
||||||
}
|
}
|
||||||
|
if ( _PTR(SObject) meshSO = SMESH::FindSObject(aMesh) )
|
||||||
|
{
|
||||||
|
if ( res < SMESH::HYP_UNKNOWN_FATAL )
|
||||||
|
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
|
||||||
|
|
||||||
|
if ( SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() ))
|
||||||
|
if( actor->GetVisibility() )
|
||||||
|
actor->Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch(const SALOME::SALOME_Exception& S_ex) {
|
} catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
|
Loading…
Reference in New Issue
Block a user