mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-14 02:30:35 +05:00
Fix of INTPAL0052192: TC7.3.0: Show only selected does not work in Explode and Group
dialogs
This commit is contained in:
parent
f66a157d83
commit
274055b2bd
@ -589,10 +589,58 @@ void EntityGUI_SubShapeDlg::showOnlySelected()
|
|||||||
Handle(SALOME_InteractiveObject) io =
|
Handle(SALOME_InteractiveObject) io =
|
||||||
new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
|
new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
|
||||||
if (view->isVisible(io)) myIsHiddenMain = true;
|
if (view->isVisible(io)) myIsHiddenMain = true;
|
||||||
}
|
|
||||||
|
|
||||||
aDisplayer->EraseAll(/*forced = false, updateViewer = true*/);
|
//keep the selected entry and IO in the map for checking
|
||||||
aDisplayer->Display(aSelList, true);
|
std::map<QString, Handle(SALOME_InteractiveObject)> aSelEntriesMap;
|
||||||
|
SALOME_ListIteratorOfListIO aSelIt(aSelList);
|
||||||
|
for ( ; aSelIt.More(); aSelIt.Next() ) {
|
||||||
|
//fill map <entry, io>
|
||||||
|
Handle(SALOME_InteractiveObject) anSelIO = aSelIt.Value();
|
||||||
|
aSelEntriesMap[anSelIO->getEntry()] = anSelIO;
|
||||||
|
}
|
||||||
|
//get the displayed sub-shapes
|
||||||
|
SALOME_ListIO displayed;
|
||||||
|
view->GetVisible(displayed);
|
||||||
|
// Erase all, except the selected shapes
|
||||||
|
std::map<QString, Handle(SALOME_InteractiveObject)>::const_iterator
|
||||||
|
aSelDispIter = aSelEntriesMap.end();
|
||||||
|
SALOME_ListIteratorOfListIO aDispIt( displayed );
|
||||||
|
for ( ; aDispIt.More(); aDispIt.Next() ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aDispIt.Value();
|
||||||
|
aSelDispIter = aSelEntriesMap.find( anIO->getEntry() );
|
||||||
|
if ( aSelDispIter != aSelEntriesMap.end() ) {
|
||||||
|
//sub-shape is selected, so erase it's record from map to keep in it not displayed, but selected sub-shapes only
|
||||||
|
aSelEntriesMap.erase(aSelDispIter);
|
||||||
|
} else {
|
||||||
|
//sub-shape is not in the map of selected, then erase it from view
|
||||||
|
aDisplayer->Erase( anIO, /*forced = */false, /*updateViewer = */false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !aSelEntriesMap.empty() ) {
|
||||||
|
// Build a presentation of the selected, but not displayed sub-shapes
|
||||||
|
TopTools_IndexedMapOfShape aSubShapesMap;
|
||||||
|
TopExp::MapShapes(myShape, aSubShapesMap);
|
||||||
|
QString anEntryBase = aMainEntry.in();
|
||||||
|
|
||||||
|
TopExp_Explorer anExp (myShape, (TopAbs_ShapeEnum)shapeType());
|
||||||
|
for (; anExp.More(); anExp.Next())
|
||||||
|
{
|
||||||
|
TopoDS_Shape aSubShape = anExp.Current();
|
||||||
|
int index = aSubShapesMap.FindIndex(aSubShape);
|
||||||
|
QString anEntry = QString( "TEMP_" ) + anEntryBase + QString("_%1").arg(index);
|
||||||
|
if ( aSelEntriesMap.find( anEntry ) == aSelEntriesMap.end() ) {
|
||||||
|
//skip not selected sub-shapes
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, view);
|
||||||
|
if (aPrs) {
|
||||||
|
displayPreview(aPrs, true, false); // append, do not update
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aDisplayer->UpdateViewer();
|
||||||
|
}
|
||||||
|
|
||||||
// Mantis issue 0021421: do not hide main shape, if explode on VERTEX
|
// Mantis issue 0021421: do not hide main shape, if explode on VERTEX
|
||||||
if ((TopAbs_ShapeEnum)shapeType() == TopAbs_VERTEX && myIsHiddenMain) {
|
if ((TopAbs_ShapeEnum)shapeType() == TopAbs_VERTEX && myIsHiddenMain) {
|
||||||
|
@ -674,10 +674,57 @@ void GroupGUI_GroupDlg::showOnlySelected()
|
|||||||
Handle(SALOME_InteractiveObject) io =
|
Handle(SALOME_InteractiveObject) io =
|
||||||
new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
|
new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
|
||||||
if (view->isVisible(io)) myIsHiddenMain = true;
|
if (view->isVisible(io)) myIsHiddenMain = true;
|
||||||
}
|
|
||||||
|
//keep the selected entry and IO in the map for checking
|
||||||
|
std::map<QString, Handle(SALOME_InteractiveObject)> aSelEntriesMap;
|
||||||
|
SALOME_ListIteratorOfListIO aSelIt(aSelList);
|
||||||
|
for ( ; aSelIt.More(); aSelIt.Next() ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anSelIO = aSelIt.Value();
|
||||||
|
aSelEntriesMap[anSelIO->getEntry()] = anSelIO;
|
||||||
|
}
|
||||||
|
//get the displayed sub-shapes
|
||||||
|
SALOME_ListIO displayed;
|
||||||
|
view->GetVisible(displayed);
|
||||||
|
// Erase all, except the selected sub-shapes
|
||||||
|
std::map<QString, Handle(SALOME_InteractiveObject)>::const_iterator
|
||||||
|
aSelDispIter = aSelEntriesMap.end();
|
||||||
|
SALOME_ListIteratorOfListIO aDispIt( displayed );
|
||||||
|
for ( ; aDispIt.More(); aDispIt.Next() ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aDispIt.Value();
|
||||||
|
aSelDispIter = aSelEntriesMap.find( anIO->getEntry() );
|
||||||
|
if ( aSelDispIter != aSelEntriesMap.end() ) {
|
||||||
|
//sub-shape is selected, so erase it's record from map to keep in it not displayed, but selected sub-shapes only
|
||||||
|
aSelEntriesMap.erase(aSelDispIter);
|
||||||
|
} else {
|
||||||
|
//sub-shape is not in the map of selected, then erase it from view
|
||||||
|
aDisplayer->Erase( anIO, /*forced = */false, /*updateViewer = */false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
aDisplayer->EraseAll(/*forced = false, updateViewer = true*/);
|
if ( !aSelEntriesMap.empty() ) {
|
||||||
aDisplayer->Display(aSelList, true);
|
// Build a presentation of the selected, but not displayed sub-shapes
|
||||||
|
TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
|
||||||
|
TopTools_IndexedMapOfShape aSubShapesMap;
|
||||||
|
TopExp::MapShapes(aMainShape, aSubShapesMap);
|
||||||
|
QString anEntryBase = aMainEntry.in();
|
||||||
|
|
||||||
|
TopExp_Explorer anExp (aMainShape, getShapeType());
|
||||||
|
for (; anExp.More(); anExp.Next()) {
|
||||||
|
TopoDS_Shape aSubShape = anExp.Current();
|
||||||
|
int index = aSubShapesMap.FindIndex(aSubShape);
|
||||||
|
QString anEntry = QString( "TEMP_" ) + anEntryBase + QString("_%1").arg(index);
|
||||||
|
if ( aSelEntriesMap.find( anEntry ) == aSelEntriesMap.end() ) {
|
||||||
|
//skip not selected sub-shapes
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, view);
|
||||||
|
if (aPrs) {
|
||||||
|
displayPreview(aPrs, true, false); // append, do not update
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aDisplayer->UpdateViewer();
|
||||||
|
}
|
||||||
|
|
||||||
// Mantis issue 0021421: do not hide main shape, if explode on VERTEX
|
// Mantis issue 0021421: do not hide main shape, if explode on VERTEX
|
||||||
if (getShapeType() == TopAbs_VERTEX && myIsHiddenMain) {
|
if (getShapeType() == TopAbs_VERTEX && myIsHiddenMain) {
|
||||||
|
Loading…
Reference in New Issue
Block a user