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
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class AttributeFilter from AIS inherits Filter from SelectMgr
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.
31 NameOfColor from Quantity,
32 EntityOwner from SelectMgr
37 Create returns mutable AttributeFilter from AIS;
39 -- Constructs an empty attribute filter object.
40 -- This filter object determines whether selectable
41 -- interactive objects have a non-null owner.
43 Create (aCol: NameOfColor from Quantity)
44 returns mutable AttributeFilter from AIS;
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;
51 -- Constructs an attribute filter object defined by the line
52 -- width attribute aWidth.
54 HasColor(me) returns Boolean from Standard;
57 -- Indicates that the Interactive Object has the color
58 -- setting specified by the argument aCol at construction time.
60 HasWidth(me) returns Boolean from Standard;
63 -- Indicates that the Interactive Object has the width
64 -- setting specified by the argument aWidth at
67 SetColor(me:mutable;aCol: NameOfColor from Quantity);
69 ---Purpose: Sets the color aCol.
70 -- This must be chosen from the list of colors in Quantity_NameOfColor.
72 SetWidth(me:mutable;aWidth : Real from Standard);
74 ---Purpose: Sets the line width aWidth.
76 UnsetColor(me:mutable);
79 -- Removes the setting for color from the filter.
81 UnsetWidth(me:mutable);
84 -- Removes the setting for width from the filter.
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.
100 myCol : NameOfColor from Quantity;
101 myWid : Real from Standard;
102 hasC,hasW : Boolean from Standard;