1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include <Standard_Stream.hxx>
24 #include "GEOM_ITransformOperations_i.hh"
26 #include "utilities.h"
28 #include "Utils_ExceptHandlers.hxx"
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"
36 #define SUBSHAPE_ERROR "Sub shape cannot be transformed"
38 //=============================================================================
42 //=============================================================================
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)
49 MESSAGE("GEOM_ITransformOperations_i::GEOM_ITransformOperations_i");
52 //=============================================================================
56 //=============================================================================
58 GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i()
60 MESSAGE("GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i");
64 //=============================================================================
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)
75 GetOperations()->SetNotDone();
76 GEOM::GEOM_Object_var aGEOMObject;
78 if (thePoint1 == NULL || thePoint2 == NULL || theObject == NULL) return aGEOMObject._retn();
80 //check if the object is a subshape
81 if(!theObject->IsMainShape()) {
82 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
83 return aGEOMObject._retn();
86 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
88 //Get the object itself
89 CORBA::String_var anEntry = theObject->GetEntry();
90 Handle(GEOM_Object) anObject =
91 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
92 if (anObject.IsNull()) return aGEOMObject._retn();
94 //Get the first point of translation
95 CORBA::String_var aP1Entry = thePoint1->GetEntry();
96 Handle(GEOM_Object) aPoint1 =
97 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
98 if (aPoint1.IsNull()) return aGEOMObject._retn();
100 //Get the second point of translation
101 CORBA::String_var aP2Entry = thePoint2->GetEntry();
102 Handle(GEOM_Object) aPoint2 =
103 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
104 if (aPoint2.IsNull()) return aGEOMObject._retn();
106 //Perform the translation
107 GetOperations()->TranslateTwoPoints(anObject, aPoint1, aPoint2);
109 return aGEOMObject._retn();
112 //=============================================================================
114 * TranslateTwoPointsCopy
116 //=============================================================================
117 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy
118 (GEOM::GEOM_Object_ptr theObject,
119 GEOM::GEOM_Object_ptr thePoint1,
120 GEOM::GEOM_Object_ptr thePoint2)
122 GEOM::GEOM_Object_var aGEOMObject;
124 //Set a not done flag
125 GetOperations()->SetNotDone();
127 if (thePoint1 == NULL || thePoint2 == NULL || theObject == NULL) return aGEOMObject._retn();
129 //Get the object itself
130 CORBA::String_var anEntry = theObject->GetEntry();
131 Handle(GEOM_Object) aBasicObject =
132 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
133 if (aBasicObject.IsNull()) return aGEOMObject._retn();
135 //Get the first point of translation
136 CORBA::String_var aP1Entry = thePoint1->GetEntry();
137 Handle(GEOM_Object) aPoint1 =
138 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
139 if (aPoint1.IsNull()) return aGEOMObject._retn();
141 //Get the second point of translation
142 CORBA::String_var aP2Entry = thePoint2->GetEntry();
143 Handle(GEOM_Object) aPoint2 =
144 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
145 if (aPoint2.IsNull()) return aGEOMObject._retn();
147 //Create the translated shape
148 Handle(GEOM_Object) anObject =
149 GetOperations()->TranslateTwoPointsCopy(aBasicObject, aPoint1, aPoint2);
150 if (!GetOperations()->IsDone() || anObject.IsNull())
151 return aGEOMObject._retn();
153 return GetObject(anObject);
156 //=============================================================================
160 //=============================================================================
161 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
162 (GEOM::GEOM_Object_ptr theObject,
163 CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
165 //Set a not done flag
166 GetOperations()->SetNotDone();
167 GEOM::GEOM_Object_var aGEOMObject ;
169 if (theObject == NULL) return aGEOMObject._retn();
171 //check if the object is a subshape
172 if(!theObject->IsMainShape()) {
173 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
174 return aGEOMObject._retn();
177 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
179 //Get the object itself
180 CORBA::String_var anEntry = theObject->GetEntry();
181 Handle(GEOM_Object) anObject =
182 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
183 if (anObject.IsNull()) return aGEOMObject._retn();
185 //Perform the translation
186 GetOperations()->TranslateDXDYDZ(anObject, theDX, theDY, theDZ);
188 return aGEOMObject._retn();
192 //=============================================================================
194 * TranslateDXDYDZCopy
196 //=============================================================================
197 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
198 (GEOM::GEOM_Object_ptr theObject,
199 CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
201 GEOM::GEOM_Object_var aGEOMObject;
203 //Set a not done flag
204 GetOperations()->SetNotDone();
206 if (theObject == NULL) return aGEOMObject._retn();
208 //Get the object itself
209 CORBA::String_var anEntry = theObject->GetEntry();
210 Handle(GEOM_Object) aBasicObject =
211 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
212 if (aBasicObject.IsNull()) return aGEOMObject._retn();
214 //Create the translated shape
215 Handle(GEOM_Object) anObject =
216 GetOperations()->TranslateDXDYDZCopy(aBasicObject, theDX, theDY, theDZ);
217 if (!GetOperations()->IsDone() || anObject.IsNull())
218 return aGEOMObject._retn();
220 return GetObject(anObject);
224 //=============================================================================
228 //=============================================================================
229 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
230 (GEOM::GEOM_Object_ptr theObject,
231 GEOM::GEOM_Object_ptr theVector)
233 //Set a not done flag
234 GetOperations()->SetNotDone();
235 GEOM::GEOM_Object_var aGEOMObject;
237 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
239 //check if the object is a subshape
240 if(!theObject->IsMainShape()) {
241 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
242 return aGEOMObject._retn();
245 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
247 //Get the object itself
248 CORBA::String_var anEntry = theObject->GetEntry();
249 Handle(GEOM_Object) anObject =
250 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
251 if (anObject.IsNull()) return aGEOMObject._retn();
253 //Get the vector of translation
254 CORBA::String_var aVEntry = theVector->GetEntry();
255 Handle(GEOM_Object) aVector =
256 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVEntry);
257 if (aVector.IsNull()) return aGEOMObject._retn();
259 //Perform the translation
260 GetOperations()->TranslateVector(anObject, aVector);
262 return aGEOMObject._retn();
265 //=============================================================================
267 * TranslateVectorCopy
269 //=============================================================================
270 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy
271 (GEOM::GEOM_Object_ptr theObject,
272 GEOM::GEOM_Object_ptr theVector)
274 GEOM::GEOM_Object_var aGEOMObject;
276 //Set a not done flag
277 GetOperations()->SetNotDone();
279 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
281 //Get the object itself
282 CORBA::String_var anEntry = theObject->GetEntry();
283 Handle(GEOM_Object) aBasicObject =
284 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
285 if (aBasicObject.IsNull()) return aGEOMObject._retn();
287 //Get the vector of translation
288 CORBA::String_var aVEntry = theVector->GetEntry();
289 Handle(GEOM_Object) aVector =
290 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVEntry);
291 if (aVector.IsNull()) return aGEOMObject._retn();
293 //Perform the translation
294 Handle(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector);
295 if (!GetOperations()->IsDone() || anObject.IsNull())
296 return aGEOMObject._retn();
298 return GetObject(anObject);
301 //=============================================================================
303 * TranslateVectorDistance
305 //=============================================================================
306 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
307 (GEOM::GEOM_Object_ptr theObject,
308 GEOM::GEOM_Object_ptr theVector,
309 CORBA::Double theDistance,
310 CORBA::Boolean theCopy)
312 GEOM::GEOM_Object_var aGEOMObject;
313 GetOperations()->SetNotDone(); //Set a not done flag
315 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
317 //check if the object is a subshape
318 if (!theCopy && !theObject->IsMainShape()) {
319 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
320 return aGEOMObject._retn();
324 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
326 //Get the object itself
327 CORBA::String_var anEntry = theObject->GetEntry();
328 Handle(GEOM_Object) aBasicObject =
329 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
330 if (aBasicObject.IsNull()) return aGEOMObject._retn();
332 //Get the vector of translation
333 CORBA::String_var aVecEntry = theVector->GetEntry();
334 Handle(GEOM_Object) aVector =
335 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
336 if (aVector.IsNull()) return aGEOMObject._retn();
338 //Perform the translation
340 Handle(GEOM_Object) anObject = GetOperations()->
341 TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
342 if (!GetOperations()->IsDone() || anObject.IsNull())
343 return aGEOMObject._retn();
345 return GetObject(anObject);
348 GetOperations()->TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
349 return aGEOMObject._retn();
352 //=============================================================================
356 //=============================================================================
357 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr theObject,
358 GEOM::GEOM_Object_ptr theAxis,
359 CORBA::Double theAngle)
361 //Set a not done flag
362 GetOperations()->SetNotDone();
363 GEOM::GEOM_Object_var aGEOMObject;
365 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
367 //check if the object is a subshape
368 if(!theObject->IsMainShape()) {
369 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
370 return aGEOMObject._retn();
373 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
375 //Get the object itself
376 CORBA::String_var anEntry = theObject->GetEntry();
377 Handle(GEOM_Object) anObject =
378 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
379 if (anObject.IsNull()) return aGEOMObject._retn();
381 //Get the axis of revolution
382 CORBA::String_var anAEntry = theAxis->GetEntry();
383 Handle(GEOM_Object) anAxis =
384 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
385 if (anAxis.IsNull()) return aGEOMObject._retn();
387 //Perform the rotation
388 GetOperations()->Rotate(anObject, anAxis, theAngle);
390 return aGEOMObject._retn();
393 //=============================================================================
397 //=============================================================================
398 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object_ptr theObject,
399 GEOM::GEOM_Object_ptr theAxis,
400 CORBA::Double theAngle)
402 GEOM::GEOM_Object_var aGEOMObject;
404 //Set a not done flag
405 GetOperations()->SetNotDone();
407 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
409 //Get the object itself
410 CORBA::String_var anEntry = theObject->GetEntry();
411 Handle(GEOM_Object) aBasicObject =
412 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
413 if (aBasicObject.IsNull()) return aGEOMObject._retn();
415 //Get the axis of rotation
416 CORBA::String_var anAEntry = theAxis->GetEntry();
417 Handle(GEOM_Object) anAxis =
418 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
419 if (anAxis.IsNull()) return aGEOMObject._retn();
421 //Perform the rotation
422 Handle(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle);
423 if (!GetOperations()->IsDone() || anObject.IsNull())
424 return aGEOMObject._retn();
426 return GetObject(anObject);
430 //=============================================================================
434 //=============================================================================
435 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
436 (GEOM::GEOM_Object_ptr theObject,
437 GEOM::GEOM_Object_ptr thePlane)
439 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
441 //Set a not done flag
442 GetOperations()->SetNotDone();
444 if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn();
446 //check if the object is a subshape
447 if (!theObject->IsMainShape()) {
448 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
449 return aGEOMObject._retn();
452 //Get the object itself
453 CORBA::String_var anEntry = theObject->GetEntry();
454 Handle(GEOM_Object) anObject =
455 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
456 if (anObject.IsNull()) return aGEOMObject._retn();
459 CORBA::String_var aPlnEntry = thePlane->GetEntry();
460 Handle(GEOM_Object) aPlane =
461 GetOperations()->GetEngine()->GetObject(thePlane->GetStudyID(), aPlnEntry);
462 if (aPlane.IsNull()) return aGEOMObject._retn();
465 GetOperations()->MirrorPlane(anObject, aPlane);
467 return aGEOMObject._retn();
470 //=============================================================================
474 //=============================================================================
475 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy
476 (GEOM::GEOM_Object_ptr theObject,
477 GEOM::GEOM_Object_ptr thePlane)
479 GEOM::GEOM_Object_var aGEOMObject;
481 //Set a not done flag
482 GetOperations()->SetNotDone();
484 if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn();
486 //Get the object itself
487 CORBA::String_var anEntry = theObject->GetEntry();
488 Handle(GEOM_Object) aBasicObject =
489 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
490 if (aBasicObject.IsNull()) return aGEOMObject._retn();
492 //Get the vector of translation
493 CORBA::String_var aPlnEntry = thePlane->GetEntry();
494 Handle(GEOM_Object) aPlane =
495 GetOperations()->GetEngine()->GetObject(thePlane->GetStudyID(), aPlnEntry);
496 if (aPlane.IsNull()) return aGEOMObject._retn();
499 Handle(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane);
500 if (!GetOperations()->IsDone() || anObject.IsNull())
501 return aGEOMObject._retn();
503 return GetObject(anObject);
506 //=============================================================================
510 //=============================================================================
511 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
512 (GEOM::GEOM_Object_ptr theObject,
513 GEOM::GEOM_Object_ptr theAxis)
515 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
517 //Set a not done flag
518 GetOperations()->SetNotDone();
520 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
522 //check if the object is a subshape
523 if(!theObject->IsMainShape()) {
524 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
525 return aGEOMObject._retn();
528 //Get the object itself
529 CORBA::String_var anEntry = theObject->GetEntry();
530 Handle(GEOM_Object) anObject =
531 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
532 if (anObject.IsNull()) return aGEOMObject._retn();
535 CORBA::String_var anAEntry = theAxis->GetEntry();
536 Handle(GEOM_Object) aAxis =
537 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
538 if (aAxis.IsNull()) return aGEOMObject._retn();
541 GetOperations()->MirrorAxis(anObject, aAxis);
543 return aGEOMObject._retn();
546 //=============================================================================
550 //=============================================================================
551 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy
552 (GEOM::GEOM_Object_ptr theObject,
553 GEOM::GEOM_Object_ptr theAxis)
555 GEOM::GEOM_Object_var aGEOMObject;
557 //Set a not done flag
558 GetOperations()->SetNotDone();
560 if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
562 //Get the object itself
563 CORBA::String_var anEntry = theObject->GetEntry();
564 Handle(GEOM_Object) aBasicObject =
565 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
566 if (aBasicObject.IsNull()) return aGEOMObject._retn();
568 //Get the vector of translation
569 CORBA::String_var anAEntry = theAxis->GetEntry();
570 Handle(GEOM_Object) aAxis =
571 GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
572 if (aAxis.IsNull()) return aGEOMObject._retn();
575 Handle(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis);
576 if (!GetOperations()->IsDone() || anObject.IsNull())
577 return aGEOMObject._retn();
579 return GetObject(anObject);
582 //=============================================================================
586 //=============================================================================
587 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
588 (GEOM::GEOM_Object_ptr theObject,
589 GEOM::GEOM_Object_ptr thePoint)
591 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
593 //Set a not done flag
594 GetOperations()->SetNotDone();
596 if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn();
598 //check if the object is a subshape
599 if (!theObject->IsMainShape()) {
600 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
601 return aGEOMObject._retn();
604 //Get the object itself
605 CORBA::String_var anEntry = theObject->GetEntry();
606 Handle(GEOM_Object) anObject =
607 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
608 if (anObject.IsNull()) return aGEOMObject._retn();
611 CORBA::String_var aPntEntry = thePoint->GetEntry();
612 Handle(GEOM_Object) aPoint =
613 GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
614 if (aPoint.IsNull()) return aGEOMObject._retn();
617 GetOperations()->MirrorPoint(anObject, aPoint);
619 return aGEOMObject._retn();
622 //=============================================================================
626 //=============================================================================
627 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
628 (GEOM::GEOM_Object_ptr theObject,
629 GEOM::GEOM_Object_ptr thePoint)
631 GEOM::GEOM_Object_var aGEOMObject;
633 //Set a not done flag
634 GetOperations()->SetNotDone();
636 if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn();
638 //Get the object itself
639 CORBA::String_var anEntry = theObject->GetEntry();
640 Handle(GEOM_Object) aBasicObject =
641 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
642 if (aBasicObject.IsNull()) return aGEOMObject._retn();
644 //Get the vector of translation
645 CORBA::String_var aPntEntry = thePoint->GetEntry();
646 Handle(GEOM_Object) aPoint =
647 GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
648 if (aPoint.IsNull()) return aGEOMObject._retn();
651 Handle(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint);
652 if (!GetOperations()->IsDone() || anObject.IsNull())
653 return aGEOMObject._retn();
655 return GetObject(anObject);
659 //=============================================================================
663 //=============================================================================
664 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
665 (GEOM::GEOM_Object_ptr theObject,
666 CORBA::Double theOffset)
668 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
670 //Set a not done flag
671 GetOperations()->SetNotDone();
673 if (theObject == NULL) return aGEOMObject._retn();
675 //check if the object is a subshape
676 if (!theObject->IsMainShape()) {
677 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
678 return aGEOMObject._retn();
681 //Get the basic object
682 CORBA::String_var anEntry = theObject->GetEntry();
683 Handle(GEOM_Object) aBasicObject =
684 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
685 if (aBasicObject.IsNull()) return aGEOMObject._retn();
687 //Create the offset shape
688 GetOperations()->OffsetShape(aBasicObject, theOffset);
690 return aGEOMObject._retn();
693 //=============================================================================
697 //=============================================================================
698 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
699 (GEOM::GEOM_Object_ptr theObject,
700 CORBA::Double theOffset)
702 GEOM::GEOM_Object_var aGEOMObject;
704 //Set a not done flag
705 GetOperations()->SetNotDone();
707 if (theObject == NULL) return aGEOMObject._retn();
709 //Get the basic object
710 CORBA::String_var anEntry = theObject->GetEntry();
711 Handle(GEOM_Object) aBasicObject =
712 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
713 if (aBasicObject.IsNull()) return aGEOMObject._retn();
715 //Create the offset shape
716 Handle(GEOM_Object) anObject = GetOperations()->OffsetShapeCopy(aBasicObject, theOffset);
717 if (!GetOperations()->IsDone() || anObject.IsNull())
718 return aGEOMObject._retn();
720 return GetObject(anObject);
724 //=============================================================================
728 //=============================================================================
729 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
730 (GEOM::GEOM_Object_ptr theObject,
731 GEOM::GEOM_Object_ptr thePoint,
732 CORBA::Double theFactor)
734 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
736 //Set a not done flag
737 GetOperations()->SetNotDone();
739 if (theObject->_is_nil()) return aGEOMObject._retn();
741 //check if the object is a subshape
742 if (!theObject->IsMainShape()) {
743 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
744 return aGEOMObject._retn();
747 //Get the object itself
748 CORBA::String_var anEntry = theObject->GetEntry();
749 Handle(GEOM_Object) anObject =
750 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
751 if (anObject.IsNull()) return aGEOMObject._retn();
754 Handle(GEOM_Object) aPoint;
755 if (!thePoint->_is_nil()) {
756 CORBA::String_var aPntEntry = thePoint->GetEntry();
757 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
758 if (aPoint.IsNull()) return aGEOMObject._retn();
762 GetOperations()->ScaleShape(anObject, aPoint, theFactor);
764 return aGEOMObject._retn();
767 //=============================================================================
771 //=============================================================================
772 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy
773 (GEOM::GEOM_Object_ptr theObject,
774 GEOM::GEOM_Object_ptr thePoint,
775 CORBA::Double theFactor)
777 GEOM::GEOM_Object_var aGEOMObject;
779 //Set a not done flag
780 GetOperations()->SetNotDone();
782 if (theObject->_is_nil()) return aGEOMObject._retn();
784 //Get the basic object
785 CORBA::String_var anEntry = theObject->GetEntry();
786 Handle(GEOM_Object) aBasicObject =
787 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
788 if (aBasicObject.IsNull()) return aGEOMObject._retn();
791 Handle(GEOM_Object) aPoint;
792 if (!thePoint->_is_nil()) {
793 CORBA::String_var aPntEntry = thePoint->GetEntry();
794 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
795 if (aPoint.IsNull()) return aGEOMObject._retn();
799 Handle(GEOM_Object) anObject =
800 GetOperations()->ScaleShapeCopy(aBasicObject, aPoint, theFactor);
801 if (!GetOperations()->IsDone() || anObject.IsNull())
802 return aGEOMObject._retn();
804 return GetObject(anObject);
807 //=============================================================================
809 * ScaleShapeAlongAxes
811 //=============================================================================
812 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
813 (GEOM::GEOM_Object_ptr theObject,
814 GEOM::GEOM_Object_ptr thePoint,
815 CORBA::Double theFactorX,
816 CORBA::Double theFactorY,
817 CORBA::Double theFactorZ)
819 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
821 //Set a not done flag
822 GetOperations()->SetNotDone();
824 if (theObject->_is_nil()) return aGEOMObject._retn();
826 //check if the object is a subshape
827 if (!theObject->IsMainShape()) {
828 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
829 return aGEOMObject._retn();
832 //Get the object itself
833 CORBA::String_var anEntry = theObject->GetEntry();
834 Handle(GEOM_Object) anObject =
835 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
836 if (anObject.IsNull()) return aGEOMObject._retn();
839 Handle(GEOM_Object) aPoint;
840 if (!thePoint->_is_nil()) {
841 CORBA::String_var aPntEntry = thePoint->GetEntry();
842 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
843 if (aPoint.IsNull()) return aGEOMObject._retn();
847 GetOperations()->ScaleShapeAlongAxes
848 (anObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/false);
850 return aGEOMObject._retn();
853 //=============================================================================
855 * ScaleShapeAlongAxesCopy
857 //=============================================================================
858 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy
859 (GEOM::GEOM_Object_ptr theObject,
860 GEOM::GEOM_Object_ptr thePoint,
861 CORBA::Double theFactorX,
862 CORBA::Double theFactorY,
863 CORBA::Double theFactorZ)
865 GEOM::GEOM_Object_var aGEOMObject;
867 //Set a not done flag
868 GetOperations()->SetNotDone();
870 if (theObject->_is_nil()) return aGEOMObject._retn();
872 //Get the basic object
873 CORBA::String_var anEntry = theObject->GetEntry();
874 Handle(GEOM_Object) aBasicObject =
875 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
876 if (aBasicObject.IsNull()) return aGEOMObject._retn();
879 Handle(GEOM_Object) aPoint;
880 if (!thePoint->_is_nil()) {
881 CORBA::String_var aPntEntry = thePoint->GetEntry();
882 aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
883 if (aPoint.IsNull()) return aGEOMObject._retn();
887 Handle(GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes
888 (aBasicObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/true);
889 if (!GetOperations()->IsDone() || anObject.IsNull())
890 return aGEOMObject._retn();
892 return GetObject(anObject);
895 //=============================================================================
899 //=============================================================================
900 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
901 (GEOM::GEOM_Object_ptr theObject,
902 GEOM::GEOM_Object_ptr theStartLCS,
903 GEOM::GEOM_Object_ptr theEndLCS)
905 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
907 //Set a not done flag
908 GetOperations()->SetNotDone();
910 if (theObject == NULL || theEndLCS == NULL)
911 return aGEOMObject._retn();
913 //check if the object is a subshape
914 if (!theObject->IsMainShape()) {
915 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
916 return aGEOMObject._retn();
919 //Get the basic object
920 CORBA::String_var anEntry = theObject->GetEntry();
921 Handle(GEOM_Object) anObject =
922 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
923 if (anObject.IsNull()) return aGEOMObject._retn();
925 //Get the Start LCS (may be NULL for positioning from global LCS)
926 Handle(GEOM_Object) aStartLCS = NULL;
927 if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) {
928 CORBA::String_var aStartLCSEntry = theStartLCS->GetEntry();
929 aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), aStartLCSEntry);
930 if (aStartLCS.IsNull()) return aGEOMObject._retn();
934 CORBA::String_var anEndLCSEntry = theEndLCS->GetEntry();
935 Handle(GEOM_Object) aEndLCS =
936 GetOperations()->GetEngine()->GetObject(theEndLCS->GetStudyID(), anEndLCSEntry);
937 if (aEndLCS.IsNull()) return aGEOMObject._retn();
939 //Perform the Position
940 GetOperations()->PositionShape(anObject, aStartLCS, aEndLCS);
942 return aGEOMObject._retn();
945 //=============================================================================
949 //=============================================================================
950 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
951 (GEOM::GEOM_Object_ptr theObject,
952 GEOM::GEOM_Object_ptr theStartLCS,
953 GEOM::GEOM_Object_ptr theEndLCS)
955 GEOM::GEOM_Object_var aGEOMObject;
957 //Set a not done flag
958 GetOperations()->SetNotDone();
960 if (theObject == NULL || theEndLCS == NULL)
961 return aGEOMObject._retn();
963 //Get the basic object
964 CORBA::String_var anEntry = theObject->GetEntry();
965 Handle(GEOM_Object) aBasicObject =
966 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
967 if (aBasicObject.IsNull()) return aGEOMObject._retn();
969 //Get the Start LCS (may be NULL for positioning from global LCS)
970 Handle(GEOM_Object) aStartLCS = NULL;
971 if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) {
972 CORBA::String_var aStartLCSEntry = theStartLCS->GetEntry();
973 aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), aStartLCSEntry);
974 if (aStartLCS.IsNull()) return aGEOMObject._retn();
978 CORBA::String_var anEndLCSEntry = theEndLCS->GetEntry();
979 Handle(GEOM_Object) aEndLCS =
980 GetOperations()->GetEngine()->GetObject(theEndLCS->GetStudyID(), anEndLCSEntry);
981 if (aEndLCS.IsNull()) return aGEOMObject._retn();
983 //Perform the position
984 Handle(GEOM_Object) anObject =
985 GetOperations()->PositionShapeCopy(aBasicObject, aStartLCS, aEndLCS);
986 if (!GetOperations()->IsDone() || anObject.IsNull())
987 return aGEOMObject._retn();
989 return GetObject(anObject);
992 //=============================================================================
996 //=============================================================================
997 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
998 (GEOM::GEOM_Object_ptr theObject,
999 GEOM::GEOM_Object_ptr thePath,
1000 CORBA::Double theDistance,
1001 CORBA::Boolean theCopy,
1002 CORBA::Boolean theReverse)
1004 GEOM::GEOM_Object_var aGEOMObject;
1006 //Set a not done flag
1007 GetOperations()->SetNotDone();
1009 if (theObject == NULL || thePath == NULL)
1010 return aGEOMObject._retn();
1012 //Get the basic object
1013 CORBA::String_var anEntry = theObject->GetEntry();
1014 Handle(GEOM_Object) aBasicObject =
1015 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1016 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1018 //Get the path object
1019 CORBA::String_var aPathEntry = thePath->GetEntry();
1020 Handle(GEOM_Object) aPathObject =
1021 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), aPathEntry);
1022 if (aPathObject.IsNull()) return aGEOMObject._retn();
1024 //Perform the position
1025 Handle(GEOM_Object) anObject =
1026 GetOperations()->PositionAlongPath(aBasicObject, aPathObject, theDistance, theCopy, theReverse);
1027 if (!GetOperations()->IsDone() || anObject.IsNull())
1028 return aGEOMObject._retn();
1030 return GetObject(anObject);
1033 //=============================================================================
1037 //=============================================================================
1038 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
1039 (GEOM::GEOM_Object_ptr theObject,
1040 GEOM::GEOM_Object_ptr theVector,
1041 CORBA::Double theStep, CORBA::Long theNbTimes)
1043 //Set a not done flag
1044 GetOperations()->SetNotDone();
1046 GEOM::GEOM_Object_var aGEOMObject;
1048 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
1050 //Get the object itself
1051 CORBA::String_var anEntry = theObject->GetEntry();
1052 Handle(GEOM_Object) aBasicObject =
1053 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1054 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1056 //Get the vector of translation
1057 CORBA::String_var aVecEntry = theVector->GetEntry();
1058 Handle(GEOM_Object) aVector =
1059 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
1060 if (aVector.IsNull()) return aGEOMObject._retn();
1062 //Perform the translation
1063 Handle(GEOM_Object) anObject =
1064 GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes);
1065 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1067 return GetObject(anObject);
1070 //=============================================================================
1074 //=============================================================================
1075 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
1076 GEOM::GEOM_Object_ptr theVector1,
1077 CORBA::Double theStep1,
1078 CORBA::Long theNbTimes1,
1079 GEOM::GEOM_Object_ptr theVector2,
1080 CORBA::Double theStep2,
1081 CORBA::Long theNbTimes2)
1083 //Set a not done flag
1084 GetOperations()->SetNotDone();
1086 GEOM::GEOM_Object_var aGEOMObject;
1088 if (theObject == NULL || theVector1 == NULL || theVector2 == NULL) return aGEOMObject._retn();
1090 //Get the object itself
1091 CORBA::String_var anEntry = theObject->GetEntry();
1092 Handle(GEOM_Object) aBasicObject =
1093 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1094 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1096 //Get the vector1 of translation
1097 CORBA::String_var aVec1Entry = theVector1->GetEntry();
1098 Handle(GEOM_Object) aVector1 =
1099 GetOperations()->GetEngine()->GetObject(theVector1->GetStudyID(), aVec1Entry);
1100 if (aVector1.IsNull()) return aGEOMObject._retn();
1102 //Get the vector2 of translation
1103 CORBA::String_var aVec2Entry = theVector2->GetEntry();
1104 Handle(GEOM_Object) aVector2 =
1105 GetOperations()->GetEngine()->GetObject(theVector2->GetStudyID(), aVec2Entry);
1106 if (aVector2.IsNull()) return aGEOMObject._retn();
1108 //Perform the translation
1109 Handle(GEOM_Object) anObject = GetOperations()->Translate2D
1110 (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2);
1111 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1113 return GetObject(anObject);
1116 //=============================================================================
1120 //=============================================================================
1121 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObject,
1122 GEOM::GEOM_Object_ptr theVector,
1123 CORBA::Long theNbTimes)
1125 //Set a not done flag
1126 GetOperations()->SetNotDone();
1128 GEOM::GEOM_Object_var aGEOMObject;
1130 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
1132 //Get the object itself
1133 CORBA::String_var anEntry = theObject->GetEntry();
1134 Handle(GEOM_Object) aBasicObject =
1135 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1136 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1138 //Get the a directon of rotation
1139 CORBA::String_var aVecEntry = theVector->GetEntry();
1140 Handle(GEOM_Object) aVector =
1141 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
1142 if (aVector.IsNull()) return aGEOMObject._retn();
1144 //Perform the rotation
1145 Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
1146 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1148 return GetObject(anObject);
1151 //=============================================================================
1155 //=============================================================================
1156 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObject,
1157 GEOM::GEOM_Object_ptr theVector,
1158 CORBA::Double theAngle,
1159 CORBA::Long theNbTimes1,
1160 CORBA::Double theStep,
1161 CORBA::Long theNbTimes2)
1163 //Set a not done flag
1164 GetOperations()->SetNotDone();
1166 GEOM::GEOM_Object_var aGEOMObject;
1168 if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
1170 //Get the object itself
1171 CORBA::String_var anEntry = theObject->GetEntry();
1172 Handle(GEOM_Object) aBasicObject =
1173 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1174 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1176 //Get the a directon of rotation
1177 CORBA::String_var aVecEntry = theVector->GetEntry();
1178 Handle(GEOM_Object) aVector =
1179 GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
1180 if (aVector.IsNull()) return aGEOMObject._retn();
1182 //Perform the rotation
1183 Handle(GEOM_Object) anObject = GetOperations()->Rotate2D
1184 (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
1185 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1187 return GetObject(anObject);
1190 //=============================================================================
1194 //=============================================================================
1195 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
1196 (GEOM::GEOM_Object_ptr theObject,
1197 GEOM::GEOM_Object_ptr theCentPoint,
1198 GEOM::GEOM_Object_ptr thePoint1,
1199 GEOM::GEOM_Object_ptr thePoint2)
1201 //Set a not done flag
1202 GetOperations()->SetNotDone();
1203 GEOM::GEOM_Object_var aGEOMObject;
1205 if (theCentPoint == NULL || thePoint1 == NULL || thePoint2 == NULL || theObject == NULL)
1206 return aGEOMObject._retn();
1208 //check if the object is a subshape
1209 if (!theObject->IsMainShape()) {
1210 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
1211 return aGEOMObject._retn();
1214 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1216 //Get the object itself
1217 CORBA::String_var anEntry = theObject->GetEntry();
1218 Handle(GEOM_Object) anObject =
1219 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1220 if (anObject.IsNull()) return aGEOMObject._retn();
1222 //Get the central point of rotation
1223 CORBA::String_var aCPEntry = theCentPoint->GetEntry();
1224 Handle(GEOM_Object) aCentPoint =
1225 GetOperations()->GetEngine()->GetObject(theCentPoint->GetStudyID(), aCPEntry);
1226 if (aCentPoint.IsNull()) return aGEOMObject._retn();
1228 //Get the first point
1229 CORBA::String_var aP1Entry = thePoint1->GetEntry();
1230 Handle(GEOM_Object) aPoint1 =
1231 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
1232 if (aPoint1.IsNull()) return aGEOMObject._retn();
1234 //Get the second point
1235 CORBA::String_var aP2Entry = thePoint2->GetEntry();
1236 Handle(GEOM_Object) aPoint2 =
1237 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
1238 if (aPoint2.IsNull()) return aGEOMObject._retn();
1240 //Perform the translation
1241 GetOperations()->RotateThreePoints(anObject, aCentPoint, aPoint1, aPoint2);
1243 return aGEOMObject._retn();
1246 //=============================================================================
1248 * RotateThreePointsCopy
1250 //=============================================================================
1251 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
1252 (GEOM::GEOM_Object_ptr theObject,
1253 GEOM::GEOM_Object_ptr theCentPoint,
1254 GEOM::GEOM_Object_ptr thePoint1,
1255 GEOM::GEOM_Object_ptr thePoint2)
1257 GEOM::GEOM_Object_var aGEOMObject;
1259 //Set a not done flag
1260 GetOperations()->SetNotDone();
1262 if (theCentPoint == NULL || thePoint1 == NULL || thePoint2 == NULL || theObject == NULL)
1263 return aGEOMObject._retn();
1265 //Get the object itself
1266 CORBA::String_var anEntry = theObject->GetEntry();
1267 Handle(GEOM_Object) aBasicObject =
1268 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1269 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1271 //Get the central point of rotation
1272 CORBA::String_var aCPEntry = theCentPoint->GetEntry();
1273 Handle(GEOM_Object) aCentPoint =
1274 GetOperations()->GetEngine()->GetObject(theCentPoint->GetStudyID(), aCPEntry);
1275 if (aCentPoint.IsNull()) return aGEOMObject._retn();
1277 //Get the first point
1278 CORBA::String_var aP1Entry = thePoint1->GetEntry();
1279 Handle(GEOM_Object) aPoint1 =
1280 GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
1281 if (aPoint1.IsNull()) return aGEOMObject._retn();
1283 //Get the second point
1284 CORBA::String_var aP2Entry = thePoint2->GetEntry();
1285 Handle(GEOM_Object) aPoint2 =
1286 GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
1287 if (aPoint2.IsNull()) return aGEOMObject._retn();
1289 //Perform the rotation
1290 Handle(GEOM_Object) anObject =
1291 GetOperations()->RotateThreePointsCopy(aBasicObject, aCentPoint, aPoint1, aPoint2);
1292 if (!GetOperations()->IsDone() || anObject.IsNull())
1293 return aGEOMObject._retn();
1295 return GetObject(anObject);
1298 //=============================================================================
1302 //=============================================================================
1303 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject
1304 (GEOM::GEOM_Object_ptr theObject)
1306 //Set a not done flag
1307 GetOperations()->SetNotDone();
1308 GEOM::GEOM_Object_var aGEOMObject;
1310 if (theObject == NULL) return aGEOMObject._retn();
1312 //check if the object is a subshape
1313 //if (!theObject->IsMainShape()) {
1314 // GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
1315 // return aGEOMObject._retn();
1318 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1320 //Get the object itself
1321 CORBA::String_var anEntry = theObject->GetEntry();
1322 Handle(GEOM_Object) anObject =
1323 GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
1324 if (anObject.IsNull()) return aGEOMObject._retn();
1326 //Perform the recomputation
1327 Handle(GEOM_Function) aLastFunction = anObject->GetLastFunction();
1328 if (aLastFunction.IsNull()) return aGEOMObject._retn();
1329 GetOperations()->GetSolver()->ComputeFunction(aLastFunction);
1331 return aGEOMObject._retn();