mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0026076: Visualization - empty bounding box of a shape after closing local context
Fixed handling of invalid bounding boxes; Links related to temporary objects are now removed from selection structures; Test case for issue #26076
This commit is contained in:
@@ -603,6 +603,13 @@ void AIS_InteractiveObject::BoundingBox (Bnd_Box& theBndBox)
|
||||
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations.First().Presentation();
|
||||
const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
|
||||
const Graphic3d_BndBox4f& aBndBox = aStruct->CStructure()->BoundingBox();
|
||||
|
||||
if (!aBndBox.IsValid())
|
||||
{
|
||||
theBndBox.SetVoid();
|
||||
return;
|
||||
}
|
||||
|
||||
theBndBox.Update (static_cast<Standard_Real> (aBndBox.CornerMin().x()),
|
||||
static_cast<Standard_Real> (aBndBox.CornerMin().y()),
|
||||
static_cast<Standard_Real> (aBndBox.CornerMin().z()),
|
||||
@@ -636,6 +643,13 @@ void AIS_InteractiveObject::BoundingBox (Bnd_Box& theBndBox)
|
||||
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter).Presentation();
|
||||
const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
|
||||
const Graphic3d_BndBox4f& aBndBox = aStruct->CStructure()->BoundingBox();
|
||||
|
||||
if (!aBndBox.IsValid())
|
||||
{
|
||||
theBndBox.SetVoid();
|
||||
return;
|
||||
}
|
||||
|
||||
theBndBox.Update (static_cast<Standard_Real> (aBndBox.CornerMin().x()),
|
||||
static_cast<Standard_Real> (aBndBox.CornerMin().y()),
|
||||
static_cast<Standard_Real> (aBndBox.CornerMin().z()),
|
||||
|
@@ -1017,8 +1017,17 @@ void AIS_LocalContext::ClearObjects()
|
||||
|
||||
}
|
||||
ClearSelected( Standard_False );
|
||||
|
||||
// Clear selection structures for temporary objects, created in local context
|
||||
for (AIS_DataMapIteratorOfDataMapOfSelStat anIter (myActiveObjects); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->IsTemporary())
|
||||
{
|
||||
mySM->Remove (anIter.Key(), myMainVS);
|
||||
}
|
||||
}
|
||||
|
||||
myActiveObjects.Clear();
|
||||
// myMainVS->ClearAreas();myMainVS->ClearSensitive();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user