mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-25 04:30:34 +05:00
IPAL53919: Pb with nodes after element removal
This commit is contained in:
parent
2e5f78b7d2
commit
b99e203236
@ -126,6 +126,7 @@ SMESH_ActorDef::SMESH_ActorDef()
|
||||
|
||||
myIsPointsVisible = false;
|
||||
myIsEntityModeCache = false;
|
||||
myRepresentationCache = 0;
|
||||
|
||||
myHighlightActor = SMESH_SVTKActor::New();
|
||||
myHighlightActor->Delete(); // vtkSmartPointer!
|
||||
@ -1559,30 +1560,30 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation)
|
||||
|
||||
void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
||||
{
|
||||
myEntityState = eAllEntity; // entities present in my object
|
||||
unsigned int anObjectEntities = eAllEntity; // entities present in my object
|
||||
|
||||
if(!myVisualObj->GetNbEntities(SMDSAbs_0DElement)) {
|
||||
myEntityState &= ~e0DElements;
|
||||
anObjectEntities &= ~e0DElements;
|
||||
theMode &= ~e0DElements;
|
||||
}
|
||||
|
||||
if(!myVisualObj->GetNbEntities(SMDSAbs_Ball)) {
|
||||
myEntityState &= ~eBallElem;
|
||||
anObjectEntities &= ~eBallElem;
|
||||
theMode &= ~eBallElem;
|
||||
}
|
||||
|
||||
if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)) {
|
||||
myEntityState &= ~eEdges;
|
||||
anObjectEntities &= ~eEdges;
|
||||
theMode &= ~eEdges;
|
||||
}
|
||||
|
||||
if(!myVisualObj->GetNbEntities(SMDSAbs_Face)) {
|
||||
myEntityState &= ~eFaces;
|
||||
anObjectEntities &= ~eFaces;
|
||||
theMode &= ~eFaces;
|
||||
}
|
||||
|
||||
if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)) {
|
||||
myEntityState &= ~eVolumes;
|
||||
anObjectEntities &= ~eVolumes;
|
||||
theMode &= ~eVolumes;
|
||||
}
|
||||
|
||||
@ -1603,34 +1604,39 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
||||
theMode |= eVolumes;
|
||||
}
|
||||
|
||||
myBaseActor->myGeomFilter->SetInside(myEntityMode != myEntityState);
|
||||
myBaseActor->myGeomFilter->SetInside(myEntityMode != anObjectEntities);
|
||||
|
||||
if ( anObjectEntities == 0 && myRepresentation != ePoint ) // no elements, show nodes
|
||||
{
|
||||
myRepresentationCache = GetRepresentation();
|
||||
SetRepresentation( ePoint );
|
||||
}
|
||||
|
||||
if ( myEntityMode != theMode )
|
||||
{
|
||||
myEntityMode = theMode; // entities to show
|
||||
|
||||
VTKViewer_ExtractUnstructuredGrid* aFilter = myBaseActor->GetExtractUnstructuredGrid();
|
||||
aFilter->ClearRegisteredCellsWithType();
|
||||
VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
|
||||
aHightFilter->ClearRegisteredCellsWithType();
|
||||
// Set cell types to extract
|
||||
|
||||
bool isPassAll =
|
||||
(( myEntityMode & e0DElements || myVisualObj->GetNbEntities(SMDSAbs_0DElement) == 0 ) &&
|
||||
( myEntityMode & eBallElem || myVisualObj->GetNbEntities(SMDSAbs_Ball) == 0 ) &&
|
||||
( myEntityMode & eEdges || myVisualObj->GetNbEntities(SMDSAbs_Edge) == 0 ) &&
|
||||
( myEntityMode & eFaces || myVisualObj->GetNbEntities(SMDSAbs_Face) == 0 ) &&
|
||||
( myEntityMode & eVolumes || myVisualObj->GetNbEntities(SMDSAbs_Volume) == 0 ));
|
||||
if ( isPassAll && myEntityMode )
|
||||
VTKViewer_ExtractUnstructuredGrid* aFilter = myBaseActor->GetExtractUnstructuredGrid();
|
||||
VTKViewer_ExtractUnstructuredGrid* aHltFilter = myHighlitableActor->GetExtractUnstructuredGrid();
|
||||
aFilter->ClearRegisteredCellsWithType();
|
||||
aHltFilter->ClearRegisteredCellsWithType();
|
||||
|
||||
bool isPassAll = ( myEntityMode == anObjectEntities && myEntityMode );
|
||||
if ( isPassAll )
|
||||
{
|
||||
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
|
||||
aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
|
||||
aHltFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
|
||||
}
|
||||
else
|
||||
{
|
||||
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
||||
aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
||||
aHltFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
||||
|
||||
if (myEntityMode & e0DElements) {
|
||||
aFilter->RegisterCellsWithType(VTK_VERTEX);
|
||||
aHightFilter->RegisterCellsWithType(VTK_VERTEX);
|
||||
aHltFilter->RegisterCellsWithType(VTK_VERTEX);
|
||||
}
|
||||
|
||||
if (myEntityMode & eBallElem) {
|
||||
@ -1641,8 +1647,8 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
||||
aFilter->RegisterCellsWithType(VTK_LINE);
|
||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
|
||||
|
||||
aHightFilter->RegisterCellsWithType(VTK_LINE);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
|
||||
aHltFilter->RegisterCellsWithType(VTK_LINE);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
|
||||
}
|
||||
|
||||
if (myEntityMode & eFaces) {
|
||||
@ -1655,14 +1661,14 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
||||
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
|
||||
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
|
||||
|
||||
aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUAD);
|
||||
aHightFilter->RegisterCellsWithType(VTK_POLYGON);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
|
||||
aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
|
||||
aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
|
||||
aHltFilter->RegisterCellsWithType(VTK_TRIANGLE);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUAD);
|
||||
aHltFilter->RegisterCellsWithType(VTK_POLYGON);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
|
||||
aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
|
||||
aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
|
||||
}
|
||||
|
||||
if (myEntityMode & eVolumes) {
|
||||
@ -1680,25 +1686,27 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
||||
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
||||
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
||||
|
||||
aHightFilter->RegisterCellsWithType(VTK_TETRA);
|
||||
aHightFilter->RegisterCellsWithType(VTK_VOXEL);
|
||||
aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
|
||||
aHightFilter->RegisterCellsWithType(VTK_WEDGE);
|
||||
aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
|
||||
aHightFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
||||
aHightFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
||||
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
||||
aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
||||
aHightFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
||||
aHltFilter->RegisterCellsWithType(VTK_TETRA);
|
||||
aHltFilter->RegisterCellsWithType(VTK_VOXEL);
|
||||
aHltFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
|
||||
aHltFilter->RegisterCellsWithType(VTK_WEDGE);
|
||||
aHltFilter->RegisterCellsWithType(VTK_PYRAMID);
|
||||
aHltFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
||||
aHltFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
||||
aHltFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
||||
aHltFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
||||
}
|
||||
}
|
||||
if ( GetVisibility() )
|
||||
aFilter->Update();
|
||||
if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());
|
||||
SetVisibility(GetVisibility(),false);
|
||||
}
|
||||
|
||||
SetVisibility( GetVisibility(), myRepresentationCache != 0 );
|
||||
}
|
||||
|
||||
void SMESH_ActorDef::SetRepresentation (int theMode)
|
||||
@ -1709,6 +1717,15 @@ void SMESH_ActorDef::SetRepresentation (int theMode)
|
||||
int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
|
||||
int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
|
||||
|
||||
if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls )
|
||||
{
|
||||
theMode = myRepresentationCache;
|
||||
if ( theMode == eSurface && aNbFaces + aNbVolumes == 0 )
|
||||
theMode = eEdge;
|
||||
else
|
||||
myRepresentationCache = 0;
|
||||
}
|
||||
|
||||
if (theMode < 0) {
|
||||
myRepresentation = eSurface;
|
||||
if (!aNbFaces && !aNbVolumes && !aNbBalls && aNbEdges) {
|
||||
|
@ -295,8 +295,8 @@ class SMESH_ActorDef : public SMESH_Actor
|
||||
SMESH_DeviceActor* my0DExtActor;
|
||||
|
||||
unsigned int myEntityMode;
|
||||
unsigned int myEntityState;
|
||||
unsigned int myEntityModeCache;
|
||||
int myRepresentationCache;
|
||||
bool myIsEntityModeCache;
|
||||
bool myIsPointsVisible;
|
||||
|
||||
|
@ -714,6 +714,7 @@ SMESH_Mesh::AddHypothesis(const TopoDS_Shape & aSubShape,
|
||||
}
|
||||
}
|
||||
HasModificationsToDiscard(); // to reset _isModified flag if a mesh becomes empty
|
||||
GetMeshDS()->Modified();
|
||||
|
||||
if(MYDEBUG) subMesh->DumpAlgoState(true);
|
||||
if(MYDEBUG) SCRUTE(ret);
|
||||
@ -784,6 +785,7 @@ SMESH_Mesh::RemoveHypothesis(const TopoDS_Shape & aSubShape,
|
||||
}
|
||||
|
||||
HasModificationsToDiscard(); // to reset _isModified flag if mesh become empty
|
||||
GetMeshDS()->Modified();
|
||||
|
||||
if(MYDEBUG) subMesh->DumpAlgoState(true);
|
||||
if(MYDEBUG) SCRUTE(ret);
|
||||
|
@ -4493,7 +4493,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
popupMgr()->setRule( action( SMESHOp::OpDMShading ), "displayMode = 'eSurface'", QtxPopupMgr::ToggleRule );
|
||||
|
||||
popupMgr()->insert( action( SMESHOp::OpDMNodes ), anId, -1 );
|
||||
popupMgr()->setRule( action( SMESHOp::OpDMNodes ), aMeshInVTK + "&&" + hasNodes, QtxPopupMgr::VisibleRule );
|
||||
popupMgr()->setRule( action( SMESHOp::OpDMNodes ), aMeshInVTK + "&&" + hasNodes + "&&" + hasElems, QtxPopupMgr::VisibleRule );
|
||||
popupMgr()->setRule( action( SMESHOp::OpDMNodes ), "displayMode = 'ePoint'", QtxPopupMgr::ToggleRule );
|
||||
|
||||
popupMgr()->insert( separator(), anId, -1 );
|
||||
@ -4532,7 +4532,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
popupMgr()->insert( separator(), anId, -1 );
|
||||
|
||||
popupMgr()->insert( action( SMESHOp::OpDEChoose ), anId, -1 );
|
||||
popupMgr()->setRule( action( SMESHOp::OpDEChoose ), aClient + "&& $type in {" + mesh + "} &&" + isNotEmpty, QtxPopupMgr::VisibleRule );
|
||||
popupMgr()->setRule( action( SMESHOp::OpDEChoose ), aClient + "&& $type in {" + mesh + "} &&" + hasDifferentElems, QtxPopupMgr::VisibleRule );
|
||||
|
||||
popupMgr()->insert( separator(), anId, -1 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user