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