1 // Created on: 1997-03-05
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _SelectMgr_Filter_HeaderFile
18 #define _SelectMgr_Filter_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Transient.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <TopAbs_ShapeEnum.hxx>
26 class SelectMgr_EntityOwner;
29 class SelectMgr_Filter;
30 DEFINE_STANDARD_HANDLE(SelectMgr_Filter, Standard_Transient)
32 //! The root class to define filter objects for selection.
33 //! Advance handling of objects requires the services of
34 //! filters. These only allow dynamic detection and
35 //! selection of objects which correspond to the criteria defined in each.
36 //! Eight standard filters inheriting SelectMgr_Filter are
37 //! defined in Open CASCADE.
38 //! You can create your own filters by defining new filter
39 //! classes inheriting this framework. You use these
40 //! filters by loading them into an AIS interactive context.
41 class SelectMgr_Filter : public Standard_Transient
47 //! Indicates that the selected Interactive Object
48 //! passes the filter. The owner, anObj, can be either
49 //! direct or user. A direct owner is the corresponding
50 //! construction element, whereas a user is the
51 //! compound shape of which the entity forms a part.
52 //! When an object is detected by the mouse - in AIS,
53 //! this is done through a context selector - its owner
54 //! is passed to the filter as an argument.
55 //! If the object returns Standard_True, it is kept; if
56 //! not, it is rejected.
57 //! If you are creating a filter class inheriting this
58 //! framework, and the daughter class is to be used in
59 //! an AIS local context, you will need to implement the
60 //! virtual function ActsOn.
61 Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anObj) const = 0;
63 //! Returns true in an AIS local context, if this filter
64 //! operates on a type of subshape defined in a filter
65 //! class inheriting this framework.
66 //! This function completes IsOk in an AIS local context.
67 Standard_EXPORT virtual Standard_Boolean ActsOn (const TopAbs_ShapeEnum aStandardMode) const;
72 DEFINE_STANDARD_RTTIEXT(SelectMgr_Filter,Standard_Transient)
92 #endif // _SelectMgr_Filter_HeaderFile