mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027805: Visualization - AIS_InteractiveContext::FitSelected() is broken for global selection
AIS_Selection class has been cleaned up: - SelectMgr_EntityOwner is now used in interface instead of Standard_Transient. - Method ::Select() has been renamed to ::Clear() for clarity. - Dropped unused class fields. - Owners without Selectable are not added to the list (should never happen). SelectMgr_SelectableObject::BndBoxOfSelected() has been modified to properly compute bounding box of ALL selection Entities for specified Owner (only first Entity has been used before the patch). Methods of AIS_InteractiveContext::DisplaySelected(), ::SetSelectedAspect(), ::FitSelected(), ::SubIntensityOff() have been fixed (wrong DownCast). AIS_InteractiveContext::AddSelect() now handles properly AIS_InteractiveObject as argument.
This commit is contained in:
@@ -602,16 +602,14 @@ const Handle(SelectMgr_EntityOwner)& SelectMgr_SelectableObject::GetAssemblyOwne
|
||||
|
||||
//=======================================================================
|
||||
//function : BndBoxOfSelected
|
||||
//purpose : Returns a bounding box of sensitive entities with the owners given
|
||||
// if they are a part of activated selection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Bnd_Box SelectMgr_SelectableObject::BndBoxOfSelected (Handle(SelectMgr_IndexedMapOfOwner)& theOwners)
|
||||
Bnd_Box SelectMgr_SelectableObject::BndBoxOfSelected (const Handle(SelectMgr_IndexedMapOfOwner)& theOwners)
|
||||
{
|
||||
Bnd_Box aBnd;
|
||||
|
||||
if (theOwners->IsEmpty())
|
||||
return aBnd;
|
||||
return Bnd_Box();
|
||||
|
||||
Bnd_Box aBnd;
|
||||
for (Init(); More(); Next())
|
||||
{
|
||||
const Handle(SelectMgr_Selection)& aSel = CurrentSelection();
|
||||
@@ -625,20 +623,8 @@ Bnd_Box SelectMgr_SelectableObject::BndBoxOfSelected (Handle(SelectMgr_IndexedMa
|
||||
if (theOwners->Contains (anOwner))
|
||||
{
|
||||
Select3D_BndBox3d aBox = aSel->Sensitive()->BaseSensitive()->BoundingBox();
|
||||
Bnd_Box aTmpBnd;
|
||||
aTmpBnd.Update (aBox.CornerMin().x(), aBox.CornerMin().y(), aBox.CornerMin().z(),
|
||||
aBox.CornerMax().x(), aBox.CornerMax().y(), aBox.CornerMax().z());
|
||||
aBnd.Add (aTmpBnd);
|
||||
|
||||
Standard_Integer anOwnerIdx = theOwners->FindIndex (anOwner);
|
||||
if (theOwners->Size() != anOwnerIdx)
|
||||
{
|
||||
theOwners->Swap (anOwnerIdx, theOwners->Size());
|
||||
}
|
||||
theOwners->RemoveLast();
|
||||
|
||||
if (theOwners->IsEmpty())
|
||||
return aBnd;
|
||||
aBnd.Update (aBox.CornerMin().x(), aBox.CornerMin().y(), aBox.CornerMin().z(),
|
||||
aBox.CornerMax().x(), aBox.CornerMax().y(), aBox.CornerMax().z());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -210,7 +210,7 @@ public:
|
||||
|
||||
//! Returns a bounding box of sensitive entities with the owners given
|
||||
//! if they are a part of activated selection
|
||||
Standard_EXPORT Bnd_Box BndBoxOfSelected (Handle(SelectMgr_IndexedMapOfOwner)& theOwners);
|
||||
Standard_EXPORT Bnd_Box BndBoxOfSelected (const Handle(SelectMgr_IndexedMapOfOwner)& theOwners);
|
||||
|
||||
//! Returns the mode for selection of object as a whole
|
||||
Standard_Integer GlobalSelectionMode() const
|
||||
|
Reference in New Issue
Block a user