b311480e |
1 | -- Created on: 1998-01-08 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class GTool from Interface inherits TShared |
18 | |
19 | ---Purpose : GTool - General Tool for a Model |
20 | -- Provides the functions performed by Protocol/GeneralModule for |
21 | -- entities of a Model, and recorded in a GeneralLib |
22 | -- Optimized : once an entity has been queried, the GeneralLib is |
23 | -- not longer queried |
24 | -- Shareable between several users : as a Handle |
25 | |
26 | uses Transient, |
27 | Protocol, GeneralLib, GeneralModule, |
28 | SignType, InterfaceModel, |
29 | IndexedDataMapOfTransientTransient from TColStd, |
30 | DataMapOfTransientInteger from Interface |
31 | |
32 | is |
33 | |
6e33d3ce |
34 | Create returns GTool; |
7fd59977 |
35 | ---Purpose : Creates an empty, not set, GTool |
36 | |
6e33d3ce |
37 | Create (proto : Protocol; nbent : Integer = 0) returns GTool; |
7fd59977 |
38 | ---Purpose : Creates a GTool from a Protocol |
39 | -- Optional starting count of entities |
40 | |
41 | SetSignType (me : mutable; sign : SignType); |
42 | ---Purpose : Sets a new SignType |
43 | |
44 | SignType (me) returns SignType; |
45 | ---Purpose : Returns the SignType. Can be null |
46 | |
47 | SignValue (me; ent : Transient; model : InterfaceModel) |
48 | returns CString; |
49 | ---Purpose : Returns the Signature for a Transient Object in a Model |
50 | -- It calls SignType to do that |
51 | -- If SignType is not defined, return ClassName of <ent> |
52 | |
53 | SignName (me) returns CString; |
54 | ---Purpose : Returns the Name of the SignType, or "Class Name" |
55 | |
56 | SetProtocol (me : mutable; proto : Protocol; enforce : Boolean = Standard_False); |
57 | ---Purpose : Sets a new Protocol |
58 | -- if <enforce> is False and the new Protocol equates the old one |
59 | -- then nothing is done |
60 | |
61 | Protocol (me) returns Protocol; |
62 | ---Purpose : Returns the Protocol. Warning : it can be Null |
63 | |
64 | Lib (me : mutable) returns GeneralLib; |
65 | ---Purpose : Returns the GeneralLib itself |
66 | ---C++ : return & |
67 | |
68 | Reservate (me : mutable; nb : Integer; enforce : Boolean = Standard_False); |
69 | ---Purpose : Reservates maps for a count of entities |
70 | -- <enforce> False : minimum count |
71 | -- <enforce> True : clears former reservations |
72 | -- Does not clear the maps |
73 | |
74 | ClearEntities (me : mutable); |
75 | ---Purpose : Clears the maps which record, for each already recorded entity |
76 | -- its Module and Case Number |
77 | |
78 | Select (me : mutable; ent : Transient; |
6e33d3ce |
79 | gmod : out GeneralModule; |
7fd59977 |
80 | CN : out Integer; |
81 | enforce : Boolean = Standard_False) returns Boolean; |
82 | ---Purpose : Selects for an entity, its Module and Case Number |
83 | -- It is optimised : once done for each entity, the result is |
84 | -- mapped and the GeneralLib is not longer queried |
85 | -- <enforce> True overpasses this optimisation |
86 | |
87 | fields |
88 | |
89 | theproto : Protocol; |
90 | thesign : SignType; |
91 | thelib : GeneralLib; |
92 | thentnum : DataMapOfTransientInteger; |
93 | thentmod : IndexedDataMapOfTransientTransient; |
94 | |
95 | end GTool; |