Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:29:10

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 //! The root class to define filter objects for selection.
0028 //! Advance handling of objects requires the services of
0029 //! filters. These only allow dynamic detection and
0030 //! selection of objects which correspond to the criteria defined in each.
0031 //! Eight standard filters inheriting SelectMgr_Filter are
0032 //! defined in Open CASCADE.
0033 //! You can create your own filters by defining new filter
0034 //! classes inheriting this framework. You use these
0035 //! filters by loading them into an AIS interactive context.
0036 class SelectMgr_Filter : public Standard_Transient
0037 {
0038 
0039 public:
0040   //! Indicates that the selected Interactive Object
0041   //! passes the filter. The owner, anObj, can be either
0042   //! direct or user. A direct owner is the corresponding
0043   //! construction element, whereas a user is the
0044   //! compound shape of which the entity forms a part.
0045   //! When an object is detected by the mouse - in AIS,
0046   //! this is done through a context selector - its owner
0047   //! is passed to the filter as an argument.
0048   //! If the object returns true, it is kept; if
0049   //! not, it is rejected.
0050   //! If you are creating a filter class inheriting this
0051   //! framework, and the daughter class is to be used in
0052   //! an AIS local context, you will need to implement the
0053   //! virtual function ActsOn.
0054   Standard_EXPORT virtual bool IsOk(const occ::handle<SelectMgr_EntityOwner>& anObj) const = 0;
0055 
0056   //! Returns true in an AIS local context, if this filter
0057   //! operates on a type of subshape defined in a filter
0058   //! class inheriting this framework.
0059   //! This function completes IsOk in an AIS local context.
0060   Standard_EXPORT virtual bool ActsOn(const TopAbs_ShapeEnum aStandardMode) const;
0061 
0062   DEFINE_STANDARD_RTTIEXT(SelectMgr_Filter, Standard_Transient)
0063 };
0064 
0065 #endif // _SelectMgr_Filter_HeaderFile