// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <AIS_TypeFilter.ixx>
+
#include <AIS_InteractiveObject.hxx>
+#include <AIS_TypeFilter.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <Standard_Type.hxx>
AIS_TypeFilter::AIS_TypeFilter(const AIS_KindOfInteractive TheKind):
myKind(TheKind){}
Standard_Boolean AIS_TypeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj) const
{
- if(Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull())
- return Standard_False;
-
-//#ifndef DEB
- Handle(SelectMgr_SelectableObject) aSelectableObject = anObj->Selectable() ;
- return ((Handle(AIS_InteractiveObject)&) aSelectableObject)->Type()== myKind;
-//#else
-// return ((Handle(AIS_InteractiveObject)&)anObj->Selectable())->Type()== myKind;
-//#endif
+ Handle(AIS_InteractiveObject) anObject =
+ Handle(AIS_InteractiveObject)::DownCast (anObj->Selectable());
+ return ! anObject.IsNull() && anObject->Type()== myKind;
}