7fd59977 |
1 | -- File: STEPCAFControl_Writer.cdl |
2 | -- Created: Tue Aug 15 17:23:00 2000 |
3 | -- Author: Andrey BETENEV |
4 | -- <abv@doomox.nnov.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 2000 |
6 | |
7 | |
8 | class Writer from STEPCAFControl |
9 | -- inherits Writer from STEPControl |
10 | |
11 | ---Purpose: Provides a tool to write DECAF document to the |
12 | -- STEP file. Besides transfer of shapes (including |
13 | -- assemblies) provided by STEPControl, supports also |
14 | -- colors and part names |
15 | -- |
16 | -- Also supports multifile writing |
17 | |
18 | uses |
19 | AsciiString from TCollection, |
20 | ReturnStatus from IFSelect, |
21 | WorkSession from XSControl, |
22 | Shape from TopoDS, |
23 | Writer from STEPControl, |
24 | StepModelType from STEPControl, |
25 | DictionaryOfExternFile from STEPCAFControl, |
26 | ExternFile from STEPCAFControl, |
27 | Label from TDF, |
28 | LabelSequence from TDF, |
29 | DataMapOfLabelShape from STEPCAFControl, |
30 | DataMapOfLabelExternFile from STEPCAFControl, |
31 | Document from TDocStd, |
32 | DataMapOfShapeTransient from MoniTool |
33 | |
34 | is |
35 | |
36 | Create returns Writer; |
37 | ---Purpose: Creates a writer with an empty |
38 | -- STEP model and sets ColorMode, LayerMode, NameMode and |
39 | -- PropsMode to Standard_True. |
40 | |
41 | Create (WS : mutable WorkSession from XSControl; |
42 | scratch : Boolean = Standard_True) returns Writer; |
43 | ---Purpose: Creates a reader tool and attaches it to an already existing Session |
44 | -- Clears the session if it was not yet set for STEP |
45 | -- Clears the internal data structures |
46 | |
47 | Init (me: in out; WS : mutable WorkSession from XSControl; |
48 | scratch : Boolean = Standard_True); |
49 | ---Purpose: Clears the internal data structures and attaches to a new session |
50 | -- Clears the session if it was not yet set for STEP |
51 | |
52 | Write (me : in out; filename : CString) |
53 | returns ReturnStatus from IFSelect; |
54 | ---Purpose: Writes all the produced models into file |
55 | -- In case of multimodel with extern references, |
56 | -- filename will be a name of root file, all other files |
57 | -- have names of corresponding parts |
58 | -- Provided for use like single-file writer |
59 | |
60 | Transfer (me : in out; doc : Document from TDocStd; |
61 | mode: StepModelType from STEPControl = STEPControl_AsIs; |
62 | multi: CString = 0) |
63 | returns Boolean; |
64 | Transfer (me : in out; L: Label from TDF; |
65 | mode: StepModelType from STEPControl = STEPControl_AsIs; |
66 | multi: CString = 0) |
67 | returns Boolean; |
68 | ---Purpose: Transfers a document (or single label) to a STEP model |
69 | -- The mode of translation of shape is AsIs |
70 | -- If multi is not null pointer, it switches to multifile |
71 | -- mode (with external refs), and string pointed by <multi> |
72 | -- gives prefix for names of extern files (can be empty string) |
73 | -- Returns True if translation is OK |
74 | |
75 | Perform (me : in out; doc : Document from TDocStd; |
76 | filename: AsciiString from TCollection) |
77 | returns Boolean; |
78 | |
79 | Perform (me : in out; doc : Document from TDocStd; filename: CString) |
80 | returns Boolean; |
81 | ---Purpose : Transfers a document and writes it to a STEP file |
82 | -- Returns True if translation is OK |
83 | |
84 | ---Scope: Access to fields |
85 | |
86 | ExternFiles (me) returns DictionaryOfExternFile from STEPCAFControl; |
87 | ---Purpose: Returns data on external files |
88 | -- Returns Null handle if no external files are read |
89 | ---C++: return const & |
90 | |
91 | ExternFile (me; L: Label from TDF; ef: out ExternFile from STEPCAFControl) |
92 | returns Boolean; |
93 | ---Purpose: Returns data on external file by its original label |
94 | -- Returns False if no external file with given name is read |
95 | |
96 | ExternFile (me; name: CString; ef: out ExternFile from STEPCAFControl) |
97 | returns Boolean; |
98 | ---Purpose: Returns data on external file by its name |
99 | -- Returns False if no external file with given name is read |
100 | |
101 | ChangeWriter (me: in out) returns Writer from STEPControl; |
102 | ---Purpose: Returns basic reader for root file |
103 | ---C++: return & |
104 | |
105 | Writer (me) returns Writer from STEPControl; |
106 | ---Purpose: Returns basic reader as const |
107 | ---C++: return const & |
108 | |
109 | ---Scope: Internal methods |
110 | |
111 | Transfer (me : in out; wr: in out Writer from STEPControl; |
112 | labels: LabelSequence from TDF; |
113 | mode: StepModelType from STEPControl = STEPControl_AsIs; |
114 | multi: CString = 0; |
115 | isExternFile: Boolean = Standard_False) |
116 | returns Boolean is protected; |
117 | ---Purpose: Transfers labels to a STEP model |
118 | -- Returns True if translation is OK |
119 | -- isExternFile setting from TransferExternFiles method |
120 | |
121 | TransferExternFiles (me : in out; L: Label from TDF; |
122 | mode: StepModelType from STEPControl; |
123 | Lseq: out LabelSequence from TDF; |
124 | prefix: CString = "") |
125 | returns Shape from TopoDS is protected; |
126 | ---Purpose: Parses assembly structure of label L, writes all the simple |
127 | -- shapes each to its own file named by name of its label plus |
128 | -- prefix |
129 | -- Returns shape representing that assembly structure |
130 | -- in the form of nested empty compounds (and a sequence of |
131 | -- labels which are newly written nodes of this assembly) |
132 | |
133 | WriteExternRefs (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF) |
134 | returns Boolean is protected; |
135 | ---Purpose: Write external references to STEP |
136 | |
137 | WriteColors (me: in out; WS: WorkSession from XSControl; labels: LabelSequence from TDF) |
138 | returns Boolean is protected; |
139 | ---Purpose: Write colors assigned to specified labels, to STEP model |
140 | |
141 | WriteNames (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF) |
142 | returns Boolean is protected; |
143 | ---Purpose: Write names assigned to specified labels, to STEP model |
144 | |
145 | WriteDGTs (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF) |
146 | returns Boolean is protected; |
147 | ---Purpose: Write D>s assigned to specified labels, to STEP model |
148 | |
149 | WriteMaterials (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF) |
150 | returns Boolean is protected; |
151 | ---Purpose: Write materials assigned to specified labels, to STEP model |
152 | |
153 | WriteValProps (me; WS: WorkSession from XSControl; |
154 | labels: LabelSequence from TDF; multi: CString) |
155 | returns Boolean is protected; |
156 | ---Purpose: Write validation properties assigned to specified labels, |
157 | -- to STEP model |
158 | |
159 | WriteLayers (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF) |
160 | returns Boolean is protected; |
161 | ---Purpose: Write layers assigned to specified labels, to STEP model |
162 | |
163 | WriteSHUOs (me: in out; WS: WorkSession from XSControl; labels: LabelSequence from TDF) |
164 | returns Boolean is protected; |
165 | ---Purpose: Write SHUO assigned to specified component, to STEP model |
166 | |
167 | --- Work with fileds for different mode of writing STEP file. |
168 | |
169 | SetColorMode(me: in out; colormode: Boolean from Standard); |
170 | ---Purpose: Set ColorMode for indicate write Colors or not. |
171 | |
172 | GetColorMode(me) returns Boolean; |
173 | |
174 | SetNameMode(me: in out; namemode: Boolean from Standard); |
175 | ---Purpose: Set NameMode for indicate write Name or not. |
176 | |
177 | GetNameMode(me) returns Boolean; |
178 | |
179 | SetLayerMode(me: in out; layermode: Boolean from Standard); |
180 | ---Purpose: Set LayerMode for indicate write Layers or not. |
181 | |
182 | GetLayerMode(me) returns Boolean; |
183 | |
184 | SetPropsMode(me: in out; propsmode: Boolean from Standard); |
185 | ---Purpose: PropsMode for indicate write Validation properties or not. |
186 | |
187 | GetPropsMode(me) returns Boolean; |
188 | |
189 | SetSHUOMode(me: in out; shuomode: Boolean from Standard); |
190 | ---Purpose: Set SHUO mode for indicate write SHUO or not. |
191 | |
192 | GetSHUOMode(me) returns Boolean; |
193 | |
194 | SetDimTolMode(me: in out; dimtolmode: Boolean from Standard); |
195 | ---Purpose: Set dimtolmode for indicate write D>s or not. |
196 | |
197 | GetDimTolMode(me) returns Boolean; |
198 | |
199 | SetMaterialMode(me: in out; matmode: Boolean from Standard); |
200 | ---Purpose: Set dimtolmode for indicate write D>s or not. |
201 | |
202 | GetMaterialMode(me) returns Boolean; |
203 | |
204 | fields |
205 | |
206 | myWriter : Writer from STEPControl; |
207 | myFiles : DictionaryOfExternFile from STEPCAFControl; |
208 | myLabels : DataMapOfLabelShape from STEPCAFControl; |
209 | myLabEF : DataMapOfLabelExternFile from STEPCAFControl; |
210 | myColorMode: Boolean; |
211 | myNameMode : Boolean; |
212 | myLayerMode: Boolean; |
213 | myPropsMode: Boolean; |
214 | mySHUOMode : Boolean; |
215 | myMapCompMDGPR : DataMapOfShapeTransient from MoniTool; |
216 | myDGTMode : Boolean; |
217 | myMatMode : Boolean; |
218 | |
219 | end Writer; |