Salome HOME
GPUSPHGUI: add an option to Offset Surface opreation
[modules/geom.git] / src / GEOMImpl / GEOMImpl_ITransformOperations.cxx
index 07098c561bc9c9fa4c82428afa96af026b50f66e..2e3f57ba21d3d0205ac5cbf2e31b7012daa739c5 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
@@ -34,6 +34,8 @@
 
 #include <GEOMImpl_ITranslate.hxx>
 #include <GEOMImpl_IMirror.hxx>
+#include <GEOMImpl_IProjection.hxx>
+#include <GEOMImpl_IProjOnCyl.hxx>
 #include <GEOMImpl_IOffset.hxx>
 #include <GEOMImpl_IScale.hxx>
 #include <GEOMImpl_IRotate.hxx>
 #include <GEOM_Function.hxx>
 #include <GEOM_PythonDump.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-
 #include "utilities.h"
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
 
 #include <TFunction_DriverTable.hxx>
 #include <TFunction_Driver.hxx>
-#include <TFunction_Logbook.hxx>
 #include <TDF_Tool.hxx>
 
 #include <BRep_Tool.hxx>
@@ -128,22 +127,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPoints
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateTwoPoints("
+  GEOM::TPythonDump(aFunction) << "geompy.TranslateTwoPoints("
     << theObject << ", " << thePoint1 << ", " << thePoint2 << ")";
 
   SetErrorCode(OK);
@@ -181,17 +177,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZ
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -220,7 +213,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPointsCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -237,17 +230,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPointsCopy
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -275,7 +265,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -292,17 +282,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZCopy
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -347,22 +334,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVector
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateVector("
+  GEOM::TPythonDump(aFunction) << "geompy.TranslateVector("
                                << theObject << ", " << theVector << ")";
 
   SetErrorCode(OK);
@@ -384,7 +368,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -400,17 +384,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorCopy
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -461,17 +442,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorDistance
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -500,7 +478,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate1D
 {
   SetErrorCode(KO);
 
-  if (theObject.IsNull() || theVector.IsNull()) return NULL;
+  if (theObject.IsNull()) return NULL;
 
   Handle(GEOM_Function) aLastFunction = theObject->GetLastFunction();
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
@@ -515,25 +493,23 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate1D
   //Check if the function is set correctly
   if (aFunction->GetDriverGUID() != GEOMImpl_TranslateDriver::GetID()) return NULL;
 
-  GEOMImpl_ITranslate aTI(aFunction);
-  aTI.SetVector(theVector->GetLastFunction());
+  GEOMImpl_ITranslate aTI (aFunction);
   aTI.SetOriginal(aLastFunction);
+  if (!theVector.IsNull())
+    aTI.SetVector(theVector->GetLastFunction());
   aTI.SetStep1(theStep);
   aTI.SetNbIter1(theNbTimes);
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -560,7 +536,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate2D (Handle(GEOM_Obje
 {
   SetErrorCode(KO);
 
-  if (theObject.IsNull() || theVector.IsNull() || theVector2.IsNull()) return NULL;
+  if (theObject.IsNull()) return NULL;
 
   Handle(GEOM_Function) aLastFunction = theObject->GetLastFunction();
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
@@ -576,27 +552,26 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate2D (Handle(GEOM_Obje
   if (aFunction->GetDriverGUID() != GEOMImpl_TranslateDriver::GetID()) return NULL;
 
   GEOMImpl_ITranslate aTI (aFunction);
-  aTI.SetVector(theVector->GetLastFunction());
-  aTI.SetVector2(theVector2->GetLastFunction());
   aTI.SetOriginal(aLastFunction);
+  if (!theVector.IsNull())
+    aTI.SetVector(theVector->GetLastFunction());
   aTI.SetStep1(theStep1);
   aTI.SetNbIter1(theNbTimes1);
+  if (!theVector2.IsNull())
+    aTI.SetVector2(theVector2->GetLastFunction());
   aTI.SetStep2(theStep2);
   aTI.SetNbIter2(theNbTimes2);
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Translation driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -784,22 +759,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlane
 
   //Compute the mirror
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Mirror driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.MirrorPlane("
+  GEOM::TPythonDump(aFunction) << "geompy.MirrorByPlane("
                                << theObject << ", " << thePlane << ")";
 
   SetErrorCode(OK);
@@ -822,7 +794,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlaneCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -837,17 +809,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlaneCopy
 
   //Compute the mirror
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Mirror driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -891,22 +860,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPoint
 
   //Compute the mirror
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Mirror driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.MirrorPoint("
+  GEOM::TPythonDump(aFunction) << "geompy.MirrorByPoint("
                                << theObject << ", " << thePoint << ")";
 
   SetErrorCode(OK);
@@ -929,7 +895,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPointCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -944,17 +910,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPointCopy
 
   //Compute the mirror
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Mirror driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -998,22 +961,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxis
 
   //Compute the mirror
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Mirror driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.MirrorAxis("
+  GEOM::TPythonDump(aFunction) << "geompy.MirrorByAxis("
                                << theObject << ", " << theAxis << ")";
 
   SetErrorCode(OK);
@@ -1036,7 +996,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -1051,17 +1011,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy
 
   //Compute the mirror
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Mirror driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1079,8 +1036,10 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy
  *  OffsetShape
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShape
-                              (Handle(GEOM_Object) theObject, double theOffset)
+Handle(GEOM_Object)
+GEOMImpl_ITransformOperations::OffsetShape (Handle(GEOM_Object) theObject,
+                                            double              theOffset,
+                                            bool                theJoinByPipes)
 {
   SetErrorCode(KO);
 
@@ -1098,27 +1057,25 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShape
   if (aFunction->GetDriverGUID() != GEOMImpl_OffsetDriver::GetID()) return NULL;
 
   GEOMImpl_IOffset aTI (aFunction);
-  aTI.SetShape(anOriginal);
-  aTI.SetValue(theOffset);
+  aTI.SetShape( anOriginal );
+  aTI.SetValue( theOffset );
+  aTI.SetJoinByPipes( theJoinByPipes );
 
   //Compute the offset
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Offset driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.OffsetShape("
+  GEOM::TPythonDump(aFunction) << "geompy.Offset("
                                << theObject << ", " << theOffset << ")";
 
   SetErrorCode(OK);
@@ -1130,8 +1087,10 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShape
  *  OffsetShapeCopy
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
-                              (Handle(GEOM_Object) theObject, double theOffset)
+Handle(GEOM_Object)
+GEOMImpl_ITransformOperations::OffsetShapeCopy( Handle(GEOM_Object) theObject,
+                                                double              theOffset,
+                                                bool                theJoinByPipes)
 {
   SetErrorCode(KO);
 
@@ -1141,7 +1100,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a new Offset function
   Handle(GEOM_Function) aFunction =
@@ -1152,22 +1111,20 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
   if (aFunction->GetDriverGUID() != GEOMImpl_OffsetDriver::GetID()) return NULL;
 
   GEOMImpl_IOffset aTI (aFunction);
-  aTI.SetShape(anOriginal);
-  aTI.SetValue(theOffset);
+  aTI.SetShape( anOriginal );
+  aTI.SetValue( theOffset );
+  aTI.SetJoinByPipes( theJoinByPipes );
 
   //Compute the offset
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Offset driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1185,8 +1142,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
  *  ProjectShapeCopy
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_ITransformOperations::ProjectShapeCopy
-       (Handle(GEOM_Object) theSource, Handle(GEOM_Object) theTarget)
+Handle(GEOM_Object)
+GEOMImpl_ITransformOperations::ProjectShapeCopy (Handle(GEOM_Object) theSource,
+                                                 Handle(GEOM_Object) theTarget)
 {
   SetErrorCode(KO);
 
@@ -1195,44 +1153,128 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ProjectShapeCopy
   Handle(GEOM_Function) aLastFunction = theSource->GetLastFunction();
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be projected
 
+  Handle(GEOM_Object) aCopy;
+
+  TopoDS_Shape aTarget = theTarget->GetValue();
+  if ( aTarget.IsNull() ) return NULL;
+  if ( aTarget.ShapeType() == TopAbs_EDGE ||
+       aTarget.ShapeType() == TopAbs_WIRE )
+  {
+    // a TPythonDump prevents dumping ProjectPointOnWire(),
+    // dump of MakeProjection() is done at the end of this function
+    GEOM::TPythonDump preventDump(aLastFunction, /*append=*/true);
+    Standard_Integer dummy;
+    ProjectPointOnWire( theSource, theTarget, aCopy, dummy );
+    if ( aCopy.IsNull() || !IsDone() )
+      return NULL;
+  }
+  else
+  {
+    //Add a new Projection object
+    aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+
+    //Add a Projection function
+    Handle(GEOM_Function) aFunction =
+      aCopy->AddFunction(GEOMImpl_ProjectionDriver::GetID(), PROJECTION_COPY);
+
+    //Check if the function is set correctly
+    if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) return NULL;
+
+    GEOMImpl_IMirror aTI (aFunction);
+    aTI.SetPlane(theTarget->GetLastFunction());
+    aTI.SetOriginal(aLastFunction);
+
+    //Compute the Projection
+    try {
+      OCC_CATCH_SIGNALS;
+      if (!GetSolver()->ComputeFunction(aFunction)) {
+        SetErrorCode("Projection driver failed");
+        return NULL;
+      }
+    }
+    catch (Standard_Failure& aFail) {
+      SetErrorCode(aFail.GetMessageString());
+      return NULL;
+    }
+  }
+
+  //Make a Python command
+  Handle(GEOM_Function) aFunction = aCopy->GetLastFunction();
+  GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeProjection("
+                               << theSource << ", " << theTarget << ")";
+
+  SetErrorCode(OK);
+  return aCopy;
+}
+
+//=============================================================================
+/*!
+ *  ProjectPointOnWire
+ */
+//=============================================================================
+Standard_Real GEOMImpl_ITransformOperations::ProjectPointOnWire
+                                    (Handle(GEOM_Object) thePoint,
+                                     Handle(GEOM_Object) theWire,
+                                     Handle(GEOM_Object) &thePointOnEdge,
+                                     Standard_Integer    &theEdgeInWireIndex)
+{
+  Standard_Real aResult = -1.;
+
+  SetErrorCode(KO);
+
+  if (thePoint.IsNull() || theWire.IsNull()) {
+    return aResult;
+  }
+
+  Handle(GEOM_Function) aLastFunction = thePoint->GetLastFunction();
+
+  if (aLastFunction.IsNull()) {
+    //There is no function which creates an object to be projected
+    return aResult;
+  }
+
   //Add a new Projection object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+  thePointOnEdge = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
 
   //Add a Projection function
-  Handle(GEOM_Function) aFunction =
-    aCopy->AddFunction(GEOMImpl_ProjectionDriver::GetID(), PROJECTION_COPY);
+  Handle(GEOM_Function) aFunction = thePointOnEdge->AddFunction
+    (GEOMImpl_ProjectionDriver::GetID(), PROJECTION_ON_WIRE);
 
   //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) return NULL;
+  if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) {
+    return aResult;
+  }
 
-  GEOMImpl_IMirror aTI (aFunction);
-  aTI.SetPlane(theTarget->GetLastFunction());
-  aTI.SetOriginal(aLastFunction);
+  GEOMImpl_IProjection aProj (aFunction);
+  aProj.SetPoint(aLastFunction);
+  aProj.SetShape(theWire->GetLastFunction());
 
   //Compute the Projection
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Projection driver failed");
-      return NULL;
+      return aResult;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
-    return NULL;
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
+    return aResult;
   }
 
+  aResult            = aProj.GetU();
+  theEdgeInWireIndex = aProj.GetIndex();
+
+
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeProjection("
-                               << theSource << ", " << theTarget << ")";
+  GEOM::TPythonDump(aFunction) << "(u, " << thePointOnEdge
+    << ", EdgeInWireIndex) = geompy.MakeProjectionOnWire(" << thePoint
+    << ", " << theWire << ")";
 
   SetErrorCode(OK);
-  return aCopy;
-}
 
+  return aResult;
+}
 
 //=============================================================================
 /*!
@@ -1270,22 +1312,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShape
 
   //Compute the scale
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Scale driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.ScaleShape("
+  GEOM::TPythonDump(aFunction) << "geompy.Scale("
     << theObject << ", " << thePoint << ", " << theFactor << ")";
 
   SetErrorCode(OK);
@@ -1308,7 +1347,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a scale function
   Handle(GEOM_Function) aFunction =
@@ -1331,17 +1370,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeCopy
 
   //Compute the scale
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Scale driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1402,17 +1438,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeAlongAxes (Handle(G
 
   //Compute the scale
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Scale driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1426,7 +1459,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeAlongAxes (Handle(G
     return aCopy;
   }
 
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.ScaleShapeAlongAxes("
+  GEOM::TPythonDump(aFunction) << "geompy.ScaleAlongAxes("
                                << theObject << ", " << thePoint << ", "
                                << theFactorX << ", " << theFactorY << ", " << theFactorZ << ")";
   return theObject;
@@ -1467,22 +1500,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShape
 
   //Compute the Position
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Position driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.PositionShape("
+  GEOM::TPythonDump(aFunction) << "geompy.Position("
     << theObject << ", " << theStartLCS << ", " << theEndLCS << ")";
 
   SetErrorCode(OK);
@@ -1505,7 +1535,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a position function
   Standard_Integer aType = POSITION_SHAPE_COPY;
@@ -1526,17 +1556,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy
 
   //Compute the position
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Position driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1588,29 +1615,26 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionAlongPath
 
   //Compute the position
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Position driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
   if (theCopy) {
-    GEOM::TPythonDump(aFunction) << aCopy << " = geompy.PositionAlongPath("
+    GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakePositionAlongPath("
                                  << theObject << ", " << thePath << ", " << theDistance << ", " << theCopy << ", " << theReverse << ")";
     SetErrorCode(OK);
     return aCopy;
   }
 
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.PositionAlongPath("
+  GEOM::TPythonDump(aFunction) << "geompy.PositionAlongPath("
     << theObject << ", " << thePath << ", " << theDistance << ", " << theCopy << ", " << theReverse << ")";
 
   SetErrorCode(OK);
@@ -1651,17 +1675,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate (Handle(GEOM_Object) t
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Rotate driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1675,10 +1696,12 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate (Handle(GEOM_Object) t
 
 //=============================================================================
 /*!
- *  Rotate
+ *  RotateCopy
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Object) theObject, Handle(GEOM_Object) theAxis, double theAngle)
+Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Object) theObject,
+                                                               Handle(GEOM_Object) theAxis,
+                                                               double theAngle)
 {
   SetErrorCode(KO);
 
@@ -1688,7 +1711,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec
   if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a rotate function
   aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY);
@@ -1704,17 +1727,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Rotate driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1728,7 +1748,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec
 
 //=============================================================================
 /*!
- *  Rotate1D
+ *  Rotate1D (for MultiRotate1DNbTimes)
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object) theObject,
@@ -1737,7 +1757,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object)
 {
   SetErrorCode(KO);
 
-  if (theObject.IsNull() || theAxis.IsNull()) return NULL;
+  if (theObject.IsNull()) return NULL;
 
   Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
   if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
@@ -1754,27 +1774,25 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object)
 
   GEOMImpl_IRotate aRI(aFunction);
   aRI.SetOriginal(aLastFunction);
-  aRI.SetAxis(theAxis->GetLastFunction());
+  if (!theAxis.IsNull())
+    aRI.SetAxis(theAxis->GetLastFunction());
   aRI.SetNbIter1(theNbTimes);
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Rotate driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MultiRotate1D("
+  GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MultiRotate1DNbTimes("
     << theObject << ", " << theAxis << ", " << theNbTimes << ")";
 
   SetErrorCode(OK);
@@ -1783,22 +1801,142 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object)
 
 //=============================================================================
 /*!
- *  Rotate2D
+ *  Rotate1D (for MultiRotate1DByStep)
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object) theObject,
+                                                             Handle(GEOM_Object) theAxis,
+                                                             double theAngleStep,
+                                                             Standard_Integer theNbSteps)
+{
+  SetErrorCode(KO);
+
+  if (theObject.IsNull()) return NULL;
+
+  Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
+  if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
+
+  //Add a new Copy object
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+
+  //Add a rotate function
+  aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D_STEP);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_RotateDriver::GetID()) return NULL;
+
+  //Convert angle into degrees
+  double anAngleStep = theAngleStep * 180. / M_PI;
+
+  GEOMImpl_IRotate aRI (aFunction);
+  aRI.SetOriginal(aLastFunction);
+  if (!theAxis.IsNull())
+    aRI.SetAxis(theAxis->GetLastFunction());
+  aRI.SetAngle(anAngleStep);
+  aRI.SetNbIter1(theNbSteps);
+
+  //Compute the translation
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Rotate driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction)
+    << aCopy << " = geompy.MultiRotate1DByStep(" << theObject << ", "
+    << theAxis << ", " << anAngleStep << "*math.pi/180.0, " << theNbSteps << ")";
+
+  SetErrorCode(OK);
+  return aCopy;
+}
+
+//=============================================================================
+/*!
+ *  Rotate2D (for MultiRotate2DNbTimes)
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) theObject,
+                                                             Handle(GEOM_Object) theAxis,
+                                                             Standard_Integer theNbObjects,
+                                                             double theRadialStep,
+                                                             Standard_Integer theNbSteps)
+{
+  SetErrorCode(KO);
+
+  if (theObject.IsNull()) return NULL;
+
+  Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
+  if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
+
+  //Add a new Copy object
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+
+  //Add a rotate function
+  aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_RotateDriver::GetID()) return NULL;
+
+  double anAngle = 360. / (double)theNbObjects;
+
+  GEOMImpl_IRotate aRI (aFunction);
+  aRI.SetOriginal(aLastFunction);
+  if (!theAxis.IsNull())
+    aRI.SetAxis(theAxis->GetLastFunction());
+  aRI.SetAngle(anAngle);
+  aRI.SetNbIter1(theNbObjects);
+  aRI.SetStep(theRadialStep);
+  aRI.SetNbIter2(theNbSteps);
+
+  //Compute the translation
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Rotate driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MultiRotate2DNbTimes("
+                               << theObject << ", " << theAxis << ", " << theNbObjects
+                               << ", " << theRadialStep << ", " << theNbSteps << ")";
+
+  SetErrorCode(OK);
+  return aCopy;
+}
+
+//=============================================================================
+/*!
+ *  Rotate2D (for MultiRotate2DByStep)
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) theObject,
                                                              Handle(GEOM_Object) theAxis,
-                                                             double theAngle,
+                                                             double theAngleStep,
                                                              Standard_Integer theNbTimes1,
                                                              double theStep,
                                                              Standard_Integer theNbTimes2)
 {
   SetErrorCode(KO);
 
-  if (theObject.IsNull() || theAxis.IsNull()) return NULL;
+  if (theObject.IsNull()) return NULL;
 
   Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
-  if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
+  if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
 
   //Add a new Copy object
   Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
@@ -1807,37 +1945,39 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object)
   aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
   if (aFunction.IsNull()) return NULL;
 
-    //Check if the function is set correctly
+  //Check if the function is set correctly
   if (aFunction->GetDriverGUID() != GEOMImpl_RotateDriver::GetID()) return NULL;
 
-  GEOMImpl_IRotate aRI(aFunction);
-  aRI.SetAxis(theAxis->GetLastFunction());
+  //Convert angle into degrees
+  double anAngleStep = theAngleStep * 180. / M_PI;
+
+  GEOMImpl_IRotate aRI (aFunction);
   aRI.SetOriginal(aLastFunction);
+  if (!theAxis.IsNull())
+    aRI.SetAxis(theAxis->GetLastFunction());
+  aRI.SetAngle(anAngleStep);
   aRI.SetNbIter1(theNbTimes1);
-  aRI.SetNbIter2(theNbTimes2);
-  aRI.SetAngle(theAngle);
   aRI.SetStep(theStep);
+  aRI.SetNbIter2(theNbTimes2);
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Rotate driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MultiRotate2D("
-    << theObject << ", " << theAxis << ", " << theAngle << ", "
-      << theNbTimes1 << ", " << theStep << ", " << theNbTimes2 << ")";
+  GEOM::TPythonDump(aFunction)
+    << aCopy << " = geompy.MultiRotate2DByStep(" << theObject << ", "
+    << theAxis << ", " << anAngleStep << "*math.pi/180.0, "
+    << theNbTimes1 << ", " << theStep << ", " << theNbTimes2 << ")";
 
   SetErrorCode(OK);
   return aCopy;
@@ -1858,7 +1998,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePoints (Handle(GEO
   if (theObject.IsNull() || theCentPoint.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
 
   Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
-  if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
+  if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
 
   // Get last functions of the arguments
   Handle(GEOM_Function) aCPF = theCentPoint->GetLastFunction();
@@ -1882,22 +2022,19 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePoints (Handle(GEO
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Rotate driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.RotateThreePoints(" << theObject
+  GEOM::TPythonDump(aFunction) << "geompy.RotateThreePoints(" << theObject
                                << ", " << theCentPoint << ", "<<thePoint1 << ", " << thePoint2 << ")";
 
   SetErrorCode(OK);
@@ -1922,7 +2059,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle
   if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a rotate function
   aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY);
@@ -1939,17 +2076,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle
 
   //Compute the translation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Rotate driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -1981,7 +2115,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy
   if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object
 
   // Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   // Add a transform function (depends on theSample function)
   Handle(GEOM_Function) aFunction =
@@ -2085,17 +2219,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy
 
   // Compute the transformation
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Driver failed");
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
     return NULL;
   }
 
@@ -2106,3 +2237,73 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy
   SetErrorCode(OK);
   return aCopy;
 }
+
+//=============================================================================
+/*!
+ *  MakeProjectionOnCylinder
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder
+                             (const Handle(GEOM_Object) &theObject,
+                              const Standard_Real        theRadius,
+                              const Standard_Real        theStartAngle,
+                              const Standard_Real        theAngleLength,
+                              const Standard_Real        theAngleRotation)
+{
+  SetErrorCode(KO);
+
+  if (theObject.IsNull()) {
+    return NULL;
+  }
+
+  Handle(GEOM_Function) aLastFunction = theObject->GetLastFunction();
+
+  if (aLastFunction.IsNull()) {
+    //There is no function which creates an object to be projected
+    return NULL;
+  }
+
+  //Add a new Projection object
+  Handle(GEOM_Object) aResult =
+    GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+
+  //Add a Projection function
+  Handle(GEOM_Function) aFunction = aResult->AddFunction
+    (GEOMImpl_ProjectionDriver::GetID(), PROJECTION_ON_CYLINDER);
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) {
+    return aResult;
+  }
+
+  GEOMImpl_IProjOnCyl aProj (aFunction);
+
+  aProj.SetShape(aLastFunction);
+  aProj.SetRadius(theRadius);
+  aProj.SetStartAngle(theStartAngle);
+  aProj.SetAngleLength(theAngleLength);
+  aProj.SetAngleRotation(theAngleRotation);
+
+  //Compute the Projection
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Projection driver failed");
+      return aResult;
+    }
+  }
+  catch (Standard_Failure& aFail) {
+    SetErrorCode(aFail.GetMessageString());
+    return aResult;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction)
+    << aResult << " = geompy.MakeProjectionOnCylinder("
+    << theObject << ", " << theRadius << ", " << theStartAngle
+    << ", " << theAngleLength << ", " << theAngleRotation << ")";
+
+  SetErrorCode(OK);
+
+  return aResult;
+}