0032174: Data Exchange - read.step.root.transformation parameter has reversed definition
[occt.git] / src / STEPControl / STEPControl_Controller.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 //:j4 gka 16.03.99 S4134
15 //    gka 05.04.99 S4136: parameters definitions changed
16
17 #include <APIHeaderSection_EditHeader.hxx>
18 #include <APIHeaderSection_MakeHeader.hxx>
19 #include <HeaderSection.hxx>
20 #include <IFSelect_EditForm.hxx>
21 #include <IFSelect_SelectModelRoots.hxx>
22 #include <IFSelect_SelectSignature.hxx>
23 #include <IFSelect_SignAncestor.hxx>
24 #include <IFSelect_SignCounter.hxx>
25 #include <Interface_InterfaceModel.hxx>
26 #include <Interface_Macros.hxx>
27 #include <Interface_Static.hxx>
28 #include <RWHeaderSection.hxx>
29 #include <RWStepAP214.hxx>
30 #include <Standard_Type.hxx>
31 #include <Standard_Version.hxx>
32 #include <STEPControl_ActorRead.hxx>
33 #include <STEPControl_ActorWrite.hxx>
34 #include <STEPControl_Controller.hxx>
35 #include <StepData_FileProtocol.hxx>
36 #include <StepData_StepModel.hxx>
37 #include <STEPEdit.hxx>
38 #include <STEPEdit_EditContext.hxx>
39 #include <STEPEdit_EditSDR.hxx>
40 #include <StepSelect_StepType.hxx>
41 #include <StepSelect_WorkLibrary.hxx>
42 #include <STEPSelections_SelectAssembly.hxx>
43 #include <STEPSelections_SelectDerived.hxx>
44 #include <STEPSelections_SelectFaces.hxx>
45 #include <STEPSelections_SelectForTransfer.hxx>
46 #include <STEPSelections_SelectGSCurves.hxx>
47 #include <STEPSelections_SelectInstances.hxx>
48 #include <TCollection_HAsciiString.hxx>
49 #include <TopoDS_Shape.hxx>
50 #include <Transfer_ActorOfTransientProcess.hxx>
51 #include <Transfer_FinderProcess.hxx>
52 #include <XSAlgo.hxx>
53 #include <XSControl_WorkSession.hxx>
54
55 IMPLEMENT_STANDARD_RTTIEXT(STEPControl_Controller,XSControl_Controller)
56
57 //  Pour NewModel et Write : definition de produit (temporaire ...)
58 STEPControl_Controller::STEPControl_Controller ()
59 : XSControl_Controller ("STEP", "step")
60 {
61   static Standard_Boolean init = Standard_False;
62   if (!init) {
63     RWHeaderSection::Init();  RWStepAP214::Init();
64
65     Interface_Static::Init ("step","write.step.product.name",'t',"Open CASCADE STEP translator " OCC_VERSION_STRING);
66     Interface_Static::Init ("step","write.step.assembly",'e',"");
67     Interface_Static::Init ("step","write.step.assembly",'&',"enum 0");
68     Interface_Static::Init ("step","write.step.assembly",'&',"eval Off");
69     Interface_Static::Init ("step","write.step.assembly",'&',"eval On");
70     Interface_Static::Init ("step","write.step.assembly",'&',"eval Auto");
71     Interface_Static::SetCVal("write.step.assembly","Auto"); 
72
73     Interface_Static::Init("step","step.angleunit.mode", 'e',"");
74     Interface_Static::Init("step","step.angleunit.mode", '&',"enum 0");
75     Interface_Static::Init("step","step.angleunit.mode", '&',"eval File");
76     Interface_Static::Init("step","step.angleunit.mode", '&',"eval Rad");
77     Interface_Static::Init("step","step.angleunit.mode", '&',"eval Deg");
78     Interface_Static::SetCVal("step.angleunit.mode","File"); 
79
80     Interface_Static::Init("step","write.step.schema", 'e',"");  
81     Interface_Static::Init("step","write.step.schema",'&',"enum 1");
82     Interface_Static::Init("step","write.step.schema",'&',"eval AP214CD");
83     Interface_Static::Init("step","write.step.schema",'&',"eval AP214DIS");
84     Interface_Static::Init("step","write.step.schema",'&',"eval AP203");
85     Interface_Static::Init("step","write.step.schema",'&',"eval AP214IS");
86     Interface_Static::Init("step","write.step.schema",'&',"eval AP242DIS");
87     Interface_Static::SetCVal("write.step.schema","AP214IS"); 
88
89     // Type of Product Definition for reading
90     // Note: the numbers should be consistent with function FindShapeReprType()
91     // in STEPControl_ActorRead.cxx
92     Interface_Static::Init("step","read.step.shape.repr",'e',"");
93     Interface_Static::Init("step","read.step.shape.repr",'&',"enum 1");
94     Interface_Static::Init("step","read.step.shape.repr",'&',"eval All");   // 1
95     Interface_Static::Init("step","read.step.shape.repr",'&',"eval ABSR");  // 2
96     Interface_Static::Init("step","read.step.shape.repr",'&',"eval MSSR");  // 3
97     Interface_Static::Init("step","read.step.shape.repr",'&',"eval GBSSR"); // 4
98     Interface_Static::Init("step","read.step.shape.repr",'&',"eval FBSR");  // 5
99     Interface_Static::Init("step","read.step.shape.repr",'&',"eval EBWSR"); // 6
100     Interface_Static::Init("step","read.step.shape.repr",'&',"eval GBWSR"); // 7
101     Interface_Static::SetCVal("read.step.shape.repr","All");
102
103     // Mode for reading shapes attached to main SDR by SRR
104     // (hybrid model representation in AP203 since 1998)
105     Interface_Static::Init("step","read.step.shape.relationship",'e',"");
106     Interface_Static::Init("step","read.step.shape.relationship",'&',"enum 0");
107     Interface_Static::Init("step","read.step.shape.relationship",'&',"eval OFF");
108     Interface_Static::Init("step","read.step.shape.relationship",'&',"eval ON");
109     Interface_Static::SetCVal("read.step.shape.relationship","ON");
110
111     // Mode for reading shapes attached to Product by ShapeAspect 
112     // (hybrid model representation in AP203 before 1998)
113     Interface_Static::Init("step","read.step.shape.aspect",'e',"");
114     Interface_Static::Init("step","read.step.shape.aspect",'&',"enum 0");
115     Interface_Static::Init("step","read.step.shape.aspect",'&',"eval OFF");
116     Interface_Static::Init("step","read.step.shape.aspect",'&',"eval ON");
117     Interface_Static::SetCVal("read.step.shape.aspect","ON");
118
119     // Mode for reading SDR and ShapeRepr if it is necessary
120     Interface_Static::Init("step","read.step.product.mode",'e',"");
121     Interface_Static::Init("step","read.step.product.mode",'&',"enum 0");
122     Interface_Static::Init("step","read.step.product.mode",'&',"eval OFF");
123     Interface_Static::Init("step","read.step.product.mode",'&',"eval ON");
124     Interface_Static::SetCVal("read.step.product.mode","ON");
125
126     // Order of reading ShapeDefinitionRepresentation in ProductDefinition
127     Interface_Static::Init("step","read.step.product.context",'e',"");
128     Interface_Static::Init("step","read.step.product.context",'&',"enum 1");
129     Interface_Static::Init("step","read.step.product.context",'&',"eval all");     // 1
130     Interface_Static::Init("step","read.step.product.context",'&',"eval design");  // 2
131     Interface_Static::Init("step","read.step.product.context",'&',"eval analysis");// 3
132     Interface_Static::SetCVal("read.step.product.context","all");
133
134     // What we try to read in ProductDefinition
135     Interface_Static::Init("step","read.step.assembly.level",'e',"");
136     Interface_Static::Init("step","read.step.assembly.level",'&',"enum 1");
137     Interface_Static::Init("step","read.step.assembly.level",'&',"eval all");      // 1
138     Interface_Static::Init("step","read.step.assembly.level",'&',"eval assembly"); // 2
139     Interface_Static::Init("step","read.step.assembly.level",'&',"eval structure");// 3
140     Interface_Static::Init("step","read.step.assembly.level",'&',"eval shape");    // 4
141     Interface_Static::SetCVal("read.step.assembly.level","all");
142
143     // unit: supposed to be cascade unit (target unit for reading)
144     Interface_Static::Init("step","write.step.unit", 'e',"");
145     Interface_Static::Init("step","write.step.unit",'&',"enum 1");
146     Interface_Static::Init("step","write.step.unit",'&',"eval INCH");  // 1
147     Interface_Static::Init("step","write.step.unit",'&',"eval MM");    // 2
148     Interface_Static::Init("step","write.step.unit",'&',"eval ??");    // 3
149     Interface_Static::Init("step","write.step.unit",'&',"eval FT");    // 4
150     Interface_Static::Init("step","write.step.unit",'&',"eval MI");    // 5
151     Interface_Static::Init("step","write.step.unit",'&',"eval M");     // 6
152     Interface_Static::Init("step","write.step.unit",'&',"eval KM");    // 7
153     Interface_Static::Init("step","write.step.unit",'&',"eval MIL");   // 8
154     Interface_Static::Init("step","write.step.unit",'&',"eval UM");    // 9
155     Interface_Static::Init("step","write.step.unit",'&',"eval CM");    //10
156     Interface_Static::Init("step","write.step.unit",'&',"eval UIN");   //11
157     Interface_Static::SetCVal ("write.step.unit","MM");
158
159     // Non-manifold topology reading: OFF by default (ssv; 26.11.2010)
160     Interface_Static::Init ("step","read.step.nonmanifold",'e',"");
161     Interface_Static::Init ("step","read.step.nonmanifold",'&',"enum 0");
162     Interface_Static::Init ("step","read.step.nonmanifold",'&',"eval Off");
163     Interface_Static::Init ("step","read.step.nonmanifold",'&',"eval On");
164     Interface_Static::SetIVal("read.step.nonmanifold",0); 
165
166     // Non-manifold topology writing: OFF by default (ssv; 26.11.2010)
167     Interface_Static::Init ("step","write.step.nonmanifold",'e',"");
168     Interface_Static::Init ("step","write.step.nonmanifold",'&',"enum 0");
169     Interface_Static::Init ("step","write.step.nonmanifold",'&',"eval Off");
170     Interface_Static::Init ("step","write.step.nonmanifold",'&',"eval On");
171     Interface_Static::SetIVal("write.step.nonmanifold",0); 
172
173     // I-Deas-like STEP processing: OFF by default (ssv; 22.11.2010)
174     Interface_Static::Init ("step","read.step.ideas",'e',"");
175     Interface_Static::Init ("step","read.step.ideas",'&',"enum 0");
176     Interface_Static::Init ("step","read.step.ideas",'&',"eval Off");
177     Interface_Static::Init ("step","read.step.ideas",'&',"eval On");
178     Interface_Static::SetIVal("read.step.ideas",0); 
179
180     //Parameter to write all free vertices in one SDR (name and style of vertex are lost) (default) 
181     //or each vertex in its own SDR (name and style of vertex are exported). (ika; 21.07.2014) 
182     Interface_Static::Init ("step","write.step.vertex.mode",'e',"");
183     Interface_Static::Init ("step","write.step.vertex.mode",'&',"enum 0");
184     Interface_Static::Init ("step","write.step.vertex.mode",'&',"eval One Compound");
185     Interface_Static::Init ("step","write.step.vertex.mode",'&',"eval Single Vertex");
186     Interface_Static::SetIVal("write.step.vertex.mode",0);
187   
188     // abv 15.11.00: ShapeProcessing
189     Interface_Static::Init ("XSTEP","write.step.resource.name",'t',"STEP");
190     Interface_Static::Init ("XSTEP","read.step.resource.name",'t',"STEP");
191     Interface_Static::Init ("XSTEP","write.step.sequence",'t',"ToSTEP");
192     Interface_Static::Init ("XSTEP","read.step.sequence",'t',"FromSTEP");
193
194     // ika 28.07.16: Paremeter to read all top level solids and shells,
195     // should be used only in case of invalid shape_representation without links to shapes.
196     Interface_Static::Init("step", "read.step.all.shapes", 'e', "");
197     Interface_Static::Init("step", "read.step.all.shapes", '&', "enum 0");
198     Interface_Static::Init("step", "read.step.all.shapes", '&', "eval Off");
199     Interface_Static::Init("step", "read.step.all.shapes", '&', "eval On");
200     Interface_Static::SetIVal("read.step.all.shapes", 0);
201
202      // Mode for reading constructive geometry representation relationship to read
203     //StepRepr_ConstructiveGeometryRepresentation method implemented only for StepGeom_MakeAxis2Placement3d
204     //for axis placements representing axis for suplemented geometry. Axis placements are translated to planar faces with CS 
205     //equal to translated axis placements
206     Interface_Static::Init("step","read.step.constructivegeom.relationship",'e',"");
207     Interface_Static::Init("step","read.step.constructivegeom.relationship",'&',"enum 0");
208     Interface_Static::Init("step","read.step.constructivegeom.relationship",'&',"eval OFF");
209     Interface_Static::Init("step","read.step.constructivegeom.relationship",'&',"eval ON");
210     Interface_Static::SetCVal("read.step.constructivegeom.relationship","OFF");
211
212     // Mode to variate apply or not transformation placed in the root shape representation.
213     // Issues #29068 and #31491.
214     Interface_Static::Init("step", "read.step.root.transformation", 'e', "");
215     Interface_Static::Init("step", "read.step.root.transformation", '&', "enum 0");
216     Interface_Static::Init("step", "read.step.root.transformation", '&', "eval OFF");
217     Interface_Static::Init("step", "read.step.root.transformation", '&', "eval ON");
218     Interface_Static::SetCVal("read.step.root.transformation", "ON");
219
220     // STEP file encoding for names translation
221     // Note: the numbers should be consistent with Resource_FormatType enumeration
222     Interface_Static::Init("step", "read.step.codepage", 'e', "");
223     Interface_Static::Init("step", "read.step.codepage", '&', "enum 0");
224     Interface_Static::Init("step", "read.step.codepage", '&', "eval SJIS");         // Resource_FormatType_SJIS
225     Interface_Static::Init("step", "read.step.codepage", '&', "eval EUC");          // Resource_FormatType_EUC
226     Interface_Static::Init("step", "read.step.codepage", '&', "eval NoConversion"); // Resource_FormatType_NoConversion
227     Interface_Static::Init("step", "read.step.codepage", '&', "eval GB");           // Resource_FormatType_GB
228     Interface_Static::Init("step", "read.step.codepage", '&', "eval UTF8");         // Resource_FormatType_UTF8
229     Interface_Static::Init("step", "read.step.codepage", '&', "eval SystemLocale"); // Resource_FormatType_SystemLocale
230     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1250");       // Resource_FormatType_CP1250
231     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1251");       // Resource_FormatType_CP1251
232     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1252");       // Resource_FormatType_CP1252
233     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1253");       // Resource_FormatType_CP1253
234     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1254");       // Resource_FormatType_CP1254
235     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1255");       // Resource_FormatType_CP1255
236     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1256");       // Resource_FormatType_CP1256
237     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1257");       // Resource_FormatType_CP1257
238     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP1258");       // Resource_FormatType_CP1258
239     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-1");    // Resource_FormatType_iso8859_1
240     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-2");    // Resource_FormatType_iso8859_2
241     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-3");    // Resource_FormatType_iso8859_3
242     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-4");    // Resource_FormatType_iso8859_4
243     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-5");    // Resource_FormatType_iso8859_5
244     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-6");    // Resource_FormatType_iso8859_6
245     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-7");    // Resource_FormatType_iso8859_7
246     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-8");    // Resource_FormatType_iso8859_8
247     Interface_Static::Init("step", "read.step.codepage", '&', "eval iso8859-9");    // Resource_FormatType_iso8859_9
248     Interface_Static::Init("step", "read.step.codepage", '&', "eval CP850");        // Resource_FormatType_CP850
249     Interface_Static::SetCVal("read.step.codepage", "UTF8");
250
251     Standard_STATIC_ASSERT((int)Resource_FormatType_CP850 - (int)Resource_FormatType_CP1250 == 18); // "Error: Invalid Codepage Enumeration"
252
253     init = Standard_True;
254   }
255
256   Handle(STEPControl_ActorWrite) ActWrite = new STEPControl_ActorWrite;
257   ActWrite->SetGroupMode (Interface_Static::IVal("write.step.assembly"));
258   myAdaptorWrite = ActWrite;
259
260   Handle(StepSelect_WorkLibrary) swl = new StepSelect_WorkLibrary;
261   swl->SetDumpLabel(1);
262   myAdaptorLibrary  = swl;
263   myAdaptorProtocol = STEPEdit::Protocol();
264   myAdaptorRead     = new STEPControl_ActorRead;  // par ex pour Recognize
265
266   SetModeWrite (0,4);
267   SetModeWriteHelp (0,"As Is");
268   SetModeWriteHelp (1,"Faceted Brep");
269   SetModeWriteHelp (2,"Shell Based");
270   SetModeWriteHelp (3,"Manifold Solid");
271   SetModeWriteHelp (4,"Wireframe");
272   TraceStatic ("read.surfacecurve.mode",5);
273
274   //   ---  SELECTIONS, SIGNATURES, COMPTEURS, EDITEURS
275
276   DeclareAndCast(IFSelect_Selection,xmr,SessionItem("xst-model-roots"));
277   if (!xmr.IsNull()) {
278     Handle(IFSelect_Signature) sty = STEPEdit::SignType();
279     AddSessionItem (sty,"step-type");
280     Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True);
281     AddSessionItem (tys,"step-types");
282
283     //szv:mySignType = sty;
284     
285     //pdn S4133 18.02.99
286     AddSessionItem (new IFSelect_SignAncestor(),"xst-derived");
287
288     Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived();
289     stdvar->SetProtocol(STEPEdit::Protocol());
290     AddSessionItem (stdvar,"step-derived");
291     
292     Handle(IFSelect_SelectSignature) selsdr = STEPEdit::NewSelectSDR();
293     selsdr->SetInput (xmr);
294     AddSessionItem (selsdr,"step-shape-def-repr");
295
296     AddSessionItem (STEPEdit::NewSelectPlacedItem(),"step-placed-items");
297     // input deja pret avec ModelAll
298     AddSessionItem (STEPEdit::NewSelectShapeRepr(),"step-shape-repr");
299   }
300   
301   //pdn
302   Handle(STEPSelections_SelectFaces) stfaces = new STEPSelections_SelectFaces;
303   stfaces->SetInput (xmr);
304   AddSessionItem (stfaces,"step-faces");
305   
306   Handle(STEPSelections_SelectInstances) stinst = new STEPSelections_SelectInstances;
307   AddSessionItem (stinst,"step-instances");
308   
309   Handle(STEPSelections_SelectGSCurves) stcurves = new STEPSelections_SelectGSCurves;
310   stcurves->SetInput (xmr);
311   AddSessionItem (stcurves,"step-GS-curves");
312   
313   Handle(STEPSelections_SelectAssembly) assembly = new STEPSelections_SelectAssembly;
314   assembly->SetInput (xmr);
315   AddSessionItem (assembly,"step-assembly");
316   
317   Handle(APIHeaderSection_EditHeader) edhead = new APIHeaderSection_EditHeader;
318   Handle(IFSelect_EditForm) edheadf = new IFSelect_EditForm (edhead,Standard_False,Standard_True,"Step Header");
319   AddSessionItem (edhead,"step-header-edit");
320   AddSessionItem (edheadf,"step-header");
321
322   Handle(STEPEdit_EditContext) edctx = new STEPEdit_EditContext;
323   Handle(IFSelect_EditForm) edctxf = new IFSelect_EditForm (edctx,Standard_False,Standard_True,"STEP Product Definition Context");
324   AddSessionItem (edctx,"step-context-edit");
325   AddSessionItem (edctxf,"step-context");
326
327
328   Handle(STEPEdit_EditSDR) edsdr = new STEPEdit_EditSDR;
329   Handle(IFSelect_EditForm) edsdrf = new IFSelect_EditForm (edsdr,Standard_False,Standard_True,"STEP Product Data (SDR)");
330   AddSessionItem (edsdr,"step-SDR-edit");
331   AddSessionItem (edsdrf,"step-SDR-data");
332 }
333
334 Handle(Interface_InterfaceModel)  STEPControl_Controller::NewModel () const
335 {
336   return STEPEdit::NewModel();
337 }
338
339 //  ####    PROVISOIRE ???   ####
340
341 IFSelect_ReturnStatus  STEPControl_Controller::TransferWriteShape
342   (const TopoDS_Shape& shape,
343    const Handle(Transfer_FinderProcess)& FP,
344    const Handle(Interface_InterfaceModel)& model,
345    const Standard_Integer modeshape,
346    const Message_ProgressRange& theProgress) const
347 {
348   if (modeshape < 0 || modeshape > 4) return IFSelect_RetError;
349   Handle(STEPControl_ActorWrite) ActWrite =
350     Handle(STEPControl_ActorWrite)::DownCast(myAdaptorWrite);
351 //    A PRESENT ON PASSE PAR LE PROFILE
352   if (!ActWrite.IsNull()) 
353     ActWrite->SetGroupMode (Interface_Static::IVal("write.step.assembly"));
354
355   return XSControl_Controller::TransferWriteShape(shape, FP, model, modeshape, theProgress);
356 }
357
358 Standard_Boolean STEPControl_Controller::Init ()
359 {
360   static Standard_Boolean inic = Standard_False;
361   if (!inic) {
362     Handle(STEPControl_Controller) STEPCTL = new STEPControl_Controller;
363     STEPCTL->AutoRecord();  // avec les noms donnes a la construction
364     XSAlgo::Init();                                                                                                        
365     inic = Standard_True;
366   }
367   return Standard_True;
368 }
369 //=======================================================================
370 //function : Customise
371 //purpose  : 
372 //=======================================================================
373
374 void STEPControl_Controller::Customise(Handle(XSControl_WorkSession)& WS) 
375 {
376   XSControl_Controller::Customise(WS);
377
378   Handle(IFSelect_SelectModelRoots) slr;
379   Handle(Standard_Transient) slr1 = WS->NamedItem("xst-model-roots");
380   if(!slr1.IsNull())
381     slr = Handle(IFSelect_SelectModelRoots)::DownCast(slr1);
382   else  {
383     slr = new IFSelect_SelectModelRoots;
384     WS->AddNamedItem ("xst-model-roots",slr);
385   }
386
387   Handle(STEPSelections_SelectForTransfer) st1= new STEPSelections_SelectForTransfer;
388   st1->SetReader (WS->TransferReader());
389   WS->AddNamedItem ("xst-transferrable-roots",st1);
390
391   if (!slr.IsNull()) {
392     Handle(IFSelect_Signature) sty = STEPEdit::SignType();
393     WS->AddNamedItem ("step-type",sty);
394     
395     Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True);
396     WS->AddNamedItem ("step-types",tys);
397
398         //szv:mySignType = sty;
399     WS->SetSignType( sty );
400     
401     //pdn S4133 18.02.99
402     WS->AddNamedItem ("xst-derived",new IFSelect_SignAncestor());
403     Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived();
404     stdvar->SetProtocol(STEPEdit::Protocol());
405     WS->AddNamedItem ("step-derived",stdvar);
406     
407     Handle(IFSelect_SelectSignature) selsdr = STEPEdit::NewSelectSDR();
408     selsdr->SetInput (slr);
409     WS->AddNamedItem ("step-shape-def-repr",selsdr);
410     Handle(IFSelect_SelectSignature) selrrs = STEPEdit::NewSelectPlacedItem();
411     WS->AddNamedItem ("step-placed-items",selrrs);
412     Handle(IFSelect_SelectSignature) selsr = STEPEdit::NewSelectShapeRepr();
413     // input deja pret avec ModelAll
414     WS->AddNamedItem ("step-shape-repr",selsr);
415   }
416   
417   //pdn
418   Handle(STEPSelections_SelectFaces) stfaces = new STEPSelections_SelectFaces;
419   stfaces->SetInput (slr);
420   WS->AddNamedItem ("step-faces",stfaces);
421   
422   Handle(STEPSelections_SelectInstances) stinst = new STEPSelections_SelectInstances;
423   WS->AddNamedItem ("step-instances",stinst);
424   
425   Handle(STEPSelections_SelectGSCurves) stcurves = new STEPSelections_SelectGSCurves;
426   stcurves->SetInput (slr);
427   WS->AddNamedItem ("step-GS-curves",stcurves);
428   
429   Handle(STEPSelections_SelectAssembly) assembly = new STEPSelections_SelectAssembly;
430   assembly->SetInput (slr);
431   WS->AddNamedItem ("step-assembly",assembly);
432   
433   Handle(APIHeaderSection_EditHeader) edhead = new APIHeaderSection_EditHeader;
434   Handle(IFSelect_EditForm) edheadf = new IFSelect_EditForm (edhead,Standard_False,Standard_True,"Step Header");
435   WS->AddNamedItem ("step-header-edit",edhead);
436   WS->AddNamedItem ("step-header",edheadf);
437
438   Handle(STEPEdit_EditContext) edctx = new STEPEdit_EditContext;
439   Handle(IFSelect_EditForm) edctxf = new IFSelect_EditForm (edctx,Standard_False,Standard_True,"STEP Product Definition Context");
440   WS->AddNamedItem ("step-context-edit",edctx);
441   WS->AddNamedItem ("step-context",edctxf);
442
443
444   Handle(STEPEdit_EditSDR) edsdr = new STEPEdit_EditSDR;
445   Handle(IFSelect_EditForm) edsdrf = new IFSelect_EditForm (edsdr,Standard_False,Standard_True,"STEP Product Data (SDR)");
446   WS->AddNamedItem ("step-SDR-edit",edsdr);
447   WS->AddNamedItem ("step-SDR-data",edsdrf);
448
449   
450   
451 }