1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #include <Standard_Stream.hxx>
23 #include "GEOM_ITransformOperations_i.hh"
25 #include "utilities.h"
27 #include "Utils_ExceptHandlers.hxx"
29 #include <TDF_Label.hxx>
30 #include <TDF_Tool.hxx>
31 #include <TCollection_AsciiString.hxx>
32 #include "GEOM_Engine.hxx"
33 #include "GEOM_Object.hxx"
35 #define SUBSHAPE_ERROR "Sub shape cannot be transformed"
37 //=============================================================================
41 //=============================================================================
43 GEOM_ITransformOperations_i::GEOM_ITransformOperations_i (PortableServer::POA_ptr thePOA,
44 GEOM::GEOM_Gen_ptr theEngine,
45 ::GEOMImpl_ITransformOperations* theImpl)
46 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
48 MESSAGE("GEOM_ITransformOperations_i::GEOM_ITransformOperations_i");
51 //=============================================================================
55 //=============================================================================
57 GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i()
59 MESSAGE("GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i");
63 //=============================================================================
67 //=============================================================================
68 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
69 (GEOM::GEOM_Object_ptr theObject,
70 GEOM::GEOM_Object_ptr thePoint1,
71 GEOM::GEOM_Object_ptr thePoint2)
74 GetOperations()->SetNotDone();
75 GEOM::GEOM_Object_var aGEOMObject;
77 if (thePoint1 == NULL || thePoint2 == NULL || theObject == NULL) return aGEOMObject._retn();
79 //check if the object is a subshape
80 if(!theObject->IsMainShape()) {
81 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
82 return aGEOMObject._retn();
85 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
87 //Get the object itself
88 CORBA::String_var anEntry = theObject->GetEntry();
89 Handle(GEOM_Object) anObject =
90 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
91 if (anObject.IsNull()) return aGEOMObject._retn();
93 //Get the first point of translation
94 CORBA::String_var aP1Entry = thePoint1->GetEntry();
95 Handle(GEOM_Object) aPoint1 =
96 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
97 if (aPoint1.IsNull()) return aGEOMObject._retn();
99 //Get the second point of translation
100 CORBA::String_var aP2Entry = thePoint2->GetEntry();
101 Handle(GEOM_Object) aPoint2 =
102 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
103 if (aPoint2.IsNull()) return aGEOMObject._retn();
105 //Perform the translation
106 GetOperations()->TranslateTwoPoints(anObject, aPoint1, aPoint2);
108 return aGEOMObject._retn();
111 //=============================================================================
113 * TranslateTwoPointsCopy
115 //=============================================================================
116 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy
117 (GEOM::GEOM_Object_ptr theObject,
118 GEOM::GEOM_Object_ptr thePoint1,
119 GEOM::GEOM_Object_ptr thePoint2)
121 GEOM::GEOM_Object_var aGEOMObject;
123 //Set a not done flag
124 GetOperations()->SetNotDone();
126 if (thePoint1 == NULL || thePoint2 == NULL || theObject == NULL) return aGEOMObject._retn();
128 //Get the object itself
129 CORBA::String_var anEntry = theObject->GetEntry();
130 Handle(GEOM_Object) aBasicObject =
131 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
132 if (aBasicObject.IsNull()) return aGEOMObject._retn();
134 //Get the first point of translation
135 CORBA::String_var aP1Entry = thePoint1->GetEntry();
136 Handle(GEOM_Object) aPoint1 =
137 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
138 if (aPoint1.IsNull()) return aGEOMObject._retn();
140 //Get the second point of translation
141 CORBA::String_var aP2Entry = thePoint2->GetEntry();
142 Handle(GEOM_Object) aPoint2 =
143 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
144 if (aPoint2.IsNull()) return aGEOMObject._retn();
146 //Create the translated shape
147 Handle(GEOM_Object) anObject =
148 GetOperations()->TranslateTwoPointsCopy(aBasicObject, aPoint1, aPoint2);
149 if (!GetOperations()->IsDone() || anObject.IsNull())
150 return aGEOMObject._retn();
152 return GetObject(anObject);
155 //=============================================================================
159 //=============================================================================
160 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
161 (GEOM::GEOM_Object_ptr theObject,
162 CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
164 //Set a not done flag
165 GetOperations()->SetNotDone();
166 GEOM::GEOM_Object_var aGEOMObject ;
168 if (theObject == NULL) return aGEOMObject._retn();
170 //check if the object is a subshape
171 if(!theObject->IsMainShape()) {
172 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
173 return aGEOMObject._retn();
176 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
178 //Get the object itself
179 CORBA::String_var anEntry = theObject->GetEntry();
180 Handle(GEOM_Object) anObject =
181 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
182 if (anObject.IsNull()) return aGEOMObject._retn();
184 //Perform the translation
185 GetOperations()->TranslateDXDYDZ(anObject, theDX, theDY, theDZ);
187 return aGEOMObject._retn();
191 //=============================================================================
193 * TranslateDXDYDZCopy
195 //=============================================================================
196 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
197 (GEOM::GEOM_Object_ptr theObject,
198 CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
200 GEOM::GEOM_Object_var aGEOMObject;
202 //Set a not done flag
203 GetOperations()->SetNotDone();
205 if (theObject == NULL) return aGEOMObject._retn();
207 //Get the object itself
208 CORBA::String_var anEntry = theObject->GetEntry();
209 Handle(GEOM_Object) aBasicObject =
210 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
211 if (aBasicObject.IsNull()) return aGEOMObject._retn();
213 //Create the translated shape
214 Handle(GEOM_Object) anObject =
215 GetOperations()->TranslateDXDYDZCopy(aBasicObject, theDX, theDY, theDZ);
216 if (!GetOperations()->IsDone() || anObject.IsNull())
217 return aGEOMObject._retn();
219 return GetObject(anObject);
223 //=============================================================================
227 //=============================================================================
228 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
229 (GEOM::GEOM_Object_ptr theObject,
230 GEOM::GEOM_Object_ptr theVector)
232 //Set a not done flag
233 GetOperations()->SetNotDone();
234 GEOM::GEOM_Object_var aGEOMObject;
236 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
238 //check if the object is a subshape
239 if(!theObject->IsMainShape()) {
240 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
241 return aGEOMObject._retn();
244 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
246 //Get the object itself
247 CORBA::String_var anEntry = theObject->GetEntry();
248 Handle(GEOM_Object) anObject =
249 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
250 if (anObject.IsNull()) return aGEOMObject._retn();
252 //Get the vector of translation
253 CORBA::String_var aVEntry = theVector->GetEntry();
254 Handle(GEOM_Object) aVector =
255 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVEntry);
256 if (aVector.IsNull()) return aGEOMObject._retn();
258 //Perform the translation
259 GetOperations()->TranslateVector(anObject, aVector);
261 return aGEOMObject._retn();
264 //=============================================================================
266 * TranslateVectorCopy
268 //=============================================================================
269 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy
270 (GEOM::GEOM_Object_ptr theObject,
271 GEOM::GEOM_Object_ptr theVector)
273 GEOM::GEOM_Object_var aGEOMObject;
275 //Set a not done flag
276 GetOperations()->SetNotDone();
278 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
280 //Get the object itself
281 CORBA::String_var anEntry = theObject->GetEntry();
282 Handle(GEOM_Object) aBasicObject =
283 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
284 if (aBasicObject.IsNull()) return aGEOMObject._retn();
286 //Get the vector of translation
287 CORBA::String_var aVEntry = theVector->GetEntry();
288 Handle(GEOM_Object) aVector =
289 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVEntry);
290 if (aVector.IsNull()) return aGEOMObject._retn();
292 //Perform the translation
293 Handle(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector);
294 if (!GetOperations()->IsDone() || anObject.IsNull())
295 return aGEOMObject._retn();
297 return GetObject(anObject);
300 //=============================================================================
302 * TranslateVectorDistance
304 //=============================================================================
305 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
306 (GEOM::GEOM_Object_ptr theObject,
307 GEOM::GEOM_Object_ptr theVector,
308 CORBA::Double theDistance,
309 CORBA::Boolean theCopy)
311 GEOM::GEOM_Object_var aGEOMObject;
312 GetOperations()->SetNotDone(); //Set a not done flag
314 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
316 //check if the object is a subshape
317 if (!theCopy && !theObject->IsMainShape()) {
318 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
319 return aGEOMObject._retn();
323 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
325 //Get the object itself
326 CORBA::String_var anEntry = theObject->GetEntry();
327 Handle(GEOM_Object) aBasicObject =
328 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
329 if (aBasicObject.IsNull()) return aGEOMObject._retn();
331 //Get the vector of translation
332 CORBA::String_var aVecEntry = theVector->GetEntry();
333 Handle(GEOM_Object) aVector =
334 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
335 if (aVector.IsNull()) return aGEOMObject._retn();
337 //Perform the translation
339 Handle(GEOM_Object) anObject = GetOperations()->
340 TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
341 if (!GetOperations()->IsDone() || anObject.IsNull())
342 return aGEOMObject._retn();
344 return GetObject(anObject);
347 GetOperations()->TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
348 return aGEOMObject._retn();
351 //=============================================================================
355 //=============================================================================
356 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr theObject,
357 GEOM::GEOM_Object_ptr theAxis,
358 CORBA::Double theAngle)
360 //Set a not done flag
361 GetOperations()->SetNotDone();
362 GEOM::GEOM_Object_var aGEOMObject;
364 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
366 //check if the object is a subshape
367 if(!theObject->IsMainShape()) {
368 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
369 return aGEOMObject._retn();
372 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
374 //Get the object itself
375 CORBA::String_var anEntry = theObject->GetEntry();
376 Handle(GEOM_Object) anObject =
377 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
378 if (anObject.IsNull()) return aGEOMObject._retn();
380 //Get the axis of revolution
381 CORBA::String_var anAEntry = theAxis->GetEntry();
382 Handle(GEOM_Object) anAxis =
383 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
384 if (anAxis.IsNull()) return aGEOMObject._retn();
386 //Perform the rotation
387 GetOperations()->Rotate(anObject, anAxis, theAngle);
389 return aGEOMObject._retn();
392 //=============================================================================
396 //=============================================================================
397 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object_ptr theObject,
398 GEOM::GEOM_Object_ptr theAxis,
399 CORBA::Double theAngle)
401 GEOM::GEOM_Object_var aGEOMObject;
403 //Set a not done flag
404 GetOperations()->SetNotDone();
406 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
408 //Get the object itself
409 CORBA::String_var anEntry = theObject->GetEntry();
410 Handle(GEOM_Object) aBasicObject =
411 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
412 if (aBasicObject.IsNull()) return aGEOMObject._retn();
414 //Get the axis of rotation
415 CORBA::String_var anAEntry = theAxis->GetEntry();
416 Handle(GEOM_Object) anAxis =
417 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
418 if (anAxis.IsNull()) return aGEOMObject._retn();
420 //Perform the rotation
421 Handle(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle);
422 if (!GetOperations()->IsDone() || anObject.IsNull())
423 return aGEOMObject._retn();
425 return GetObject(anObject);
429 //=============================================================================
433 //=============================================================================
434 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
435 (GEOM::GEOM_Object_ptr theObject,
436 GEOM::GEOM_Object_ptr thePlane)
438 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
440 //Set a not done flag
441 GetOperations()->SetNotDone();
443 if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn();
445 //check if the object is a subshape
446 if (!theObject->IsMainShape()) {
447 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
448 return aGEOMObject._retn();
451 //Get the object itself
452 CORBA::String_var anEntry = theObject->GetEntry();
453 Handle(GEOM_Object) anObject =
454 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
455 if (anObject.IsNull()) return aGEOMObject._retn();
458 CORBA::String_var aPlnEntry = thePlane->GetEntry();
459 Handle(GEOM_Object) aPlane =
460 GetOperations()->GetEngine()->GetObject(thePlane->GetStudyID(), aPlnEntry);
461 if (aPlane.IsNull()) return aGEOMObject._retn();
464 GetOperations()->MirrorPlane(anObject, aPlane);
466 return aGEOMObject._retn();
469 //=============================================================================
473 //=============================================================================
474 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy
475 (GEOM::GEOM_Object_ptr theObject,
476 GEOM::GEOM_Object_ptr thePlane)
478 GEOM::GEOM_Object_var aGEOMObject;
480 //Set a not done flag
481 GetOperations()->SetNotDone();
483 if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn();
485 //Get the object itself
486 CORBA::String_var anEntry = theObject->GetEntry();
487 Handle(GEOM_Object) aBasicObject =
488 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
489 if (aBasicObject.IsNull()) return aGEOMObject._retn();
491 //Get the vector of translation
492 CORBA::String_var aPlnEntry = thePlane->GetEntry();
493 Handle(GEOM_Object) aPlane =
494 GetOperations()->GetEngine()->GetObject(thePlane->GetStudyID(), aPlnEntry);
495 if (aPlane.IsNull()) return aGEOMObject._retn();
498 Handle(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane);
499 if (!GetOperations()->IsDone() || anObject.IsNull())
500 return aGEOMObject._retn();
502 return GetObject(anObject);
505 //=============================================================================
509 //=============================================================================
510 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
511 (GEOM::GEOM_Object_ptr theObject,
512 GEOM::GEOM_Object_ptr theAxis)
514 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
516 //Set a not done flag
517 GetOperations()->SetNotDone();
519 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
521 //check if the object is a subshape
522 if(!theObject->IsMainShape()) {
523 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
524 return aGEOMObject._retn();
527 //Get the object itself
528 CORBA::String_var anEntry = theObject->GetEntry();
529 Handle(GEOM_Object) anObject =
530 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
531 if (anObject.IsNull()) return aGEOMObject._retn();
534 CORBA::String_var anAEntry = theAxis->GetEntry();
535 Handle(GEOM_Object) aAxis =
536 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
537 if (aAxis.IsNull()) return aGEOMObject._retn();
540 GetOperations()->MirrorAxis(anObject, aAxis);
542 return aGEOMObject._retn();
545 //=============================================================================
549 //=============================================================================
550 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy
551 (GEOM::GEOM_Object_ptr theObject,
552 GEOM::GEOM_Object_ptr theAxis)
554 GEOM::GEOM_Object_var aGEOMObject;
556 //Set a not done flag
557 GetOperations()->SetNotDone();
559 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
561 //Get the object itself
562 CORBA::String_var anEntry = theObject->GetEntry();
563 Handle(GEOM_Object) aBasicObject =
564 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
565 if (aBasicObject.IsNull()) return aGEOMObject._retn();
567 //Get the vector of translation
568 CORBA::String_var anAEntry = theAxis->GetEntry();
569 Handle(GEOM_Object) aAxis =
570 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
571 if (aAxis.IsNull()) return aGEOMObject._retn();
574 Handle(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis);
575 if (!GetOperations()->IsDone() || anObject.IsNull())
576 return aGEOMObject._retn();
578 return GetObject(anObject);
581 //=============================================================================
585 //=============================================================================
586 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
587 (GEOM::GEOM_Object_ptr theObject,
588 GEOM::GEOM_Object_ptr thePoint)
590 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
592 //Set a not done flag
593 GetOperations()->SetNotDone();
595 if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn();
597 //check if the object is a subshape
598 if (!theObject->IsMainShape()) {
599 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
600 return aGEOMObject._retn();
603 //Get the object itself
604 CORBA::String_var anEntry = theObject->GetEntry();
605 Handle(GEOM_Object) anObject =
606 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
607 if (anObject.IsNull()) return aGEOMObject._retn();
610 CORBA::String_var aPntEntry = thePoint->GetEntry();
611 Handle(GEOM_Object) aPoint =
612 GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
613 if (aPoint.IsNull()) return aGEOMObject._retn();
616 GetOperations()->MirrorPoint(anObject, aPoint);
618 return aGEOMObject._retn();
621 //=============================================================================
625 //=============================================================================
626 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
627 (GEOM::GEOM_Object_ptr theObject,
628 GEOM::GEOM_Object_ptr thePoint)
630 GEOM::GEOM_Object_var aGEOMObject;
632 //Set a not done flag
633 GetOperations()->SetNotDone();
635 if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn();
637 //Get the object itself
638 CORBA::String_var anEntry = theObject->GetEntry();
639 Handle(GEOM_Object) aBasicObject =
640 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
641 if (aBasicObject.IsNull()) return aGEOMObject._retn();
643 //Get the vector of translation
644 CORBA::String_var aPntEntry = thePoint->GetEntry();
645 Handle(GEOM_Object) aPoint =
646 GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
647 if (aPoint.IsNull()) return aGEOMObject._retn();
650 Handle(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint);
651 if (!GetOperations()->IsDone() || anObject.IsNull())
652 return aGEOMObject._retn();
654 return GetObject(anObject);
658 //=============================================================================
662 //=============================================================================
663 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
664 (GEOM::GEOM_Object_ptr theObject,
665 CORBA::Double theOffset)
667 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
669 //Set a not done flag
670 GetOperations()->SetNotDone();
672 if (theObject == NULL) return aGEOMObject._retn();
674 //check if the object is a subshape
675 if (!theObject->IsMainShape()) {
676 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
677 return aGEOMObject._retn();
680 //Get the basic object
681 CORBA::String_var anEntry = theObject->GetEntry();
682 Handle(GEOM_Object) aBasicObject =
683 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
684 if (aBasicObject.IsNull()) return aGEOMObject._retn();
686 //Create the offset shape
687 GetOperations()->OffsetShape(aBasicObject, theOffset);
689 return aGEOMObject._retn();
692 //=============================================================================
696 //=============================================================================
697 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
698 (GEOM::GEOM_Object_ptr theObject,
699 CORBA::Double theOffset)
701 GEOM::GEOM_Object_var aGEOMObject;
703 //Set a not done flag
704 GetOperations()->SetNotDone();
706 if (theObject == NULL) return aGEOMObject._retn();
708 //Get the basic object
709 CORBA::String_var anEntry = theObject->GetEntry();
710 Handle(GEOM_Object) aBasicObject =
711 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
712 if (aBasicObject.IsNull()) return aGEOMObject._retn();
714 //Create the offset shape
715 Handle(GEOM_Object) anObject = GetOperations()->OffsetShapeCopy(aBasicObject, theOffset);
716 if (!GetOperations()->IsDone() || anObject.IsNull())
717 return aGEOMObject._retn();
719 return GetObject(anObject);
723 //=============================================================================
727 //=============================================================================
728 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
729 (GEOM::GEOM_Object_ptr theObject,
730 GEOM::GEOM_Object_ptr thePoint,
731 CORBA::Double theFactor)
733 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
735 //Set a not done flag
736 GetOperations()->SetNotDone();
738 if (theObject->_is_nil()) return aGEOMObject._retn();
740 //check if the object is a subshape
741 if (!theObject->IsMainShape()) {
742 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
743 return aGEOMObject._retn();
746 //Get the object itself
747 CORBA::String_var anEntry = theObject->GetEntry();
748 Handle(GEOM_Object) anObject =
749 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
750 if (anObject.IsNull()) return aGEOMObject._retn();
753 Handle(GEOM_Object) aPoint;
754 if (!thePoint->_is_nil()) {
755 CORBA::String_var aPntEntry = thePoint->GetEntry();
756 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
757 if (aPoint.IsNull()) return aGEOMObject._retn();
761 GetOperations()->ScaleShape(anObject, aPoint, theFactor);
763 return aGEOMObject._retn();
766 //=============================================================================
770 //=============================================================================
771 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy
772 (GEOM::GEOM_Object_ptr theObject,
773 GEOM::GEOM_Object_ptr thePoint,
774 CORBA::Double theFactor)
776 GEOM::GEOM_Object_var aGEOMObject;
778 //Set a not done flag
779 GetOperations()->SetNotDone();
781 if (theObject->_is_nil()) return aGEOMObject._retn();
783 //Get the basic object
784 CORBA::String_var anEntry = theObject->GetEntry();
785 Handle(GEOM_Object) aBasicObject =
786 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
787 if (aBasicObject.IsNull()) return aGEOMObject._retn();
790 Handle(GEOM_Object) aPoint;
791 if (!thePoint->_is_nil()) {
792 CORBA::String_var aPntEntry = thePoint->GetEntry();
793 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
794 if (aPoint.IsNull()) return aGEOMObject._retn();
798 Handle(GEOM_Object) anObject =
799 GetOperations()->ScaleShapeCopy(aBasicObject, aPoint, theFactor);
800 if (!GetOperations()->IsDone() || anObject.IsNull())
801 return aGEOMObject._retn();
803 return GetObject(anObject);
806 //=============================================================================
808 * ScaleShapeAlongAxes
810 //=============================================================================
811 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
812 (GEOM::GEOM_Object_ptr theObject,
813 GEOM::GEOM_Object_ptr thePoint,
814 CORBA::Double theFactorX,
815 CORBA::Double theFactorY,
816 CORBA::Double theFactorZ)
818 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
820 //Set a not done flag
821 GetOperations()->SetNotDone();
823 if (theObject->_is_nil()) return aGEOMObject._retn();
825 //check if the object is a subshape
826 if (!theObject->IsMainShape()) {
827 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
828 return aGEOMObject._retn();
831 //Get the object itself
832 CORBA::String_var anEntry = theObject->GetEntry();
833 Handle(GEOM_Object) anObject =
834 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
835 if (anObject.IsNull()) return aGEOMObject._retn();
838 Handle(GEOM_Object) aPoint;
839 if (!thePoint->_is_nil()) {
840 CORBA::String_var aPntEntry = thePoint->GetEntry();
841 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
842 if (aPoint.IsNull()) return aGEOMObject._retn();
846 GetOperations()->ScaleShapeAlongAxes
847 (anObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/false);
849 return aGEOMObject._retn();
852 //=============================================================================
854 * ScaleShapeAlongAxesCopy
856 //=============================================================================
857 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy
858 (GEOM::GEOM_Object_ptr theObject,
859 GEOM::GEOM_Object_ptr thePoint,
860 CORBA::Double theFactorX,
861 CORBA::Double theFactorY,
862 CORBA::Double theFactorZ)
864 GEOM::GEOM_Object_var aGEOMObject;
866 //Set a not done flag
867 GetOperations()->SetNotDone();
869 if (theObject->_is_nil()) return aGEOMObject._retn();
871 //Get the basic object
872 CORBA::String_var anEntry = theObject->GetEntry();
873 Handle(GEOM_Object) aBasicObject =
874 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
875 if (aBasicObject.IsNull()) return aGEOMObject._retn();
878 Handle(GEOM_Object) aPoint;
879 if (!thePoint->_is_nil()) {
880 CORBA::String_var aPntEntry = thePoint->GetEntry();
881 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
882 if (aPoint.IsNull()) return aGEOMObject._retn();
886 Handle(GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes
887 (aBasicObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/true);
888 if (!GetOperations()->IsDone() || anObject.IsNull())
889 return aGEOMObject._retn();
891 return GetObject(anObject);
894 //=============================================================================
898 //=============================================================================
899 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
900 (GEOM::GEOM_Object_ptr theObject,
901 GEOM::GEOM_Object_ptr theStartLCS,
902 GEOM::GEOM_Object_ptr theEndLCS)
904 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
906 //Set a not done flag
907 GetOperations()->SetNotDone();
909 if (theObject == NULL || theEndLCS == NULL)
910 return aGEOMObject._retn();
912 //check if the object is a subshape
913 if (!theObject->IsMainShape()) {
914 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
915 return aGEOMObject._retn();
918 //Get the basic object
919 CORBA::String_var anEntry = theObject->GetEntry();
920 Handle(GEOM_Object) anObject =
921 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
922 if (anObject.IsNull()) return aGEOMObject._retn();
924 //Get the Start LCS (may be NULL for positioning from global LCS)
925 Handle(GEOM_Object) aStartLCS = NULL;
926 if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) {
927 CORBA::String_var aStartLCSEntry = theStartLCS->GetEntry();
928 aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), aStartLCSEntry);
929 if (aStartLCS.IsNull()) return aGEOMObject._retn();
933 CORBA::String_var anEndLCSEntry = theEndLCS->GetEntry();
934 Handle(GEOM_Object) aEndLCS =
935 GetOperations()->GetEngine()->GetObject(theEndLCS->GetStudyID(), anEndLCSEntry);
936 if (aEndLCS.IsNull()) return aGEOMObject._retn();
938 //Perform the Position
939 GetOperations()->PositionShape(anObject, aStartLCS, aEndLCS);
941 return aGEOMObject._retn();
944 //=============================================================================
948 //=============================================================================
949 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
950 (GEOM::GEOM_Object_ptr theObject,
951 GEOM::GEOM_Object_ptr theStartLCS,
952 GEOM::GEOM_Object_ptr theEndLCS)
954 GEOM::GEOM_Object_var aGEOMObject;
956 //Set a not done flag
957 GetOperations()->SetNotDone();
959 if (theObject == NULL || theEndLCS == NULL)
960 return aGEOMObject._retn();
962 //Get the basic object
963 CORBA::String_var anEntry = theObject->GetEntry();
964 Handle(GEOM_Object) aBasicObject =
965 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
966 if (aBasicObject.IsNull()) return aGEOMObject._retn();
968 //Get the Start LCS (may be NULL for positioning from global LCS)
969 Handle(GEOM_Object) aStartLCS = NULL;
970 if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) {
971 CORBA::String_var aStartLCSEntry = theStartLCS->GetEntry();
972 aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), aStartLCSEntry);
973 if (aStartLCS.IsNull()) return aGEOMObject._retn();
977 CORBA::String_var anEndLCSEntry = theEndLCS->GetEntry();
978 Handle(GEOM_Object) aEndLCS =
979 GetOperations()->GetEngine()->GetObject(theEndLCS->GetStudyID(), anEndLCSEntry);
980 if (aEndLCS.IsNull()) return aGEOMObject._retn();
982 //Perform the position
983 Handle(GEOM_Object) anObject =
984 GetOperations()->PositionShapeCopy(aBasicObject, aStartLCS, aEndLCS);
985 if (!GetOperations()->IsDone() || anObject.IsNull())
986 return aGEOMObject._retn();
988 return GetObject(anObject);
991 //=============================================================================
995 //=============================================================================
996 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
997 (GEOM::GEOM_Object_ptr theObject,
998 GEOM::GEOM_Object_ptr thePath,
999 CORBA::Double theDistance,
1000 CORBA::Boolean theCopy)
1002 GEOM::GEOM_Object_var aGEOMObject;
1004 //Set a not done flag
1005 GetOperations()->SetNotDone();
1007 if (theObject == NULL || thePath == NULL)
1008 return aGEOMObject._retn();
1010 //Get the basic object
1011 CORBA::String_var anEntry = theObject->GetEntry();
1012 Handle(GEOM_Object) aBasicObject =
1013 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1014 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1016 //Get the path object
1017 CORBA::String_var aPathEntry = thePath->GetEntry();
1018 Handle(GEOM_Object) aPathObject =
1019 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), aPathEntry);
1020 if (aPathObject.IsNull()) return aGEOMObject._retn();
1022 //Perform the position
1023 Handle(GEOM_Object) anObject =
1024 GetOperations()->PositionAlongPath(aBasicObject, aPathObject, theDistance, theCopy);
1025 if (!GetOperations()->IsDone() || anObject.IsNull())
1026 return aGEOMObject._retn();
1028 return GetObject(anObject);
1031 //=============================================================================
1035 //=============================================================================
1036 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
1037 (GEOM::GEOM_Object_ptr theObject,
1038 GEOM::GEOM_Object_ptr theVector,
1039 CORBA::Double theStep, CORBA::Long theNbTimes)
1041 //Set a not done flag
1042 GetOperations()->SetNotDone();
1044 GEOM::GEOM_Object_var aGEOMObject;
1046 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
1048 //Get the object itself
1049 CORBA::String_var anEntry = theObject->GetEntry();
1050 Handle(GEOM_Object) aBasicObject =
1051 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1052 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1054 //Get the vector of translation
1055 CORBA::String_var aVecEntry = theVector->GetEntry();
1056 Handle(GEOM_Object) aVector =
1057 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
1058 if (aVector.IsNull()) return aGEOMObject._retn();
1060 //Perform the translation
1061 Handle(GEOM_Object) anObject =
1062 GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes);
1063 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1065 return GetObject(anObject);
1068 //=============================================================================
1072 //=============================================================================
1073 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
1074 GEOM::GEOM_Object_ptr theVector1,
1075 CORBA::Double theStep1,
1076 CORBA::Long theNbTimes1,
1077 GEOM::GEOM_Object_ptr theVector2,
1078 CORBA::Double theStep2,
1079 CORBA::Long theNbTimes2)
1081 //Set a not done flag
1082 GetOperations()->SetNotDone();
1084 GEOM::GEOM_Object_var aGEOMObject;
1086 if (theObject == NULL || theVector1 == NULL || theVector2 == NULL) return aGEOMObject._retn();
1088 //Get the object itself
1089 CORBA::String_var anEntry = theObject->GetEntry();
1090 Handle(GEOM_Object) aBasicObject =
1091 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1092 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1094 //Get the vector1 of translation
1095 CORBA::String_var aVec1Entry = theVector1->GetEntry();
1096 Handle(GEOM_Object) aVector1 =
1097 GetOperations()->GetEngine()->GetObject(theVector1->GetStudyID(), aVec1Entry);
1098 if (aVector1.IsNull()) return aGEOMObject._retn();
1100 //Get the vector2 of translation
1101 CORBA::String_var aVec2Entry = theVector2->GetEntry();
1102 Handle(GEOM_Object) aVector2 =
1103 GetOperations()->GetEngine()->GetObject(theVector2->GetStudyID(), aVec2Entry);
1104 if (aVector2.IsNull()) return aGEOMObject._retn();
1106 //Perform the translation
1107 Handle(GEOM_Object) anObject = GetOperations()->Translate2D
1108 (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2);
1109 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1111 return GetObject(anObject);
1114 //=============================================================================
1118 //=============================================================================
1119 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObject,
1120 GEOM::GEOM_Object_ptr theVector,
1121 CORBA::Long theNbTimes)
1123 //Set a not done flag
1124 GetOperations()->SetNotDone();
1126 GEOM::GEOM_Object_var aGEOMObject;
1128 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
1130 //Get the object itself
1131 CORBA::String_var anEntry = theObject->GetEntry();
1132 Handle(GEOM_Object) aBasicObject =
1133 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1134 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1136 //Get the a directon of rotation
1137 CORBA::String_var aVecEntry = theVector->GetEntry();
1138 Handle(GEOM_Object) aVector =
1139 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
1140 if (aVector.IsNull()) return aGEOMObject._retn();
1142 //Perform the rotation
1143 Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
1144 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1146 return GetObject(anObject);
1149 //=============================================================================
1153 //=============================================================================
1154 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObject,
1155 GEOM::GEOM_Object_ptr theVector,
1156 CORBA::Double theAngle,
1157 CORBA::Long theNbTimes1,
1158 CORBA::Double theStep,
1159 CORBA::Long theNbTimes2)
1161 //Set a not done flag
1162 GetOperations()->SetNotDone();
1164 GEOM::GEOM_Object_var aGEOMObject;
1166 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
1168 //Get the object itself
1169 CORBA::String_var anEntry = theObject->GetEntry();
1170 Handle(GEOM_Object) aBasicObject =
1171 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1172 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1174 //Get the a directon of rotation
1175 CORBA::String_var aVecEntry = theVector->GetEntry();
1176 Handle(GEOM_Object) aVector =
1177 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
1178 if (aVector.IsNull()) return aGEOMObject._retn();
1180 //Perform the rotation
1181 Handle(GEOM_Object) anObject = GetOperations()->Rotate2D
1182 (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
1183 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1185 return GetObject(anObject);
1188 //=============================================================================
1192 //=============================================================================
1193 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
1194 (GEOM::GEOM_Object_ptr theObject,
1195 GEOM::GEOM_Object_ptr theCentPoint,
1196 GEOM::GEOM_Object_ptr thePoint1,
1197 GEOM::GEOM_Object_ptr thePoint2)
1199 //Set a not done flag
1200 GetOperations()->SetNotDone();
1201 GEOM::GEOM_Object_var aGEOMObject;
1203 if (theCentPoint == NULL || thePoint1 == NULL || thePoint2 == NULL || theObject == NULL)
1204 return aGEOMObject._retn();
1206 //check if the object is a subshape
1207 if (!theObject->IsMainShape()) {
1208 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
1209 return aGEOMObject._retn();
1212 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1214 //Get the object itself
1215 CORBA::String_var anEntry = theObject->GetEntry();
1216 Handle(GEOM_Object) anObject =
1217 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1218 if (anObject.IsNull()) return aGEOMObject._retn();
1220 //Get the central point of rotation
1221 CORBA::String_var aCPEntry = theCentPoint->GetEntry();
1222 Handle(GEOM_Object) aCentPoint =
1223 GetOperations()->GetEngine()->GetObject(theCentPoint->GetStudyID(), aCPEntry);
1224 if (aCentPoint.IsNull()) return aGEOMObject._retn();
1226 //Get the first point
1227 CORBA::String_var aP1Entry = thePoint1->GetEntry();
1228 Handle(GEOM_Object) aPoint1 =
1229 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
1230 if (aPoint1.IsNull()) return aGEOMObject._retn();
1232 //Get the second point
1233 CORBA::String_var aP2Entry = thePoint2->GetEntry();
1234 Handle(GEOM_Object) aPoint2 =
1235 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
1236 if (aPoint2.IsNull()) return aGEOMObject._retn();
1238 //Perform the translation
1239 GetOperations()->RotateThreePoints(anObject, aCentPoint, aPoint1, aPoint2);
1241 return aGEOMObject._retn();
1244 //=============================================================================
1246 * RotateThreePointsCopy
1248 //=============================================================================
1249 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
1250 (GEOM::GEOM_Object_ptr theObject,
1251 GEOM::GEOM_Object_ptr theCentPoint,
1252 GEOM::GEOM_Object_ptr thePoint1,
1253 GEOM::GEOM_Object_ptr thePoint2)
1255 GEOM::GEOM_Object_var aGEOMObject;
1257 //Set a not done flag
1258 GetOperations()->SetNotDone();
1260 if (theCentPoint == NULL || thePoint1 == NULL || thePoint2 == NULL || theObject == NULL)
1261 return aGEOMObject._retn();
1263 //Get the object itself
1264 CORBA::String_var anEntry = theObject->GetEntry();
1265 Handle(GEOM_Object) aBasicObject =
1266 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1267 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1269 //Get the central point of rotation
1270 CORBA::String_var aCPEntry = theCentPoint->GetEntry();
1271 Handle(GEOM_Object) aCentPoint =
1272 GetOperations()->GetEngine()->GetObject(theCentPoint->GetStudyID(), aCPEntry);
1273 if (aCentPoint.IsNull()) return aGEOMObject._retn();
1275 //Get the first point
1276 CORBA::String_var aP1Entry = thePoint1->GetEntry();
1277 Handle(GEOM_Object) aPoint1 =
1278 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
1279 if (aPoint1.IsNull()) return aGEOMObject._retn();
1281 //Get the second point
1282 CORBA::String_var aP2Entry = thePoint2->GetEntry();
1283 Handle(GEOM_Object) aPoint2 =
1284 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
1285 if (aPoint2.IsNull()) return aGEOMObject._retn();
1287 //Perform the rotation
1288 Handle(GEOM_Object) anObject =
1289 GetOperations()->RotateThreePointsCopy(aBasicObject, aCentPoint, aPoint1, aPoint2);
1290 if (!GetOperations()->IsDone() || anObject.IsNull())
1291 return aGEOMObject._retn();
1293 return GetObject(anObject);
1296 //=============================================================================
1300 //=============================================================================
1301 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject
1302 (GEOM::GEOM_Object_ptr theObject)
1304 //Set a not done flag
1305 GetOperations()->SetNotDone();
1306 GEOM::GEOM_Object_var aGEOMObject;
1308 if (theObject == NULL) return aGEOMObject._retn();
1310 //check if the object is a subshape
1311 //if (!theObject->IsMainShape()) {
1312 // GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
1313 // return aGEOMObject._retn();
1316 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1318 //Get the object itself
1319 CORBA::String_var anEntry = theObject->GetEntry();
1320 Handle(GEOM_Object) anObject =
1321 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1322 if (anObject.IsNull()) return aGEOMObject._retn();
1324 //Perform the recomputation
1325 Handle(GEOM_Function) aLastFunction = anObject->GetLastFunction();
1326 if (aLastFunction.IsNull()) return aGEOMObject._retn();
1327 GetOperations()->GetSolver()->ComputeFunction(aLastFunction);
1329 return aGEOMObject._retn();