b311480e |
1 | -- Created on: 1997-11-28 |
2 | -- Created by: Robert COUBLANC |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class ExclusionFilter from AIS inherits Filter from SelectMgr |
24 | |
25 | ---Purpose: A framework to reject or to accept only objects of |
26 | -- given types and/or signatures. |
27 | -- Objects are stored, and the stored objects - along |
28 | -- with the flag settings - are used to define the filter. |
29 | -- Objects to be filtered are compared with the stored |
30 | -- objects added to the filter, and are accepted or |
31 | -- rejected according to the exclusion flag setting. |
32 | -- - Exclusion flag on |
33 | -- - the function IsOk answers true for all objects, |
34 | -- except those of the types and signatures stored |
35 | -- in the filter framework |
36 | -- - Exclusion flag off |
37 | -- - the funciton IsOk answers true for all objects |
38 | -- which have the same type and signature as the stored ones. |
39 | |
40 | uses |
41 | |
42 | EntityOwner from SelectMgr, |
43 | KindOfInteractive from AIS, |
44 | ListOfInteger from TColStd, |
45 | DataMapOfIntegerListOfInteger from TColStd |
46 | is |
47 | |
48 | Create(ExclusionFlagOn:Boolean from Standard = Standard_True) |
49 | returns mutable ExclusionFilter from AIS; |
50 | ---Purpose: Constructs an empty exclusion filter object defined by |
51 | -- the flag setting ExclusionFlagOn. |
52 | -- By default, the flag is set to true. |
53 | |
54 | Create(TypeToExclude : KindOfInteractive from AIS; |
55 | ExclusionFlagOn : Boolean from Standard = Standard_True) |
56 | returns mutable ExclusionFilter from AIS; |
57 | ---Purpose: All the AIS objects of <TypeToExclude> |
58 | -- Will be rejected by the IsOk Method. |
59 | |
60 | |
61 | Create(TypeToExclude : KindOfInteractive from AIS; |
62 | SignatureInType :Integer from Standard ; |
63 | ExclusionFlagOn : Boolean from Standard = Standard_True) |
64 | returns mutable ExclusionFilter from AIS; |
65 | ---Purpose: Constructs an exclusion filter object defined by the |
66 | -- enumeration value TypeToExclude, the signature |
67 | -- SignatureInType, and the flag setting ExclusionFlagOn. |
68 | -- By default, the flag is set to true. |
69 | |
70 | |
71 | IsOk(me; anObj : EntityOwner from SelectMgr) |
72 | returns Boolean from Standard |
73 | is redefined virtual; |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | ---Category: Load Filter... |
80 | |
81 | Add(me:mutable;TypeToExclude : KindOfInteractive from AIS) |
82 | returns Boolean from Standard; |
83 | ---Purpose: Adds the type TypeToExclude to the list of types. |
84 | |
85 | Add(me:mutable; |
86 | TypeToExclude : KindOfInteractive from AIS; |
87 | SignatureInType : Integer from Standard) |
88 | returns Boolean from Standard; |
89 | |
90 | Remove(me:mutable; |
91 | TypeToExclude:KindOfInteractive from AIS) |
92 | returns Boolean from Standard; |
93 | |
94 | Remove(me:mutable; |
95 | TypeToExclude:KindOfInteractive from AIS; |
96 | SignatureInType : Integer from Standard) |
97 | returns Boolean from Standard; |
98 | |
99 | Clear(me:mutable); |
100 | |
101 | ---Category: Information about Filter... |
102 | |
103 | |
104 | |
105 | IsExclusionFlagOn(me) returns Boolean from Standard; |
106 | ---C++: inline |
107 | |
108 | SetExclusionFlag(me:mutable; Status : Boolean from Standard); |
109 | ---C++: inline |
110 | |
111 | |
112 | IsStored(me;aType:KindOfInteractive from AIS) returns Boolean from Standard; |
113 | |
114 | ListOfStoredTypes( me; TheList: in out ListOfInteger from TColStd); |
115 | |
116 | ListOfSignature(me; |
117 | aType : KindOfInteractive from AIS; |
118 | TheStoredList : in out ListOfInteger from TColStd); |
119 | |
120 | |
121 | IsSignatureIn(me;aType:KindOfInteractive from AIS;aSignature:Integer from Standard) |
122 | returns Boolean from Standard is static private; |
123 | |
124 | fields |
125 | myIsExclusionFlagOn : Boolean from Standard; |
126 | myStoredTypes : DataMapOfIntegerListOfInteger from TColStd; |
127 | end ExclusionFilter; |