Salome HOME
remove std::cout.
[modules/geom.git] / src / GEOM_I / GEOM_IBasicOperations_i.cc
1 //  Copyright (C) 2007-2010  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.
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_IBasicOperations_i.hh"
26
27 #include "utilities.h"
28 #include "OpUtil.hxx"
29 #include "Utils_ExceptHandlers.hxx"
30
31 #include "GEOM_Engine.hxx"
32 #include "GEOM_Object.hxx"
33
34 //=============================================================================
35 /*!
36  *   constructor:
37  */
38 //=============================================================================
39 GEOM_IBasicOperations_i::GEOM_IBasicOperations_i (PortableServer::POA_ptr thePOA,
40                                                   GEOM::GEOM_Gen_ptr theEngine,
41                                                   ::GEOMImpl_IBasicOperations* theImpl)
42      :GEOM_IOperations_i(thePOA, theEngine, theImpl)
43 {
44   MESSAGE("GEOM_IBasicOperations_i::GEOM_IBasicOperations_i");
45 }
46
47 //=============================================================================
48 /*!
49  *  destructor
50  */
51 //=============================================================================
52 GEOM_IBasicOperations_i::~GEOM_IBasicOperations_i()
53 {
54   MESSAGE("GEOM_IBasicOperations_i::~GEOM_IBasicOperations_i");
55 }
56
57
58 //=============================================================================
59 /*!
60  *  MakePointXYZ
61  */
62 //=============================================================================
63 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointXYZ
64   (CORBA::Double theX, CORBA::Double theY, CORBA::Double theZ)
65 {
66   GEOM::GEOM_Object_var aGEOMObject;
67
68   //Set a not done flag
69   GetOperations()->SetNotDone();
70
71   //Create the point
72   Handle(GEOM_Object) anObject = GetOperations()->MakePointXYZ(theX, theY, theZ);
73   if (!GetOperations()->IsDone() || anObject.IsNull())
74     return aGEOMObject._retn();
75
76   return GetObject(anObject);
77 }
78
79 //=============================================================================
80 /*!
81  *  MakePointWithReference
82  */
83 //=============================================================================
84 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointWithReference
85   (GEOM::GEOM_Object_ptr theReference, CORBA::Double theX, CORBA::Double theY, CORBA::Double theZ)
86 {
87   GEOM::GEOM_Object_var aGEOMObject;
88
89   //Set a not done flag
90   GetOperations()->SetNotDone();
91
92   //Get the reference point
93   Handle(GEOM_Object) aReference = GetObjectImpl(theReference);
94   if (aReference.IsNull()) return aGEOMObject._retn();
95
96   //Create the point
97   Handle(GEOM_Object) anObject =
98     GetOperations()->MakePointWithReference(aReference, theX, theY, theZ);
99   if (!GetOperations()->IsDone() || anObject.IsNull())
100     return aGEOMObject._retn();
101
102   return GetObject(anObject);
103 }
104
105 //=============================================================================
106 /*!
107  *  MakePointOnLinesIntersection
108  */
109 //=============================================================================
110 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
111                   (GEOM::GEOM_Object_ptr theLine1,  GEOM::GEOM_Object_ptr theLine2)
112 {
113   GEOM::GEOM_Object_var aGEOMObject;
114
115   //Set a not done flag
116   GetOperations()->SetNotDone();
117
118   //Get the reference Lines
119   Handle(GEOM_Object) aRef1 = GetObjectImpl(theLine1);
120   Handle(GEOM_Object) aRef2 = GetObjectImpl(theLine2);
121   if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
122
123   //Create the point
124   Handle(GEOM_Object) anObject =
125     GetOperations()->MakePointOnLinesIntersection(aRef1, aRef2);
126   if (!GetOperations()->IsDone() || anObject.IsNull())
127     return aGEOMObject._retn();
128
129   return GetObject(anObject);
130 }
131
132 //=============================================================================
133 /*!
134  *  MakePointOnCurve
135  */
136 //=============================================================================
137 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
138                   (GEOM::GEOM_Object_ptr theCurve,  CORBA::Double theParameter)
139 {
140   GEOM::GEOM_Object_var aGEOMObject;
141
142   //Set a not done flag
143   GetOperations()->SetNotDone();
144
145   //Get the reference curve
146   Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
147   if (aReference.IsNull()) return aGEOMObject._retn();
148
149   //Create the point
150   Handle(GEOM_Object) anObject =
151     GetOperations()->MakePointOnCurve(aReference, theParameter);
152   if (!GetOperations()->IsDone() || anObject.IsNull())
153     return aGEOMObject._retn();
154
155   return GetObject(anObject);
156 }
157
158 //=============================================================================
159 /*!
160  *  MakePointOnCurveByLength
161  */
162 //=============================================================================
163 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurveByLength
164                   (GEOM::GEOM_Object_ptr theCurve,  
165                    CORBA::Double theLength,
166                    CORBA::Boolean theReverse)
167 {
168   GEOM::GEOM_Object_var aGEOMObject;
169
170   //Set a not done flag
171   GetOperations()->SetNotDone();
172
173   //Get the reference curve
174   Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
175   if (aReference.IsNull()) return aGEOMObject._retn();
176
177   //Create the point
178   Handle(GEOM_Object) anObject =
179     GetOperations()->MakePointOnCurveByLength(aReference, theLength,
180                                               theReverse);
181   if (!GetOperations()->IsDone() || anObject.IsNull())
182     return aGEOMObject._retn();
183
184   return GetObject(anObject);
185 }
186
187 //=============================================================================
188 /*!
189  *  MakePointOnCurveByCoord
190  */
191 //=============================================================================
192 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurveByCoord
193                   (GEOM::GEOM_Object_ptr theCurve, 
194                    CORBA::Double theXParameter,
195                    CORBA::Double theYParameter,
196                    CORBA::Double theZParameter)
197 {
198   GEOM::GEOM_Object_var aGEOMObject;
199
200   //Set a not done flag
201   GetOperations()->SetNotDone();
202
203   //Get the reference curve
204   Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
205   if (aReference.IsNull()) return aGEOMObject._retn();
206
207   //Create the point
208   Handle(GEOM_Object) anObject =
209     GetOperations()->MakePointOnCurveByCoord(aReference, theXParameter,
210                                              theYParameter, theZParameter);
211   if (!GetOperations()->IsDone() || anObject.IsNull())
212     return aGEOMObject._retn();
213
214   return GetObject(anObject);
215 }
216
217 //=============================================================================
218 /*!
219  *  MakePointOnSurface
220  */
221 //=============================================================================
222 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnSurface
223                                              (GEOM::GEOM_Object_ptr theSurface,
224                                               CORBA::Double theUParameter,
225                                               CORBA::Double theVParameter)
226 {
227   GEOM::GEOM_Object_var aGEOMObject;
228
229   //Set a not done flag
230   GetOperations()->SetNotDone();
231
232   //Get the reference surface
233   Handle(GEOM_Object) aReference = GetObjectImpl(theSurface);
234   if (aReference.IsNull()) return aGEOMObject._retn();
235
236   //Create the point
237   Handle(GEOM_Object) anObject =
238     GetOperations()->MakePointOnSurface(aReference, theUParameter, theVParameter);
239   if (!GetOperations()->IsDone() || anObject.IsNull())
240     return aGEOMObject._retn();
241
242   return GetObject(anObject);
243 }
244
245 //=============================================================================
246 /*!
247  *  MakePointOnSurfaceByCoord
248  */
249 //=============================================================================
250 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnSurfaceByCoord
251                                              (GEOM::GEOM_Object_ptr theSurface,
252                                               CORBA::Double theXParameter,
253                                               CORBA::Double theYParameter,
254                                               CORBA::Double theZParameter)
255 {
256   GEOM::GEOM_Object_var aGEOMObject;
257
258   //Set a not done flag
259   GetOperations()->SetNotDone();
260
261   //Get the reference surface
262   Handle(GEOM_Object) aReference = GetObjectImpl(theSurface);
263   if (aReference.IsNull()) return aGEOMObject._retn();
264
265   //Create the point
266   Handle(GEOM_Object) anObject =
267     GetOperations()->MakePointOnSurfaceByCoord(aReference, theXParameter,
268                                                theYParameter, theZParameter);
269   if (!GetOperations()->IsDone() || anObject.IsNull())
270     return aGEOMObject._retn();
271
272   return GetObject(anObject);
273 }
274
275
276 //=============================================================================
277 /*!
278  *  MakeTangentOnCurve
279  */
280 //=============================================================================
281 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentOnCurve
282                   (GEOM::GEOM_Object_ptr theCurve,  CORBA::Double theParameter)
283 {
284   GEOM::GEOM_Object_var aGEOMObject;
285
286   //Set a not done flag
287   GetOperations()->SetNotDone();
288
289   //Get the reference curve
290   Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
291   if (aReference.IsNull()) return aGEOMObject._retn();
292
293   //Create the vector
294   Handle(GEOM_Object) anObject =
295     GetOperations()->MakeTangentOnCurve(aReference, theParameter);
296   if (!GetOperations()->IsDone() || anObject.IsNull())
297     return aGEOMObject._retn();
298
299   return GetObject(anObject);
300 }
301
302 //=============================================================================
303 /*!
304  *  MakeVectorDXDYDZ
305  */
306 //=============================================================================
307 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeVectorDXDYDZ
308   (CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
309 {
310   GEOM::GEOM_Object_var aGEOMObject;
311
312   //Set a not done flag
313   GetOperations()->SetNotDone();
314
315   //Create the Vector
316
317   Handle(GEOM_Object) anObject = GetOperations()->MakeVectorDXDYDZ(theDX, theDY, theDZ);
318   if (!GetOperations()->IsDone() || anObject.IsNull())
319     return aGEOMObject._retn();
320
321   return GetObject(anObject);
322 }
323
324 //=============================================================================
325 /*!
326  *  MakeVectorTwoPnt
327  */
328 //=============================================================================
329 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeVectorTwoPnt
330                  (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
331 {
332   GEOM::GEOM_Object_var aGEOMObject;
333
334   //Set a not done flag
335   GetOperations()->SetNotDone();
336
337   //Get the reference points
338   Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt1);
339   Handle(GEOM_Object) aRef2 = GetObjectImpl(thePnt2);
340   if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
341
342   //Create the vector
343   Handle(GEOM_Object) anObject = GetOperations()->MakeVectorTwoPnt(aRef1, aRef2);
344   if (!GetOperations()->IsDone() || anObject.IsNull())
345     return aGEOMObject._retn();
346
347   return GetObject(anObject);
348 }
349
350
351 //=============================================================================
352 /*!
353  *  MakeLine
354  */
355 //=============================================================================
356 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLine
357                    (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theDir)
358 {
359   GEOM::GEOM_Object_var aGEOMObject;
360
361   //Set a not done flag
362   GetOperations()->SetNotDone();
363
364   //Get the reference objects
365   Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt);
366   Handle(GEOM_Object) aRef2 = GetObjectImpl(theDir);
367   if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
368
369   //Create the Line
370   Handle(GEOM_Object) anObject = GetOperations()->MakeLine(aRef1, aRef2);
371   if (!GetOperations()->IsDone() || anObject.IsNull())
372     return aGEOMObject._retn();
373
374   return GetObject(anObject);
375 }
376
377 //=============================================================================
378 /*!
379  *  MakeLineTwoPnt
380  */
381 //=============================================================================
382 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoPnt
383                  (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
384 {
385   GEOM::GEOM_Object_var aGEOMObject;
386
387   //Set a not done flag
388   GetOperations()->SetNotDone();
389
390   //Get the reference points
391   Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt1);
392   Handle(GEOM_Object) aRef2 = GetObjectImpl(thePnt2);
393   if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
394
395   //Create the Line
396   Handle(GEOM_Object) anObject = GetOperations()->MakeLineTwoPnt(aRef1, aRef2);
397   if (!GetOperations()->IsDone() || anObject.IsNull())
398     return aGEOMObject._retn();
399
400   return GetObject(anObject);
401 }
402
403 //=============================================================================
404 /*!
405  *  MakeLineTwoFaces
406  */
407 //=============================================================================
408 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoFaces
409                  (GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
410 {
411   GEOM::GEOM_Object_var aGEOMObject;
412
413   //Set a not done flag
414   GetOperations()->SetNotDone();
415
416   //Get the reference points
417   Handle(GEOM_Object) aRef1 = GetObjectImpl(theFace1);
418   Handle(GEOM_Object) aRef2 = GetObjectImpl(theFace2);
419   if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
420
421   //Create the Line
422   Handle(GEOM_Object) anObject =
423     GetOperations()->MakeLineTwoFaces(aRef1, aRef2);
424   if (!GetOperations()->IsDone() || anObject.IsNull())
425     return aGEOMObject._retn();
426
427   return GetObject(anObject);
428 }
429
430
431 //=============================================================================
432 /*!
433  *  MakePlanePntVec
434  */
435 //=============================================================================
436 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlanePntVec
437                  (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
438                   CORBA::Double theTrimSize)
439 {
440   GEOM::GEOM_Object_var aGEOMObject;
441
442   //Set a not done flag
443   GetOperations()->SetNotDone();
444
445   //Get the references
446   Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt);
447   Handle(GEOM_Object) aRef2 = GetObjectImpl(theVec);
448   if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
449
450   //Create the plane
451   Handle(GEOM_Object) anObject =
452     GetOperations()->MakePlanePntVec(aRef1, aRef2, theTrimSize);
453   if (!GetOperations()->IsDone() || anObject.IsNull())
454     return aGEOMObject._retn();
455
456   return GetObject(anObject);
457 }
458
459 //=============================================================================
460 /*!
461  *  MakePlaneThreePnt
462  */
463 //=============================================================================
464 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlaneThreePnt
465                  (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
466                   GEOM::GEOM_Object_ptr thePnt3, CORBA::Double theTrimSize)
467 {
468   GEOM::GEOM_Object_var aGEOMObject;
469
470   //Set a not done flag
471   GetOperations()->SetNotDone();
472
473   //Get the reference points
474   Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt1);
475   Handle(GEOM_Object) aRef2 = GetObjectImpl(thePnt2);
476   Handle(GEOM_Object) aRef3 = GetObjectImpl(thePnt3);
477   if (aRef1.IsNull() || aRef2.IsNull() || aRef3.IsNull())
478     return aGEOMObject._retn();
479
480   //Create the plane
481   Handle(GEOM_Object) anObject =
482     GetOperations()->MakePlaneThreePnt(aRef1, aRef2, aRef3, theTrimSize);
483   if (!GetOperations()->IsDone() || anObject.IsNull())
484     return aGEOMObject._retn();
485
486   return GetObject(anObject);
487 }
488
489 //=============================================================================
490 /*!
491  *  MakePlaneFace
492  */
493 //=============================================================================
494 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlaneFace
495                      (GEOM::GEOM_Object_ptr theFace, CORBA::Double theTrimSize)
496 {
497   GEOM::GEOM_Object_var aGEOMObject;
498
499   //Set a not done flag
500   GetOperations()->SetNotDone();
501
502   //Get the reference face
503   Handle(GEOM_Object) aRef = GetObjectImpl(theFace);
504   if (aRef.IsNull()) return aGEOMObject._retn();
505
506   //Create the plane
507   Handle(GEOM_Object) anObject =
508     GetOperations()->MakePlaneFace(aRef, theTrimSize);
509   if (!GetOperations()->IsDone() || anObject.IsNull())
510     return aGEOMObject._retn();
511
512   return GetObject(anObject);
513 }
514
515 //=============================================================================
516 /*!
517  *  MakePlane2Vec
518  */
519 //=============================================================================
520 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlane2Vec
521                  (GEOM::GEOM_Object_ptr theVec1, GEOM::GEOM_Object_ptr theVec2,
522                   CORBA::Double theTrimSize)
523 {
524   GEOM::GEOM_Object_var aGEOMObject;
525
526   //Set a not done flag
527   GetOperations()->SetNotDone();
528
529   //Get the references
530   Handle(GEOM_Object) aRef1 = GetObjectImpl(theVec1);
531   Handle(GEOM_Object) aRef2 = GetObjectImpl(theVec2);
532   if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
533
534   //Create the plane
535   Handle(GEOM_Object) anObject =
536     GetOperations()->MakePlane2Vec(aRef1, aRef2, theTrimSize);
537   if (!GetOperations()->IsDone() || anObject.IsNull())
538     return aGEOMObject._retn();
539
540   return GetObject(anObject);
541 }
542
543 //=============================================================================
544 /*!
545  *  MakePlaneLCS
546  */
547 //=============================================================================
548 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlaneLCS
549                  (GEOM::GEOM_Object_ptr theLCS, CORBA::Double theTrimSize,
550                   CORBA::Double theOrientation)
551 {
552   GEOM::GEOM_Object_var aGEOMObject;
553
554   //Set a not done flag
555   GetOperations()->SetNotDone();
556
557   //Get the references
558   Handle(GEOM_Object) aRef1 = GetObjectImpl(theLCS);
559
560   //Create the plane
561   Handle(GEOM_Object) anObject =
562     GetOperations()->MakePlaneLCS(aRef1, theTrimSize, theOrientation);
563   if (!GetOperations()->IsDone() || anObject.IsNull())
564     return aGEOMObject._retn();
565
566   return GetObject(anObject);
567 }
568
569 //=============================================================================
570 /*!
571  *  MakeMarker
572  */
573 //=============================================================================
574 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeMarker
575   (CORBA::Double theOX , CORBA::Double theOY , CORBA::Double theOZ,
576    CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ,
577    CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ)
578 {
579   GEOM::GEOM_Object_var aGEOMObject;
580
581   //Set a not done flag
582   GetOperations()->SetNotDone();
583
584   //Create the point
585   Handle(GEOM_Object) anObject = GetOperations()->MakeMarker(theOX , theOY , theOZ,
586                                                              theXDX, theXDY, theXDZ,
587                                                              theYDX, theYDY, theYDZ);
588   if (!GetOperations()->IsDone() || anObject.IsNull())
589     return aGEOMObject._retn();
590
591   return GetObject(anObject);
592 }
593
594 //=============================================================================
595 /*!
596  *  MakeMarkerFromShape
597  */
598 //=============================================================================
599 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeMarkerFromShape
600                                               (GEOM::GEOM_Object_ptr theShape)
601 {
602   GEOM::GEOM_Object_var aGEOMObject;
603
604   //Set a not done flag
605   GetOperations()->SetNotDone();
606
607   //Get the referenced object
608   Handle(GEOM_Object) aRef = GetObjectImpl(theShape);
609   if (aRef.IsNull()) return aGEOMObject._retn();
610
611   //Create the point
612   Handle(GEOM_Object) anObject = GetOperations()->MakeMarkerFromShape(aRef);
613   if (!GetOperations()->IsDone() || anObject.IsNull())
614     return aGEOMObject._retn();
615
616   return GetObject(anObject);
617 }
618
619 //=============================================================================
620 /*!
621  *  MakeMarkerPntTwoVec
622  */
623 //=============================================================================
624 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeMarkerPntTwoVec
625                                               (GEOM::GEOM_Object_ptr theOrigin,
626                                                GEOM::GEOM_Object_ptr theXVec,
627                                                GEOM::GEOM_Object_ptr theYVec)
628 {
629   GEOM::GEOM_Object_var aGEOMObject;
630
631   //Set a not done flag
632   GetOperations()->SetNotDone();
633
634   //Get the referenced objects
635   Handle(GEOM_Object) aRef1 = GetObjectImpl(theOrigin);
636   Handle(GEOM_Object) aRef2 = GetObjectImpl(theXVec);
637   Handle(GEOM_Object) aRef3 = GetObjectImpl(theYVec);
638   if (aRef1.IsNull() || aRef2.IsNull() || aRef3.IsNull()) return aGEOMObject._retn();
639
640   //Create the point
641   Handle(GEOM_Object) anObject = GetOperations()->MakeMarkerPntTwoVec(aRef1,
642                                                                       aRef2,
643                                                                       aRef3);
644   if (!GetOperations()->IsDone() || anObject.IsNull())
645     return aGEOMObject._retn();
646
647   return GetObject(anObject);
648 }
649
650 //=============================================================================
651 /*!
652  *  MakeTangentPlaneOnFace
653  */
654 //=============================================================================
655
656 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentPlaneOnFace
657                      (GEOM::GEOM_Object_ptr theFace,
658                       CORBA::Double theParameterU,
659                       CORBA::Double theParameterV,
660                       CORBA::Double theTrimSize)
661 {
662   GEOM::GEOM_Object_var aGEOMObject;
663
664   //Set a not done flag
665   GetOperations()->SetNotDone();
666
667   //Get the reference face
668   Handle(GEOM_Object) aRef = GetObjectImpl(theFace);
669   if (aRef.IsNull()) return aGEOMObject._retn();
670
671   //Create the plane
672   Handle(GEOM_Object) anObject =
673     GetOperations()->MakeTangentPlaneOnFace(aRef, theParameterU,theParameterV,theTrimSize);
674   if (!GetOperations()->IsDone() || anObject.IsNull())
675     return aGEOMObject._retn();
676
677   return GetObject(anObject);
678 }