b311480e |
1 | -- Created on: 2007-07-31 |
2 | -- Created by: Sergey ZARITCHNY |
973c2be1 |
3 | -- Copyright (c) 2007-2014 OPEN CASCADE SAS |
b311480e |
4 | -- |
973c2be1 |
5 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
6 | -- |
d5f74e42 |
7 | -- This library is free software; you can redistribute it and/or modify it under |
8 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | -- by the Free Software Foundation, with special exception defined in the file |
10 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | -- |
973c2be1 |
13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | class IntPackedMap from TDataStd inherits Attribute from TDF |
17 | |
18 | ---Purpose: Attribute for storing TColStd_PackedMapOfInteger |
19 | |
20 | uses |
21 | Attribute from TDF, |
22 | Label from TDF, |
23 | GUID from Standard, |
24 | PackedMapOfInteger from TColStd, |
25 | HPackedMapOfInteger from TColStd, |
26 | DeltaOnModification from TDF, |
27 | RelocationTable from TDF |
28 | |
29 | |
30 | is |
31 | |
32 | ---Purpose: class methods |
33 | -- ============= |
34 | |
35 | GetID (myclass) |
36 | ---C++: return const & |
37 | ---Purpose: Returns the GUID of the attribute. |
38 | returns GUID from Standard; |
39 | |
40 | Set (myclass; label : Label from TDF; isDelta : Boolean from Standard = Standard_False) |
41 | ---Purpose: Finds or creates an integer map attribute on the given label. |
42 | -- If <isDelta> == False, DefaultDeltaOnModification is used. |
43 | -- If <isDelta> == True, DeltaOnModification of the current attribute is used. |
44 | -- If attribute is already set, input parameter <isDelta> is refused and the found |
45 | -- attribute returned. |
46 | returns IntPackedMap from TDataStd; |
47 | |
48 | ---Purpose: Attribute methods |
49 | -- =================== |
50 | |
51 | Create |
6e33d3ce |
52 | returns IntPackedMap from TDataStd; |
7fd59977 |
53 | -- Constructor |
54 | |
55 | ChangeMap (me : mutable; theMap : HPackedMapOfInteger from TColStd) |
56 | -- Sets the inner map to theMap. If the content of theMap is the same as myMap, |
57 | -- it does nothing and return false. Else full backup is performed. |
58 | returns Boolean from Standard; |
59 | |
60 | GetMap (me) |
61 | returns PackedMapOfInteger from TColStd; |
62 | ---C++: inline |
63 | ---C++: return const & |
64 | -- Access to the const interface of the map |
65 | |
66 | GetHMap (me) |
67 | returns HPackedMapOfInteger from TColStd; |
68 | ---C++: inline |
69 | ---C++: return const & |
70 | -- Access to the handle of the map. |
71 | -- WARNING! do not use the handle returned by this method to modify the map, |
72 | -- otherwise undo/redo mechanism will be failed. |
73 | |
74 | Clear(me : mutable) |
75 | returns Boolean from Standard; |
76 | -- Clears the inner map. Returns false if map is alredy empty. |
77 | |
78 | Add(me : mutable; theKey : Integer from Standard) |
79 | returns Boolean from Standard; |
80 | -- Adds a new key to the map. Returns false if this key already exists. |
81 | |
82 | Remove(me : mutable; theKey : Integer from Standard) |
83 | returns Boolean from Standard; |
84 | -- Removes the key from the map. Returns false if this key was not found. |
85 | |
86 | Contains(me; theKey : Integer from Standard) |
87 | returns Boolean from Standard; |
88 | -- Returns true if the key contains in the map, false otherwise |
89 | |
90 | Extent(me) |
91 | ---C++: inline |
92 | returns Integer from Standard; |
93 | -- Returns the size of the map |
94 | |
95 | IsEmpty(me) |
96 | ---C++: inline |
97 | returns Boolean from Standard; |
98 | |
99 | GetDelta(me) returns Boolean from Standard; |
100 | ---C++: inline |
101 | |
102 | SetDelta(me : mutable; isDelta : Boolean from Standard); |
103 | ---C++: inline |
104 | ---Purpose: for internal use only! |
105 | |
106 | RemoveMap(me : mutable) is private; |
107 | ---C++: inline |
108 | ---Category: TDF_Attribute methods |
109 | -- ===================== |
110 | |
111 | ID (me) |
112 | ---C++: return const & |
113 | returns GUID from Standard; |
114 | |
115 | Restore (me: mutable; with : Attribute from TDF); |
116 | -- Restores the backuped content from <with> into this one. |
117 | |
118 | NewEmpty (me) |
6e33d3ce |
119 | returns Attribute from TDF; |
7fd59977 |
120 | -- Returns an new empty AsciiString attribute. |
121 | |
6e33d3ce |
122 | Paste (me; into : Attribute from TDF; |
123 | RT : RelocationTable from TDF); |
7fd59977 |
124 | -- This method is used when copying an attribute from a source structure |
125 | -- into a target structure. |
126 | |
127 | Dump(me; anOS : in out OStream from Standard) |
128 | returns OStream from Standard |
129 | is redefined; |
130 | ---C++: return & |
131 | -- This method dumps the attribute value into the stream |
132 | |
133 | ---Category: methods to be added for using in DeltaOn Modification |
134 | -- ===================================================== |
135 | DeltaOnModification(me; anOldAttribute : Attribute from TDF) |
136 | returns DeltaOnModification from TDF |
137 | ---Purpose : Makes a DeltaOnModification between <me> and |
138 | -- <anOldAttribute>. |
139 | is redefined virtual; |
140 | |
141 | |
142 | fields |
143 | |
144 | myMap : HPackedMapOfInteger from TColStd; |
145 | myIsDelta : Boolean from Standard; |
146 | |
147 | friends |
148 | |
149 | class DeltaOnModificationOfIntPackedMap from TDataStd |
150 | |
151 | end IntPackedMap; |