#include <Standard_Type.hxx>
#include <TopLoc_Location.hxx>
+IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_SelectableObject,PrsMgr_PresentableObject)
+
static Standard_Integer Search (const SelectMgr_SequenceOfSelection& seq,
const Handle (SelectMgr_Selection)& theSel)
{
myHilightDrawer->Link (myDrawer);
}
+//==================================================
+// Function: Destructor
+// Purpose : Clears all selections of the object
+//==================================================
+SelectMgr_SelectableObject::~SelectMgr_SelectableObject()
+{
+ for (Standard_Integer aSelIdx = 1; aSelIdx <= myselections.Length(); ++aSelIdx)
+ {
+ myselections.Value (aSelIdx)->Clear();
+ }
+}
//==================================================
-// Function:
+// Function: HasSelection
// Purpose :
//==================================================
-
-Standard_Boolean SelectMgr_SelectableObject
-::HasSelection(const Standard_Integer aMode) const
+Standard_Boolean SelectMgr_SelectableObject::HasSelection (const Standard_Integer theMode) const
{
- Standard_Boolean Found=Standard_False;
- for (Standard_Integer I=1;I<= myselections.Length() && !Found;I++)
- { if(((myselections.Value(I))->Mode())==aMode)
- return Standard_True;
- }
+ for (Standard_Integer aSelIdx = 1; aSelIdx <= myselections.Length(); ++aSelIdx)
+ {
+ if (((myselections.Value (aSelIdx))->Mode()) == theMode)
+ return Standard_True;
+ }
return Standard_False;
}
const Handle(SelectMgr_Selection)& SelectMgr_SelectableObject
::Selection(const Standard_Integer aMode) const
{
- static Handle(SelectMgr_Selection) bidsel;
Standard_Boolean Found = Standard_False;
Standard_Integer Rank=0;
for (Standard_Integer i=1;i<=myselections.Length() && !Found;i++)
}
//=======================================================================
-//function : UpdateSelection
+//function : updateSelection
//purpose : Sets update status FULL to selections of the object. Must be
// used as the only method of UpdateSelection from outer classes
// to prevent BVH structures from being outdated.
//=======================================================================
-void SelectMgr_SelectableObject::UpdateSelection (const Standard_Integer theMode)
+void SelectMgr_SelectableObject::updateSelection (const Standard_Integer theMode)
{
if (theMode == -1)
{