Salome HOME
Join modifications from branch BR_For_OCT_611: migration to OCCT6.1.1 with new except...
[modules/geom.git] / src / GEOMImpl / GEOMImpl_I3DPrimOperations.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 #include <Standard_Stream.hxx>
21
22 #include <GEOMImpl_I3DPrimOperations.hxx>
23
24 #include "utilities.h"
25 #include <OpUtil.hxx>
26 #include <Utils_ExceptHandlers.hxx>
27
28 #include <TFunction_DriverTable.hxx>
29 #include <TFunction_Driver.hxx>
30 #include <TFunction_Logbook.hxx>
31 #include <TDF_Tool.hxx>
32
33 #include <GEOM_Function.hxx>
34 #include <GEOM_PythonDump.hxx>
35
36 #include <GEOMImpl_Types.hxx>
37
38 #include <GEOMImpl_BoxDriver.hxx>
39 #include <GEOMImpl_CylinderDriver.hxx>
40 #include <GEOMImpl_ConeDriver.hxx>
41 #include <GEOMImpl_SphereDriver.hxx>
42 #include <GEOMImpl_TorusDriver.hxx>
43 #include <GEOMImpl_PrismDriver.hxx>
44 #include <GEOMImpl_PipeDriver.hxx>
45 #include <GEOMImpl_RevolutionDriver.hxx>
46 #include <GEOMImpl_ShapeDriver.hxx>
47 #include <GEOMImpl_FillingDriver.hxx>
48 #include <GEOMImpl_ThruSectionsDriver.hxx>
49
50 #include <GEOMImpl_IBox.hxx>
51 #include <GEOMImpl_ICylinder.hxx>
52 #include <GEOMImpl_ICone.hxx>
53 #include <GEOMImpl_ISphere.hxx>
54 #include <GEOMImpl_ITorus.hxx>
55 #include <GEOMImpl_IPrism.hxx>
56 #include <GEOMImpl_IPipe.hxx>
57 #include <GEOMImpl_IRevolution.hxx>
58 #include <GEOMImpl_IShapes.hxx>
59 #include <GEOMImpl_IFilling.hxx>
60 #include <GEOMImpl_IThruSections.hxx>
61 #include <GEOMImpl_IPipeDiffSect.hxx>
62
63 #include <Standard_Failure.hxx>
64 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
65
66 //=============================================================================
67 /*!
68  *   constructor:
69  */
70 //=============================================================================
71 GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine, int theDocID)
72 : GEOM_IOperations(theEngine, theDocID)
73 {
74   MESSAGE("GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations");
75 }
76
77 //=============================================================================
78 /*!
79  *  destructor
80  */
81 //=============================================================================
82 GEOMImpl_I3DPrimOperations::~GEOMImpl_I3DPrimOperations()
83 {
84   MESSAGE("GEOMImpl_I3DPrimOperations::~GEOMImpl_I3DPrimOperations");
85 }
86
87
88 //=============================================================================
89 /*!
90  *  MakeBoxDXDYDZ
91  */
92 //=============================================================================
93 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxDXDYDZ (double theDX, double theDY, double theDZ)
94 {
95   SetErrorCode(KO);
96
97   //Add a new Box object
98   Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
99
100   //Add a new Box function with DX_DY_DZ parameters
101   Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_DX_DY_DZ);
102   if (aFunction.IsNull()) return NULL;
103
104   //Check if the function is set correctly
105   if (aFunction->GetDriverGUID() != GEOMImpl_BoxDriver::GetID()) return NULL;
106
107   GEOMImpl_IBox aBI (aFunction);
108
109   aBI.SetDX(theDX);
110   aBI.SetDY(theDY);
111   aBI.SetDZ(theDZ);
112
113   //Compute the box value
114   try {
115 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
116     OCC_CATCH_SIGNALS;
117 #endif
118     if (!GetSolver()->ComputeFunction(aFunction)) {
119       SetErrorCode("Box driver failed");
120       return NULL;
121     }
122   }
123   catch (Standard_Failure) {
124     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
125     SetErrorCode(aFail->GetMessageString());
126     return NULL;
127   }
128
129   //Make a Python command
130   GEOM::TPythonDump(aFunction) << aBox << " = geompy.MakeBoxDXDYDZ("
131     << theDX << ", " << theDY << ", " << theDZ << ")";
132
133   SetErrorCode(OK);
134   return aBox;
135 }
136
137
138 //=============================================================================
139 /*!
140  *  MakeBoxTwoPnt
141  */
142 //=============================================================================
143 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Object) thePnt1,
144                                                                Handle(GEOM_Object) thePnt2)
145 {
146   SetErrorCode(KO);
147
148   if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
149
150   //Add a new Box object
151   Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
152
153   //Add a new Box function for creation a box relatively to two points
154   Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_TWO_PNT);
155   if (aFunction.IsNull()) return NULL;
156
157   //Check if the function is set correctly
158   if (aFunction->GetDriverGUID() != GEOMImpl_BoxDriver::GetID()) return aBox;
159
160   GEOMImpl_IBox aBI (aFunction);
161
162   Handle(GEOM_Function) aRefFunction1 = thePnt1->GetLastFunction();
163   Handle(GEOM_Function) aRefFunction2 = thePnt2->GetLastFunction();
164
165   if (aRefFunction1.IsNull() || aRefFunction2.IsNull()) return aBox;
166
167   aBI.SetRef1(aRefFunction1);
168   aBI.SetRef2(aRefFunction2);
169
170   //Compute the Box value
171   try {
172 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
173     OCC_CATCH_SIGNALS;
174 #endif
175     if (!GetSolver()->ComputeFunction(aFunction)) {
176       SetErrorCode("Box driver failed");
177       return NULL;
178     }
179   }
180   catch (Standard_Failure) {
181     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
182     SetErrorCode(aFail->GetMessageString());
183     return NULL;
184   }
185
186   //Make a Python command
187   GEOM::TPythonDump(aFunction) << aBox << " = geompy.MakeBoxTwoPnt("
188     << thePnt1 << ", " << thePnt2 << ")";
189
190   SetErrorCode(OK);
191   return aBox;
192 }
193
194
195 //=============================================================================
196 /*!
197  *  MakeCylinderRH
198  */
199 //=============================================================================
200 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, double theH)
201 {
202   SetErrorCode(KO);
203
204   //Add a new Cylinder object
205   Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
206
207   //Add a new Cylinder function with R and H parameters
208   Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H);
209   if (aFunction.IsNull()) return NULL;
210
211   //Check if the function is set correctly
212   if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
213
214   GEOMImpl_ICylinder aCI (aFunction);
215
216   aCI.SetR(theR);
217   aCI.SetH(theH);
218
219   //Compute the Cylinder value
220   try {
221 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
222     OCC_CATCH_SIGNALS;
223 #endif
224     if (!GetSolver()->ComputeFunction(aFunction)) {
225       SetErrorCode("Cylinder driver failed");
226       return NULL;
227     }
228   }
229   catch (Standard_Failure) {
230     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
231     SetErrorCode(aFail->GetMessageString());
232     return NULL;
233   }
234
235   //Make a Python command
236   GEOM::TPythonDump(aFunction) << aCylinder
237     << " = geompy.MakeCylinderRH(" << theR << ", " << theH << ")";
238
239   SetErrorCode(OK);
240   return aCylinder;
241 }
242
243
244 //=============================================================================
245 /*!
246  *  MakeCylinderPntVecRH
247  */
248 //=============================================================================
249 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
250                                                                       Handle(GEOM_Object) theVec,
251                                                                       double theR, double theH)
252 {
253   SetErrorCode(KO);
254
255   if (thePnt.IsNull() || theVec.IsNull()) return NULL;
256
257   //Add a new Cylinder object
258   Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
259
260   //Add a new Cylinder function for creation a cylinder relatively to point and vector
261   Handle(GEOM_Function) aFunction =
262     aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_PNT_VEC_R_H);
263   if (aFunction.IsNull()) return NULL;
264
265   //Check if the function is set correctly
266   if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
267
268   GEOMImpl_ICylinder aCI (aFunction);
269
270   Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
271   Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
272
273   if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
274
275   aCI.SetPoint(aRefPnt);
276   aCI.SetVector(aRefVec);
277   aCI.SetR(theR);
278   aCI.SetH(theH);
279
280   //Compute the Cylinder value
281   try {
282 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
283     OCC_CATCH_SIGNALS;
284 #endif
285     if (!GetSolver()->ComputeFunction(aFunction)) {
286       SetErrorCode("Cylinder driver failed");
287       return NULL;
288     }
289   }
290   catch (Standard_Failure) {
291     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
292     SetErrorCode(aFail->GetMessageString());
293     return NULL;
294   }
295
296   //Make a Python command
297   GEOM::TPythonDump(aFunction) << aCylinder << " = geompy.MakeCylinder("
298     << thePnt << ", " << theVec << ", " << theR << ", " << theH << ")";
299
300   SetErrorCode(OK);
301   return aCylinder;
302 }
303
304
305 //=============================================================================
306 /*!
307  *  MakeConeR1R2H
308  */
309 //=============================================================================
310 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, double theR2,
311                                                                double theH)
312 {
313   SetErrorCode(KO);
314
315   //Add a new Cone object
316   Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE);
317
318   //Add a new Cone function with R and H parameters
319   Handle(GEOM_Function) aFunction =
320     aCone->AddFunction(GEOMImpl_ConeDriver::GetID(), CONE_R1_R2_H);
321   if (aFunction.IsNull()) return NULL;
322
323   //Check if the function is set correctly
324   if (aFunction->GetDriverGUID() != GEOMImpl_ConeDriver::GetID()) return NULL;
325
326   GEOMImpl_ICone aCI (aFunction);
327
328   aCI.SetR1(theR1);
329   aCI.SetR2(theR2);
330   aCI.SetH(theH);
331
332   //Compute the Cone value
333   try {
334 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
335     OCC_CATCH_SIGNALS;
336 #endif
337     if (!GetSolver()->ComputeFunction(aFunction)) {
338       SetErrorCode("Cone driver failed");
339       return NULL;
340     }
341   }
342   catch (Standard_Failure) {
343     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
344     SetErrorCode(aFail->GetMessageString());
345     return NULL;
346   }
347
348   //Make a Python command
349   GEOM::TPythonDump(aFunction) << aCone << " = geompy.MakeConeR1R2H("
350     << theR1 << ", " << theR2 << ", " << theH << ")";
351
352   SetErrorCode(OK);
353   return aCone;
354 }
355
356
357 //=============================================================================
358 /*!
359  *  MakeConePntVecR1R2H
360  */
361 //=============================================================================
362 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM_Object) thePnt,
363                                                                      Handle(GEOM_Object) theVec,
364                                                                      double theR1, double theR2,
365                                                                      double theH)
366 {
367   SetErrorCode(KO);
368
369   if (thePnt.IsNull() || theVec.IsNull()) return NULL;
370
371   //Add a new Cone object
372   Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE);
373
374   //Add a new Cone function for creation a cone relatively to point and vector
375   Handle(GEOM_Function) aFunction =
376     aCone->AddFunction(GEOMImpl_ConeDriver::GetID(), CONE_PNT_VEC_R1_R2_H);
377   if (aFunction.IsNull()) return NULL;
378
379   //Check if the function is set correctly
380   if (aFunction->GetDriverGUID() != GEOMImpl_ConeDriver::GetID()) return NULL;
381
382   GEOMImpl_ICone aCI (aFunction);
383
384   Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
385   Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
386
387   if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
388
389   aCI.SetPoint(aRefPnt);
390   aCI.SetVector(aRefVec);
391   aCI.SetR1(theR1);
392   aCI.SetR2(theR2);
393   aCI.SetH(theH);
394
395   //Compute the Cone value
396   try {
397 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
398     OCC_CATCH_SIGNALS;
399 #endif
400     if (!GetSolver()->ComputeFunction(aFunction)) {
401       SetErrorCode("Cone driver failed");
402       return NULL;
403     }
404   }
405   catch (Standard_Failure) {
406     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
407     SetErrorCode(aFail->GetMessageString());
408     return NULL;
409   }
410
411   //Make a Python command
412   GEOM::TPythonDump(aFunction) << aCone << " = geompy.MakeCone(" << thePnt
413     << ", " << theVec << ", " << theR1 << ", " << theR2 << ", " << theH << ")";
414
415   SetErrorCode(OK);
416   return aCone;
417 }
418
419
420 //=============================================================================
421 /*!
422  *  MakeSphereR
423  */
424 //=============================================================================
425 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR)
426 {
427   SetErrorCode(KO);
428
429   //Add a new Sphere object
430   Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE);
431
432   //Add a new Sphere function with R parameter
433   Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_R);
434   if (aFunction.IsNull()) return NULL;
435
436   //Check if the function is set correctly
437   if (aFunction->GetDriverGUID() != GEOMImpl_SphereDriver::GetID()) return NULL;
438
439   GEOMImpl_ISphere aCI (aFunction);
440
441   aCI.SetR(theR);
442
443   //Compute the Sphere value
444   try {
445 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
446     OCC_CATCH_SIGNALS;
447 #endif
448     if (!GetSolver()->ComputeFunction(aFunction)) {
449       SetErrorCode("Sphere driver failed");
450       return NULL;
451     }
452   }
453   catch (Standard_Failure) {
454     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
455     SetErrorCode(aFail->GetMessageString());
456     return NULL;
457   }
458
459   //Make a Python command
460   GEOM::TPythonDump(aFunction) << aSphere << " = geompy.MakeSphereR(" << theR << ")";
461
462   SetErrorCode(OK);
463   return aSphere;
464 }
465
466
467 //=============================================================================
468 /*!
469  *  MakeSpherePntR
470  */
471 //=============================================================================
472 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Object) thePnt,
473                                                                 double theR)
474 {
475   SetErrorCode(KO);
476
477   if (thePnt.IsNull()) return NULL;
478
479   //Add a new Point object
480   Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE);
481
482   //Add a new Sphere function for creation a sphere relatively to point
483   Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_PNT_R);
484   if (aFunction.IsNull()) return NULL;
485
486   //Check if the function is set correctly
487   if (aFunction->GetDriverGUID() != GEOMImpl_SphereDriver::GetID()) return NULL;
488
489   GEOMImpl_ISphere aCI (aFunction);
490
491   Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
492
493   if (aRefPnt.IsNull()) return NULL;
494
495   aCI.SetPoint(aRefPnt);
496   aCI.SetR(theR);
497
498   //Compute the Sphere value
499   try {
500 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
501     OCC_CATCH_SIGNALS;
502 #endif
503     if (!GetSolver()->ComputeFunction(aFunction)) {
504       SetErrorCode("Sphere driver failed");
505       return NULL;
506     }
507   }
508   catch (Standard_Failure) {
509     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
510     SetErrorCode(aFail->GetMessageString());
511     return NULL;
512   }
513
514   //Make a Python command
515   GEOM::TPythonDump(aFunction) << aSphere
516     << " = geompy.MakeSpherePntR(" << thePnt << ", " << theR << ")";
517
518   SetErrorCode(OK);
519   return aSphere;
520 }
521
522
523 //=============================================================================
524 /*!
525  *  MakeTorusRR
526  */
527 //=============================================================================
528 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR
529                                            (double theRMajor, double theRMinor)
530 {
531   SetErrorCode(KO);
532
533   //Add a new Torus object
534   Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS);
535
536   //Add a new Torus function
537   Handle(GEOM_Function) aFunction =
538     anEll->AddFunction(GEOMImpl_TorusDriver::GetID(), TORUS_RR);
539   if (aFunction.IsNull()) return NULL;
540
541   //Check if the function is set correctly
542   if (aFunction->GetDriverGUID() != GEOMImpl_TorusDriver::GetID()) return NULL;
543
544   GEOMImpl_ITorus aCI (aFunction);
545
546   aCI.SetRMajor(theRMajor);
547   aCI.SetRMinor(theRMinor);
548
549   //Compute the Torus value
550   try {
551 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
552     OCC_CATCH_SIGNALS;
553 #endif
554     if (!GetSolver()->ComputeFunction(aFunction)) {
555       SetErrorCode("Torus driver failed");
556       return NULL;
557     }
558   }
559   catch (Standard_Failure) {
560     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
561     SetErrorCode(aFail->GetMessageString());
562     return NULL;
563   }
564
565   //Make a Python command
566   GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeTorusRR("
567     << theRMajor << ", " << theRMinor << ")";
568
569   SetErrorCode(OK);
570   return anEll;
571 }
572
573 //=============================================================================
574 /*!
575  *  MakeTorusPntVecRR
576  */
577 //=============================================================================
578 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR
579                        (Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theVec,
580                         double theRMajor, double theRMinor)
581 {
582   SetErrorCode(KO);
583
584   if (thePnt.IsNull() || theVec.IsNull()) return NULL;
585
586   //Add a new Torus object
587   Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS);
588
589   //Add a new Torus function
590   Handle(GEOM_Function) aFunction =
591     anEll->AddFunction(GEOMImpl_TorusDriver::GetID(), TORUS_PNT_VEC_RR);
592   if (aFunction.IsNull()) return NULL;
593
594   //Check if the function is set correctly
595   if (aFunction->GetDriverGUID() != GEOMImpl_TorusDriver::GetID()) return NULL;
596
597   GEOMImpl_ITorus aCI (aFunction);
598
599   Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
600   Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
601
602   if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
603
604   aCI.SetCenter(aRefPnt);
605   aCI.SetVector(aRefVec);
606   aCI.SetRMajor(theRMajor);
607   aCI.SetRMinor(theRMinor);
608
609   //Compute the Torus value
610   try {
611 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
612     OCC_CATCH_SIGNALS;
613 #endif
614     if (!GetSolver()->ComputeFunction(aFunction)) {
615       SetErrorCode("Torus driver failed");
616       return NULL;
617     }
618   }
619   catch (Standard_Failure) {
620     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
621     SetErrorCode(aFail->GetMessageString());
622     return NULL;
623   }
624
625   //Make a Python command
626   GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeTorus(" << thePnt
627     << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
628
629   SetErrorCode(OK);
630   return anEll;
631 }
632
633
634 //=============================================================================
635 /*!
636  *  MakePrismVecH
637  */
638 //=============================================================================
639 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Object) theBase,
640                                                                Handle(GEOM_Object) theVec,
641                                                                double theH)
642 {
643   SetErrorCode(KO);
644
645   if (theBase.IsNull() || theVec.IsNull()) return NULL;
646
647   //Add a new Prism object
648   Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
649
650   //Add a new Prism function for creation a Prism relatively to vector
651   Handle(GEOM_Function) aFunction =
652     aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_VEC_H);
653   if (aFunction.IsNull()) return NULL;
654
655   //Check if the function is set correctly
656   if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
657
658   GEOMImpl_IPrism aCI (aFunction);
659
660   Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
661   Handle(GEOM_Function) aRefVec  = theVec->GetLastFunction();
662
663   if (aRefBase.IsNull() || aRefVec.IsNull()) return NULL;
664
665   aCI.SetBase(aRefBase);
666   aCI.SetVector(aRefVec);
667   aCI.SetH(theH);
668
669   //Compute the Prism value
670   try {
671 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
672     OCC_CATCH_SIGNALS;
673 #endif
674     if (!GetSolver()->ComputeFunction(aFunction)) {
675       //SetErrorCode("Prism driver failed");
676       SetErrorCode("Extrusion can not be created, check input data");
677       return NULL;
678     }
679   }
680   catch (Standard_Failure) {
681     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
682     SetErrorCode(aFail->GetMessageString());
683     return NULL;
684   }
685
686   //Make a Python command
687   GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismVecH("
688     << theBase << ", " << theVec << ", " << theH << ")";
689
690   SetErrorCode(OK);
691   return aPrism;
692 }
693
694 //=============================================================================
695 /*!
696  *  MakePrismTwoPnt
697  */
698 //=============================================================================
699 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
700        (Handle(GEOM_Object) theBase,
701         Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2)
702 {
703   SetErrorCode(KO);
704
705   if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
706
707   //Add a new Prism object
708   Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
709
710   //Add a new Prism function for creation a Prism relatively to two points
711   Handle(GEOM_Function) aFunction =
712     aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_TWO_PNT);
713   if (aFunction.IsNull()) return NULL;
714
715   //Check if the function is set correctly
716   if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
717
718   GEOMImpl_IPrism aCI (aFunction);
719
720   Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
721   Handle(GEOM_Function) aRefPnt1 = thePoint1->GetLastFunction();
722   Handle(GEOM_Function) aRefPnt2 = thePoint2->GetLastFunction();
723
724   if (aRefBase.IsNull() || aRefPnt1.IsNull() || aRefPnt2.IsNull()) return NULL;
725
726   aCI.SetBase(aRefBase);
727   aCI.SetFirstPoint(aRefPnt1);
728   aCI.SetLastPoint(aRefPnt2);
729
730   //Compute the Prism value
731   try {
732 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
733     OCC_CATCH_SIGNALS;
734 #endif
735     if (!GetSolver()->ComputeFunction(aFunction)) {
736       //SetErrorCode("Prism driver failed");
737       SetErrorCode("Extrusion can not be created, check input data");
738       return NULL;
739     }
740   }
741   catch (Standard_Failure) {
742     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
743     SetErrorCode(aFail->GetMessageString());
744     return NULL;
745   }
746
747   //Make a Python command
748   GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrism("
749     << theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
750
751   SetErrorCode(OK);
752   return aPrism;
753 }
754
755
756 //=============================================================================
757 /*!
758  *  MakePipe
759  */
760 //=============================================================================
761 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) theBase,
762                                                           Handle(GEOM_Object) thePath)
763 {
764   SetErrorCode(KO);
765
766   if (theBase.IsNull() || thePath.IsNull()) return NULL;
767
768   //Add a new Pipe object
769   Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
770
771   //Add a new Pipe function
772   Handle(GEOM_Function) aFunction =
773     aPipe->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_BASE_PATH);
774   if (aFunction.IsNull()) return NULL;
775
776   //Check if the function is set correctly
777   if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
778
779   GEOMImpl_IPipe aCI (aFunction);
780
781   Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
782   Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
783
784   if (aRefBase.IsNull() || aRefPath.IsNull()) return NULL;
785
786   aCI.SetBase(aRefBase);
787   aCI.SetPath(aRefPath);
788
789   //Compute the Pipe value
790   try {
791 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
792     OCC_CATCH_SIGNALS;
793 #endif
794     if (!GetSolver()->ComputeFunction(aFunction)) {
795       SetErrorCode("Pipe driver failed");
796       return NULL;
797     }
798   }
799   catch (Standard_Failure) {
800     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
801     SetErrorCode(aFail->GetMessageString());
802     return NULL;
803   }
804
805   //Make a Python command
806   GEOM::TPythonDump(aFunction) << aPipe << " = geompy.MakePipe("
807     << theBase << ", " << thePath << ")";
808
809   SetErrorCode(OK);
810   return aPipe;
811 }
812
813
814 //=============================================================================
815 /*!
816  *  MakeRevolutionAxisAngle
817  */
818 //=============================================================================
819 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase,
820                                                                          Handle(GEOM_Object) theAxis,
821                                                                          double theAngle)
822 {
823   SetErrorCode(KO);
824
825   if (theBase.IsNull() || theAxis.IsNull()) return NULL;
826
827   //Add a new Revolution object
828   Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
829
830   //Add a new Revolution function for creation a revolution relatively to axis
831   Handle(GEOM_Function) aFunction =
832     aRevolution->AddFunction(GEOMImpl_RevolutionDriver::GetID(), REVOLUTION_BASE_AXIS_ANGLE);
833   if (aFunction.IsNull()) return NULL;
834
835   //Check if the function is set correctly
836   if (aFunction->GetDriverGUID() != GEOMImpl_RevolutionDriver::GetID()) return NULL;
837
838   GEOMImpl_IRevolution aCI (aFunction);
839
840   Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
841   Handle(GEOM_Function) aRefAxis = theAxis->GetLastFunction();
842
843   if (aRefBase.IsNull() || aRefAxis.IsNull()) return NULL;
844
845   aCI.SetBase(aRefBase);
846   aCI.SetAxis(aRefAxis);
847   aCI.SetAngle(theAngle);
848
849   //Compute the Revolution value
850   try {
851 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
852     OCC_CATCH_SIGNALS;
853 #endif
854     if (!GetSolver()->ComputeFunction(aFunction)) {
855       SetErrorCode("Revolution driver failed");
856       return NULL;
857     }
858   }
859   catch (Standard_Failure) {
860     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
861     SetErrorCode(aFail->GetMessageString());
862     return NULL;
863   }
864
865   //Make a Python command
866   GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution("
867     << theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
868
869   SetErrorCode(OK);
870   return aRevolution;
871 }
872
873
874 //=============================================================================
875 /*!
876  *  MakeSolidShell
877  */
878 //=============================================================================
879 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Object) theShell)
880 {
881   SetErrorCode(KO);
882
883   if (theShell.IsNull()) return NULL;
884
885   //Add a new Solid object
886   Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID);
887
888   //Add a new Solid function for creation a solid from a shell
889   Handle(GEOM_Function) aFunction =
890     aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_SHELL);
891   if (aFunction.IsNull()) return NULL;
892
893   //Check if the function is set correctly
894   if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
895
896   GEOMImpl_IShapes aCI (aFunction);
897
898   Handle(GEOM_Function) aRefShell = theShell->GetLastFunction();
899
900   if (aRefShell.IsNull()) return NULL;
901
902   aCI.SetBase(aRefShell);
903
904   //Compute the Solid value
905   try {
906 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
907     OCC_CATCH_SIGNALS;
908 #endif
909     if (!GetSolver()->ComputeFunction(aFunction)) {
910       SetErrorCode("Solid driver failed");
911       return NULL;
912     }
913   }
914   catch (Standard_Failure) {
915     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
916     SetErrorCode(aFail->GetMessageString());
917     return NULL;
918   }
919
920   //Make a Python command
921   GEOM::TPythonDump(aFunction) << aSolid << " = geompy.MakeSolid(" << theShell << ")";
922
923   SetErrorCode(OK);
924   return aSolid;
925 }
926
927 //=============================================================================
928 /*!
929  *  MakeFilling
930  */
931 //=============================================================================
932 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
933        (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg,
934         double theTol2D, double theTol3D, int theNbIter)
935 {
936   SetErrorCode(KO);
937
938   if (theShape.IsNull()) return NULL;
939
940   //Add a new Filling object
941   Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GetDocID(), GEOM_FILLING);
942
943   //Add a new Filling function for creation a filling  from a compound
944   Handle(GEOM_Function) aFunction = aFilling->AddFunction(GEOMImpl_FillingDriver::GetID(), BASIC_FILLING);
945   if (aFunction.IsNull()) return NULL;
946
947   //Check if the function is set correctly
948   if (aFunction->GetDriverGUID() != GEOMImpl_FillingDriver::GetID()) return NULL;
949
950   GEOMImpl_IFilling aFI (aFunction);
951
952   Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
953
954   if (aRefShape.IsNull()) return NULL;
955
956   aFI.SetShape(aRefShape);
957   aFI.SetMinDeg(theMinDeg);
958   aFI.SetMaxDeg(theMaxDeg);
959   aFI.SetTol2D(theTol2D);
960   aFI.SetTol3D(theTol3D);
961   aFI.SetNbIter(theNbIter);
962
963   //Compute the Solid value
964   try {
965 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
966     OCC_CATCH_SIGNALS;
967 #endif
968     if (!GetSolver()->ComputeFunction(aFunction)) {
969       SetErrorCode("Filling driver failed");
970       return NULL;
971     }
972   }
973   catch (Standard_Failure) {
974     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
975     if (strcmp(aFail->GetMessageString(), "Geom_BSplineSurface") == 0)
976       SetErrorCode("B-Spline surface construction failed");
977     else
978       SetErrorCode(aFail->GetMessageString());
979     return NULL;
980   }
981
982   //Make a Python command
983   GEOM::TPythonDump(aFunction) << aFilling << " = geompy.MakeFilling("
984     << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
985       << theTol2D << ", " << theTol3D << ", " << theNbIter << ")";
986
987   SetErrorCode(OK);
988   return aFilling;
989 }
990
991 //=============================================================================
992 /*!
993  *  MakeThruSections
994  */
995 //=============================================================================
996 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
997                                                 const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
998                                                 bool theModeSolid,
999                                                 double thePreci,
1000                                                 bool theRuled)
1001 {
1002   Handle(GEOM_Object) anObj;
1003   SetErrorCode(KO);
1004   if(theSeqSections.IsNull())
1005     return anObj;
1006
1007   Standard_Integer nbObj = theSeqSections->Length();
1008   if (!nbObj) 
1009     return anObj;
1010
1011   //Add a new ThruSections object
1012   Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS);
1013
1014  
1015   //Add a new ThruSections function
1016
1017   int aTypeFunc = (theRuled ? THRUSECTIONS_RULED : THRUSECTIONS_SMOOTHED);
1018   Handle(GEOM_Function) aFunction =
1019     aThruSect->AddFunction(GEOMImpl_ThruSectionsDriver::GetID(), aTypeFunc);
1020   if (aFunction.IsNull()) return anObj;
1021
1022   //Check if the function is set correctly
1023   if (aFunction->GetDriverGUID() != GEOMImpl_ThruSectionsDriver::GetID()) return NULL;
1024
1025   GEOMImpl_IThruSections aCI (aFunction);
1026
1027   Handle(TColStd_HSequenceOfTransient) aSeqSections = new TColStd_HSequenceOfTransient;
1028
1029   Standard_Integer i =1;
1030   for( ; i <= nbObj; i++) {
1031
1032     Handle(Standard_Transient) anItem = theSeqSections->Value(i);
1033     if(anItem.IsNull())
1034       continue;
1035     
1036     Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
1037     if(!aSectObj.IsNull())
1038     {
1039       Handle(GEOM_Function) aRefSect = aSectObj->GetLastFunction();
1040       if(!aRefSect.IsNull())
1041         aSeqSections->Append(aRefSect);
1042     }
1043   }
1044
1045   if(!aSeqSections->Length())
1046     return anObj;
1047
1048   aCI.SetSections(aSeqSections);
1049   aCI.SetSolidMode(theModeSolid);
1050   aCI.SetPrecision(thePreci);
1051
1052   //Compute the ThruSections value
1053   try {
1054 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
1055     OCC_CATCH_SIGNALS;
1056 #endif
1057     if (!GetSolver()->ComputeFunction(aFunction)) {
1058       SetErrorCode("ThruSections driver failed");
1059       return anObj;
1060     }
1061   }
1062   catch (Standard_Failure) {
1063     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
1064     SetErrorCode(aFail->GetMessageString());
1065     return anObj;
1066   }
1067
1068   //Make a Python command
1069   GEOM::TPythonDump pyDump(aFunction);
1070   pyDump << aThruSect << " = geompy.MakeThruSections([";
1071
1072   for(i =1 ; i <= nbObj; i++) {
1073
1074     Handle(Standard_Transient) anItem = theSeqSections->Value(i);
1075     if(anItem.IsNull())
1076       continue;
1077     
1078     Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
1079     if(!aSectObj.IsNull()) {
1080       pyDump<< aSectObj;
1081       if(i < nbObj)
1082         pyDump<<", ";
1083     }
1084   }
1085   
1086   pyDump<< "],"<<theModeSolid << "," << thePreci <<","<< theRuled <<")";
1087
1088   SetErrorCode(OK);
1089   return aThruSect;
1090   
1091    
1092 }
1093
1094 //=============================================================================
1095 /*!
1096  *  MakePipeWithDifferentSections
1097  */
1098 //=============================================================================
1099 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
1100                                                 const Handle(TColStd_HSequenceOfTransient)& theBases,
1101                                                 const Handle(TColStd_HSequenceOfTransient)& theLocations,
1102                                                 const Handle(GEOM_Object)& thePath,
1103                                                 bool theWithContact,
1104                                                 bool theWithCorrections)
1105 {
1106   Handle(GEOM_Object) anObj;
1107   SetErrorCode(KO);
1108   if(theBases.IsNull())
1109     return anObj;
1110
1111   Standard_Integer nbBases = theBases->Length();
1112   
1113   if (!nbBases)
1114     return anObj;
1115   
1116   Standard_Integer nbLocs =  (theLocations.IsNull() ? 0 :theLocations->Length());
1117   //Add a new Pipe object
1118   Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
1119  
1120   //Add a new Pipe function
1121
1122   Handle(GEOM_Function) aFunction =
1123     aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_DIFFERENT_SECTIONS);
1124   if (aFunction.IsNull()) return anObj;
1125
1126   //Check if the function is set correctly
1127   if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj;
1128
1129   GEOMImpl_IPipeDiffSect aCI (aFunction);
1130
1131   Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
1132   if(aRefPath.IsNull())
1133     return anObj;
1134
1135   Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
1136   Handle(TColStd_HSequenceOfTransient) aSeqLocs = new TColStd_HSequenceOfTransient;
1137
1138   Standard_Integer i =1;
1139   for( ; i <= nbBases; i++) {
1140
1141     Handle(Standard_Transient) anItem = theBases->Value(i);
1142     if(anItem.IsNull())
1143       continue;
1144     
1145     Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
1146     if(aBase.IsNull())
1147       continue;
1148     Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
1149     if(aRefBase.IsNull())
1150       continue;
1151     if(nbLocs)
1152     {
1153       Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
1154       if(anItemLoc.IsNull())
1155         continue;
1156     
1157       Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
1158       if(aLoc.IsNull())
1159         continue;
1160       Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
1161       if(aRefLoc.IsNull())
1162         continue;
1163       aSeqLocs->Append(aRefLoc);
1164     }
1165     aSeqBases->Append(aRefBase);
1166   }
1167
1168   if(!aSeqBases->Length())
1169     return anObj;
1170
1171   aCI.SetBases(aSeqBases);
1172   aCI.SetLocations(aSeqLocs);
1173   aCI.SetPath(aRefPath);
1174   aCI.SetWithContactMode(theWithContact);
1175   aCI.SetWithCorrectionMode(theWithCorrections);
1176   
1177   //Compute the Pipe value
1178   try {
1179 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
1180     OCC_CATCH_SIGNALS;
1181 #endif
1182     if (!GetSolver()->ComputeFunction(aFunction)) {
1183       SetErrorCode("Pipe with defferent section driver failed");
1184       return anObj;
1185     }
1186   }
1187   catch (Standard_Failure) {
1188     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
1189     SetErrorCode(aFail->GetMessageString());
1190     return anObj;
1191   }
1192
1193   //Make a Python command
1194   GEOM::TPythonDump pyDump(aFunction);
1195   pyDump << aPipeDS << " = geompy.MakePipeWithDifferentSections([";
1196
1197   for(i =1 ; i <= nbBases; i++) {
1198
1199     Handle(Standard_Transient) anItem = theBases->Value(i);
1200     if(anItem.IsNull())
1201       continue;
1202     
1203     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
1204     if(!anObj.IsNull()) {
1205       pyDump<< anObj;
1206       if(i < nbBases)
1207         pyDump<<", ";
1208     }
1209     
1210   }
1211   
1212   pyDump<< "], [";
1213    
1214   for(i =1 ; i <= nbLocs; i++) {
1215
1216     Handle(Standard_Transient) anItem = theLocations->Value(i);
1217     if(anItem.IsNull())
1218       continue;
1219     
1220     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
1221     if(!anObj.IsNull()) {
1222       pyDump<< anObj;
1223       if(i < nbLocs)
1224         pyDump<<", ";
1225     }
1226   }  
1227
1228   pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
1229
1230   SetErrorCode(OK);
1231   return aPipeDS;
1232   
1233    
1234 }