Salome HOME
GPUSPHGUI: add an option to Offset Surface opreation
[modules/geom.git] / src / GEOM_I / GEOM_ITransformOperations_i.cc
index 59bc4a2932522f68fc5573985e9f0b8069d0f0a2..7d2993f2b724b107ce8d49f49b5fe8d93b9ef24b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -87,20 +87,23 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the first point of translation
-  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+  Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point of translation
-  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
+  Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
   GetOperations()->TranslateTwoPoints(anObject, aPoint1, aPoint2);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -120,19 +123,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the first point of translation
-  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+  Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point of translation
-  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
+  Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Create the translated shape
-  Handle(GEOM_Object) anObject =
+  Handle(::GEOM_Object) anObject =
     GetOperations()->TranslateTwoPointsCopy(aBasicObject, aPoint1, aPoint2);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -164,12 +167,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
   GetOperations()->TranslateDXDYDZ(anObject, theDX, theDY, theDZ);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -188,11 +194,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Create the translated shape
-  Handle(GEOM_Object) anObject =
+  Handle(::GEOM_Object) anObject =
     GetOperations()->TranslateDXDYDZCopy(aBasicObject, theDX, theDY, theDZ);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -224,16 +230,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
   GetOperations()->TranslateVector(anObject, aVector);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -252,15 +261,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
-  Handle(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector);
+  Handle(::GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -293,16 +302,16 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
     aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
   if (theCopy) {
-    Handle(GEOM_Object) anObject = GetOperations()->
+    Handle(::GEOM_Object) anObject = GetOperations()->
       TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
     if (!GetOperations()->IsDone() || anObject.IsNull())
       return aGEOMObject._retn();
@@ -311,6 +320,10 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
   }
 
   GetOperations()->TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
+
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -338,16 +351,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the axis of revolution
-  Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
+  Handle(::GEOM_Object) anAxis = GetObjectImpl(theAxis);
   if (anAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
   GetOperations()->Rotate(anObject, anAxis, theAngle);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -366,15 +382,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the axis of rotation
-  Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
+  Handle(::GEOM_Object) anAxis = GetObjectImpl(theAxis);
   if (anAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
-  Handle(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle);
+  Handle(::GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -404,16 +420,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
   }
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the plane
-  Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane);
+  Handle(::GEOM_Object) aPlane = GetObjectImpl(thePlane);
   if (aPlane.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
   GetOperations()->MirrorPlane(anObject, aPlane);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -432,15 +451,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane);
+  Handle(::GEOM_Object) aPlane = GetObjectImpl(thePlane);
   if (aPlane.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
-  Handle(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane);
+  Handle(::GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -470,16 +489,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
   }
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the axis
-  Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis);
+  Handle(::GEOM_Object) aAxis = GetObjectImpl(theAxis);
   if (aAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
   GetOperations()->MirrorAxis(anObject, aAxis);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -498,15 +520,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis);
+  Handle(::GEOM_Object) aAxis = GetObjectImpl(theAxis);
   if (aAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
-  Handle(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis);
+  Handle(::GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -536,16 +558,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
   }
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
-  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+  Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint);
   if (aPoint.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
   GetOperations()->MirrorPoint(anObject, aPoint);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -564,15 +589,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+  Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint);
   if (aPoint.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
-  Handle(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint);
+  Handle(::GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -584,9 +609,10 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
  *  OffsetShape
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
-                                             (GEOM::GEOM_Object_ptr theObject,
-                                              CORBA::Double theOffset)
+GEOM::GEOM_Object_ptr
+GEOM_ITransformOperations_i::OffsetShape (GEOM::GEOM_Object_ptr theObject,
+                                          CORBA::Double         theOffset,
+                                          CORBA::Boolean        theJoinByPipes)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
@@ -602,11 +628,14 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
   }
 
   //Get the basic object
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Create the offset shape
-  GetOperations()->OffsetShape(aBasicObject, theOffset);
+  GetOperations()->OffsetShape( aBasicObject, theOffset, theJoinByPipes );
+
+  // Update GUI.
+  UpdateGUIForObject(theObject);
 
   return aGEOMObject._retn();
 }
@@ -616,9 +645,10 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
  *  OffsetShapeCopy
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
-                                             (GEOM::GEOM_Object_ptr theObject,
-                                              CORBA::Double theOffset)
+GEOM::GEOM_Object_ptr
+GEOM_ITransformOperations_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject,
+                                              CORBA::Double         theOffset,
+                                              CORBA::Boolean        theJoinByPipes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -626,11 +656,12 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
   GetOperations()->SetNotDone();
 
   //Get the basic object
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Create the offset shape
-  Handle(GEOM_Object) anObject = GetOperations()->OffsetShapeCopy(aBasicObject, theOffset);
+  Handle(::GEOM_Object) anObject =
+    GetOperations()->OffsetShapeCopy(aBasicObject, theOffset, theJoinByPipes);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -652,18 +683,53 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ProjectShapeCopy
   GetOperations()->SetNotDone();
 
   //Get the input objects
-  Handle(GEOM_Object) aSource = GetObjectImpl(theSource);
-  Handle(GEOM_Object) aTarget = GetObjectImpl(theTarget);
+  Handle(::GEOM_Object) aSource = GetObjectImpl(theSource);
+  Handle(::GEOM_Object) aTarget = GetObjectImpl(theTarget);
   if (aSource.IsNull() || aTarget.IsNull()) return aGEOMObject._retn();
 
   //Create the projection
-  Handle(GEOM_Object) anObject = GetOperations()->ProjectShapeCopy(aSource, aTarget);
+  Handle(::GEOM_Object) anObject = GetOperations()->ProjectShapeCopy(aSource, aTarget);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  ProjectPointOnWire
+ */
+//=============================================================================
+CORBA::Double GEOM_ITransformOperations_i::ProjectPointOnWire
+                               (GEOM::GEOM_Object_ptr thePoint,
+                                GEOM::GEOM_Object_ptr theWire,
+                                GEOM::GEOM_Object_out thePointOnEdge,
+                                CORBA::Long&          theEdgeInWireIndex)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference shape
+  Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint);
+  Handle(::GEOM_Object) aWire = GetObjectImpl(theWire);
+
+  if (aPoint.IsNull() || aWire.IsNull()) {
+    return -1.0;
+  }
+
+  Handle(::GEOM_Object) aPointOnEdge;
+  Standard_Integer anEdgeIndex;
+  CORBA::Double aResult = GetOperations()->ProjectPointOnWire
+    (aPoint, aWire, aPointOnEdge, anEdgeIndex);
+
+  if (!aPointOnEdge.IsNull()) {
+    thePointOnEdge = GetObject(aPointOnEdge);
+    theEdgeInWireIndex = anEdgeIndex;
+  }
+
+  return aResult;
+}
+
 //=============================================================================
 /*!
  *  ScaleShape
@@ -688,11 +754,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
   }
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
-  Handle(GEOM_Object) aPoint;
+  Handle(::GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
     aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
@@ -701,6 +767,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
   //Perform the scale
   GetOperations()->ScaleShape(anObject, aPoint, theFactor);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return  aGEOMObject._retn();
 }
 
@@ -720,18 +789,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy
   GetOperations()->SetNotDone();
 
   //Get the basic object
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
-  Handle(GEOM_Object) aPoint;
+  Handle(::GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
     aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
   }
 
   //Perform the scale
-  Handle(GEOM_Object) anObject =
+  Handle(::GEOM_Object) anObject =
     GetOperations()->ScaleShapeCopy(aBasicObject, aPoint, theFactor);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -765,11 +834,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
   }
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
-  Handle(GEOM_Object) aPoint;
+  Handle(::GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
     aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
@@ -779,6 +848,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
   GetOperations()->ScaleShapeAlongAxes
     (anObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/false);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return  aGEOMObject._retn();
 }
 
@@ -800,18 +872,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy
   GetOperations()->SetNotDone();
 
   //Get the basic object
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
-  Handle(GEOM_Object) aPoint;
+  Handle(::GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
     aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
   }
 
   //Perform the scale
-  Handle(GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes
+  Handle(::GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes
     (aBasicObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/true);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -844,23 +916,26 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
   }
 
   //Get the basic object
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the Start LCS (may be NULL for positioning from global LCS)
-  Handle(GEOM_Object) aStartLCS;
+  Handle(::GEOM_Object) aStartLCS;
   if (!CORBA::is_nil(theStartLCS)) {
     aStartLCS = GetObjectImpl(theStartLCS);
     if (aStartLCS.IsNull()) return aGEOMObject._retn();
   }
 
   //Get the End LCS
-  Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
+  Handle(::GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
   if (aEndLCS.IsNull()) return aGEOMObject._retn();
 
   //Perform the Position
   GetOperations()->PositionShape(anObject, aStartLCS, aEndLCS);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return  aGEOMObject._retn();
 }
 
@@ -880,22 +955,22 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
   GetOperations()->SetNotDone();
 
   //Get the basic object
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the Start LCS (may be NULL for positioning from global LCS)
-  Handle(GEOM_Object) aStartLCS;
+  Handle(::GEOM_Object) aStartLCS;
   if (!CORBA::is_nil(theStartLCS)) {
     aStartLCS = GetObjectImpl(theStartLCS);
     if (aStartLCS.IsNull()) return aGEOMObject._retn();
   }
 
   //Get the End LCS
-  Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
+  Handle(::GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
   if (aEndLCS.IsNull()) return aGEOMObject._retn();
 
   //Perform the position
-  Handle(GEOM_Object) anObject =
+  Handle(::GEOM_Object) anObject =
     GetOperations()->PositionShapeCopy(aBasicObject, aStartLCS, aEndLCS);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -921,19 +996,24 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
   GetOperations()->SetNotDone();
 
   //Get the basic object
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the path object
-  Handle(GEOM_Object) aPathObject = GetObjectImpl(thePath);
+  Handle(::GEOM_Object) aPathObject = GetObjectImpl(thePath);
   if (aPathObject.IsNull()) return aGEOMObject._retn();
 
   //Perform the position
-  Handle(GEOM_Object) anObject =
+  Handle(::GEOM_Object) anObject =
     GetOperations()->PositionAlongPath(aBasicObject, aPathObject, theDistance, theCopy, theReverse);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
+  if (!theCopy) {
+    // Update GUI.
+    UpdateGUIForObject(theObject);
+  }
+
   return GetObject(anObject);
 }
 
@@ -953,15 +1033,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
-  if (aVector.IsNull()) return aGEOMObject._retn();
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
+  //if (aVector.IsNull()) return aGEOMObject._retn(); // DX by default
 
   //Perform the translation
-  Handle(GEOM_Object) anObject =
+  Handle(::GEOM_Object) anObject =
     GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes);
   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
 
@@ -987,19 +1067,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector1 of translation
-  Handle(GEOM_Object) aVector1 = GetObjectImpl(theVector1);
-  if (aVector1.IsNull()) return aGEOMObject._retn();
+  Handle(::GEOM_Object) aVector1 = GetObjectImpl(theVector1);
+  //if (aVector1.IsNull()) return aGEOMObject._retn(); // DX by default
 
   //Get the vector2 of translation
-  Handle(GEOM_Object) aVector2 = GetObjectImpl(theVector2);
-  if (aVector2.IsNull()) return aGEOMObject._retn();
+  Handle(::GEOM_Object) aVector2 = GetObjectImpl(theVector2);
+  //if (aVector2.IsNull()) return aGEOMObject._retn(); // DY by default
 
   //Perform the translation
-  Handle(GEOM_Object) anObject = GetOperations()->Translate2D
+  Handle(::GEOM_Object) anObject = GetOperations()->Translate2D
     (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2);
   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
 
@@ -1021,15 +1101,110 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Obj
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the a directon of rotation
-  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
-  if (aVector.IsNull()) return aGEOMObject._retn();
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
+  //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
 
   //Perform the rotation
-  Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
+  Handle(::GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
+  if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ *  MultiRotate1DByStep
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1DByStep (GEOM::GEOM_Object_ptr theObject,
+                                                                        GEOM::GEOM_Object_ptr theVector,
+                                                                        CORBA::Double theAngleStep,
+                                                                        CORBA::Long theNbSteps)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Get the object itself
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  if (aBasicObject.IsNull()) return aGEOMObject._retn();
+
+  //Get the a directon of rotation
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
+  //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
+
+  //Perform the rotation
+  Handle(::GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theAngleStep, theNbSteps);
+  if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ *  MultiRotate2DNbTimes
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DNbTimes (GEOM::GEOM_Object_ptr theObject,
+                                                                         GEOM::GEOM_Object_ptr theVector,
+                                                                         CORBA::Long theNbObjects,
+                                                                         CORBA::Double theRadialStep,
+                                                                         CORBA::Long theNbSteps)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Get the object itself
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  if (aBasicObject.IsNull()) return aGEOMObject._retn();
+
+  //Get the a directon of rotation
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
+  //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
+
+  //Perform the rotation
+  Handle(::GEOM_Object) anObject = GetOperations()->Rotate2D
+    (aBasicObject, aVector, theNbObjects, theRadialStep, theNbSteps);
+  if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ *  MultiRotate2DByStep
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DByStep (GEOM::GEOM_Object_ptr theObject,
+                                                                        GEOM::GEOM_Object_ptr theVector,
+                                                                        CORBA::Double theAngle,
+                                                                        CORBA::Long theNbTimes1,
+                                                                        CORBA::Double theStep,
+                                                                        CORBA::Long theNbTimes2)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Get the object itself
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  if (aBasicObject.IsNull()) return aGEOMObject._retn();
+
+  //Get the a directon of rotation
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
+  //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
+
+  //Perform the rotation
+  Handle(::GEOM_Object) anObject = GetOperations()->Rotate2D
+    (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
 
   return GetObject(anObject);
@@ -1053,16 +1228,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Obj
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the a directon of rotation
-  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
-  if (aVector.IsNull()) return aGEOMObject._retn();
+  Handle(::GEOM_Object) aVector = GetObjectImpl(theVector);
+  //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default
+
+  double anAngle = M_PI * theAngle / 180.;
 
   //Perform the rotation
-  Handle(GEOM_Object) anObject = GetOperations()->Rotate2D
-    (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
+  Handle(::GEOM_Object) anObject = GetOperations()->Rotate2D
+    (aBasicObject, aVector, anAngle, theNbTimes1, theStep, theNbTimes2);
   if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
 
   return GetObject(anObject);
@@ -1095,24 +1272,27 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the central point of rotation
-  Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
+  Handle(::GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
   if (aCentPoint.IsNull()) return aGEOMObject._retn();
 
   //Get the first point
-  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+  Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point
-  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
+  Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
   GetOperations()->RotateThreePoints(anObject, aCentPoint, aPoint1, aPoint2);
 
+  // Update GUI.
+  UpdateGUIForObject(theObject);
+
   return aGEOMObject._retn();
 }
 
@@ -1133,23 +1313,23 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the central point of rotation
-  Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
+  Handle(::GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
   if (aCentPoint.IsNull()) return aGEOMObject._retn();
 
   //Get the first point
-  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+  Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point
-  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
+  Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
-  Handle(GEOM_Object) anObject =
+  Handle(::GEOM_Object) anObject =
     GetOperations()->RotateThreePointsCopy(aBasicObject, aCentPoint, aPoint1, aPoint2);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -1172,15 +1352,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TransformLikeOtherCopy
   GetOperations()->SetNotDone();
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the sample object
-  Handle(GEOM_Object) aSample = GetObjectImpl(theSample);
+  Handle(::GEOM_Object) aSample = GetObjectImpl(theSample);
   if (aSample.IsNull()) return aGEOMObject._retn();
 
   //Perform the transformation
-  Handle(GEOM_Object) aResObject =
+  Handle(::GEOM_Object) aResObject =
     GetOperations()->TransformLikeOtherCopy(anObject, aSample);
   if (!GetOperations()->IsDone() || aResObject.IsNull())
     return aGEOMObject._retn();
@@ -1205,13 +1385,48 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Perform the recomputation
-  Handle(GEOM_Function) aLastFunction = anObject->GetLastFunction();
+  Handle(::GEOM_Function) aLastFunction = anObject->GetLastFunction();
   if (aLastFunction.IsNull()) return aGEOMObject._retn();
   GetOperations()->GetSolver()->ComputeFunction(aLastFunction);
 
   return aGEOMObject._retn();
 }
+
+//=============================================================================
+/*!
+ *  MakeProjectionOnCylinder
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MakeProjectionOnCylinder
+                                   (GEOM::GEOM_Object_ptr theObject,
+                                    CORBA::Double         theRadius,
+                                    CORBA::Double         theStartAngle,
+                                    CORBA::Double         theAngleLength,
+                                    CORBA::Double         theAngleRotation)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the object
+  Handle(::GEOM_Object) anObject = GetObjectImpl(theObject);
+
+  if (anObject.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  //Perform the transformation
+  Handle(::GEOM_Object) aResObject = GetOperations()->MakeProjectionOnCylinder
+    (anObject, theRadius, theStartAngle, theAngleLength, theAngleRotation);
+
+  if (!GetOperations()->IsDone() || aResObject.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  return GetObject(aResObject);
+}