X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FAIS%2FAIS_TypeFilter.cxx;h=4d8221d18b394b3019efc73f438bb287de3f76e3;hp=1e4b16e5e4d5f97e6a7d7e85f16b91b5fc7a1e52;hb=4c7a3faef5f292475c23ee615ad49d57fc039b58;hpb=c5f3a42524e2cc831c258e347e591ffa4bdaa4c2 diff --git a/src/AIS/AIS_TypeFilter.cxx b/src/AIS/AIS_TypeFilter.cxx index 1e4b16e..4d8221d 100644 --- a/src/AIS/AIS_TypeFilter.cxx +++ b/src/AIS/AIS_TypeFilter.cxx @@ -14,21 +14,20 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include + #include +#include +#include +#include + +IMPLEMENT_STANDARD_RTTIEXT(AIS_TypeFilter,SelectMgr_Filter) 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 OCCT_DEBUG - Handle(SelectMgr_SelectableObject) aSelectableObject = anObj->Selectable() ; - return Handle(AIS_InteractiveObject)::DownCast (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; }