]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOM_I/GEOM_ITransformOperations_i.cc
Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / src / GEOM_I / GEOM_ITransformOperations_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_ITransformOperations_i.hh"
25
26 #include "utilities.h"
27 #include "OpUtil.hxx"
28 #include "Utils_ExceptHandlers.hxx"
29
30 #include <TDF_Label.hxx>
31 #include <TDF_Tool.hxx>
32 #include <TCollection_AsciiString.hxx>
33 #include "GEOM_Engine.hxx"
34 #include "GEOM_Object.hxx"
35
36 #define SUBSHAPE_ERROR "Sub shape cannot be transformed"
37
38 //=============================================================================
39 /*!
40  *   constructor:
41  */
42 //=============================================================================
43
44 GEOM_ITransformOperations_i::GEOM_ITransformOperations_i (PortableServer::POA_ptr thePOA,
45                                                           GEOM::GEOM_Gen_ptr theEngine,
46                                                           ::GEOMImpl_ITransformOperations* theImpl)
47      :GEOM_IOperations_i(thePOA, theEngine, theImpl)
48 {
49   MESSAGE("GEOM_ITransformOperations_i::GEOM_ITransformOperations_i");
50 }
51
52 //=============================================================================
53 /*!
54  *  destructor
55  */
56 //=============================================================================
57
58 GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i()
59 {
60   MESSAGE("GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i");
61 }
62
63
64 //=============================================================================
65 /*!
66  *  TranslateTwoPoints
67  */
68 //=============================================================================
69 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
70                                              (GEOM::GEOM_Object_ptr theObject,
71                                               GEOM::GEOM_Object_ptr thePoint1,
72                                               GEOM::GEOM_Object_ptr thePoint2)
73 {
74   //Set a not done flag
75   GetOperations()->SetNotDone();
76   GEOM::GEOM_Object_var aGEOMObject;
77
78   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
79
80   //check if the object is a sub-shape
81   if (!theObject->IsMainShape()) {
82     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
83     return aGEOMObject._retn();
84   }
85
86   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
87
88   //Get the object itself
89   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
90   if (anObject.IsNull()) return aGEOMObject._retn();
91
92   //Get the first point of translation
93   Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
94   if (aPoint1.IsNull()) return aGEOMObject._retn();
95
96   //Get the second point of translation
97   Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
98   if (aPoint2.IsNull()) return aGEOMObject._retn();
99
100   //Perform the translation
101   GetOperations()->TranslateTwoPoints(anObject, aPoint1, aPoint2);
102
103   return aGEOMObject._retn();
104 }
105
106 //=============================================================================
107 /*!
108  *  TranslateTwoPointsCopy
109  */
110 //=============================================================================
111 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy
112                                              (GEOM::GEOM_Object_ptr theObject,
113                                               GEOM::GEOM_Object_ptr thePoint1,
114                                               GEOM::GEOM_Object_ptr thePoint2)
115 {
116   GEOM::GEOM_Object_var aGEOMObject;
117
118   //Set a not done flag
119   GetOperations()->SetNotDone();
120
121   //Get the object itself
122   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
123   if (aBasicObject.IsNull()) return aGEOMObject._retn();
124
125   //Get the first point of translation
126   Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
127   if (aPoint1.IsNull()) return aGEOMObject._retn();
128
129   //Get the second point of translation
130   Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
131   if (aPoint2.IsNull()) return aGEOMObject._retn();
132
133   //Create the translated shape
134   Handle(GEOM_Object) anObject =
135     GetOperations()->TranslateTwoPointsCopy(aBasicObject, aPoint1, aPoint2);
136   if (!GetOperations()->IsDone() || anObject.IsNull())
137     return aGEOMObject._retn();
138
139   return GetObject(anObject);
140 }
141
142 //=============================================================================
143 /*!
144  *  TranslateDXDYDZ
145  */
146 //=============================================================================
147 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
148                       (GEOM::GEOM_Object_ptr theObject,
149                        CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
150 {
151   //Set a not done flag
152   GetOperations()->SetNotDone();
153   GEOM::GEOM_Object_var aGEOMObject;
154
155   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
156
157   //check if the object is a sub-shape
158   if (!theObject->IsMainShape()) {
159     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
160     return aGEOMObject._retn();
161   }
162
163   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
164
165   //Get the object itself
166   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
167   if (anObject.IsNull()) return aGEOMObject._retn();
168
169   //Perform the translation
170   GetOperations()->TranslateDXDYDZ(anObject, theDX, theDY, theDZ);
171
172   return aGEOMObject._retn();
173 }
174
175 //=============================================================================
176 /*!
177  *  TranslateDXDYDZCopy
178  */
179 //=============================================================================
180 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
181                                              (GEOM::GEOM_Object_ptr theObject,
182                                               CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
183 {
184   GEOM::GEOM_Object_var aGEOMObject;
185
186   //Set a not done flag
187   GetOperations()->SetNotDone();
188
189   //Get the object itself
190   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
191   if (aBasicObject.IsNull()) return aGEOMObject._retn();
192
193   //Create the translated shape
194   Handle(GEOM_Object) anObject =
195     GetOperations()->TranslateDXDYDZCopy(aBasicObject, theDX, theDY, theDZ);
196   if (!GetOperations()->IsDone() || anObject.IsNull())
197     return aGEOMObject._retn();
198
199   return GetObject(anObject);
200 }
201
202 //=============================================================================
203 /*!
204  *  TranslateVector
205  */
206 //=============================================================================
207 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
208                                             (GEOM::GEOM_Object_ptr theObject,
209                                              GEOM::GEOM_Object_ptr theVector)
210 {
211   //Set a not done flag
212   GetOperations()->SetNotDone();
213   GEOM::GEOM_Object_var aGEOMObject;
214
215   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
216
217   //check if the object is a sub-shape
218   if (!theObject->IsMainShape()) {
219     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
220     return aGEOMObject._retn();
221   }
222
223   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
224
225   //Get the object itself
226   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
227   if (anObject.IsNull()) return aGEOMObject._retn();
228
229   //Get the vector of translation
230   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
231   if (aVector.IsNull()) return aGEOMObject._retn();
232
233   //Perform the translation
234   GetOperations()->TranslateVector(anObject, aVector);
235
236   return aGEOMObject._retn();
237 }
238
239 //=============================================================================
240 /*!
241  *  TranslateVectorCopy
242  */
243 //=============================================================================
244 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy
245                                             (GEOM::GEOM_Object_ptr theObject,
246                                              GEOM::GEOM_Object_ptr theVector)
247 {
248   GEOM::GEOM_Object_var aGEOMObject;
249
250   //Set a not done flag
251   GetOperations()->SetNotDone();
252
253   //Get the object itself
254   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
255   if (aBasicObject.IsNull()) return aGEOMObject._retn();
256
257   //Get the vector of translation
258   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
259   if (aVector.IsNull()) return aGEOMObject._retn();
260
261   //Perform the translation
262   Handle(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector);
263   if (!GetOperations()->IsDone() || anObject.IsNull())
264     return aGEOMObject._retn();
265
266   return GetObject(anObject);
267 }
268
269 //=============================================================================
270 /*!
271  *  TranslateVectorDistance
272  */
273 //=============================================================================
274 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
275                                             (GEOM::GEOM_Object_ptr theObject,
276                                              GEOM::GEOM_Object_ptr theVector,
277                                              CORBA::Double theDistance,
278                                              CORBA::Boolean theCopy)
279 {
280   GEOM::GEOM_Object_var aGEOMObject;
281   GetOperations()->SetNotDone(); //Set a not done flag
282
283   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
284
285   //check if the object is a sub-shape
286   if (!theCopy && !theObject->IsMainShape()) {
287     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
288     return aGEOMObject._retn();
289   }
290
291   if (!theCopy)
292     aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
293
294   //Get the object itself
295   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
296   if (aBasicObject.IsNull()) return aGEOMObject._retn();
297
298   //Get the vector of translation
299   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
300   if (aVector.IsNull()) return aGEOMObject._retn();
301
302   //Perform the translation
303   if (theCopy) {
304     Handle(GEOM_Object) anObject = GetOperations()->
305       TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
306     if (!GetOperations()->IsDone() || anObject.IsNull())
307       return aGEOMObject._retn();
308
309     return GetObject(anObject);
310   }
311
312   GetOperations()->TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
313   return aGEOMObject._retn();
314 }
315
316 //=============================================================================
317 /*!
318  *  Rotate
319  */
320 //=============================================================================
321 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr theObject,
322                                                            GEOM::GEOM_Object_ptr theAxis,
323                                                            CORBA::Double theAngle)
324 {
325   //Set a not done flag
326   GetOperations()->SetNotDone();
327   GEOM::GEOM_Object_var aGEOMObject;
328
329   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
330
331   //check if the object is a sub-shape
332   if (!theObject->IsMainShape()) {
333     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
334     return aGEOMObject._retn();
335   }
336
337   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
338
339   //Get the object itself
340   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
341   if (anObject.IsNull()) return aGEOMObject._retn();
342
343   //Get the axis of revolution
344   Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
345   if (anAxis.IsNull()) return aGEOMObject._retn();
346
347   //Perform the rotation
348   GetOperations()->Rotate(anObject, anAxis, theAngle);
349
350   return aGEOMObject._retn();
351 }
352
353 //=============================================================================
354 /*!
355  *  RotateCopy
356  */
357 //=============================================================================
358 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object_ptr theObject,
359                                                                GEOM::GEOM_Object_ptr theAxis,
360                                                                CORBA::Double theAngle)
361 {
362   GEOM::GEOM_Object_var aGEOMObject;
363
364   //Set a not done flag
365   GetOperations()->SetNotDone();
366
367   //Get the object itself
368   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
369   if (aBasicObject.IsNull()) return aGEOMObject._retn();
370
371   //Get the axis of rotation
372   Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
373   if (anAxis.IsNull()) return aGEOMObject._retn();
374
375   //Perform the rotation
376   Handle(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle);
377   if (!GetOperations()->IsDone() || anObject.IsNull())
378     return aGEOMObject._retn();
379
380   return GetObject(anObject);
381 }
382
383 //=============================================================================
384 /*!
385  *  MirrorPlane
386  */
387 //=============================================================================
388 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
389                                             (GEOM::GEOM_Object_ptr theObject,
390                                              GEOM::GEOM_Object_ptr thePlane)
391 {
392   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
393
394   //Set a not done flag
395   GetOperations()->SetNotDone();
396
397   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
398
399   //check if the object is a sub-shape
400   if (!theObject->IsMainShape()) {
401     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
402     return aGEOMObject._retn();
403   }
404
405   //Get the object itself
406   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
407   if (anObject.IsNull()) return aGEOMObject._retn();
408
409   //Get the plane
410   Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane);
411   if (aPlane.IsNull()) return aGEOMObject._retn();
412
413   //Perform the mirror
414   GetOperations()->MirrorPlane(anObject, aPlane);
415
416   return aGEOMObject._retn();
417 }
418
419 //=============================================================================
420 /*!
421  *  MirrorPlaneCopy
422  */
423 //=============================================================================
424 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy
425                                             (GEOM::GEOM_Object_ptr theObject,
426                                              GEOM::GEOM_Object_ptr thePlane)
427 {
428   GEOM::GEOM_Object_var aGEOMObject;
429
430   //Set a not done flag
431   GetOperations()->SetNotDone();
432
433   //Get the object itself
434   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
435   if (aBasicObject.IsNull()) return aGEOMObject._retn();
436
437   //Get the vector of translation
438   Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane);
439   if (aPlane.IsNull()) return aGEOMObject._retn();
440
441   //Perform the mirror
442   Handle(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane);
443   if (!GetOperations()->IsDone() || anObject.IsNull())
444     return aGEOMObject._retn();
445
446   return GetObject(anObject);
447 }
448
449 //=============================================================================
450 /*!
451  *  MirrorAxis
452  */
453 //=============================================================================
454 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
455                                             (GEOM::GEOM_Object_ptr theObject,
456                                              GEOM::GEOM_Object_ptr theAxis)
457 {
458   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
459
460   //Set a not done flag
461   GetOperations()->SetNotDone();
462
463   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
464
465   //check if the object is a sub-shape
466   if (!theObject->IsMainShape()) {
467     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
468     return aGEOMObject._retn();
469   }
470
471   //Get the object itself
472   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
473   if (anObject.IsNull()) return aGEOMObject._retn();
474
475   //Get the axis
476   Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis);
477   if (aAxis.IsNull()) return aGEOMObject._retn();
478
479   //Perform the mirror
480   GetOperations()->MirrorAxis(anObject, aAxis);
481
482   return aGEOMObject._retn();
483 }
484
485 //=============================================================================
486 /*!
487  *  MirrorAxisCopy
488  */
489 //=============================================================================
490 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy
491                                             (GEOM::GEOM_Object_ptr theObject,
492                                              GEOM::GEOM_Object_ptr theAxis)
493 {
494   GEOM::GEOM_Object_var aGEOMObject;
495
496   //Set a not done flag
497   GetOperations()->SetNotDone();
498
499   //Get the object itself
500   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
501   if (aBasicObject.IsNull()) return aGEOMObject._retn();
502
503   //Get the vector of translation
504   Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis);
505   if (aAxis.IsNull()) return aGEOMObject._retn();
506
507   //Perform the mirror
508   Handle(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis);
509   if (!GetOperations()->IsDone() || anObject.IsNull())
510     return aGEOMObject._retn();
511
512   return GetObject(anObject);
513 }
514
515 //=============================================================================
516 /*!
517  *  MirrorPoint
518  */
519 //=============================================================================
520 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
521                                             (GEOM::GEOM_Object_ptr theObject,
522                                              GEOM::GEOM_Object_ptr thePoint)
523 {
524   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
525
526   //Set a not done flag
527   GetOperations()->SetNotDone();
528
529   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
530
531   //check if the object is a sub-shape
532   if (!theObject->IsMainShape()) {
533     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
534     return aGEOMObject._retn();
535   }
536
537   //Get the object itself
538   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
539   if (anObject.IsNull()) return aGEOMObject._retn();
540
541   //Get the point
542   Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
543   if (aPoint.IsNull()) return aGEOMObject._retn();
544
545   //Perform the mirror
546   GetOperations()->MirrorPoint(anObject, aPoint);
547
548   return aGEOMObject._retn();
549 }
550
551 //=============================================================================
552 /*!
553  *  MirrorPointCopy
554  */
555 //=============================================================================
556 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
557                                             (GEOM::GEOM_Object_ptr theObject,
558                                              GEOM::GEOM_Object_ptr thePoint)
559 {
560   GEOM::GEOM_Object_var aGEOMObject;
561
562   //Set a not done flag
563   GetOperations()->SetNotDone();
564
565   //Get the object itself
566   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
567   if (aBasicObject.IsNull()) return aGEOMObject._retn();
568
569   //Get the vector of translation
570   Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
571   if (aPoint.IsNull()) return aGEOMObject._retn();
572
573   //Perform the mirror
574   Handle(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint);
575   if (!GetOperations()->IsDone() || anObject.IsNull())
576     return aGEOMObject._retn();
577
578   return GetObject(anObject);
579 }
580
581 //=============================================================================
582 /*!
583  *  OffsetShape
584  */
585 //=============================================================================
586 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
587                                              (GEOM::GEOM_Object_ptr theObject,
588                                               CORBA::Double theOffset)
589 {
590   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
591
592   //Set a not done flag
593   GetOperations()->SetNotDone();
594
595   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
596
597   //check if the object is a sub-shape
598   if (!theObject->IsMainShape()) {
599     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
600     return aGEOMObject._retn();
601   }
602
603   //Get the basic object
604   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
605   if (aBasicObject.IsNull()) return aGEOMObject._retn();
606
607   //Create the offset shape
608   GetOperations()->OffsetShape(aBasicObject, theOffset);
609
610   return aGEOMObject._retn();
611 }
612
613 //=============================================================================
614 /*!
615  *  OffsetShapeCopy
616  */
617 //=============================================================================
618 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
619                                              (GEOM::GEOM_Object_ptr theObject,
620                                               CORBA::Double theOffset)
621 {
622   GEOM::GEOM_Object_var aGEOMObject;
623
624   //Set a not done flag
625   GetOperations()->SetNotDone();
626
627   //Get the basic object
628   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
629   if (aBasicObject.IsNull()) return aGEOMObject._retn();
630
631   //Create the offset shape
632   Handle(GEOM_Object) anObject = GetOperations()->OffsetShapeCopy(aBasicObject, theOffset);
633   if (!GetOperations()->IsDone() || anObject.IsNull())
634     return aGEOMObject._retn();
635
636   return GetObject(anObject);
637 }
638
639 //=============================================================================
640 /*!
641  *  ProjectShapeCopy
642  */
643 //=============================================================================
644 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ProjectShapeCopy
645                                              (GEOM::GEOM_Object_ptr theSource,
646                                               GEOM::GEOM_Object_ptr theTarget)
647 {
648   GEOM::GEOM_Object_var aGEOMObject;
649
650   //Set a not done flag
651   GetOperations()->SetNotDone();
652
653   //Get the input objects
654   Handle(GEOM_Object) aSource = GetObjectImpl(theSource);
655   Handle(GEOM_Object) aTarget = GetObjectImpl(theTarget);
656   if (aSource.IsNull() || aTarget.IsNull()) return aGEOMObject._retn();
657
658   //Create the projection
659   Handle(GEOM_Object) anObject = GetOperations()->ProjectShapeCopy(aSource, aTarget);
660   if (!GetOperations()->IsDone() || anObject.IsNull())
661     return aGEOMObject._retn();
662
663   return GetObject(anObject);
664 }
665
666 //=============================================================================
667 /*!
668  *  ScaleShape
669  */
670 //=============================================================================
671 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
672                                              (GEOM::GEOM_Object_ptr theObject,
673                                               GEOM::GEOM_Object_ptr thePoint,
674                                               CORBA::Double         theFactor)
675 {
676   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
677
678   //Set a not done flag
679   GetOperations()->SetNotDone();
680
681   if (theObject->_is_nil()) return aGEOMObject._retn();
682
683   //check if the object is a sub-shape
684   if (!theObject->IsMainShape()) {
685     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
686     return aGEOMObject._retn();
687   }
688
689   //Get the object itself
690   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
691   if (anObject.IsNull()) return aGEOMObject._retn();
692
693   //Get the point
694   Handle(GEOM_Object) aPoint;
695   if (!thePoint->_is_nil()) {
696     aPoint = GetObjectImpl(thePoint);
697     if (aPoint.IsNull()) return aGEOMObject._retn();
698   }
699
700   //Perform the scale
701   GetOperations()->ScaleShape(anObject, aPoint, theFactor);
702
703   return  aGEOMObject._retn();
704 }
705
706 //=============================================================================
707 /*!
708  *  ScaleShapeCopy
709  */
710 //=============================================================================
711 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy
712                                              (GEOM::GEOM_Object_ptr theObject,
713                                               GEOM::GEOM_Object_ptr thePoint,
714                                               CORBA::Double         theFactor)
715 {
716   GEOM::GEOM_Object_var aGEOMObject;
717
718   //Set a not done flag
719   GetOperations()->SetNotDone();
720
721   //Get the basic object
722   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
723   if (aBasicObject.IsNull()) return aGEOMObject._retn();
724
725   //Get the point
726   Handle(GEOM_Object) aPoint;
727   if (!thePoint->_is_nil()) {
728     aPoint = GetObjectImpl(thePoint);
729     if (aPoint.IsNull()) return aGEOMObject._retn();
730   }
731
732   //Perform the scale
733   Handle(GEOM_Object) anObject =
734     GetOperations()->ScaleShapeCopy(aBasicObject, aPoint, theFactor);
735   if (!GetOperations()->IsDone() || anObject.IsNull())
736     return aGEOMObject._retn();
737
738   return GetObject(anObject);
739 }
740
741 //=============================================================================
742 /*!
743  *  ScaleShapeAlongAxes
744  */
745 //=============================================================================
746 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
747                                              (GEOM::GEOM_Object_ptr theObject,
748                                               GEOM::GEOM_Object_ptr thePoint,
749                                               CORBA::Double         theFactorX,
750                                               CORBA::Double         theFactorY,
751                                               CORBA::Double         theFactorZ)
752 {
753   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
754
755   //Set a not done flag
756   GetOperations()->SetNotDone();
757
758   if (theObject->_is_nil()) return aGEOMObject._retn();
759
760   //check if the object is a sub-shape
761   if (!theObject->IsMainShape()) {
762     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
763     return aGEOMObject._retn();
764   }
765
766   //Get the object itself
767   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
768   if (anObject.IsNull()) return aGEOMObject._retn();
769
770   //Get the point
771   Handle(GEOM_Object) aPoint;
772   if (!thePoint->_is_nil()) {
773     aPoint = GetObjectImpl(thePoint);
774     if (aPoint.IsNull()) return aGEOMObject._retn();
775   }
776
777   //Perform the scale
778   GetOperations()->ScaleShapeAlongAxes
779     (anObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/false);
780
781   return  aGEOMObject._retn();
782 }
783
784 //=============================================================================
785 /*!
786  *  ScaleShapeAlongAxesCopy
787  */
788 //=============================================================================
789 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy
790                                              (GEOM::GEOM_Object_ptr theObject,
791                                               GEOM::GEOM_Object_ptr thePoint,
792                                               CORBA::Double         theFactorX,
793                                               CORBA::Double         theFactorY,
794                                               CORBA::Double         theFactorZ)
795 {
796   GEOM::GEOM_Object_var aGEOMObject;
797
798   //Set a not done flag
799   GetOperations()->SetNotDone();
800
801   //Get the basic object
802   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
803   if (aBasicObject.IsNull()) return aGEOMObject._retn();
804
805   //Get the point
806   Handle(GEOM_Object) aPoint;
807   if (!thePoint->_is_nil()) {
808     aPoint = GetObjectImpl(thePoint);
809     if (aPoint.IsNull()) return aGEOMObject._retn();
810   }
811
812   //Perform the scale
813   Handle(GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes
814     (aBasicObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/true);
815   if (!GetOperations()->IsDone() || anObject.IsNull())
816     return aGEOMObject._retn();
817
818   return GetObject(anObject);
819 }
820
821 //=============================================================================
822 /*!
823  *  PositionShape
824  */
825 //=============================================================================
826 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
827                                              (GEOM::GEOM_Object_ptr theObject,
828                                               GEOM::GEOM_Object_ptr theStartLCS,
829                                               GEOM::GEOM_Object_ptr theEndLCS)
830 {
831   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
832
833   //Set a not done flag
834   GetOperations()->SetNotDone();
835
836   if (CORBA::is_nil(theObject) || CORBA::is_nil(theEndLCS))
837     return aGEOMObject._retn();
838
839   //check if the object is a sub-shape
840   if (!theObject->IsMainShape()) {
841     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
842     return aGEOMObject._retn();
843   }
844
845   //Get the basic object
846   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
847   if (anObject.IsNull()) return aGEOMObject._retn();
848
849   //Get the Start LCS (may be NULL for positioning from global LCS)
850   Handle(GEOM_Object) aStartLCS;
851   if (!CORBA::is_nil(theStartLCS)) {
852     aStartLCS = GetObjectImpl(theStartLCS);
853     if (aStartLCS.IsNull()) return aGEOMObject._retn();
854   }
855
856   //Get the End LCS
857   Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
858   if (aEndLCS.IsNull()) return aGEOMObject._retn();
859
860   //Perform the Position
861   GetOperations()->PositionShape(anObject, aStartLCS, aEndLCS);
862
863   return  aGEOMObject._retn();
864 }
865
866 //=============================================================================
867 /*!
868  *  PositionShapeCopy
869  */
870 //=============================================================================
871 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
872                                              (GEOM::GEOM_Object_ptr theObject,
873                                               GEOM::GEOM_Object_ptr theStartLCS,
874                                               GEOM::GEOM_Object_ptr theEndLCS)
875 {
876   GEOM::GEOM_Object_var aGEOMObject;
877
878   //Set a not done flag
879   GetOperations()->SetNotDone();
880
881   //Get the basic object
882   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
883   if (aBasicObject.IsNull()) return aGEOMObject._retn();
884
885   //Get the Start LCS (may be NULL for positioning from global LCS)
886   Handle(GEOM_Object) aStartLCS;
887   if (!CORBA::is_nil(theStartLCS)) {
888     aStartLCS = GetObjectImpl(theStartLCS);
889     if (aStartLCS.IsNull()) return aGEOMObject._retn();
890   }
891
892   //Get the End LCS
893   Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
894   if (aEndLCS.IsNull()) return aGEOMObject._retn();
895
896   //Perform the position
897   Handle(GEOM_Object) anObject =
898     GetOperations()->PositionShapeCopy(aBasicObject, aStartLCS, aEndLCS);
899   if (!GetOperations()->IsDone() || anObject.IsNull())
900     return aGEOMObject._retn();
901
902   return GetObject(anObject);
903 }
904
905 //=============================================================================
906 /*!
907  *  PositionAlongPath
908  */
909 //=============================================================================
910 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
911                                              (GEOM::GEOM_Object_ptr theObject,
912                                               GEOM::GEOM_Object_ptr thePath,
913                                               CORBA::Double         theDistance,
914                                               CORBA::Boolean        theCopy,
915                                               CORBA::Boolean        theReverse)
916 {
917   GEOM::GEOM_Object_var aGEOMObject;
918
919   //Set a not done flag
920   GetOperations()->SetNotDone();
921
922   //Get the basic object
923   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
924   if (aBasicObject.IsNull()) return aGEOMObject._retn();
925
926   //Get the path object
927   Handle(GEOM_Object) aPathObject = GetObjectImpl(thePath);
928   if (aPathObject.IsNull()) return aGEOMObject._retn();
929
930   //Perform the position
931   Handle(GEOM_Object) anObject =
932     GetOperations()->PositionAlongPath(aBasicObject, aPathObject, theDistance, theCopy, theReverse);
933   if (!GetOperations()->IsDone() || anObject.IsNull())
934     return aGEOMObject._retn();
935
936   return GetObject(anObject);
937 }
938
939 //=============================================================================
940 /*!
941  *  MultiTranslate1D
942  */
943 //=============================================================================
944 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
945                            (GEOM::GEOM_Object_ptr theObject,
946                             GEOM::GEOM_Object_ptr theVector,
947                             CORBA::Double theStep, CORBA::Long theNbTimes)
948 {
949   //Set a not done flag
950   GetOperations()->SetNotDone();
951
952   GEOM::GEOM_Object_var aGEOMObject;
953
954   //Get the object itself
955   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
956   if (aBasicObject.IsNull()) return aGEOMObject._retn();
957
958   //Get the vector of translation
959   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
960   //if (aVector.IsNull()) return aGEOMObject._retn(); // DX by default
961
962   //Perform the translation
963   Handle(GEOM_Object) anObject =
964     GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes);
965   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
966
967   return GetObject(anObject);
968 }
969
970 //=============================================================================
971 /*!
972  *  MultiTranslate2D
973  */
974 //=============================================================================
975 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
976                                                                      GEOM::GEOM_Object_ptr theVector1,
977                                                                      CORBA::Double theStep1,
978                                                                      CORBA::Long theNbTimes1,
979                                                                      GEOM::GEOM_Object_ptr theVector2,
980                                                                      CORBA::Double theStep2,
981                                                                      CORBA::Long theNbTimes2)
982 {
983   //Set a not done flag
984   GetOperations()->SetNotDone();
985
986   GEOM::GEOM_Object_var aGEOMObject;
987
988   //Get the object itself
989   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
990   if (aBasicObject.IsNull()) return aGEOMObject._retn();
991
992   //Get the vector1 of translation
993   Handle(GEOM_Object) aVector1 = GetObjectImpl(theVector1);
994   //if (aVector1.IsNull()) return aGEOMObject._retn(); // DX by default
995
996   //Get the vector2 of translation
997   Handle(GEOM_Object) aVector2 = GetObjectImpl(theVector2);
998   //if (aVector2.IsNull()) return aGEOMObject._retn(); // DY by default
999
1000   //Perform the translation
1001   Handle(GEOM_Object) anObject = GetOperations()->Translate2D
1002     (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2);
1003   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1004
1005   return GetObject(anObject);
1006 }
1007
1008 //=============================================================================
1009 /*!
1010  *  MultiRotate1D
1011  */
1012 //=============================================================================
1013 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObject,
1014                                                                   GEOM::GEOM_Object_ptr theVector,
1015                                                                   CORBA::Long theNbTimes)
1016 {
1017   //Set a not done flag
1018   GetOperations()->SetNotDone();
1019
1020   GEOM::GEOM_Object_var aGEOMObject;
1021
1022   //Get the object itself
1023   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1024   if (aBasicObject.IsNull()) return aGEOMObject._retn();
1025
1026   //Get the a directon of rotation
1027   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
1028   //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1029
1030   //Perform the rotation
1031   Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
1032   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1033
1034   return GetObject(anObject);
1035 }
1036
1037 //=============================================================================
1038 /*!
1039  *  MultiRotate1DByStep
1040  */
1041 //=============================================================================
1042 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1DByStep (GEOM::GEOM_Object_ptr theObject,
1043                                                                         GEOM::GEOM_Object_ptr theVector,
1044                                                                         CORBA::Double theAngleStep,
1045                                                                         CORBA::Long theNbSteps)
1046 {
1047   //Set a not done flag
1048   GetOperations()->SetNotDone();
1049
1050   GEOM::GEOM_Object_var aGEOMObject;
1051
1052   //Get the object itself
1053   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1054   if (aBasicObject.IsNull()) return aGEOMObject._retn();
1055
1056   //Get the a directon of rotation
1057   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
1058   //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1059
1060   //Perform the rotation
1061   Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theAngleStep, theNbSteps);
1062   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1063
1064   return GetObject(anObject);
1065 }
1066
1067 //=============================================================================
1068 /*!
1069  *  MultiRotate2DNbTimes
1070  */
1071 //=============================================================================
1072 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DNbTimes (GEOM::GEOM_Object_ptr theObject,
1073                                                                          GEOM::GEOM_Object_ptr theVector,
1074                                                                          CORBA::Long theNbObjects,
1075                                                                          CORBA::Double theRadialStep,
1076                                                                          CORBA::Long theNbSteps)
1077 {
1078   //Set a not done flag
1079   GetOperations()->SetNotDone();
1080
1081   GEOM::GEOM_Object_var aGEOMObject;
1082
1083   //Get the object itself
1084   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1085   if (aBasicObject.IsNull()) return aGEOMObject._retn();
1086
1087   //Get the a directon of rotation
1088   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
1089   //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1090
1091   //Perform the rotation
1092   Handle(GEOM_Object) anObject = GetOperations()->Rotate2D
1093     (aBasicObject, aVector, theNbObjects, theRadialStep, theNbSteps);
1094   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1095
1096   return GetObject(anObject);
1097 }
1098
1099 //=============================================================================
1100 /*!
1101  *  MultiRotate2DByStep
1102  */
1103 //=============================================================================
1104 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DByStep (GEOM::GEOM_Object_ptr theObject,
1105                                                                         GEOM::GEOM_Object_ptr theVector,
1106                                                                         CORBA::Double theAngle,
1107                                                                         CORBA::Long theNbTimes1,
1108                                                                         CORBA::Double theStep,
1109                                                                         CORBA::Long theNbTimes2)
1110 {
1111   //Set a not done flag
1112   GetOperations()->SetNotDone();
1113
1114   GEOM::GEOM_Object_var aGEOMObject;
1115
1116   //Get the object itself
1117   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1118   if (aBasicObject.IsNull()) return aGEOMObject._retn();
1119
1120   //Get the a directon of rotation
1121   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
1122   //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1123
1124   //Perform the rotation
1125   Handle(GEOM_Object) anObject = GetOperations()->Rotate2D
1126     (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
1127   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1128
1129   return GetObject(anObject);
1130 }
1131
1132 //=============================================================================
1133 /*!
1134  *  MultiRotate2D
1135  */
1136 //=============================================================================
1137 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObject,
1138                                                                   GEOM::GEOM_Object_ptr theVector,
1139                                                                   CORBA::Double theAngle,
1140                                                                   CORBA::Long theNbTimes1,
1141                                                                   CORBA::Double theStep,
1142                                                                   CORBA::Long theNbTimes2)
1143 {
1144   //Set a not done flag
1145   GetOperations()->SetNotDone();
1146
1147   GEOM::GEOM_Object_var aGEOMObject;
1148
1149   //Get the object itself
1150   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1151   if (aBasicObject.IsNull()) return aGEOMObject._retn();
1152
1153   //Get the a directon of rotation
1154   Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
1155   //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1156
1157   double anAngle = M_PI * theAngle / 180.;
1158
1159   //Perform the rotation
1160   Handle(GEOM_Object) anObject = GetOperations()->Rotate2D
1161     (aBasicObject, aVector, anAngle, theNbTimes1, theStep, theNbTimes2);
1162   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1163
1164   return GetObject(anObject);
1165 }
1166
1167 //=============================================================================
1168 /*!
1169  *  RotateThreePoints
1170  */
1171 //=============================================================================
1172 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
1173                                              (GEOM::GEOM_Object_ptr theObject,
1174                                               GEOM::GEOM_Object_ptr theCentPoint,
1175                                               GEOM::GEOM_Object_ptr thePoint1,
1176                                               GEOM::GEOM_Object_ptr thePoint2)
1177 {
1178   //Set a not done flag
1179   GetOperations()->SetNotDone();
1180   GEOM::GEOM_Object_var aGEOMObject;
1181
1182   if (CORBA::is_nil(theObject))
1183     return aGEOMObject._retn();
1184
1185   //check if the object is a sub-shape
1186   if (!theObject->IsMainShape()) {
1187     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
1188     return aGEOMObject._retn();
1189   }
1190
1191   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1192
1193   //Get the object itself
1194   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
1195   if (anObject.IsNull()) return aGEOMObject._retn();
1196
1197   //Get the central point of rotation
1198   Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
1199   if (aCentPoint.IsNull()) return aGEOMObject._retn();
1200
1201   //Get the first point
1202   Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
1203   if (aPoint1.IsNull()) return aGEOMObject._retn();
1204
1205   //Get the second point
1206   Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
1207   if (aPoint2.IsNull()) return aGEOMObject._retn();
1208
1209   //Perform the translation
1210   GetOperations()->RotateThreePoints(anObject, aCentPoint, aPoint1, aPoint2);
1211
1212   return aGEOMObject._retn();
1213 }
1214
1215 //=============================================================================
1216 /*!
1217  *  RotateThreePointsCopy
1218  */
1219 //=============================================================================
1220 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
1221                                              (GEOM::GEOM_Object_ptr theObject,
1222                                               GEOM::GEOM_Object_ptr theCentPoint,
1223                                               GEOM::GEOM_Object_ptr thePoint1,
1224                                               GEOM::GEOM_Object_ptr thePoint2)
1225 {
1226   GEOM::GEOM_Object_var aGEOMObject;
1227
1228   //Set a not done flag
1229   GetOperations()->SetNotDone();
1230
1231   //Get the object itself
1232   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1233   if (aBasicObject.IsNull()) return aGEOMObject._retn();
1234
1235   //Get the central point of rotation
1236   Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
1237   if (aCentPoint.IsNull()) return aGEOMObject._retn();
1238
1239   //Get the first point
1240   Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
1241   if (aPoint1.IsNull()) return aGEOMObject._retn();
1242
1243   //Get the second point
1244   Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
1245   if (aPoint2.IsNull()) return aGEOMObject._retn();
1246
1247   //Perform the rotation
1248   Handle(GEOM_Object) anObject =
1249     GetOperations()->RotateThreePointsCopy(aBasicObject, aCentPoint, aPoint1, aPoint2);
1250   if (!GetOperations()->IsDone() || anObject.IsNull())
1251     return aGEOMObject._retn();
1252
1253   return GetObject(anObject);
1254 }
1255
1256 //=============================================================================
1257 /*!
1258  *  TransformLikeOtherCopy
1259  */
1260 //=============================================================================
1261 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TransformLikeOtherCopy
1262                                              (GEOM::GEOM_Object_ptr theObject,
1263                                               GEOM::GEOM_Object_ptr theSample)
1264 {
1265   GEOM::GEOM_Object_var aGEOMObject;
1266
1267   //Set a not done flag
1268   GetOperations()->SetNotDone();
1269
1270   //Get the object itself
1271   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
1272   if (anObject.IsNull()) return aGEOMObject._retn();
1273
1274   //Get the sample object
1275   Handle(GEOM_Object) aSample = GetObjectImpl(theSample);
1276   if (aSample.IsNull()) return aGEOMObject._retn();
1277
1278   //Perform the transformation
1279   Handle(GEOM_Object) aResObject =
1280     GetOperations()->TransformLikeOtherCopy(anObject, aSample);
1281   if (!GetOperations()->IsDone() || aResObject.IsNull())
1282     return aGEOMObject._retn();
1283
1284   return GetObject(aResObject);
1285 }
1286
1287 //=============================================================================
1288 /*!
1289  *  RecomputeObject
1290  */
1291 //=============================================================================
1292 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject
1293                                              (GEOM::GEOM_Object_ptr theObject)
1294 {
1295   //Set a not done flag
1296   GetOperations()->SetNotDone();
1297   GEOM::GEOM_Object_var aGEOMObject;
1298
1299   if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
1300
1301   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1302
1303   //Get the object itself
1304   Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
1305   if (anObject.IsNull()) return aGEOMObject._retn();
1306
1307   //Perform the recomputation
1308   Handle(GEOM_Function) aLastFunction = anObject->GetLastFunction();
1309   if (aLastFunction.IsNull()) return aGEOMObject._retn();
1310   GetOperations()->GetSolver()->ComputeFunction(aLastFunction);
1311
1312   return aGEOMObject._retn();
1313 }