0027969: Visualization - add interfaces to access selecting volumes from SelectMgr_Se...
[occt.git] / src / SelectMgr / SelectMgr_Filter.hxx
CommitLineData
42cf5bc1 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _SelectMgr_Filter_HeaderFile
18#define _SelectMgr_Filter_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <MMgt_TShared.hxx>
24#include <Standard_Boolean.hxx>
25#include <TopAbs_ShapeEnum.hxx>
26class SelectMgr_EntityOwner;
27
28
29class SelectMgr_Filter;
30DEFINE_STANDARD_HANDLE(SelectMgr_Filter, MMgt_TShared)
31
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.
41class SelectMgr_Filter : public MMgt_TShared
42{
43
44public:
45
46
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;
62
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;
68
69
70
71
92efcf78 72 DEFINE_STANDARD_RTTIEXT(SelectMgr_Filter,MMgt_TShared)
42cf5bc1 73
74protected:
75
76
77
78
79private:
80
81
82
83
84};
85
86
87
88
89
90
91
92#endif // _SelectMgr_Filter_HeaderFile