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

0022368: AIS_Trihedron's highlight presentation isn't updated on trihedron relocation

This commit is contained in:
APL
2011-10-21 16:07:55 +00:00
committed by bugmaster
parent cbc651403a
commit 29d43f9cba
5 changed files with 223 additions and 15 deletions

View File

@@ -78,10 +78,21 @@ void StdSelect_BRepOwner::Hilight(const Handle(PrsMgr_PresentationManager)& PM,
#else
Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
#endif
if(myFromDecomposition)
if (myFromDecomposition)
{
// do the update flag check
if (!myPrsSh.IsNull())
{
TColStd_ListOfInteger aModesList;
myPrsSh->ToBeUpdated (aModesList);
if (!aModesList.IsEmpty())
myPrsSh.Nullify();
}
if(myPrsSh.IsNull())
myPrsSh = new StdSelect_Shape(myShape);
myPrsSh = new StdSelect_Shape (myShape);
}
if(myPrsSh.IsNull())
PM->Highlight(Selectable(),M);
else
@@ -100,7 +111,17 @@ void StdSelect_BRepOwner::HilightWithColor(const Handle(PrsMgr_PresentationManag
#else
Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
#endif
if(myFromDecomposition){
if (myFromDecomposition)
{
// do the update flag check
if (!myPrsSh.IsNull())
{
TColStd_ListOfInteger aModesList;
myPrsSh->ToBeUpdated (aModesList);
if (!aModesList.IsEmpty())
myPrsSh.Nullify();
}
if(myPrsSh.IsNull()){
if(HasLocation()){
TopLoc_Location lbid = Location() * myShape.Location();
@@ -147,13 +168,20 @@ void StdSelect_BRepOwner::Clear(const Handle(PrsMgr_PresentationManager)& PM,
void StdSelect_BRepOwner::SetLocation(const TopLoc_Location& aLoc)
{
SelectMgr_EntityOwner::SetLocation(aLoc);
if(!myPrsSh.IsNull())
myPrsSh.Nullify();
// 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();
}
void StdSelect_BRepOwner::ResetLocation()
{
SelectMgr_EntityOwner::ResetLocation();
if(!myPrsSh.IsNull())
myPrsSh.Nullify();
// 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();
}