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); |
83 | |
84 | ID(me) returns GUID from Standard |
85 | is redefined static; |
86 | ---Purpose: Returns the ID of the attribute. |
87 | ---C++: inline |
88 | ---C++: return const & |
89 | |
90 | BackupCopy(me) returns mutable Attribute from TDF |
91 | is redefined; |
92 | ---Purpose: Copies the attribute contents into a new other |
93 | -- attribute. It is used by Backup(). |
94 | |
95 | Restore(me: mutable; anAttribute : Attribute from TDF) |
96 | is redefined; |
97 | ---Purpose: Restores the contents from <anAttribute> into this |
98 | -- one. It is used when aborting a transaction. |
99 | -- |
100 | |
101 | -- Delta use methods |
102 | -- ----------------- |
103 | |
104 | DeltaOnModification(me; anOldAttribute : Attribute from TDF) |
105 | returns DeltaOnModification from TDF |
106 | ---Purpose : Makes a DeltaOnModification between <me> and |
107 | -- <anOldAttribute. |
108 | is redefined virtual; |
109 | |
110 | DeltaOnModification(me : mutable; aDelta : DeltaOnModification from TDF) |
111 | is redefined virtual; |
112 | ---Purpose: Applies a DeltaOnModification to <me>. |
113 | |
114 | DeltaOnRemoval(me) |
115 | returns DeltaOnRemoval from TDF |
116 | ---Purpose : Makes a DeltaOnRemoval on <me> because <me> has |
117 | -- disappeared from the DS. |
118 | is redefined virtual; |
119 | |
120 | |
121 | -- Copy use methods |
122 | -- ---------------- |
123 | |
124 | NewEmpty(me) |
125 | returns mutable Attribute from TDF |
126 | is redefined; |
127 | ---Purpose: Returns an new empty attribute from the good end |
128 | -- type. It is used by the copy algorithm. |
129 | |
130 | Paste(me; |
131 | intoAttribute : mutable Attribute from TDF; |
132 | aRelocTationable : mutable RelocationTable from TDF) |
133 | is redefined; |
134 | ---Purpose: This method is different from the "Copy" one, |
135 | -- because it is used when copying an attribute from |
136 | -- a source structure into a target structure. This |
137 | -- method pastes the current attribute to the label |
138 | -- corresponding to the insertor. The pasted |
139 | -- attribute may be a brand new one or a new version |
140 | -- of the previous one. |
141 | |
7fd59977 |
142 | References(me; aDataSet : DataSet from TDF) |
143 | is redefined; |
144 | ---Purpose: Adds the directly referenced attributes and labels |
145 | -- to <aDataSet>. "Directly" means we have only to |
146 | -- look at the first level of references. |
147 | |
148 | |
149 | BeforeRemoval(me: mutable) is redefined; |
150 | |
151 | BeforeUndo(me: mutable; |
152 | anAttDelta : AttributeDelta from TDF; |
153 | forceIt : Boolean from Standard = Standard_False) |
154 | returns Boolean from Standard |
155 | is redefined; |
156 | ---Purpose: Something to do before applying <anAttDelta> |
157 | |
158 | AfterUndo(me: mutable; |
159 | anAttDelta : AttributeDelta from TDF; |
160 | forceIt : Boolean from Standard = Standard_False) |
161 | returns Boolean from Standard |
162 | is redefined; |
163 | ---Purpose: Something to do after applying <anAttDelta>. |
164 | |
165 | |
166 | -- Methods to build contents of the TNaming attribute |
167 | -- This methods are private. the only one way to build |
168 | -- an Attribute is to use the TNaming_Builder. |
169 | ----------------------------------------------------- |
170 | |
171 | Add(me : mutable ; Evolution : in out PtrNode from TNaming) |
172 | ---Purpose: Adds an evolution |
173 | is private; |
174 | |
175 | |
176 | Dump(me; anOS : in out OStream from Standard) |
177 | returns OStream from Standard |
178 | is redefined ; |
179 | ---Purpose: Dumps the attribute on <aStream>. |
180 | ---C++: return & |
181 | |
182 | fields |
183 | myNode : PtrNode from TNaming; |
184 | myEvolution : Evolution from TNaming; |
185 | myVersion : Integer from Standard; |
186 | |
187 | friends |
188 | class Builder from TNaming, |
189 | class Iterator from TNaming, |
190 | class NewShapeIterator from TNaming, |
191 | class OldShapeIterator from TNaming |
192 | |
193 | end Attribute; |