Salome HOME
f1d2469c0e60293037538300dda6fc8c44754fb2
[modules/geom.git] / src / GEOM_I / GEOM_ICurvesOperations_i.cc
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include <Standard_Stream.hxx>
24
25 #include "GEOM_ICurvesOperations_i.hh"
26
27 #include "utilities.h"
28 #include "OpUtil.hxx"
29
30 #include "GEOM_Engine.hxx"
31 #include "GEOM_Object.hxx"
32
33 //=============================================================================
34 /*!
35  *   constructor:
36  */
37 //=============================================================================
38 GEOM_ICurvesOperations_i::GEOM_ICurvesOperations_i (PortableServer::POA_ptr thePOA,
39                                                     GEOM::GEOM_Gen_ptr theEngine,
40                                                     ::GEOMImpl_ICurvesOperations* theImpl)
41 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
42 {
43   MESSAGE("GEOM_ICurvesOperations_i::GEOM_ICurvesOperations_i");
44 }
45
46 //=============================================================================
47 /*!
48  *  destructor
49  */
50 //=============================================================================
51 GEOM_ICurvesOperations_i::~GEOM_ICurvesOperations_i()
52 {
53   MESSAGE("GEOM_ICurvesOperations_i::~GEOM_ICurvesOperations_i");
54 }
55
56
57 //=============================================================================
58 /*!
59  *  MakeCirclePntVecR
60  */
61 //=============================================================================
62 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCirclePntVecR
63                       (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
64                        CORBA::Double theR)
65 {
66   GEOM::GEOM_Object_var aGEOMObject;
67
68   //Set a not done flag
69   GetOperations()->SetNotDone();
70
71   // Not set thePnt means origin of global CS,
72   // Not set theVec means Z axis of global CS
73   //if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
74
75   //Get the arguments
76   Handle(GEOM_Object) aPnt, aVec;
77   if (!CORBA::is_nil(thePnt)) {
78     aPnt = GetObjectImpl(thePnt);
79     if (aPnt.IsNull()) return aGEOMObject._retn();
80   }
81   if (!CORBA::is_nil(theVec)) {
82     aVec = GetObjectImpl(theVec);
83     if (aVec.IsNull()) return aGEOMObject._retn();
84   }
85
86   // Make Circle
87   Handle(GEOM_Object) anObject =
88     GetOperations()->MakeCirclePntVecR(aPnt, aVec, theR);
89   if (!GetOperations()->IsDone() || anObject.IsNull())
90     return aGEOMObject._retn();
91
92   return GetObject(anObject);
93 }
94
95 //=============================================================================
96 /*!
97  *  MakeCircleThreePnt
98  */
99 //=============================================================================
100 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCircleThreePnt
101                       (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
102                        GEOM::GEOM_Object_ptr thePnt3)
103 {
104   GEOM::GEOM_Object_var aGEOMObject;
105
106   //Set a not done flag
107   GetOperations()->SetNotDone();
108
109   //Get the reference points
110   Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
111   Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
112   Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
113
114   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
115
116   // Make Circle
117   Handle(GEOM_Object) anObject =
118       GetOperations()->MakeCircleThreePnt(aPnt1, aPnt2, aPnt3);
119   if (!GetOperations()->IsDone() || anObject.IsNull())
120     return aGEOMObject._retn();
121
122   return GetObject(anObject);
123 }
124
125 //=============================================================================
126 /*!
127  *  MakeCircleCenter2Pnt
128  */
129 //=============================================================================
130 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCircleCenter2Pnt
131                       (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
132                        GEOM::GEOM_Object_ptr thePnt3)
133 {
134   GEOM::GEOM_Object_var aGEOMObject;
135
136   //Set a not done flag
137   GetOperations()->SetNotDone();
138
139   //Get the reference points
140   Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
141   Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
142   Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
143
144   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
145
146   // Make Circle
147   Handle(GEOM_Object) anObject = GetOperations()->MakeCircleCenter2Pnt(aPnt1, aPnt2, aPnt3);
148   if (!GetOperations()->IsDone() || anObject.IsNull())
149     return aGEOMObject._retn();
150
151   return GetObject(anObject);
152 }
153
154 //=============================================================================
155 /*!
156  *  MakeEllipse
157  */
158 //=============================================================================
159 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipse
160                       (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
161                        CORBA::Double theRMajor, double theRMinor)
162 {
163   GEOM::GEOM_Object_var aGEOMObject;
164
165   //Set a not done flag
166   GetOperations()->SetNotDone();
167
168   // Not set thePnt means origin of global CS,
169   // Not set theVec means Z axis of global CS
170   //if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
171
172   //Get the arguments
173   Handle(GEOM_Object) aPnt, aVec, aVecMaj;
174   if (!CORBA::is_nil(thePnt)) {
175     aPnt = GetObjectImpl(thePnt);
176     if (aPnt.IsNull()) return aGEOMObject._retn();
177   }
178   if (!CORBA::is_nil(theVec)) {
179     aVec = GetObjectImpl(theVec);
180     if (aVec.IsNull()) return aGEOMObject._retn();
181   }
182
183   // Make Ellipse
184   Handle(GEOM_Object) anObject =
185     GetOperations()->MakeEllipse(aPnt, aVec, theRMajor, theRMinor, aVecMaj);
186   if (!GetOperations()->IsDone() || anObject.IsNull())
187     return aGEOMObject._retn();
188
189   return GetObject(anObject);
190 }
191
192 //=============================================================================
193 /*!
194  *  MakeEllipseVec
195  */
196 //=============================================================================
197 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipseVec
198                       (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
199                        CORBA::Double theRMajor, double theRMinor,
200                        GEOM::GEOM_Object_ptr theVecMaj)
201 {
202   GEOM::GEOM_Object_var aGEOMObject;
203
204   //Set a not done flag
205   GetOperations()->SetNotDone();
206
207   // Not set thePnt means origin of global CS,
208   // Not set theVec means Z axis of global CS
209   // Not set theVecMaj means X axis of global CS
210   //if (thePnt == NULL || theVec == NULL || theVecMaj == NULL) return aGEOMObject._retn();
211
212   //Get the arguments
213   Handle(GEOM_Object) aPnt, aVec, aVecMaj;
214   if (!CORBA::is_nil(thePnt)) {
215     aPnt = GetObjectImpl(thePnt);
216     if (aPnt.IsNull()) return aGEOMObject._retn();
217   }
218   if (!CORBA::is_nil(theVec)) {
219     aVec = GetObjectImpl(theVec);
220     if (aVec.IsNull()) return aGEOMObject._retn();
221   }
222   if (!CORBA::is_nil(theVecMaj)) {
223     aVecMaj = GetObjectImpl(theVecMaj);
224     if (aVecMaj.IsNull()) return aGEOMObject._retn();
225   }
226
227   // Make Ellipse
228   Handle(GEOM_Object) anObject =
229     GetOperations()->MakeEllipse(aPnt, aVec, theRMajor, theRMinor, aVecMaj);
230   if (!GetOperations()->IsDone() || anObject.IsNull())
231     return aGEOMObject._retn();
232
233   return GetObject(anObject);
234 }
235
236 //=============================================================================
237 /*!
238  *  MakeArc
239  */
240 //=============================================================================
241 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArc
242                                                 (GEOM::GEOM_Object_ptr thePnt1,
243                                                  GEOM::GEOM_Object_ptr thePnt2,
244                                                  GEOM::GEOM_Object_ptr thePnt3)
245 {
246   GEOM::GEOM_Object_var aGEOMObject;
247
248   //Set a not done flag
249   GetOperations()->SetNotDone();
250
251   //Get the reference points
252   Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
253   Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
254   Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
255
256   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
257
258   // Make Arc
259   Handle(GEOM_Object) anObject =
260     GetOperations()->MakeArc(aPnt1, aPnt2, aPnt3);
261   if (!GetOperations()->IsDone() || anObject.IsNull())
262     return aGEOMObject._retn();
263
264   return GetObject(anObject);
265 }
266
267
268 //=============================================================================
269 /*!
270  *  MakeArcCenter
271  */
272 //=============================================================================
273 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArcCenter
274     (GEOM::GEOM_Object_ptr thePnt1,
275      GEOM::GEOM_Object_ptr thePnt2,
276      GEOM::GEOM_Object_ptr thePnt3,
277      CORBA::Boolean theSense)
278
279 {
280   GEOM::GEOM_Object_var aGEOMObject;
281   //Set a not done flag
282   GetOperations()->SetNotDone();
283
284   //Get the reference points
285   Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
286   Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
287   Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
288
289   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
290
291   // Make ArcCenter
292   Handle(GEOM_Object) anObject =
293       GetOperations()->MakeArcCenter(aPnt1, aPnt2, aPnt3,theSense);
294   if (!GetOperations()->IsDone() || anObject.IsNull())
295     return aGEOMObject._retn();
296
297   return GetObject(anObject);
298 }
299
300 //=============================================================================
301 /*!
302  *  MakeArc
303  */
304 //=============================================================================
305 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArcOfEllipse
306                                                 (GEOM::GEOM_Object_ptr thePnt1,
307                                                  GEOM::GEOM_Object_ptr thePnt2,
308                                                  GEOM::GEOM_Object_ptr thePnt3)
309 {
310   GEOM::GEOM_Object_var aGEOMObject;
311
312   //Set a not done flag
313   GetOperations()->SetNotDone();
314
315   //Get the reference points
316   Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
317   Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
318   Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
319
320   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
321
322   // Make Arc
323   Handle(GEOM_Object) anObject =
324     GetOperations()->MakeArcOfEllipse(aPnt1, aPnt2, aPnt3);
325   if (!GetOperations()->IsDone() || anObject.IsNull())
326     return aGEOMObject._retn();
327
328   return GetObject(anObject);
329 }
330
331 //=============================================================================
332 /*!
333  *  MakePolyline
334  */
335 //=============================================================================
336 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline
337                                     (const GEOM::ListOfGO& thePoints,
338                                      CORBA::Boolean        theIsClosed)
339 {
340   GEOM::GEOM_Object_var aGEOMObject;
341
342   //Set a not done flag
343   GetOperations()->SetNotDone();
344
345   //Get the reference point
346   int ind = 0;
347   int aLen = thePoints.length();
348   std::list<Handle(GEOM_Object)> aPoints;
349   for (; ind < aLen; ind++) {
350     Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
351     if (aPnt.IsNull()) return aGEOMObject._retn();
352     aPoints.push_back(aPnt);
353   }
354
355   // Make Polyline
356   Handle(GEOM_Object) anObject =
357     GetOperations()->MakePolyline(aPoints, theIsClosed);
358   if (!GetOperations()->IsDone() || anObject.IsNull())
359     return aGEOMObject._retn();
360
361   return GetObject(anObject);
362 }
363
364 //=============================================================================
365 /*!
366  *  MakeSplineBezier
367  */
368 //=============================================================================
369 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineBezier
370                                               (const GEOM::ListOfGO& thePoints,
371                                                CORBA::Boolean        theIsClosed)
372 {
373   GEOM::GEOM_Object_var aGEOMObject;
374
375   //Set a not done flag
376   GetOperations()->SetNotDone();
377
378   //Get the reference point
379   int ind = 0;
380   int aLen = thePoints.length();
381   std::list<Handle(GEOM_Object)> aPoints;
382   for (; ind < aLen; ind++) {
383     Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
384     if (aPnt.IsNull()) return aGEOMObject._retn();
385     aPoints.push_back(aPnt);
386   }
387
388   // Make Bezier curve
389   Handle(GEOM_Object) anObject =
390       GetOperations()->MakeSplineBezier(aPoints, theIsClosed);
391   if (!GetOperations()->IsDone() || anObject.IsNull())
392     return aGEOMObject._retn();
393
394   return GetObject(anObject);
395 }
396
397 //=============================================================================
398 /*!
399  *  MakeSplineInterpolation
400  */
401 //=============================================================================
402 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
403                                               (const GEOM::ListOfGO& thePoints,
404                                                CORBA::Boolean        theIsClosed,
405                                                CORBA::Boolean        theDoReordering)
406 {
407   GEOM::GEOM_Object_var aGEOMObject;
408
409   //Set a not done flag
410   GetOperations()->SetNotDone();
411
412   //Get the reference point
413   int ind = 0;
414   int aLen = thePoints.length();
415   std::list<Handle(GEOM_Object)> aPoints;
416   for (; ind < aLen; ind++) {
417     Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
418     if (aPnt.IsNull()) return aGEOMObject._retn();
419     aPoints.push_back(aPnt);
420   }
421
422   // Make Polyline
423   Handle(GEOM_Object) anObject =
424     GetOperations()->MakeSplineInterpolation(aPoints, theIsClosed, theDoReordering);
425   if (!GetOperations()->IsDone() || anObject.IsNull())
426     return aGEOMObject._retn();
427
428   return GetObject(anObject);
429 }
430
431 //=============================================================================
432 /*!
433  *  MakeSplineInterpolWithTangents
434  */
435 //=============================================================================
436 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolWithTangents
437                                               (const GEOM::ListOfGO& thePoints,
438                                                GEOM::GEOM_Object_ptr theFirstVec,
439                                                GEOM::GEOM_Object_ptr theLastVec)
440 {
441   GEOM::GEOM_Object_var aGEOMObject;
442
443   //Set a not done flag
444   GetOperations()->SetNotDone();
445
446   //Get the reference points
447   int ind = 0;
448   int aLen = thePoints.length();
449   std::list<Handle(GEOM_Object)> aPoints;
450   for (; ind < aLen; ind++) {
451     Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
452     if (aPnt.IsNull()) return aGEOMObject._retn();
453     aPoints.push_back(aPnt);
454   }
455
456   //Get the reference vectors
457   Handle(GEOM_Object) aVec1 = GetObjectImpl(theFirstVec);
458   Handle(GEOM_Object) aVec2 = GetObjectImpl(theLastVec);
459
460   if (aVec1.IsNull() || aVec2.IsNull()) return aGEOMObject._retn();
461
462   // Make Polyline
463   Handle(GEOM_Object) anObject =
464     GetOperations()->MakeSplineInterpolWithTangents(aPoints, aVec1, aVec2);
465   if (!GetOperations()->IsDone() || anObject.IsNull())
466     return aGEOMObject._retn();
467
468   return GetObject(anObject);
469 }
470
471 //=============================================================================
472 /*!
473  *  MakeCurveParametric
474  */
475 //=============================================================================
476 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCurveParametric
477              (const char* thexExpr, const char* theyExpr, const char* thezExpr,
478               double theParamMin, double theParamMax, double theParamStep,
479               GEOM::curve_type theCurveType)
480 {
481   GEOM::GEOM_Object_var aGEOMObject;
482   //Set a not done flag
483   GetOperations()->SetNotDone();
484
485   GEOMImpl_ICurvesOperations::CurveType aType;
486   switch(theCurveType) {
487   case GEOM::Polyline:
488     aType = GEOMImpl_ICurvesOperations::Polyline;
489     break;
490   case GEOM::Bezier:
491     aType = GEOMImpl_ICurvesOperations::Bezier;
492     break;
493   case GEOM::Interpolation:
494     aType = GEOMImpl_ICurvesOperations::Interpolation;
495     break;
496   default:
497     break;
498   }
499
500   // Make Polyline
501   Handle(GEOM_Object) anObject =
502     GetOperations()->MakeCurveParametric(thexExpr, theyExpr, thezExpr,
503                                          theParamMin, theParamMax,
504                                          theParamStep, aType);
505
506   if (!GetOperations()->IsDone() || anObject.IsNull())
507     return aGEOMObject._retn();
508
509   return GetObject(anObject);
510 }
511
512 //=============================================================================
513 /*!
514  *  MakeCurveParametricNew
515  */
516 //=============================================================================
517 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCurveParametricNew
518              (const char* thexExpr, const char* theyExpr, const char* thezExpr,
519               double theParamMin, double theParamMax, CORBA::Long theParamNbStep,
520               GEOM::curve_type theCurveType)
521 {
522   GEOM::GEOM_Object_var aGEOMObject;
523   //Set a not done flag
524   GetOperations()->SetNotDone();
525
526   GEOMImpl_ICurvesOperations::CurveType aType;
527   switch(theCurveType) {
528   case GEOM::Polyline:
529     aType = GEOMImpl_ICurvesOperations::Polyline;
530     break;
531   case GEOM::Bezier:
532     aType = GEOMImpl_ICurvesOperations::Bezier;
533     break;
534   case GEOM::Interpolation:
535     aType = GEOMImpl_ICurvesOperations::Interpolation;
536     break;
537   default:
538     break;
539   }
540
541   // Make Polyline
542   Handle(GEOM_Object) anObject =
543     GetOperations()->MakeCurveParametric(thexExpr, theyExpr, thezExpr,
544                        theParamMin, theParamMax,
545                        0.0, aType, theParamNbStep, true);
546
547   if (!GetOperations()->IsDone() || anObject.IsNull())
548     return aGEOMObject._retn();
549
550   return GetObject(anObject);
551 }
552
553 //=============================================================================
554 /*!
555  *  MakeIsoline
556  */
557 //=============================================================================
558 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeIsoline
559                                          (GEOM::GEOM_Object_ptr theFace,
560                                           CORBA::Boolean        IsUIsoline,
561                                           double                theParameter)
562 {
563   GEOM::GEOM_Object_var aGEOMObject;
564
565   //Set a not done flag
566   GetOperations()->SetNotDone();
567
568   Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
569
570   // Make isoline
571   Handle(GEOM_Object) anObject =
572     GetOperations()->MakeIsoline(aFace, IsUIsoline, theParameter);
573   if (!GetOperations()->IsDone() || anObject.IsNull())
574     return aGEOMObject._retn();
575
576   return GetObject(anObject);
577 }
578
579 //=============================================================================
580 /*!
581  *  MakeSketcher
582  */
583 //=============================================================================
584 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcher
585             (const char* theCommand, const GEOM::ListOfDouble& theWorkingPlane)
586 {
587   //Set a not done flag
588   GetOperations()->SetNotDone();
589
590   int ind = 0;
591   int aLen = theWorkingPlane.length();
592   std::list<double> aWorkingPlane;
593   for (; ind < aLen; ind++)
594     aWorkingPlane.push_back(theWorkingPlane[ind]);
595
596   // Make Sketcher
597   Handle(GEOM_Object) anObject =
598     GetOperations()->MakeSketcher(theCommand, aWorkingPlane);
599   if (!GetOperations()->IsDone() || anObject.IsNull())
600     return GEOM::GEOM_Object::_nil();
601
602   return GetObject(anObject);
603 }
604
605 //=============================================================================
606 /*!
607  *  MakeSketcherOnPlane
608  */
609 //=============================================================================
610 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcherOnPlane
611                 (const char* theCommand, GEOM::GEOM_Object_ptr theWorkingPlane)
612 {
613   //Set a not done flag
614   GetOperations()->SetNotDone();
615
616   Handle(GEOM_Object) aWorkingPlane = GetObjectImpl(theWorkingPlane);
617
618   // Make Sketcher
619   Handle(GEOM_Object) anObject =
620       GetOperations()->MakeSketcherOnPlane(theCommand, aWorkingPlane);
621   if (!GetOperations()->IsDone() || anObject.IsNull())
622     return GEOM::GEOM_Object::_nil();
623
624   return GetObject(anObject);
625 }
626
627 //=============================================================================
628 /*!
629  *  Make3DSketcherCommand
630  */
631 //=============================================================================
632 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::Make3DSketcherCommand (const char* theCommand)
633 {
634   //Set a not done flag
635   GetOperations()->SetNotDone();
636
637   // Make 3D Sketcher
638   Handle(GEOM_Object) anObject = GetOperations()->Make3DSketcherCommand(theCommand);
639   if (!GetOperations()->IsDone() || anObject.IsNull())
640     return GEOM::GEOM_Object::_nil();
641
642   return GetObject(anObject);
643 }
644
645 //=============================================================================
646 /*!
647  *  Make3DSketcher
648  */
649 //=============================================================================
650 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::Make3DSketcher
651             (const GEOM::ListOfDouble& theCoordinates)
652 {
653   //Set a not done flag
654   GetOperations()->SetNotDone();
655
656   int ind = 0;
657   int aLen = theCoordinates.length();
658   std::list<double> aCoords;
659   for (; ind < aLen; ind++)
660     aCoords.push_back(theCoordinates[ind]);
661
662   // Make Sketcher
663   Handle(GEOM_Object) anObject =
664     GetOperations()->Make3DSketcher(aCoords);
665   if (!GetOperations()->IsDone() || anObject.IsNull())
666     return GEOM::GEOM_Object::_nil();
667
668   return GetObject(anObject);
669 }