mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 01:30:34 +05:00
0020183: EDF SMESH 966 : Mesh element info anomaly
enable selecting nodes common to 2 shown groups
This commit is contained in:
parent
4f4312b86e
commit
2db16adfe0
@ -51,6 +51,7 @@
|
|||||||
#include <SVTK_Selection.h>
|
#include <SVTK_Selection.h>
|
||||||
#include <SVTK_ViewWindow.h>
|
#include <SVTK_ViewWindow.h>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
|
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||||
|
|
||||||
// OCCT includes
|
// OCCT includes
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
@ -373,7 +374,7 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
int nbSel = aList.Extent();
|
int nbSel = aList.Extent();
|
||||||
|
|
||||||
if (nbSel != 1)
|
if (nbSel < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||||
@ -381,15 +382,43 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
|
|||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (nbSel != 1) {
|
||||||
|
//check if all selected objects belongs to one mesh
|
||||||
|
SALOME_ListIteratorOfListIO io( aList );
|
||||||
|
for (io.Next(); io.More(); io.Next() ) {
|
||||||
|
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io.Value());
|
||||||
|
if (!mesh->_is_nil() && !mesh->_is_equivalent( myMesh ))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// select IO with any element selected (for case of selection by rectangle)
|
||||||
|
IO.Nullify();
|
||||||
|
for (io.Initialize(aList); io.More() && IO.IsNull(); io.Next() )
|
||||||
|
if ( mySelector->HasIndex( io.Value() ))
|
||||||
|
IO = io.Value();
|
||||||
|
if ( IO.IsNull() ) return;
|
||||||
|
// unhilight others
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
|
||||||
|
for (io.Initialize(aList); io.More(); io.Next() )
|
||||||
|
if ( !IO->isSame( io.Value() ))
|
||||||
|
aViewWindow->highlight( io.Value(), false, true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
myActor = SMESH::FindActorByObject(myMesh);
|
myActor = SMESH::FindActorByObject(myMesh);
|
||||||
if (!myActor)
|
if (!myActor)
|
||||||
myActor = SMESH::FindActorByEntry(IO->getEntry());
|
myActor = SMESH::FindActorByEntry(IO->getEntry());
|
||||||
if (!myActor)
|
if (!myActor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString aName;
|
QString aName = IO->getName();
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aName);
|
// cut off wite spaces from tail, else meaningful head is not visible
|
||||||
MeshName->setText(aName);
|
int size = aName.length();
|
||||||
|
while (size && aName.at(size-1).isSpace() )
|
||||||
|
--size;
|
||||||
|
if ( size != aName.length() )
|
||||||
|
aName.truncate( size );
|
||||||
|
MeshName->setText(aName); // can be something like "2 objects"
|
||||||
|
|
||||||
if(!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) {
|
if(!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) {
|
||||||
GroupMesh->setTitle(tr("SMESH_MESH"));
|
GroupMesh->setTitle(tr("SMESH_MESH"));
|
||||||
} else if(!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) {
|
} else if(!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user