- if( newIndices.Extent()>0 )
- {
- mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, true );
- myViewWindow->highlight( myActor->getIO(), true, true );
- }
- bool aNodesOK = false;
- if (myIsPoly && myElementType == SMDSAbs_Face && aListId.count() >=3 ){
- myNbOkNodes = aListId.count();
- aNodesOK = true;
- }
+ mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( myActor->getIO(), true, true );
+
+ myNbOkNodes = ( allOk && myNbNodes == aListId.count() );
+
+ if (myIsPoly)
+ {
+ if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
+ myNbOkNodes = 0;
+ else
+ myNbOkNodes = aListId.count();
+ }