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