b311480e |
1 | -- Created on: 1997-02-04 |
2 | -- Created by: Yves FRICAUD |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class NamedShape from TNaming inherits Attribute from TDF |
24 | |
25 | ---Purpose: The basis to define an attribute for the storage of |
26 | -- topology and naming data. |
27 | -- This attribute contains two parts: |
28 | -- - The type of evolution, a term of the |
29 | -- enumeration TNaming_Evolution |
30 | -- - A list of pairs of shapes called the "old" |
31 | -- shape and the "new" shape. The meaning |
32 | -- depends on the type of evolution. |
33 | |
34 | uses |
35 | GUID from Standard, |
36 | PtrNode from TNaming, |
37 | Evolution from TNaming, |
38 | DeltaOnModification from TDF, |
39 | DeltaOnRemoval from TDF, |
40 | RelocationTable from TDF, |
41 | AttributeIndexedMap from TDF, |
42 | Attribute from TDF, |
43 | AttributeDelta from TDF, |
44 | Delta from TDF, |
45 | DataSet from TDF, |
46 | Shape from TopoDS |
47 | |
48 | |
49 | is |
50 | |
51 | ---Purpose: class method |
52 | -- ============ |
53 | |
54 | GetID(myclass) returns GUID from Standard; |
55 | ---Purpose: Returns the GUID for named shapes. |
56 | ---C++: return const & |
57 | |
58 | Create returns mutable NamedShape from TNaming; |
59 | |
60 | |
61 | IsEmpty (me) |
62 | returns Boolean from Standard; |
63 | |
64 | Get (me) |
65 | ---Purpose: Returns the shapes contained in <NS>. Returns a null |
66 | -- shape if IsEmpty. |
67 | returns Shape from TopoDS; |
68 | |
69 | |
70 | Evolution (me) returns Evolution from TNaming; |
71 | ---Purpose: Returns the Evolution of the attribute. |
72 | ---C++: inline |
73 | |
74 | Version (me) returns Integer from Standard; |
75 | ---Purpose: Returns the Version of the attribute. |
76 | ---C++: inline |
77 | |
78 | SetVersion (me : mutable; version : Integer from Standard); |
79 | ---Purpose: Set the Version of the attribute. |
80 | ---C++: inline |
81 | |
82 | Clear (me : mutable); |
deb26df7 |
83 | ---C++: alias ~ |
7fd59977 |
84 | |
85 | ID(me) returns GUID from Standard |
86 | is redefined static; |
87 | ---Purpose: Returns the ID of the attribute. |
88 | ---C++: inline |
89 | ---C++: return const & |
90 | |
91 | BackupCopy(me) returns mutable Attribute from TDF |
92 | is redefined; |
93 | ---Purpose: Copies the attribute contents into a new other |
94 | -- attribute. It is used by Backup(). |
95 | |
96 | Restore(me: mutable; anAttribute : Attribute from TDF) |
97 | is redefined; |
98 | ---Purpose: Restores the contents from <anAttribute> into this |
99 | -- one. It is used when aborting a transaction. |
100 | -- |
101 | |
102 | -- Delta use methods |
103 | -- ----------------- |
104 | |
105 | DeltaOnModification(me; anOldAttribute : Attribute from TDF) |
106 | returns DeltaOnModification from TDF |
107 | ---Purpose : Makes a DeltaOnModification between <me> and |
108 | -- <anOldAttribute. |
109 | is redefined virtual; |
110 | |
111 | DeltaOnModification(me : mutable; aDelta : DeltaOnModification from TDF) |
112 | is redefined virtual; |
113 | ---Purpose: Applies a DeltaOnModification to <me>. |
114 | |
115 | DeltaOnRemoval(me) |
116 | returns DeltaOnRemoval from TDF |
117 | ---Purpose : Makes a DeltaOnRemoval on <me> because <me> has |
118 | -- disappeared from the DS. |
119 | is redefined virtual; |
120 | |
121 | |
122 | -- Copy use methods |
123 | -- ---------------- |
124 | |
125 | NewEmpty(me) |
126 | returns mutable Attribute from TDF |
127 | is redefined; |
128 | ---Purpose: Returns an new empty attribute from the good end |
129 | -- type. It is used by the copy algorithm. |
130 | |
131 | Paste(me; |
132 | intoAttribute : mutable Attribute from TDF; |
133 | aRelocTationable : mutable RelocationTable from TDF) |
134 | is redefined; |
135 | ---Purpose: This method is different from the "Copy" one, |
136 | -- because it is used when copying an attribute from |
137 | -- a source structure into a target structure. This |
138 | -- method pastes the current attribute to the label |
139 | -- corresponding to the insertor. The pasted |
140 | -- attribute may be a brand new one or a new version |
141 | -- of the previous one. |
142 | |
7fd59977 |
143 | References(me; aDataSet : DataSet from TDF) |
144 | is redefined; |
145 | ---Purpose: Adds the directly referenced attributes and labels |
146 | -- to <aDataSet>. "Directly" means we have only to |
147 | -- look at the first level of references. |
148 | |
149 | |
150 | BeforeRemoval(me: mutable) is redefined; |
151 | |
152 | BeforeUndo(me: mutable; |
153 | anAttDelta : AttributeDelta from TDF; |
154 | forceIt : Boolean from Standard = Standard_False) |
155 | returns Boolean from Standard |
156 | is redefined; |
157 | ---Purpose: Something to do before applying <anAttDelta> |
158 | |
159 | AfterUndo(me: mutable; |
160 | anAttDelta : AttributeDelta from TDF; |
161 | forceIt : Boolean from Standard = Standard_False) |
162 | returns Boolean from Standard |
163 | is redefined; |
164 | ---Purpose: Something to do after applying <anAttDelta>. |
165 | |
166 | |
167 | -- Methods to build contents of the TNaming attribute |
168 | -- This methods are private. the only one way to build |
169 | -- an Attribute is to use the TNaming_Builder. |
170 | ----------------------------------------------------- |
171 | |
172 | Add(me : mutable ; Evolution : in out PtrNode from TNaming) |
173 | ---Purpose: Adds an evolution |
174 | is private; |
175 | |
176 | |
177 | Dump(me; anOS : in out OStream from Standard) |
178 | returns OStream from Standard |
179 | is redefined ; |
180 | ---Purpose: Dumps the attribute on <aStream>. |
181 | ---C++: return & |
182 | |
183 | fields |
184 | myNode : PtrNode from TNaming; |
185 | myEvolution : Evolution from TNaming; |
186 | myVersion : Integer from Standard; |
187 | |
188 | friends |
189 | class Builder from TNaming, |
190 | class Iterator from TNaming, |
191 | class NewShapeIterator from TNaming, |
192 | class OldShapeIterator from TNaming |
193 | |
194 | end Attribute; |