Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-22 08:30:13

0001 // Created on: 1997-03-05
0002 // Created by: Robert COUBLANC
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _SelectMgr_Filter_HeaderFile
0018 #define _SelectMgr_Filter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <TopAbs_ShapeEnum.hxx>
0025 class SelectMgr_EntityOwner;
0026 
0027 class SelectMgr_Filter;
0028 DEFINE_STANDARD_HANDLE(SelectMgr_Filter, Standard_Transient)
0029 
0030 //! The root class to define filter objects for selection.
0031 //! Advance handling of objects requires the services of
0032 //! filters. These only allow dynamic detection and
0033 //! selection of objects which correspond to the criteria defined in each.
0034 //! Eight standard filters inheriting SelectMgr_Filter are
0035 //! defined in Open CASCADE.
0036 //! You can create your own filters by defining new filter
0037 //! classes inheriting this framework. You use these
0038 //! filters by loading them into an AIS interactive context.
0039 class SelectMgr_Filter : public Standard_Transient
0040 {
0041 
0042 public:
0043   //! Indicates that the selected Interactive Object
0044   //! passes the filter. The owner, anObj, can be either
0045   //! direct or user. A direct owner is the corresponding
0046   //! construction element, whereas a user is the
0047   //! compound shape of which the entity forms a part.
0048   //! When an object is detected by the mouse - in AIS,
0049   //! this is done through a context selector - its owner
0050   //! is passed to the filter as an argument.
0051   //! If the object returns Standard_True, it is kept; if
0052   //! not, it is rejected.
0053   //! If you are creating a filter class inheriting this
0054   //! framework, and the daughter class is to be used in
0055   //! an AIS local context, you will need to implement the
0056   //! virtual function ActsOn.
0057   Standard_EXPORT virtual Standard_Boolean IsOk(
0058     const Handle(SelectMgr_EntityOwner)& anObj) const = 0;
0059 
0060   //! Returns true in an AIS local context, if this filter
0061   //! operates on a type of subshape defined in a filter
0062   //! class inheriting this framework.
0063   //! This function completes IsOk in an AIS local context.
0064   Standard_EXPORT virtual Standard_Boolean ActsOn(const TopAbs_ShapeEnum aStandardMode) const;
0065 
0066   DEFINE_STANDARD_RTTIEXT(SelectMgr_Filter, Standard_Transient)
0067 
0068 protected:
0069 private:
0070 };
0071 
0072 #endif // _SelectMgr_Filter_HeaderFile