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()),
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()),
}
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();
}
const Handle(SelectMgr_SelectableObject)& anObject = GetObjectById (theIndex);
Bnd_Box aBox;
anObject->BoundingBox (aBox);
+ if (aBox.IsVoid())
+ return Select3D_BndBox3d();
+
return Select3D_BndBox3d (SelectMgr_Vec3 (aBox.CornerMin().X(), aBox.CornerMin().Y(), aBox.CornerMin().Z()),
SelectMgr_Vec3 (aBox.CornerMax().X(), aBox.CornerMax().Y(), aBox.CornerMax().Z()));
}
break;
}
}
- theSelector->RemoveSelectionOfObject (theObject, theObject->CurrentSelection());
- theSelector->RemoveSelectableObject (theObject);
- theObject->CurrentSelection()->UpdateBVHStatus (SelectMgr_TBU_Remove);
if (aSelectors.IsEmpty())
{
{
aShape->SetHilightMode (anObjHighMode);
}
- GetMapOfAIS().Bind (aShape, aName);
+ if (!toDisplayLocal)
+ GetMapOfAIS().Bind (aShape, aName);
Standard_Integer aDispMode = aShape->HasDisplayMode()
? aShape->DisplayMode()
--- /dev/null
+puts "============"
+puts "CR26076"
+puts "============"
+puts ""
+
+##########################################################################################
+puts "Visualization - empty bounding box of a shape after closing local context"
+##########################################################################################
+
+pload VISUALIZATION MODELING
+
+vinit
+
+box b1 1 1 1
+box b2 4 5 6
+
+# display box b1 in global context
+vdisplay b1
+# display box b2 in local context only
+vdisplay -local b2
+
+vfit
+
+# display only box b1 by closing local context and erasing box b2
+vdonly b1
+
+vfit
+
+# check that selection works properly
+vmoveto 100 100
+checkcolor 205 205 0 1 1
+
+vdump ${imagedir}/${casename}.png