mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025335: Visualization - method ::SelectedShape() in AIS_LocalContext and AIS_InteractiveContext overrides shape transformation
Shape location overriding fixed by combining AIS object transformation and shape location. Also incorrect highlight presentation (and sensitive) placement was possible.
This commit is contained in:
@@ -1122,10 +1122,14 @@ TopoDS_Shape AIS_InteractiveContext::SelectedShape() const
|
||||
{
|
||||
if (!HasOpenedContext())
|
||||
{
|
||||
TopoDS_Shape sh;
|
||||
Handle(AIS_Shape) shape = Handle(AIS_Shape)::DownCast(SelectedInteractive());
|
||||
if (!shape.IsNull()) sh = shape->Shape().Located (SelectedInteractive()->Transformation());
|
||||
return sh;
|
||||
TopoDS_Shape aResShape;
|
||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (SelectedInteractive());
|
||||
if (!aShape.IsNull())
|
||||
{
|
||||
aResShape = aShape->Shape().Located (TopLoc_Location (SelectedInteractive()->Transformation()) * aShape->Shape().Location());
|
||||
}
|
||||
|
||||
return aResShape;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -776,15 +776,14 @@ HasShape() const
|
||||
//==================================================
|
||||
TopoDS_Shape AIS_LocalContext::SelectedShape() const
|
||||
{
|
||||
static TopoDS_Shape aSh;
|
||||
Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
|
||||
Handle(SelectMgr_EntityOwner) EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
|
||||
Handle(StdSelect_BRepOwner) BRO = Handle(StdSelect_BRepOwner)::DownCast(EO);
|
||||
if( BRO.IsNull() )
|
||||
Handle(Standard_Transient) aTr = AIS_Selection::CurrentSelection()->Value();
|
||||
Handle(SelectMgr_EntityOwner) anEO = *((Handle(SelectMgr_EntityOwner)*)&aTr);
|
||||
Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(anEO);
|
||||
if( aBRO.IsNull() )
|
||||
{
|
||||
return aSh;
|
||||
return TopoDS_Shape();
|
||||
}
|
||||
return BRO->Shape().Located (BRO->Location());
|
||||
return aBRO->Shape().Located (aBRO->Location() * aBRO->Shape().Location());
|
||||
}
|
||||
|
||||
//==================================================
|
||||
|
@@ -379,10 +379,6 @@ void AIS_Shape::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
static TopAbs_ShapeEnum TypOfSel;
|
||||
TypOfSel = AIS_Shape::SelectionType(aMode);
|
||||
TopoDS_Shape shape = myshape;
|
||||
if( HasTransformation() ) {
|
||||
gp_Trsf trsf = Transformation();
|
||||
shape = shape.Located(TopLoc_Location(trsf)*shape.Location());
|
||||
}
|
||||
|
||||
// POP protection against crash in low layers
|
||||
|
||||
|
Reference in New Issue
Block a user