0024428: Implementation of LGPL license
[occt.git] / src / AIS / AIS_AttributeFilter.cdl
1 -- Created on: 1997-03-04
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
9 -- under the terms of the GNU Lesser General Public 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 class AttributeFilter from AIS inherits Filter from SelectMgr
18
19         ---Purpose: Selects Interactive Objects, which have the desired width or color.
20         -- The filter questions each Interactive Object in local
21         -- context to determine whether it has an non-null
22         -- owner, and if so, whether it has the required color
23         -- and width attributes. If the object returns true in each
24         -- case, it is kept. If not, it is rejected.
25         -- This filter is used only in an open local context.
26         -- In the Collector viewer, you can only locate
27         -- Interactive Objects, which answer positively to the
28         -- filters, which are in position when a local context is open.
29
30 uses
31     NameOfColor from Quantity,
32     EntityOwner from SelectMgr
33     
34
35 is
36
37     Create returns mutable AttributeFilter from AIS;
38         ---Purpose:
39         -- Constructs an empty attribute filter object.
40         -- This filter object determines whether selectable
41         -- interactive objects have a non-null owner.   
42     
43     Create (aCol: NameOfColor from Quantity)
44     returns mutable AttributeFilter from AIS;
45         ---Purpose:
46         -- Constructs an attribute filter object defined by the
47         -- color attribute aCol.    
48     Create (aWidth : Real from Standard)
49     returns mutable AttributeFilter from AIS;
50         ---Purpose:
51         -- Constructs an attribute filter object defined by the line
52         -- width attribute aWidth.
53
54     HasColor(me) returns Boolean from Standard;
55         ---C++: inline
56         ---Purpose:
57         -- Indicates that the Interactive Object has the color
58         -- setting specified by the argument aCol at construction time.
59         
60     HasWidth(me) returns Boolean from Standard;
61         ---C++: inline
62         ---Purpose:
63         -- Indicates that the Interactive Object has the width
64         -- setting specified by the argument aWidth at
65         -- construction time.
66         
67     SetColor(me:mutable;aCol: NameOfColor from Quantity);
68         ---C++: inline
69         ---Purpose: Sets the color aCol.
70         -- This must be chosen from the list of colors in Quantity_NameOfColor.
71     
72     SetWidth(me:mutable;aWidth : Real from Standard);
73         ---C++: inline
74         ---Purpose:  Sets the line width aWidth.
75     
76     UnsetColor(me:mutable);
77         ---C++: inline
78         ---Purpose:
79         -- Removes the setting for color from the filter.
80     
81     UnsetWidth(me:mutable);
82         ---C++: inline
83         ---Purpose:
84         -- Removes the setting for width from the filter.
85
86     IsOk(me;anObj : EntityOwner from SelectMgr)
87     returns Boolean from Standard is redefined virtual;
88         ---Purpose: Indicates that the selected Interactive Object passes
89         -- the filter. The owner, anObj, can be either direct or
90         -- user. A direct owner is the corresponding
91         -- construction element, whereas a user is the
92         -- compound shape of which the entity forms a part.
93         -- If the Interactive Object returns Standard_True
94         -- when detected by the Local Context selector through
95         -- the mouse, the object is kept; if not, it is rejected.
96
97
98 fields
99         
100     myCol : NameOfColor from Quantity;
101     myWid : Real from Standard;
102     hasC,hasW : Boolean from Standard;
103     
104 end AttributeFilter;