X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FAIS%2FAIS_TypeFilter.cxx;h=4d8221d18b394b3019efc73f438bb287de3f76e3;hp=819524bc578eeca996ef681cc4d45708390263bd;hb=4c7a3faef5f292475c23ee615ad49d57fc039b58;hpb=857ffd5e57f198ef3d238b16913a8f5a385258b2 diff --git a/src/AIS/AIS_TypeFilter.cxx b/src/AIS/AIS_TypeFilter.cxx index 819524b..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 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; }