1 -- Created on: 1993-10-19
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
23 deferred class GeneralModifier from IFSelect inherits TShared
25 ---Purpose : This class gives a frame for Actions which modify the effect
26 -- of a Dispatch, i.e. :
27 -- By Selections and Dispatches, an original Model can be
28 -- splitted into one or more "target" Models : these Models
29 -- contain Entities copied from the original one (that is, a
30 -- part of it). Basically, these dispatched Entities are copied
31 -- as identical to their original counterparts. Also the copied
32 -- Models reproduce the Header of the original one.
34 -- Modifiers allow to change this copied content : this is the
35 -- way to be used for any kind of alterations, adaptations ...
36 -- They are exploited by a ModelCopier, which firstly performs
37 -- the copy operation described by Dispatches, then invokes the
38 -- Modifiers to work on the result.
40 -- Each GeneralModifier can be attached to :
41 -- - all the Models produced
42 -- - a Dispatch (it will be applied to all the Models obtained
43 -- from this Dispatch) designated by its Ident in a ShareOut
44 -- - in addition, to a Selection (facultative) : this adds a
45 -- criterium, the Modifier is invoked on a produced Model only
46 -- if this Model contains an Entity copied from one of the
47 -- Entities designated by this Selection.
48 -- (for special Modifiers from IFAdapt, while they must work on
49 -- definite Entities, this Selection is mandatory to run)
51 -- Remark : this class has no action attached, it only provides
52 -- a frame to work on criteria. Then, sub-classes will define
53 -- their kind of action, which can be applied at a precise step
54 -- of the production of a File : see Modifier, and in the
55 -- package IFAdapt, EntityModifier and EntityCopier
58 uses AsciiString from TCollection, Selection, Dispatch
62 Initialize (maychangegraph : Boolean);
63 ---Purpose : Sets the Modifier criteria to default Values
64 -- (i.e. "always applies")
65 -- <maychangegraph> must be provided at creation time, to :
66 -- - False if this GeneralModifier surely lets the graph of
67 -- dependencies unchanged (NO edition of any reference, BUT
68 -- also NO entity added or replaced or removed)
69 -- - True if there is a possibility of changing the graph of
70 -- dependencies when this modifier is applied
72 MayChangeGraph (me) returns Boolean;
73 ---Purpose : Returns True if this modifier may change the graph of
74 -- dependences (aknowledged at creation time)
76 SetDispatch (me : mutable; disp : any Dispatch);
77 ---Purpose : Attaches to a Dispatch. If <disp> is Null, Resets it
78 -- (to apply the Modifier on every Dispatch)
80 Dispatch (me) returns any Dispatch;
81 ---Purpose : Returns the Dispatch to be matched, Null if not set
83 Applies (me; disp : Dispatch) returns Boolean;
84 ---Purpose : Returns True if a Model obtained from the Dispatch <disp>
85 -- is to be treated (apart from the Selection criterium)
86 -- If Dispatch(me) is Null, returns True. Else, checks <disp>
89 SetSelection (me : mutable; sel : mutable Selection);
90 ---Purpose : Sets a Selection : a Model is treated if it contains one or
91 -- more Entities designated by the Selection
93 ResetSelection (me : mutable);
94 ---Purpose : Resets the Selection : this criterium is not longer active
96 HasSelection (me) returns Boolean;
97 ---Purpose : Returns True if a Selection is set as an additionnal criterium
99 Selection (me) returns mutable Selection;
100 ---Purpose : Returns the Selection, or a Null Handle if not set
103 Label (me) returns AsciiString from TCollection is deferred;
104 ---Purpose : Returns a short text which defines the operation performed