Salome HOME
Win32 compilation.
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IBasicOperations.cxx
index 140a887f67f9d346d7ce681a3cef078afad1318f..9d8799c6d314894cf6f0671a0ab0f467714d1f81 100644 (file)
@@ -1,28 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  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.
+// 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.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
 #include <Standard_Stream.hxx>
 
 #include <GEOMImpl_IBasicOperations.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include "utilities.h"
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
@@ -103,7 +105,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointXYZ
 
   //Compute the point value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -158,7 +160,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference
 
   //Compute the point value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -182,36 +184,81 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference
 
 //=============================================================================
 /*!
- *  MakePointOnCurve
+ *  makePointOnGeom
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
-                            (Handle(GEOM_Object) theCurve, double theParameter)
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
+                    (Handle(GEOM_Object) theGeomObj,
+                     double theParam1,
+                     double theParam2,
+                     double theParam3,
+                     const PointLocation theLocation,
+                    Handle(GEOM_Object) theRefPoint)
 {
   SetErrorCode(KO);
 
-  if (theCurve.IsNull()) return NULL;
+  if (theGeomObj.IsNull()) return NULL;
 
   //Add a new Point object
   Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
 
   //Add a new Point function for creation a point relativley another point
-  Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_CURVE_PAR);
+  int fType = POINT_CURVE_PAR;
+  switch( theLocation )
+    {
+    case PointOn_CurveByParam:   fType = POINT_CURVE_PAR; break;
+    case PointOn_CurveByLength:  fType = POINT_CURVE_LENGTH; break;                             
+    case PointOn_CurveByCoord:   fType = POINT_CURVE_COORD; break;
+    case PointOn_SurfaceByParam: fType = POINT_SURFACE_PAR; break;
+    case PointOn_SurfaceByCoord: fType = POINT_SURFACE_COORD; break;
+    default: break;
+    }
+  Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), fType);
 
   //Check if the function is set correctly
   if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
 
   GEOMImpl_IPoint aPI (aFunction);
 
-  Handle(GEOM_Function) aRefFunction = theCurve->GetLastFunction();
+  Handle(GEOM_Function) aRefFunction = theGeomObj->GetLastFunction();
   if (aRefFunction.IsNull()) return NULL;
 
-  aPI.SetCurve(aRefFunction);
-  aPI.SetParameter(theParameter);
-
+  switch( theLocation )
+    {
+    case PointOn_CurveByParam:
+      aPI.SetCurve(aRefFunction);
+      aPI.SetParameter(theParam1);
+      break;
+    case PointOn_CurveByLength:
+      aPI.SetCurve(aRefFunction);
+      aPI.SetLength(theParam1);
+      if (!theRefPoint.IsNull()) {
+        Handle(GEOM_Function) aRefPoint = theRefPoint->GetLastFunction();
+        aPI.SetRef(aRefPoint);
+      }
+      break;
+    case PointOn_CurveByCoord:
+      aPI.SetCurve(aRefFunction);
+      aPI.SetX(theParam1);
+      aPI.SetY(theParam2);
+      aPI.SetZ(theParam3);
+      break;
+    case PointOn_SurfaceByParam:
+      aPI.SetSurface(aRefFunction);
+      aPI.SetParameter(theParam1);
+      aPI.SetParameter2(theParam2);
+      break;
+    case PointOn_SurfaceByCoord:
+      aPI.SetSurface(aRefFunction);
+      aPI.SetX(theParam1);
+      aPI.SetY(theParam2);
+      aPI.SetZ(theParam3);
+    default: break;
+    }
+  
   //Compute the point value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -226,68 +273,100 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurve("
-                               << theCurve << ", " << theParameter << ")";
+  switch( theLocation )
+    {
+    case PointOn_CurveByParam:
+      GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurve("
+                                   << theGeomObj << ", " << theParam1 << ")";
+      break;
+    case PointOn_CurveByLength:
+      GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByLength("
+                                   << theGeomObj << ", " << theParam1 << ", " << theRefPoint <<  ")";
+      break;
+    case PointOn_CurveByCoord:
+  GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByCoord("
+                               << theGeomObj << ", " << theParam1 
+                               << ", " << theParam2 << ", " << theParam3 << ")";
+      break;
+    case PointOn_SurfaceByParam:
+  GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnSurface("
+                               << theGeomObj << ", " << theParam1 
+                               << ", " << theParam2 << ")";
+      break;
+    case PointOn_SurfaceByCoord:
+  GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnSurfaceByCoord("
+                               << theGeomObj << ", " << theParam1 
+                               << ", " << theParam2 << ", " << theParam3 << ")";
+    default: break;
+    }
 
   SetErrorCode(OK);
   return aPoint;
 }
 
-
 //=============================================================================
 /*!
- *  MakePointOnSurface
+ *  MakePointOnCurve
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnSurface
-   (Handle(GEOM_Object) theSurface, double theUParameter, double theVParameter)
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
+                            (Handle(GEOM_Object) theCurve, double theParameter)
 {
-  SetErrorCode(KO);
-
-  if (theSurface.IsNull()) return NULL;
-
-  //Add a new Point object
-  Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
-
-  //Add a new Point function for creation a point relativley another point
-  Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(),
-                                                        POINT_SURFACE_PAR);
-
-  //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
-
-  GEOMImpl_IPoint aPI (aFunction);
-
-  Handle(GEOM_Function) aRefFunction = theSurface->GetLastFunction();
-  if (aRefFunction.IsNull()) return NULL;
+  return makePointOnGeom(theCurve, theParameter, 0.0, 0.0, PointOn_CurveByParam);
+}
 
-  aPI.SetSurface(aRefFunction);
-  aPI.SetParameter(theUParameter);
-  aPI.SetParameter2(theVParameter);
+//=============================================================================
+/*!
+ *  MakePointOnCurveByCoord
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByCoord
+                    (Handle(GEOM_Object) theCurve,
+                     double theXParam,
+                     double theYParam,
+                     double theZParam)
+{
+  return makePointOnGeom(theCurve, theXParam, theYParam, theZParam, PointOn_CurveByCoord);
+}
 
-  //Compute the point value
-  try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
-    OCC_CATCH_SIGNALS;
-#endif
-    if (!GetSolver()->ComputeFunction(aFunction)) {
-      SetErrorCode("Point driver failed");
-      return NULL;
-    }
-  }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
-    return NULL;
-  }
+//=============================================================================
+/*!
+ *  MakePointOnCurveByLength 
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByLength
+                    (Handle(GEOM_Object) theCurve, 
+                    double              theLength, 
+                    Handle(GEOM_Object) theStartPoint)
+{
+  return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength, theStartPoint);
+}
 
-  //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnSurface("
-                               << theSurface << ", " << theUParameter 
-                               << ", " << theVParameter << ")";
+//=============================================================================
+/*!
+ *  MakePointOnSurface
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnSurface
+                    (Handle(GEOM_Object) theSurface,
+                     double theUParameter,
+                     double theVParameter)
+{
+  return makePointOnGeom(theSurface, theUParameter, theVParameter, 0., PointOn_SurfaceByParam);
+}
 
-  SetErrorCode(OK);
-  return aPoint;
+//=============================================================================
+/*!
+ *  MakePointOnSurfaceByCoord
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnSurfaceByCoord
+                    (Handle(GEOM_Object) theSurface,
+                     double theXParam,
+                     double theYParam,
+                     double theZParam)
+{
+  return makePointOnGeom(theSurface, theXParam, theYParam, theZParam, PointOn_SurfaceByCoord);
 }
 
 
@@ -323,7 +402,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnLinesIntersection
 
   //Compute the point value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -376,7 +455,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentOnCurve
 
   //Compute the vector value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -427,7 +506,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorDXDYDZ
 
   //Compute the Vector value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -482,7 +561,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorTwoPnt
 
   //Compute the Vector value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -538,7 +617,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLine
 
   //Compute the Line value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -593,7 +672,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoPnt
 
   //Compute the Line value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -648,7 +727,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoFaces
 
   //Compute the Line value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -707,7 +786,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneThreePnt
 
   //Compute the Plane value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -764,7 +843,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlanePntVec
 
   //Compute the Plane value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -818,7 +897,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneFace
 
   //Compute the Plane value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -875,7 +954,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlane2Vec
 
   //Compute the Plane value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -929,7 +1008,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneLCS
 
   //Compute the Plane value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -983,7 +1062,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker
 
   //Compute the marker value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -1007,6 +1086,115 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker
   return aMarker;
 }
 
+//=============================================================================
+/*!
+ *  MakeMarkerFromShape
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerFromShape
+                                  (const Handle(GEOM_Object)& theShape)
+{
+  SetErrorCode(KO);
+
+  //Add a new Marker object
+  Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+
+  //Add a new Marker function
+  Handle(GEOM_Function) aFunction =
+    aMarker->AddFunction(GEOMImpl_MarkerDriver::GetID(), MARKER_SHAPE);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_MarkerDriver::GetID()) return NULL;
+
+  GEOMImpl_IMarker aPI(aFunction);
+
+  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+  if (aRefShape.IsNull()) return NULL;
+
+  aPI.SetShape(aRefShape);
+
+  //Compute the marker value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Marker driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction) << aMarker << " = geompy.MakeMarkerFromShape(" << theShape << ")";
+
+  SetErrorCode(OK);
+  return aMarker;
+}
+
+//=============================================================================
+/*!
+ *  MakeMarkerPntTwoVec
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerPntTwoVec
+                                              (const Handle(GEOM_Object)& theOrigin,
+                                               const Handle(GEOM_Object)& theXVec,
+                                               const Handle(GEOM_Object)& theYVec)
+{
+  SetErrorCode(KO);
+
+  //Add a new Marker object
+  Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+
+  //Add a new Marker function
+  Handle(GEOM_Function) aFunction =
+    aMarker->AddFunction(GEOMImpl_MarkerDriver::GetID(), MARKER_PNT2VEC);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_MarkerDriver::GetID()) return NULL;
+
+  GEOMImpl_IMarker aPI(aFunction);
+
+  Handle(GEOM_Function) aRefOrigin = theOrigin->GetLastFunction();
+  Handle(GEOM_Function) aRefXVec = theXVec->GetLastFunction();
+  Handle(GEOM_Function) aRefYVec = theYVec->GetLastFunction();
+  if (aRefOrigin.IsNull() || aRefXVec.IsNull() || aRefYVec.IsNull()) return NULL;
+
+  aPI.SetOrigin(aRefOrigin);
+  aPI.SetXVec(aRefXVec);
+  aPI.SetYVec(aRefYVec);
+
+  //Compute the marker value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Marker driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction) << aMarker << " = geompy.MakeMarkerPntTwoVec("
+    << theOrigin << ", " << theXVec << ", " << theYVec << ")";
+
+  SetErrorCode(OK);
+  return aMarker;
+}
+
 //=============================================================================
 /*!
  *  MakeTangentPlaneOnFace
@@ -1014,9 +1202,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker
 //=============================================================================
 
 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Handle(GEOM_Object)& theFace,
-                                                                     double theParamU,
-                                                                     double theParamV,
-                                                                     double theSize)
+                                                                      double theParamU,
+                                                                      double theParamV,
+                                                                      double theSize)
 {
    SetErrorCode(KO);
 
@@ -1044,7 +1232,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Hand
 
   //Compute the Plane value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
@@ -1065,5 +1253,3 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Hand
   SetErrorCode(OK);
   return aPlane;
 }
-
-