-- Created on: 1997-03-04 -- Created by: Robert COUBLANC -- Copyright (c) 1997-1999 Matra Datavision -- Copyright (c) 1999-2012 OPEN CASCADE SAS -- -- The content of this file is subject to the Open CASCADE Technology Public -- License Version 6.5 (the "License"). You may not use the content of this file -- except in compliance with the License. Please obtain a copy of the License -- at http://www.opencascade.org and read it completely before using this file. -- -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -- -- The Original Code and all software distributed under the License is -- distributed on an "AS IS" basis, without warranty of any kind, and the -- Initial Developer hereby disclaims all such warranties, including without -- limitation, any warranties of merchantability, fitness for a particular -- purpose or non-infringement. Please see the License for the specific terms -- and conditions governing the rights and limitations under the License. class AttributeFilter from AIS inherits Filter from SelectMgr ---Purpose: Selects Interactive Objects, which have the desired width or color. -- The filter questions each Interactive Object in local -- context to determine whether it has an non-null -- owner, and if so, whether it has the required color -- and width attributes. If the object returns true in each -- case, it is kept. If not, it is rejected. -- This filter is used only in an open local context. -- In the Collector viewer, you can only locate -- Interactive Objects, which answer positively to the -- filters, which are in position when a local context is open. uses NameOfColor from Quantity, EntityOwner from SelectMgr is Create returns mutable AttributeFilter from AIS; ---Purpose: -- Constructs an empty attribute filter object. -- This filter object determines whether selectable -- interactive objects have a non-null owner. Create (aCol: NameOfColor from Quantity) returns mutable AttributeFilter from AIS; ---Purpose: -- Constructs an attribute filter object defined by the -- color attribute aCol. Create (aWidth : Real from Standard) returns mutable AttributeFilter from AIS; ---Purpose: -- Constructs an attribute filter object defined by the line -- width attribute aWidth. HasColor(me) returns Boolean from Standard; ---C++: inline ---Purpose: -- Indicates that the Interactive Object has the color -- setting specified by the argument aCol at construction time. HasWidth(me) returns Boolean from Standard; ---C++: inline ---Purpose: -- Indicates that the Interactive Object has the width -- setting specified by the argument aWidth at -- construction time. SetColor(me:mutable;aCol: NameOfColor from Quantity); ---C++: inline ---Purpose: Sets the color aCol. -- This must be chosen from the list of colors in Quantity_NameOfColor. SetWidth(me:mutable;aWidth : Real from Standard); ---C++: inline ---Purpose: Sets the line width aWidth. UnsetColor(me:mutable); ---C++: inline ---Purpose: -- Removes the setting for color from the filter. UnsetWidth(me:mutable); ---C++: inline ---Purpose: -- Removes the setting for width from the filter. IsOk(me;anObj : EntityOwner from SelectMgr) returns Boolean from Standard is redefined virtual; ---Purpose: Indicates that the selected Interactive Object passes -- the filter. The owner, anObj, can be either direct or -- user. A direct owner is the corresponding -- construction element, whereas a user is the -- compound shape of which the entity forms a part. -- If the Interactive Object returns Standard_True -- when detected by the Local Context selector through -- the mouse, the object is kept; if not, it is rejected. fields myCol : NameOfColor from Quantity; myWid : Real from Standard; hasC,hasW : Boolean from Standard; end AttributeFilter;