mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-03-15 22:11:26 +05:00
IPAL22183: Creation of group with restriction 'Only Sub-Shapes of the Second Shape' doesn't work
This commit is contained in:
parent
a64b9bbcff
commit
956f0bc94a
@ -421,10 +421,13 @@ void GroupGUI_GroupDlg::setInPlaceObj(GEOM::GEOM_Object_var theObj, const bool i
|
|||||||
GEOM::ListOfGO_var aSubObjects = aShapesOp->MakeExplode(myInPlaceObj, getShapeType(), false);
|
GEOM::ListOfGO_var aSubObjects = aShapesOp->MakeExplode(myInPlaceObj, getShapeType(), false);
|
||||||
for (int i = 0; i < aSubObjects->length(); i++)
|
for (int i = 0; i < aSubObjects->length(); i++)
|
||||||
{
|
{
|
||||||
CORBA::Long aMainIndex = aLocOp->GetSubShapeIndex(myMainObj, aSubObjects[i]);
|
GEOM::GEOM_Object_var aSS = aShapesOp->GetSame(myMainObj, aSubObjects[i]);
|
||||||
CORBA::Long aPlaceIndex = aLocOp->GetSubShapeIndex(myInPlaceObj, aSubObjects[i]);
|
if (!CORBA::is_nil(aSS)) {
|
||||||
if (aMainIndex >= 0 && aPlaceIndex > 0)
|
CORBA::Long aMainIndex = aLocOp->GetSubShapeIndex(myMainObj, aSS);
|
||||||
myMain2InPlaceIndices.Bind(aMainIndex, aPlaceIndex);
|
CORBA::Long aPlaceIndex = aLocOp->GetSubShapeIndex(myInPlaceObj, aSubObjects[i]);
|
||||||
|
if (aMainIndex >= 0 && aPlaceIndex > 0)
|
||||||
|
myMain2InPlaceIndices.Bind(aMainIndex, aPlaceIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myInPlaceObjSelectState = subSelectionWay();
|
myInPlaceObjSelectState = subSelectionWay();
|
||||||
@ -805,29 +808,47 @@ void GroupGUI_GroupDlg::activateSelection()
|
|||||||
|
|
||||||
TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
|
TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
|
||||||
TopoDS_Shape aRestrictionShape;
|
TopoDS_Shape aRestrictionShape;
|
||||||
if (subSelectionWay() == ALL_SUBSHAPES)
|
|
||||||
|
if (subSelectionWay() == ALL_SUBSHAPES) {
|
||||||
aRestrictionShape = aMainShape;
|
aRestrictionShape = aMainShape;
|
||||||
else if (!myInPlaceObj->_is_nil())
|
|
||||||
aRestrictionShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myInPlaceObj);
|
|
||||||
else ;
|
|
||||||
|
|
||||||
TopTools_IndexedMapOfShape aSubShapesMap;
|
TopTools_IndexedMapOfShape aSubShapesMap;
|
||||||
TopExp::MapShapes(aMainShape, aSubShapesMap);
|
TopExp::MapShapes(aMainShape, aSubShapesMap);
|
||||||
CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
|
CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
|
||||||
QString anEntryBase = aMainEntry.in();
|
QString anEntryBase = aMainEntry.in();
|
||||||
|
|
||||||
TopExp_Explorer anExp (aRestrictionShape, getShapeType());
|
TopExp_Explorer anExp (aRestrictionShape, getShapeType());
|
||||||
for (; anExp.More(); anExp.Next())
|
for (; anExp.More(); anExp.Next()) {
|
||||||
{
|
TopoDS_Shape aSubShape = anExp.Current();
|
||||||
TopoDS_Shape aSubShape = anExp.Current();
|
int index = aSubShapesMap.FindIndex(aSubShape);
|
||||||
int index = aSubShapesMap.FindIndex(aSubShape);
|
QString anEntry = anEntryBase + QString("_%1").arg(index);
|
||||||
QString anEntry = anEntryBase + QString("_%1").arg(index);
|
|
||||||
|
|
||||||
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
|
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
|
||||||
if (aPrs) {
|
if (aPrs) {
|
||||||
displayPreview(aPrs, true, false); // append, do not update
|
displayPreview(aPrs, true, false); // append, do not update
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!myInPlaceObj->_is_nil()) {
|
||||||
|
TopTools_IndexedMapOfShape aSubShapesMap;
|
||||||
|
TopExp::MapShapes(aMainShape, aSubShapesMap);
|
||||||
|
CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
|
||||||
|
QString anEntryBase = aMainEntry.in();
|
||||||
|
|
||||||
|
TColStd_DataMapIteratorOfDataMapOfIntegerInteger aM2IPit (myMain2InPlaceIndices);
|
||||||
|
for (; aM2IPit.More(); aM2IPit.Next()) {
|
||||||
|
int index = aM2IPit.Key();
|
||||||
|
TopoDS_Shape aSubShape = aSubShapesMap.FindKey(index);
|
||||||
|
QString anEntry = anEntryBase + QString("_%1").arg(index);
|
||||||
|
|
||||||
|
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
|
||||||
|
if (aPrs) {
|
||||||
|
displayPreview(aPrs, true, false); // append, do not update
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else ;
|
||||||
|
|
||||||
aDisplayer->UpdateViewer();
|
aDisplayer->UpdateViewer();
|
||||||
aDisplayer->SetDisplayMode(prevDisplayMode);
|
aDisplayer->SetDisplayMode(prevDisplayMode);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user