1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0032180: Visualization - StdSelect_BRepOwner::SetLocation() does not update selected sub-shape

StdSelect_BRepOwner::SetLocation() now propagates location to sub-shape presentation instead of invalidating it.
This commit is contained in:
kgv
2021-02-27 10:48:32 +03:00
parent bc0711a5c3
commit ba590cbf15
2 changed files with 12 additions and 20 deletions

View File

@@ -114,21 +114,13 @@ void StdSelect_BRepOwner::HilightWithColor (const Handle(PrsMgr_PresentationMana
// generate new presentable shape
if (myPrsSh.IsNull())
{
if (HasLocation())
{
TopLoc_Location lbid = Location() * myShape.Location();
TopoDS_Shape ShBis = myShape.Located(lbid);
myPrsSh = new StdSelect_Shape (ShBis, theStyle);
}
else
{
myPrsSh = new StdSelect_Shape (myShape, theStyle);
}
myPrsSh = new StdSelect_Shape (myShape, theStyle);
}
// initialize presentation attributes of child presentation
myPrsSh->SetZLayer (aSel->ZLayer());
myPrsSh->SetTransformPersistence (aSel->TransformPersistence());
myPrsSh->SetLocalTransformation (Location());
myPrsSh->Attributes()->SetLink (theStyle);
myPrsSh->Attributes()->SetColor (theStyle->Color());
myPrsSh->Attributes()->SetTransparency (theStyle->Transparency());
@@ -162,11 +154,10 @@ void StdSelect_BRepOwner::Clear(const Handle(PrsMgr_PresentationManager)& PM,
void StdSelect_BRepOwner::SetLocation(const TopLoc_Location& aLoc)
{
SelectMgr_EntityOwner::SetLocation(aLoc);
// we must not nullify the myPrsSh here, because unhilight method
// will be working with wrong entity in this case, the best is to
// set the update flag and then recompute myPrsSh on hilighting
if (!myPrsSh.IsNull())
myPrsSh->SetToUpdate();
{
myPrsSh->SetLocalTransformation (Location());
}
}
//=======================================================================
@@ -177,10 +168,10 @@ void StdSelect_BRepOwner::UpdateHighlightTrsf (const Handle(V3d_Viewer)& theView
const Handle(PrsMgr_PresentationManager)& theManager,
const Standard_Integer theDispMode)
{
if (myPrsSh.IsNull() && Selectable().IsNull())
return;
theManager->UpdateHighlightTrsf (theViewer, Selectable(), theDispMode, myPrsSh);
if (!myPrsSh.IsNull() || HasSelectable())
{
theManager->UpdateHighlightTrsf (theViewer, Selectable(), theDispMode, myPrsSh);
}
}
// =======================================================================