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