1 -- File: AIS_AttributeFilter.cdl
2 -- Created: Tue Mar 4 17:58:52 1997
3 -- Author: Robert COUBLANC
4 -- <rob@robox.paris1.matra-dtv.fr>
5 ---Copyright: Matra Datavision 1997
10 class AttributeFilter from AIS inherits Filter from SelectMgr
12 ---Purpose: Selects Interactive Objects, which have the desired width or color.
13 -- The filter questions each Interactive Object in local
14 -- context to determine whether it has an non-null
15 -- owner, and if so, whether it has the required color
16 -- and width attributes. If the object returns true in each
17 -- case, it is kept. If not, it is rejected.
18 -- This filter is used only in an open local context.
19 -- In the Collector viewer, you can only locate
20 -- Interactive Objects, which answer positively to the
21 -- filters, which are in position when a local context is open.
24 NameOfColor from Quantity,
25 EntityOwner from SelectMgr
30 Create returns mutable AttributeFilter from AIS;
32 -- Constructs an empty attribute filter object.
33 -- This filter object determines whether selectable
34 -- interactive objects have a non-null owner.
36 Create (aCol: NameOfColor from Quantity)
37 returns mutable AttributeFilter from AIS;
39 -- Constructs an attribute filter object defined by the
40 -- color attribute aCol.
41 Create (aWidth : Real from Standard)
42 returns mutable AttributeFilter from AIS;
44 -- Constructs an attribute filter object defined by the line
45 -- width attribute aWidth.
47 HasColor(me) returns Boolean from Standard;
50 -- Indicates that the Interactive Object has the color
51 -- setting specified by the argument aCol at construction time.
53 HasWidth(me) returns Boolean from Standard;
56 -- Indicates that the Interactive Object has the width
57 -- setting specified by the argument aWidth at
60 SetColor(me:mutable;aCol: NameOfColor from Quantity);
62 ---Purpose: Sets the color aCol.
63 -- This must be chosen from the list of colors in Quantity_NameOfColor.
65 SetWidth(me:mutable;aWidth : Real from Standard);
67 ---Purpose: Sets the line width aWidth.
69 UnsetColor(me:mutable);
72 -- Removes the setting for color from the filter.
74 UnsetWidth(me:mutable);
77 -- Removes the setting for width from the filter.
79 IsOk(me;anObj : EntityOwner from SelectMgr)
80 returns Boolean from Standard is redefined virtual;
81 ---Purpose: Indicates that the selected Interactive Object passes
82 -- the filter. The owner, anObj, can be either direct or
83 -- user. A direct owner is the corresponding
84 -- construction element, whereas a user is the
85 -- compound shape of which the entity forms a part.
86 -- If the Interactive Object returns Standard_True
87 -- when detected by the Local Context selector through
88 -- the mouse, the object is kept; if not, it is rejected.
93 myCol : NameOfColor from Quantity;
94 myWid : Real from Standard;
95 hasC,hasW : Boolean from Standard;