::Iterator aShapeIt(theShapesToBeSelected);
for (; aShapeIt.More(); aShapeIt.Next()) {
const TopoDS_Shape& aParameterShape = aShapeIt.Key();
- // isSame should be used here as it does not check orientation of shapes
- // despite on isEqual of shapes or IsBound for shape in QMap. Orientation is
- // different for Edges shapes in model shape and owner even if this is the same shape
- if (aParameterShape.IsSame(aShape)) {
+ // In case of compound we cannot rely on simple comparison method.
+ // If the compound is generated by Group feature then this compound is alwais new.
+ // So, we have to compare content of these compounds
+
+ // isSame should be used here as it does not check orientation of shapes
+ // despite on isEqual of shapes or IsBound for shape in QMap. Orientation is
+ // different for Edges shapes in model shape and owner even if this is the same shape
+ if (ModuleBase_Tools::isSameShape(aParameterShape, aShape)) {
Handle(AIS_InteractiveObject) anOwnerPresentation =
- Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable());
+ Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable());
NCollection_Map<Handle(AIS_InteractiveObject)> aPresentations =
- theShapesToBeSelected.Find(aParameterShape);
+ theShapesToBeSelected.Find(aParameterShape);
if (aPresentations.Contains(anOwnerPresentation)) {
theContext->AddOrRemoveSelected(anOwner, Standard_False);
- anOwner->SetSelected (Standard_True);
+ anOwner->SetSelected(Standard_True);
// collect selected presentations to do not select them if compsolid is selected
if (!aSelectedPresentations.Contains(anOwnerPresentation))
aSelectedPresentations.Add(anOwnerPresentation);