1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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
23 #include <Standard_Stream.hxx>
25 #include "GEOM_ITransformOperations_i.hh"
27 #include "utilities.h"
29 #include "Utils_ExceptHandlers.hxx"
31 #include <TDF_Label.hxx>
32 #include <TDF_Tool.hxx>
33 #include <TCollection_AsciiString.hxx>
34 #include "GEOM_Engine.hxx"
35 #include "GEOM_Object.hxx"
37 #define SUBSHAPE_ERROR "Sub shape cannot be transformed"
39 //=============================================================================
43 //=============================================================================
45 GEOM_ITransformOperations_i::GEOM_ITransformOperations_i (PortableServer::POA_ptr thePOA,
46 GEOM::GEOM_Gen_ptr theEngine,
47 ::GEOMImpl_ITransformOperations* theImpl)
48 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
50 MESSAGE("GEOM_ITransformOperations_i::GEOM_ITransformOperations_i");
53 //=============================================================================
57 //=============================================================================
59 GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i()
61 MESSAGE("GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i");
65 //=============================================================================
69 //=============================================================================
70 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
71 (GEOM::GEOM_Object_ptr theObject,
72 GEOM::GEOM_Object_ptr thePoint1,
73 GEOM::GEOM_Object_ptr thePoint2)
76 GetOperations()->SetNotDone();
77 GEOM::GEOM_Object_var aGEOMObject;
79 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
81 //check if the object is a sub-shape
82 if (!theObject->IsMainShape()) {
83 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
84 return aGEOMObject._retn();
87 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
89 //Get the object itself
90 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
91 if (anObject.IsNull()) return aGEOMObject._retn();
93 //Get the first point of translation
94 HANDLE_NAMESPACE(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
95 if (aPoint1.IsNull()) return aGEOMObject._retn();
97 //Get the second point of translation
98 HANDLE_NAMESPACE(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
99 if (aPoint2.IsNull()) return aGEOMObject._retn();
101 //Perform the translation
102 GetOperations()->TranslateTwoPoints(anObject, aPoint1, aPoint2);
105 UpdateGUIForObject(theObject);
107 return aGEOMObject._retn();
110 //=============================================================================
112 * TranslateTwoPointsCopy
114 //=============================================================================
115 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy
116 (GEOM::GEOM_Object_ptr theObject,
117 GEOM::GEOM_Object_ptr thePoint1,
118 GEOM::GEOM_Object_ptr thePoint2)
120 GEOM::GEOM_Object_var aGEOMObject;
122 //Set a not done flag
123 GetOperations()->SetNotDone();
125 //Get the object itself
126 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
127 if (aBasicObject.IsNull()) return aGEOMObject._retn();
129 //Get the first point of translation
130 HANDLE_NAMESPACE(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
131 if (aPoint1.IsNull()) return aGEOMObject._retn();
133 //Get the second point of translation
134 HANDLE_NAMESPACE(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
135 if (aPoint2.IsNull()) return aGEOMObject._retn();
137 //Create the translated shape
138 HANDLE_NAMESPACE(GEOM_Object) anObject =
139 GetOperations()->TranslateTwoPointsCopy(aBasicObject, aPoint1, aPoint2);
140 if (!GetOperations()->IsDone() || anObject.IsNull())
141 return aGEOMObject._retn();
143 return GetObject(anObject);
146 //=============================================================================
150 //=============================================================================
151 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
152 (GEOM::GEOM_Object_ptr theObject,
153 CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
155 //Set a not done flag
156 GetOperations()->SetNotDone();
157 GEOM::GEOM_Object_var aGEOMObject;
159 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
161 //check if the object is a sub-shape
162 if (!theObject->IsMainShape()) {
163 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
164 return aGEOMObject._retn();
167 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
169 //Get the object itself
170 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
171 if (anObject.IsNull()) return aGEOMObject._retn();
173 //Perform the translation
174 GetOperations()->TranslateDXDYDZ(anObject, theDX, theDY, theDZ);
177 UpdateGUIForObject(theObject);
179 return aGEOMObject._retn();
182 //=============================================================================
184 * TranslateDXDYDZCopy
186 //=============================================================================
187 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
188 (GEOM::GEOM_Object_ptr theObject,
189 CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
191 GEOM::GEOM_Object_var aGEOMObject;
193 //Set a not done flag
194 GetOperations()->SetNotDone();
196 //Get the object itself
197 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
198 if (aBasicObject.IsNull()) return aGEOMObject._retn();
200 //Create the translated shape
201 HANDLE_NAMESPACE(GEOM_Object) anObject =
202 GetOperations()->TranslateDXDYDZCopy(aBasicObject, theDX, theDY, theDZ);
203 if (!GetOperations()->IsDone() || anObject.IsNull())
204 return aGEOMObject._retn();
206 return GetObject(anObject);
209 //=============================================================================
213 //=============================================================================
214 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
215 (GEOM::GEOM_Object_ptr theObject,
216 GEOM::GEOM_Object_ptr theVector)
218 //Set a not done flag
219 GetOperations()->SetNotDone();
220 GEOM::GEOM_Object_var aGEOMObject;
222 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
224 //check if the object is a sub-shape
225 if (!theObject->IsMainShape()) {
226 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
227 return aGEOMObject._retn();
230 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
232 //Get the object itself
233 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
234 if (anObject.IsNull()) return aGEOMObject._retn();
236 //Get the vector of translation
237 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
238 if (aVector.IsNull()) return aGEOMObject._retn();
240 //Perform the translation
241 GetOperations()->TranslateVector(anObject, aVector);
244 UpdateGUIForObject(theObject);
246 return aGEOMObject._retn();
249 //=============================================================================
251 * TranslateVectorCopy
253 //=============================================================================
254 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy
255 (GEOM::GEOM_Object_ptr theObject,
256 GEOM::GEOM_Object_ptr theVector)
258 GEOM::GEOM_Object_var aGEOMObject;
260 //Set a not done flag
261 GetOperations()->SetNotDone();
263 //Get the object itself
264 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
265 if (aBasicObject.IsNull()) return aGEOMObject._retn();
267 //Get the vector of translation
268 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
269 if (aVector.IsNull()) return aGEOMObject._retn();
271 //Perform the translation
272 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector);
273 if (!GetOperations()->IsDone() || anObject.IsNull())
274 return aGEOMObject._retn();
276 return GetObject(anObject);
279 //=============================================================================
281 * TranslateVectorDistance
283 //=============================================================================
284 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
285 (GEOM::GEOM_Object_ptr theObject,
286 GEOM::GEOM_Object_ptr theVector,
287 CORBA::Double theDistance,
288 CORBA::Boolean theCopy)
290 GEOM::GEOM_Object_var aGEOMObject;
291 GetOperations()->SetNotDone(); //Set a not done flag
293 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
295 //check if the object is a sub-shape
296 if (!theCopy && !theObject->IsMainShape()) {
297 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
298 return aGEOMObject._retn();
302 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
304 //Get the object itself
305 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
306 if (aBasicObject.IsNull()) return aGEOMObject._retn();
308 //Get the vector of translation
309 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
310 if (aVector.IsNull()) return aGEOMObject._retn();
312 //Perform the translation
314 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->
315 TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
316 if (!GetOperations()->IsDone() || anObject.IsNull())
317 return aGEOMObject._retn();
319 return GetObject(anObject);
322 GetOperations()->TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
325 UpdateGUIForObject(theObject);
327 return aGEOMObject._retn();
330 //=============================================================================
334 //=============================================================================
335 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr theObject,
336 GEOM::GEOM_Object_ptr theAxis,
337 CORBA::Double theAngle)
339 //Set a not done flag
340 GetOperations()->SetNotDone();
341 GEOM::GEOM_Object_var aGEOMObject;
343 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
345 //check if the object is a sub-shape
346 if (!theObject->IsMainShape()) {
347 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
348 return aGEOMObject._retn();
351 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
353 //Get the object itself
354 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
355 if (anObject.IsNull()) return aGEOMObject._retn();
357 //Get the axis of revolution
358 HANDLE_NAMESPACE(GEOM_Object) anAxis = GetObjectImpl(theAxis);
359 if (anAxis.IsNull()) return aGEOMObject._retn();
361 //Perform the rotation
362 GetOperations()->Rotate(anObject, anAxis, theAngle);
365 UpdateGUIForObject(theObject);
367 return aGEOMObject._retn();
370 //=============================================================================
374 //=============================================================================
375 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object_ptr theObject,
376 GEOM::GEOM_Object_ptr theAxis,
377 CORBA::Double theAngle)
379 GEOM::GEOM_Object_var aGEOMObject;
381 //Set a not done flag
382 GetOperations()->SetNotDone();
384 //Get the object itself
385 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
386 if (aBasicObject.IsNull()) return aGEOMObject._retn();
388 //Get the axis of rotation
389 HANDLE_NAMESPACE(GEOM_Object) anAxis = GetObjectImpl(theAxis);
390 if (anAxis.IsNull()) return aGEOMObject._retn();
392 //Perform the rotation
393 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle);
394 if (!GetOperations()->IsDone() || anObject.IsNull())
395 return aGEOMObject._retn();
397 return GetObject(anObject);
400 //=============================================================================
404 //=============================================================================
405 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
406 (GEOM::GEOM_Object_ptr theObject,
407 GEOM::GEOM_Object_ptr thePlane)
409 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
411 //Set a not done flag
412 GetOperations()->SetNotDone();
414 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
416 //check if the object is a sub-shape
417 if (!theObject->IsMainShape()) {
418 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
419 return aGEOMObject._retn();
422 //Get the object itself
423 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
424 if (anObject.IsNull()) return aGEOMObject._retn();
427 HANDLE_NAMESPACE(GEOM_Object) aPlane = GetObjectImpl(thePlane);
428 if (aPlane.IsNull()) return aGEOMObject._retn();
431 GetOperations()->MirrorPlane(anObject, aPlane);
434 UpdateGUIForObject(theObject);
436 return aGEOMObject._retn();
439 //=============================================================================
443 //=============================================================================
444 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy
445 (GEOM::GEOM_Object_ptr theObject,
446 GEOM::GEOM_Object_ptr thePlane)
448 GEOM::GEOM_Object_var aGEOMObject;
450 //Set a not done flag
451 GetOperations()->SetNotDone();
453 //Get the object itself
454 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
455 if (aBasicObject.IsNull()) return aGEOMObject._retn();
457 //Get the vector of translation
458 HANDLE_NAMESPACE(GEOM_Object) aPlane = GetObjectImpl(thePlane);
459 if (aPlane.IsNull()) return aGEOMObject._retn();
462 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane);
463 if (!GetOperations()->IsDone() || anObject.IsNull())
464 return aGEOMObject._retn();
466 return GetObject(anObject);
469 //=============================================================================
473 //=============================================================================
474 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
475 (GEOM::GEOM_Object_ptr theObject,
476 GEOM::GEOM_Object_ptr theAxis)
478 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
480 //Set a not done flag
481 GetOperations()->SetNotDone();
483 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
485 //check if the object is a sub-shape
486 if (!theObject->IsMainShape()) {
487 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
488 return aGEOMObject._retn();
491 //Get the object itself
492 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
493 if (anObject.IsNull()) return aGEOMObject._retn();
496 HANDLE_NAMESPACE(GEOM_Object) aAxis = GetObjectImpl(theAxis);
497 if (aAxis.IsNull()) return aGEOMObject._retn();
500 GetOperations()->MirrorAxis(anObject, aAxis);
503 UpdateGUIForObject(theObject);
505 return aGEOMObject._retn();
508 //=============================================================================
512 //=============================================================================
513 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy
514 (GEOM::GEOM_Object_ptr theObject,
515 GEOM::GEOM_Object_ptr theAxis)
517 GEOM::GEOM_Object_var aGEOMObject;
519 //Set a not done flag
520 GetOperations()->SetNotDone();
522 //Get the object itself
523 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
524 if (aBasicObject.IsNull()) return aGEOMObject._retn();
526 //Get the vector of translation
527 HANDLE_NAMESPACE(GEOM_Object) aAxis = GetObjectImpl(theAxis);
528 if (aAxis.IsNull()) return aGEOMObject._retn();
531 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis);
532 if (!GetOperations()->IsDone() || anObject.IsNull())
533 return aGEOMObject._retn();
535 return GetObject(anObject);
538 //=============================================================================
542 //=============================================================================
543 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
544 (GEOM::GEOM_Object_ptr theObject,
545 GEOM::GEOM_Object_ptr thePoint)
547 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
549 //Set a not done flag
550 GetOperations()->SetNotDone();
552 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
554 //check if the object is a sub-shape
555 if (!theObject->IsMainShape()) {
556 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
557 return aGEOMObject._retn();
560 //Get the object itself
561 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
562 if (anObject.IsNull()) return aGEOMObject._retn();
565 HANDLE_NAMESPACE(GEOM_Object) aPoint = GetObjectImpl(thePoint);
566 if (aPoint.IsNull()) return aGEOMObject._retn();
569 GetOperations()->MirrorPoint(anObject, aPoint);
572 UpdateGUIForObject(theObject);
574 return aGEOMObject._retn();
577 //=============================================================================
581 //=============================================================================
582 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
583 (GEOM::GEOM_Object_ptr theObject,
584 GEOM::GEOM_Object_ptr thePoint)
586 GEOM::GEOM_Object_var aGEOMObject;
588 //Set a not done flag
589 GetOperations()->SetNotDone();
591 //Get the object itself
592 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
593 if (aBasicObject.IsNull()) return aGEOMObject._retn();
595 //Get the vector of translation
596 HANDLE_NAMESPACE(GEOM_Object) aPoint = GetObjectImpl(thePoint);
597 if (aPoint.IsNull()) return aGEOMObject._retn();
600 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint);
601 if (!GetOperations()->IsDone() || anObject.IsNull())
602 return aGEOMObject._retn();
604 return GetObject(anObject);
607 //=============================================================================
611 //=============================================================================
612 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
613 (GEOM::GEOM_Object_ptr theObject,
614 CORBA::Double theOffset)
616 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
618 //Set a not done flag
619 GetOperations()->SetNotDone();
621 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
623 //check if the object is a sub-shape
624 if (!theObject->IsMainShape()) {
625 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
626 return aGEOMObject._retn();
629 //Get the basic object
630 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
631 if (aBasicObject.IsNull()) return aGEOMObject._retn();
633 //Create the offset shape
634 GetOperations()->OffsetShape(aBasicObject, theOffset);
637 UpdateGUIForObject(theObject);
639 return aGEOMObject._retn();
642 //=============================================================================
646 //=============================================================================
647 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
648 (GEOM::GEOM_Object_ptr theObject,
649 CORBA::Double theOffset)
651 GEOM::GEOM_Object_var aGEOMObject;
653 //Set a not done flag
654 GetOperations()->SetNotDone();
656 //Get the basic object
657 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
658 if (aBasicObject.IsNull()) return aGEOMObject._retn();
660 //Create the offset shape
661 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->OffsetShapeCopy(aBasicObject, theOffset);
662 if (!GetOperations()->IsDone() || anObject.IsNull())
663 return aGEOMObject._retn();
665 return GetObject(anObject);
668 //=============================================================================
672 //=============================================================================
673 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ProjectShapeCopy
674 (GEOM::GEOM_Object_ptr theSource,
675 GEOM::GEOM_Object_ptr theTarget)
677 GEOM::GEOM_Object_var aGEOMObject;
679 //Set a not done flag
680 GetOperations()->SetNotDone();
682 //Get the input objects
683 HANDLE_NAMESPACE(GEOM_Object) aSource = GetObjectImpl(theSource);
684 HANDLE_NAMESPACE(GEOM_Object) aTarget = GetObjectImpl(theTarget);
685 if (aSource.IsNull() || aTarget.IsNull()) return aGEOMObject._retn();
687 //Create the projection
688 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->ProjectShapeCopy(aSource, aTarget);
689 if (!GetOperations()->IsDone() || anObject.IsNull())
690 return aGEOMObject._retn();
692 return GetObject(anObject);
695 //=============================================================================
699 //=============================================================================
700 CORBA::Double GEOM_ITransformOperations_i::ProjectPointOnWire
701 (GEOM::GEOM_Object_ptr thePoint,
702 GEOM::GEOM_Object_ptr theWire,
703 GEOM::GEOM_Object_out thePointOnEdge,
704 CORBA::Long& theEdgeInWireIndex)
706 //Set a not done flag
707 GetOperations()->SetNotDone();
709 //Get the reference shape
710 HANDLE_NAMESPACE(GEOM_Object) aPoint = GetObjectImpl(thePoint);
711 HANDLE_NAMESPACE(GEOM_Object) aWire = GetObjectImpl(theWire);
713 if (aPoint.IsNull() || aWire.IsNull()) {
717 HANDLE_NAMESPACE(GEOM_Object) aPointOnEdge;
718 Standard_Integer anEdgeIndex;
719 CORBA::Double aResult = GetOperations()->ProjectPointOnWire
720 (aPoint, aWire, aPointOnEdge, anEdgeIndex);
722 if (!aPointOnEdge.IsNull()) {
723 thePointOnEdge = GetObject(aPointOnEdge);
724 theEdgeInWireIndex = anEdgeIndex;
730 //=============================================================================
734 //=============================================================================
735 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
736 (GEOM::GEOM_Object_ptr theObject,
737 GEOM::GEOM_Object_ptr thePoint,
738 CORBA::Double theFactor)
740 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
742 //Set a not done flag
743 GetOperations()->SetNotDone();
745 if (theObject->_is_nil()) return aGEOMObject._retn();
747 //check if the object is a sub-shape
748 if (!theObject->IsMainShape()) {
749 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
750 return aGEOMObject._retn();
753 //Get the object itself
754 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
755 if (anObject.IsNull()) return aGEOMObject._retn();
758 HANDLE_NAMESPACE(GEOM_Object) aPoint;
759 if (!thePoint->_is_nil()) {
760 aPoint = GetObjectImpl(thePoint);
761 if (aPoint.IsNull()) return aGEOMObject._retn();
765 GetOperations()->ScaleShape(anObject, aPoint, theFactor);
768 UpdateGUIForObject(theObject);
770 return aGEOMObject._retn();
773 //=============================================================================
777 //=============================================================================
778 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy
779 (GEOM::GEOM_Object_ptr theObject,
780 GEOM::GEOM_Object_ptr thePoint,
781 CORBA::Double theFactor)
783 GEOM::GEOM_Object_var aGEOMObject;
785 //Set a not done flag
786 GetOperations()->SetNotDone();
788 //Get the basic object
789 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
790 if (aBasicObject.IsNull()) return aGEOMObject._retn();
793 HANDLE_NAMESPACE(GEOM_Object) aPoint;
794 if (!thePoint->_is_nil()) {
795 aPoint = GetObjectImpl(thePoint);
796 if (aPoint.IsNull()) return aGEOMObject._retn();
800 HANDLE_NAMESPACE(GEOM_Object) anObject =
801 GetOperations()->ScaleShapeCopy(aBasicObject, aPoint, theFactor);
802 if (!GetOperations()->IsDone() || anObject.IsNull())
803 return aGEOMObject._retn();
805 return GetObject(anObject);
808 //=============================================================================
810 * ScaleShapeAlongAxes
812 //=============================================================================
813 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
814 (GEOM::GEOM_Object_ptr theObject,
815 GEOM::GEOM_Object_ptr thePoint,
816 CORBA::Double theFactorX,
817 CORBA::Double theFactorY,
818 CORBA::Double theFactorZ)
820 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
822 //Set a not done flag
823 GetOperations()->SetNotDone();
825 if (theObject->_is_nil()) return aGEOMObject._retn();
827 //check if the object is a sub-shape
828 if (!theObject->IsMainShape()) {
829 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
830 return aGEOMObject._retn();
833 //Get the object itself
834 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
835 if (anObject.IsNull()) return aGEOMObject._retn();
838 HANDLE_NAMESPACE(GEOM_Object) aPoint;
839 if (!thePoint->_is_nil()) {
840 aPoint = GetObjectImpl(thePoint);
841 if (aPoint.IsNull()) return aGEOMObject._retn();
845 GetOperations()->ScaleShapeAlongAxes
846 (anObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/false);
849 UpdateGUIForObject(theObject);
851 return aGEOMObject._retn();
854 //=============================================================================
856 * ScaleShapeAlongAxesCopy
858 //=============================================================================
859 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy
860 (GEOM::GEOM_Object_ptr theObject,
861 GEOM::GEOM_Object_ptr thePoint,
862 CORBA::Double theFactorX,
863 CORBA::Double theFactorY,
864 CORBA::Double theFactorZ)
866 GEOM::GEOM_Object_var aGEOMObject;
868 //Set a not done flag
869 GetOperations()->SetNotDone();
871 //Get the basic object
872 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
873 if (aBasicObject.IsNull()) return aGEOMObject._retn();
876 HANDLE_NAMESPACE(GEOM_Object) aPoint;
877 if (!thePoint->_is_nil()) {
878 aPoint = GetObjectImpl(thePoint);
879 if (aPoint.IsNull()) return aGEOMObject._retn();
883 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes
884 (aBasicObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/true);
885 if (!GetOperations()->IsDone() || anObject.IsNull())
886 return aGEOMObject._retn();
888 return GetObject(anObject);
891 //=============================================================================
895 //=============================================================================
896 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
897 (GEOM::GEOM_Object_ptr theObject,
898 GEOM::GEOM_Object_ptr theStartLCS,
899 GEOM::GEOM_Object_ptr theEndLCS)
901 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
903 //Set a not done flag
904 GetOperations()->SetNotDone();
906 if (CORBA::is_nil(theObject) || CORBA::is_nil(theEndLCS))
907 return aGEOMObject._retn();
909 //check if the object is a sub-shape
910 if (!theObject->IsMainShape()) {
911 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
912 return aGEOMObject._retn();
915 //Get the basic object
916 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
917 if (anObject.IsNull()) return aGEOMObject._retn();
919 //Get the Start LCS (may be NULL for positioning from global LCS)
920 HANDLE_NAMESPACE(GEOM_Object) aStartLCS;
921 if (!CORBA::is_nil(theStartLCS)) {
922 aStartLCS = GetObjectImpl(theStartLCS);
923 if (aStartLCS.IsNull()) return aGEOMObject._retn();
927 HANDLE_NAMESPACE(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
928 if (aEndLCS.IsNull()) return aGEOMObject._retn();
930 //Perform the Position
931 GetOperations()->PositionShape(anObject, aStartLCS, aEndLCS);
934 UpdateGUIForObject(theObject);
936 return aGEOMObject._retn();
939 //=============================================================================
943 //=============================================================================
944 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
945 (GEOM::GEOM_Object_ptr theObject,
946 GEOM::GEOM_Object_ptr theStartLCS,
947 GEOM::GEOM_Object_ptr theEndLCS)
949 GEOM::GEOM_Object_var aGEOMObject;
951 //Set a not done flag
952 GetOperations()->SetNotDone();
954 //Get the basic object
955 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
956 if (aBasicObject.IsNull()) return aGEOMObject._retn();
958 //Get the Start LCS (may be NULL for positioning from global LCS)
959 HANDLE_NAMESPACE(GEOM_Object) aStartLCS;
960 if (!CORBA::is_nil(theStartLCS)) {
961 aStartLCS = GetObjectImpl(theStartLCS);
962 if (aStartLCS.IsNull()) return aGEOMObject._retn();
966 HANDLE_NAMESPACE(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
967 if (aEndLCS.IsNull()) return aGEOMObject._retn();
969 //Perform the position
970 HANDLE_NAMESPACE(GEOM_Object) anObject =
971 GetOperations()->PositionShapeCopy(aBasicObject, aStartLCS, aEndLCS);
972 if (!GetOperations()->IsDone() || anObject.IsNull())
973 return aGEOMObject._retn();
975 return GetObject(anObject);
978 //=============================================================================
982 //=============================================================================
983 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
984 (GEOM::GEOM_Object_ptr theObject,
985 GEOM::GEOM_Object_ptr thePath,
986 CORBA::Double theDistance,
987 CORBA::Boolean theCopy,
988 CORBA::Boolean theReverse)
990 GEOM::GEOM_Object_var aGEOMObject;
992 //Set a not done flag
993 GetOperations()->SetNotDone();
995 //Get the basic object
996 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
997 if (aBasicObject.IsNull()) return aGEOMObject._retn();
999 //Get the path object
1000 HANDLE_NAMESPACE(GEOM_Object) aPathObject = GetObjectImpl(thePath);
1001 if (aPathObject.IsNull()) return aGEOMObject._retn();
1003 //Perform the position
1004 HANDLE_NAMESPACE(GEOM_Object) anObject =
1005 GetOperations()->PositionAlongPath(aBasicObject, aPathObject, theDistance, theCopy, theReverse);
1006 if (!GetOperations()->IsDone() || anObject.IsNull())
1007 return aGEOMObject._retn();
1011 UpdateGUIForObject(theObject);
1014 return GetObject(anObject);
1017 //=============================================================================
1021 //=============================================================================
1022 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
1023 (GEOM::GEOM_Object_ptr theObject,
1024 GEOM::GEOM_Object_ptr theVector,
1025 CORBA::Double theStep, CORBA::Long theNbTimes)
1027 //Set a not done flag
1028 GetOperations()->SetNotDone();
1030 GEOM::GEOM_Object_var aGEOMObject;
1032 //Get the object itself
1033 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1034 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1036 //Get the vector of translation
1037 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
1038 //if (aVector.IsNull()) return aGEOMObject._retn(); // DX by default
1040 //Perform the translation
1041 HANDLE_NAMESPACE(GEOM_Object) anObject =
1042 GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes);
1043 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1045 return GetObject(anObject);
1048 //=============================================================================
1052 //=============================================================================
1053 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
1054 GEOM::GEOM_Object_ptr theVector1,
1055 CORBA::Double theStep1,
1056 CORBA::Long theNbTimes1,
1057 GEOM::GEOM_Object_ptr theVector2,
1058 CORBA::Double theStep2,
1059 CORBA::Long theNbTimes2)
1061 //Set a not done flag
1062 GetOperations()->SetNotDone();
1064 GEOM::GEOM_Object_var aGEOMObject;
1066 //Get the object itself
1067 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1068 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1070 //Get the vector1 of translation
1071 HANDLE_NAMESPACE(GEOM_Object) aVector1 = GetObjectImpl(theVector1);
1072 //if (aVector1.IsNull()) return aGEOMObject._retn(); // DX by default
1074 //Get the vector2 of translation
1075 HANDLE_NAMESPACE(GEOM_Object) aVector2 = GetObjectImpl(theVector2);
1076 //if (aVector2.IsNull()) return aGEOMObject._retn(); // DY by default
1078 //Perform the translation
1079 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->Translate2D
1080 (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2);
1081 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1083 return GetObject(anObject);
1086 //=============================================================================
1090 //=============================================================================
1091 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObject,
1092 GEOM::GEOM_Object_ptr theVector,
1093 CORBA::Long theNbTimes)
1095 //Set a not done flag
1096 GetOperations()->SetNotDone();
1098 GEOM::GEOM_Object_var aGEOMObject;
1100 //Get the object itself
1101 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1102 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1104 //Get the a directon of rotation
1105 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
1106 //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1108 //Perform the rotation
1109 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
1110 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1112 return GetObject(anObject);
1115 //=============================================================================
1117 * MultiRotate1DByStep
1119 //=============================================================================
1120 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1DByStep (GEOM::GEOM_Object_ptr theObject,
1121 GEOM::GEOM_Object_ptr theVector,
1122 CORBA::Double theAngleStep,
1123 CORBA::Long theNbSteps)
1125 //Set a not done flag
1126 GetOperations()->SetNotDone();
1128 GEOM::GEOM_Object_var aGEOMObject;
1130 //Get the object itself
1131 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1132 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1134 //Get the a directon of rotation
1135 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
1136 //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1138 //Perform the rotation
1139 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theAngleStep, theNbSteps);
1140 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1142 return GetObject(anObject);
1145 //=============================================================================
1147 * MultiRotate2DNbTimes
1149 //=============================================================================
1150 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DNbTimes (GEOM::GEOM_Object_ptr theObject,
1151 GEOM::GEOM_Object_ptr theVector,
1152 CORBA::Long theNbObjects,
1153 CORBA::Double theRadialStep,
1154 CORBA::Long theNbSteps)
1156 //Set a not done flag
1157 GetOperations()->SetNotDone();
1159 GEOM::GEOM_Object_var aGEOMObject;
1161 //Get the object itself
1162 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1163 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1165 //Get the a directon of rotation
1166 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
1167 //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1169 //Perform the rotation
1170 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->Rotate2D
1171 (aBasicObject, aVector, theNbObjects, theRadialStep, theNbSteps);
1172 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1174 return GetObject(anObject);
1177 //=============================================================================
1179 * MultiRotate2DByStep
1181 //=============================================================================
1182 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DByStep (GEOM::GEOM_Object_ptr theObject,
1183 GEOM::GEOM_Object_ptr theVector,
1184 CORBA::Double theAngle,
1185 CORBA::Long theNbTimes1,
1186 CORBA::Double theStep,
1187 CORBA::Long theNbTimes2)
1189 //Set a not done flag
1190 GetOperations()->SetNotDone();
1192 GEOM::GEOM_Object_var aGEOMObject;
1194 //Get the object itself
1195 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1196 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1198 //Get the a directon of rotation
1199 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
1200 //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1202 //Perform the rotation
1203 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->Rotate2D
1204 (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
1205 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1207 return GetObject(anObject);
1210 //=============================================================================
1214 //=============================================================================
1215 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObject,
1216 GEOM::GEOM_Object_ptr theVector,
1217 CORBA::Double theAngle,
1218 CORBA::Long theNbTimes1,
1219 CORBA::Double theStep,
1220 CORBA::Long theNbTimes2)
1222 //Set a not done flag
1223 GetOperations()->SetNotDone();
1225 GEOM::GEOM_Object_var aGEOMObject;
1227 //Get the object itself
1228 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1229 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1231 //Get the a directon of rotation
1232 HANDLE_NAMESPACE(GEOM_Object) aVector = GetObjectImpl(theVector);
1233 //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
1235 double anAngle = M_PI * theAngle / 180.;
1237 //Perform the rotation
1238 HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->Rotate2D
1239 (aBasicObject, aVector, anAngle, theNbTimes1, theStep, theNbTimes2);
1240 if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
1242 return GetObject(anObject);
1245 //=============================================================================
1249 //=============================================================================
1250 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
1251 (GEOM::GEOM_Object_ptr theObject,
1252 GEOM::GEOM_Object_ptr theCentPoint,
1253 GEOM::GEOM_Object_ptr thePoint1,
1254 GEOM::GEOM_Object_ptr thePoint2)
1256 //Set a not done flag
1257 GetOperations()->SetNotDone();
1258 GEOM::GEOM_Object_var aGEOMObject;
1260 if (CORBA::is_nil(theObject))
1261 return aGEOMObject._retn();
1263 //check if the object is a sub-shape
1264 if (!theObject->IsMainShape()) {
1265 GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
1266 return aGEOMObject._retn();
1269 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1271 //Get the object itself
1272 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
1273 if (anObject.IsNull()) return aGEOMObject._retn();
1275 //Get the central point of rotation
1276 HANDLE_NAMESPACE(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
1277 if (aCentPoint.IsNull()) return aGEOMObject._retn();
1279 //Get the first point
1280 HANDLE_NAMESPACE(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
1281 if (aPoint1.IsNull()) return aGEOMObject._retn();
1283 //Get the second point
1284 HANDLE_NAMESPACE(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
1285 if (aPoint2.IsNull()) return aGEOMObject._retn();
1287 //Perform the translation
1288 GetOperations()->RotateThreePoints(anObject, aCentPoint, aPoint1, aPoint2);
1291 UpdateGUIForObject(theObject);
1293 return aGEOMObject._retn();
1296 //=============================================================================
1298 * RotateThreePointsCopy
1300 //=============================================================================
1301 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
1302 (GEOM::GEOM_Object_ptr theObject,
1303 GEOM::GEOM_Object_ptr theCentPoint,
1304 GEOM::GEOM_Object_ptr thePoint1,
1305 GEOM::GEOM_Object_ptr thePoint2)
1307 GEOM::GEOM_Object_var aGEOMObject;
1309 //Set a not done flag
1310 GetOperations()->SetNotDone();
1312 //Get the object itself
1313 HANDLE_NAMESPACE(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
1314 if (aBasicObject.IsNull()) return aGEOMObject._retn();
1316 //Get the central point of rotation
1317 HANDLE_NAMESPACE(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
1318 if (aCentPoint.IsNull()) return aGEOMObject._retn();
1320 //Get the first point
1321 HANDLE_NAMESPACE(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
1322 if (aPoint1.IsNull()) return aGEOMObject._retn();
1324 //Get the second point
1325 HANDLE_NAMESPACE(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
1326 if (aPoint2.IsNull()) return aGEOMObject._retn();
1328 //Perform the rotation
1329 HANDLE_NAMESPACE(GEOM_Object) anObject =
1330 GetOperations()->RotateThreePointsCopy(aBasicObject, aCentPoint, aPoint1, aPoint2);
1331 if (!GetOperations()->IsDone() || anObject.IsNull())
1332 return aGEOMObject._retn();
1334 return GetObject(anObject);
1337 //=============================================================================
1339 * TransformLikeOtherCopy
1341 //=============================================================================
1342 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TransformLikeOtherCopy
1343 (GEOM::GEOM_Object_ptr theObject,
1344 GEOM::GEOM_Object_ptr theSample)
1346 GEOM::GEOM_Object_var aGEOMObject;
1348 //Set a not done flag
1349 GetOperations()->SetNotDone();
1351 //Get the object itself
1352 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
1353 if (anObject.IsNull()) return aGEOMObject._retn();
1355 //Get the sample object
1356 HANDLE_NAMESPACE(GEOM_Object) aSample = GetObjectImpl(theSample);
1357 if (aSample.IsNull()) return aGEOMObject._retn();
1359 //Perform the transformation
1360 HANDLE_NAMESPACE(GEOM_Object) aResObject =
1361 GetOperations()->TransformLikeOtherCopy(anObject, aSample);
1362 if (!GetOperations()->IsDone() || aResObject.IsNull())
1363 return aGEOMObject._retn();
1365 return GetObject(aResObject);
1368 //=============================================================================
1372 //=============================================================================
1373 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject
1374 (GEOM::GEOM_Object_ptr theObject)
1376 //Set a not done flag
1377 GetOperations()->SetNotDone();
1378 GEOM::GEOM_Object_var aGEOMObject;
1380 if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
1382 aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
1384 //Get the object itself
1385 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
1386 if (anObject.IsNull()) return aGEOMObject._retn();
1388 //Perform the recomputation
1389 HANDLE_NAMESPACE(GEOM_Function) aLastFunction = anObject->GetLastFunction();
1390 if (aLastFunction.IsNull()) return aGEOMObject._retn();
1391 GetOperations()->GetSolver()->ComputeFunction(aLastFunction);
1393 return aGEOMObject._retn();
1396 //=============================================================================
1398 * MakeProjectionOnCylinder
1400 //=============================================================================
1401 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MakeProjectionOnCylinder
1402 (GEOM::GEOM_Object_ptr theObject,
1403 CORBA::Double theRadius,
1404 CORBA::Double theStartAngle,
1405 CORBA::Double theAngleLength,
1406 CORBA::Double theAngleRotation)
1408 GEOM::GEOM_Object_var aGEOMObject;
1410 //Set a not done flag
1411 GetOperations()->SetNotDone();
1414 HANDLE_NAMESPACE(GEOM_Object) anObject = GetObjectImpl(theObject);
1416 if (anObject.IsNull()) {
1417 return aGEOMObject._retn();
1420 //Perform the transformation
1421 HANDLE_NAMESPACE(GEOM_Object) aResObject = GetOperations()->MakeProjectionOnCylinder
1422 (anObject, theRadius, theStartAngle, theAngleLength, theAngleRotation);
1424 if (!GetOperations()->IsDone() || aResObject.IsNull()) {
1425 return aGEOMObject._retn();
1428 return GetObject(aResObject);