Back to index

salome-geom  6.5.0
GEOMImpl_IBasicOperations.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include <Standard_Stream.hxx>
00024 
00025 #include <GEOMImpl_IBasicOperations.hxx>
00026 
00027 #include <Basics_OCCTVersion.hxx>
00028 
00029 #include "utilities.h"
00030 #include <OpUtil.hxx>
00031 #include <Utils_ExceptHandlers.hxx>
00032 
00033 #include <TFunction_DriverTable.hxx>
00034 #include <TFunction_Driver.hxx>
00035 #include <TFunction_Logbook.hxx>
00036 #include <TDF_Tool.hxx>
00037 
00038 #include <GEOM_Function.hxx>
00039 #include <GEOM_PythonDump.hxx>
00040 
00041 #include <GEOMImpl_PointDriver.hxx>
00042 #include <GEOMImpl_VectorDriver.hxx>
00043 #include <GEOMImpl_LineDriver.hxx>
00044 #include <GEOMImpl_PlaneDriver.hxx>
00045 #include <GEOMImpl_MarkerDriver.hxx>
00046 
00047 #include <GEOMImpl_IPoint.hxx>
00048 #include <GEOMImpl_IVector.hxx>
00049 #include <GEOMImpl_ILine.hxx>
00050 #include <GEOMImpl_IPlane.hxx>
00051 #include <GEOMImpl_IMarker.hxx>
00052 
00053 #include <GEOMImpl_Types.hxx>
00054 
00055 #include <Standard_Failure.hxx>
00056 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
00057 
00058 //=============================================================================
00062 //=============================================================================
00063 GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID)
00064 : GEOM_IOperations(theEngine, theDocID)
00065 {
00066   MESSAGE("GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations");
00067 }
00068 
00069 //=============================================================================
00073 //=============================================================================
00074 GEOMImpl_IBasicOperations::~GEOMImpl_IBasicOperations()
00075 {
00076   MESSAGE("GEOMImpl_IBasicOperations::~GEOMImpl_IBasicOperations");
00077 }
00078 
00079 
00080 //=============================================================================
00084 //=============================================================================
00085 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointXYZ
00086                                         (double theX, double theY, double theZ)
00087 {
00088   SetErrorCode(KO);
00089 
00090   //Add a new Point object
00091   Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
00092 
00093   //Add a new Point function with XYZ parameters
00094   Handle(GEOM_Function) aFunction =
00095     aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ);
00096   if (aFunction.IsNull()) return NULL;
00097 
00098   //Check if the function is set correctly
00099   if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
00100 
00101   GEOMImpl_IPoint aPI(aFunction);
00102 
00103   aPI.SetX(theX);
00104   aPI.SetY(theY);
00105   aPI.SetZ(theZ);
00106 
00107   //Compute the point value
00108   try {
00109 #if OCC_VERSION_LARGE > 0x06010000
00110     OCC_CATCH_SIGNALS;
00111 #endif
00112     if (!GetSolver()->ComputeFunction(aFunction)) {
00113       SetErrorCode("Point driver failed");
00114       return NULL;
00115     }
00116   }
00117   catch (Standard_Failure) {
00118     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00119     SetErrorCode(aFail->GetMessageString());
00120     return NULL;
00121   }
00122 
00123   //Make a Python command
00124   GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertex("
00125     << theX << ", " << theY << ", " << theZ << ")";
00126 
00127   SetErrorCode(OK);
00128   return aPoint;
00129 }
00130 
00131 //=============================================================================
00135 //=============================================================================
00136 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference
00137       (Handle(GEOM_Object) theReference, double theX, double theY, double theZ)
00138 {
00139   SetErrorCode(KO);
00140 
00141   if (theReference.IsNull()) return NULL;
00142 
00143   //Add a new Point object
00144   Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
00145 
00146   //Add a new Point function for creation a point relativley another point
00147   Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ_REF);
00148 
00149   //Check if the function is set correctly
00150   if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
00151 
00152   GEOMImpl_IPoint aPI(aFunction);
00153 
00154   Handle(GEOM_Function) aRefFunction = theReference->GetLastFunction();
00155   if (aRefFunction.IsNull()) return NULL;
00156 
00157   aPI.SetRef(aRefFunction);
00158   aPI.SetX(theX);
00159   aPI.SetY(theY);
00160   aPI.SetZ(theZ);
00161 
00162   //Compute the point value
00163   try {
00164 #if OCC_VERSION_LARGE > 0x06010000
00165     OCC_CATCH_SIGNALS;
00166 #endif
00167     if (!GetSolver()->ComputeFunction(aFunction)) {
00168       SetErrorCode("Point driver failed");
00169       return NULL;
00170     }
00171   }
00172   catch (Standard_Failure) {
00173     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00174     SetErrorCode(aFail->GetMessageString());
00175     return NULL;
00176   }
00177 
00178   //Make a Python command
00179   GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexWithRef("
00180     << theReference << ", " << theX << ", " << theY << ", " << theZ << ")";
00181 
00182   SetErrorCode(OK);
00183   return aPoint;
00184 }
00185 
00186 //=============================================================================
00190 //=============================================================================
00191 Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
00192                     (Handle(GEOM_Object) theGeomObj,
00193                      double theParam1,
00194                      double theParam2,
00195                      double theParam3,
00196                      const PointLocation theLocation,
00197                    Handle(GEOM_Object) theRefPoint)
00198 {
00199   SetErrorCode(KO);
00200 
00201   if (theGeomObj.IsNull()) return NULL;
00202 
00203   //Add a new Point object
00204   Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
00205 
00206   //Add a new Point function for creation a point relativley another point
00207   int fType = POINT_CURVE_PAR;
00208   switch( theLocation )
00209     {
00210     case PointOn_CurveByParam:   fType = POINT_CURVE_PAR; break;
00211     case PointOn_CurveByLength:  fType = POINT_CURVE_LENGTH; break;                         
00212     case PointOn_CurveByCoord:   fType = POINT_CURVE_COORD; break;
00213     case PointOn_SurfaceByParam: fType = POINT_SURFACE_PAR; break;
00214     case PointOn_SurfaceByCoord: fType = POINT_SURFACE_COORD; break;
00215     default: break;
00216     }
00217   Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), fType);
00218 
00219   //Check if the function is set correctly
00220   if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
00221 
00222   GEOMImpl_IPoint aPI (aFunction);
00223 
00224   Handle(GEOM_Function) aRefFunction = theGeomObj->GetLastFunction();
00225   if (aRefFunction.IsNull()) return NULL;
00226 
00227   switch( theLocation )
00228     {
00229     case PointOn_CurveByParam:
00230       aPI.SetCurve(aRefFunction);
00231       aPI.SetParameter(theParam1);
00232       break;
00233     case PointOn_CurveByLength:
00234       aPI.SetCurve(aRefFunction);
00235       aPI.SetLength(theParam1);
00236       if (!theRefPoint.IsNull()) {
00237         Handle(GEOM_Function) aRefPoint = theRefPoint->GetLastFunction();
00238         aPI.SetRef(aRefPoint);
00239       }
00240       break;
00241     case PointOn_CurveByCoord:
00242       aPI.SetCurve(aRefFunction);
00243       aPI.SetX(theParam1);
00244       aPI.SetY(theParam2);
00245       aPI.SetZ(theParam3);
00246       break;
00247     case PointOn_SurfaceByParam:
00248       aPI.SetSurface(aRefFunction);
00249       aPI.SetParameter(theParam1);
00250       aPI.SetParameter2(theParam2);
00251       break;
00252     case PointOn_SurfaceByCoord:
00253       aPI.SetSurface(aRefFunction);
00254       aPI.SetX(theParam1);
00255       aPI.SetY(theParam2);
00256       aPI.SetZ(theParam3);
00257     default: break;
00258     }
00259   
00260   //Compute the point value
00261   try {
00262 #if OCC_VERSION_LARGE > 0x06010000
00263     OCC_CATCH_SIGNALS;
00264 #endif
00265     if (!GetSolver()->ComputeFunction(aFunction)) {
00266       SetErrorCode("Point driver failed");
00267       return NULL;
00268     }
00269   }
00270   catch (Standard_Failure) {
00271     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00272     SetErrorCode(aFail->GetMessageString());
00273     return NULL;
00274   }
00275 
00276   //Make a Python command
00277   switch( theLocation )
00278     {
00279     case PointOn_CurveByParam:
00280       GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurve("
00281                                    << theGeomObj << ", " << theParam1 << ")";
00282       break;
00283     case PointOn_CurveByLength:
00284       GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByLength("
00285                                    << theGeomObj << ", " << theParam1 << ", " << theRefPoint <<  ")";
00286       break;
00287     case PointOn_CurveByCoord:
00288   GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByCoord("
00289                                << theGeomObj << ", " << theParam1 
00290                                << ", " << theParam2 << ", " << theParam3 << ")";
00291       break;
00292     case PointOn_SurfaceByParam:
00293   GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnSurface("
00294                                << theGeomObj << ", " << theParam1 
00295                                << ", " << theParam2 << ")";
00296       break;
00297     case PointOn_SurfaceByCoord:
00298   GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnSurfaceByCoord("
00299                                << theGeomObj << ", " << theParam1 
00300                                << ", " << theParam2 << ", " << theParam3 << ")";
00301     default: break;
00302     }
00303 
00304   SetErrorCode(OK);
00305   return aPoint;
00306 }
00307 
00308 //=============================================================================
00312 //=============================================================================
00313 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
00314                             (Handle(GEOM_Object) theCurve, double theParameter)
00315 {
00316   return makePointOnGeom(theCurve, theParameter, 0.0, 0.0, PointOn_CurveByParam);
00317 }
00318 
00319 //=============================================================================
00323 //=============================================================================
00324 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByCoord
00325                     (Handle(GEOM_Object) theCurve,
00326                      double theXParam,
00327                      double theYParam,
00328                      double theZParam)
00329 {
00330   return makePointOnGeom(theCurve, theXParam, theYParam, theZParam, PointOn_CurveByCoord);
00331 }
00332 
00333 //=============================================================================
00337 //=============================================================================
00338 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByLength
00339                     (Handle(GEOM_Object) theCurve, 
00340                    double              theLength, 
00341                    Handle(GEOM_Object) theStartPoint)
00342 {
00343   return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength, theStartPoint);
00344 }
00345 
00346 //=============================================================================
00350 //=============================================================================
00351 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnSurface
00352                     (Handle(GEOM_Object) theSurface,
00353                      double theUParameter,
00354                      double theVParameter)
00355 {
00356   return makePointOnGeom(theSurface, theUParameter, theVParameter, 0., PointOn_SurfaceByParam);
00357 }
00358 
00359 //=============================================================================
00363 //=============================================================================
00364 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnSurfaceByCoord
00365                     (Handle(GEOM_Object) theSurface,
00366                      double theXParam,
00367                      double theYParam,
00368                      double theZParam)
00369 {
00370   return makePointOnGeom(theSurface, theXParam, theYParam, theZParam, PointOn_SurfaceByCoord);
00371 }
00372 
00373 
00374 //=============================================================================
00378 //=============================================================================
00379 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnLinesIntersection
00380                             (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2)
00381 {
00382   SetErrorCode(KO);
00383 
00384   if (theLine1.IsNull() || theLine2.IsNull()) return NULL;
00385 
00386   //Add a new Point object
00387   Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
00388 
00389   //Add a new Point function for creation a point relativley another point
00390   Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_LINES_INTERSECTION);
00391 
00392   //Check if the function is set correctly
00393   if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
00394 
00395   GEOMImpl_IPoint aPI (aFunction);
00396 
00397   Handle(GEOM_Function) aRef1 = theLine1->GetLastFunction();
00398   Handle(GEOM_Function) aRef2 = theLine2->GetLastFunction();
00399   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
00400 
00401   aPI.SetLine1(aRef1);
00402   aPI.SetLine2(aRef2);
00403 
00404   //Compute the point value
00405   try {
00406 #if OCC_VERSION_LARGE > 0x06010000
00407     OCC_CATCH_SIGNALS;
00408 #endif
00409     if (!GetSolver()->ComputeFunction(aFunction)) {
00410       SetErrorCode("Point driver failed");
00411       return NULL;
00412     }
00413   }
00414   catch (Standard_Failure) {
00415     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00416     SetErrorCode(aFail->GetMessageString());
00417     return NULL;
00418   }
00419 
00420   //Make a Python command
00421   GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnLinesIntersection("
00422                                << theLine1 << ", " << theLine2 << ")";
00423 
00424   SetErrorCode(OK);
00425   return aPoint;
00426 }
00427 
00428 //=============================================================================
00432 //=============================================================================
00433 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentOnCurve
00434                             (const Handle(GEOM_Object)& theCurve, double theParameter)
00435 {
00436   SetErrorCode(KO);
00437 
00438   if (theCurve.IsNull()) return NULL;
00439 
00440   //Add a new Vector object
00441   Handle(GEOM_Object) aVec = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
00442 
00443   //Add a new Point function for creation a point relativley another point
00444   Handle(GEOM_Function) aFunction = aVec->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TANGENT_CURVE_PAR);
00445 
00446   //Check if the function is set correctly
00447   if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL;
00448 
00449   GEOMImpl_IVector aVI (aFunction);
00450 
00451   Handle(GEOM_Function) aRefFunction = theCurve->GetLastFunction();
00452   if (aRefFunction.IsNull()) return NULL;
00453 
00454   aVI.SetCurve(aRefFunction);
00455   aVI.SetParameter(theParameter);
00456 
00457   //Compute the vector value
00458   try {
00459 #if OCC_VERSION_LARGE > 0x06010000
00460     OCC_CATCH_SIGNALS;
00461 #endif
00462     if (!GetSolver()->ComputeFunction(aFunction)) {
00463       SetErrorCode("Vector driver failed");
00464       return NULL;
00465     }
00466   }
00467   catch (Standard_Failure) {
00468     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00469     SetErrorCode(aFail->GetMessageString());
00470     return NULL;
00471   }
00472 
00473   //Make a Python command
00474   GEOM::TPythonDump(aFunction) << aVec << " = geompy.MakeTangentOnCurve("
00475                                << theCurve << ", " << theParameter << ")";
00476 
00477   SetErrorCode(OK);
00478   return aVec;
00479 }
00480 
00481 //=============================================================================
00485 //=============================================================================
00486 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorDXDYDZ
00487                                      (double theDX, double theDY, double theDZ)
00488 {
00489   SetErrorCode(KO);
00490 
00491   //Add a new Vector object
00492   Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
00493 
00494   //Add a new Vector function with DXDYDZ parameters
00495   Handle(GEOM_Function) aFunction =
00496     aVector->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_DX_DY_DZ);
00497   if (aFunction.IsNull()) return NULL;
00498 
00499   //Check if the function is set correctly
00500   if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL;
00501 
00502   GEOMImpl_IVector aPI (aFunction);
00503 
00504   aPI.SetDX(theDX);
00505   aPI.SetDY(theDY);
00506   aPI.SetDZ(theDZ);
00507 
00508   //Compute the Vector value
00509   try {
00510 #if OCC_VERSION_LARGE > 0x06010000
00511     OCC_CATCH_SIGNALS;
00512 #endif
00513     if (!GetSolver()->ComputeFunction(aFunction)) {
00514       SetErrorCode("Vector driver failed");
00515       return NULL;
00516     }
00517   }
00518   catch (Standard_Failure) {
00519     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00520     SetErrorCode(aFail->GetMessageString());
00521     return NULL;
00522   }
00523 
00524   //Make a Python command
00525   GEOM::TPythonDump(aFunction) << aVector << " = geompy.MakeVectorDXDYDZ("
00526     << theDX << ", " << theDY << ", " << theDZ << ")";
00527 
00528   SetErrorCode(OK);
00529   return aVector;
00530 }
00531 
00532 //=============================================================================
00536 //=============================================================================
00537 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorTwoPnt
00538                      (Handle(GEOM_Object) thePnt1, Handle(GEOM_Object) thePnt2)
00539 {
00540   SetErrorCode(KO);
00541 
00542   if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
00543 
00544   //Add a new Vector object
00545   Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
00546 
00547   //Add a new Vector function
00548   Handle(GEOM_Function) aFunction =
00549     aVector->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TWO_PNT);
00550 
00551   //Check if the function is set correctly
00552   if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL;
00553 
00554   GEOMImpl_IVector aPI (aFunction);
00555 
00556   Handle(GEOM_Function) aRef1 = thePnt1->GetLastFunction();
00557   Handle(GEOM_Function) aRef2 = thePnt2->GetLastFunction();
00558   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
00559 
00560   aPI.SetPoint1(aRef1);
00561   aPI.SetPoint2(aRef2);
00562 
00563   //Compute the Vector value
00564   try {
00565 #if OCC_VERSION_LARGE > 0x06010000
00566     OCC_CATCH_SIGNALS;
00567 #endif
00568     if (!GetSolver()->ComputeFunction(aFunction)) {
00569       SetErrorCode("Vector driver failed");
00570       return NULL;
00571     }
00572   }
00573   catch (Standard_Failure) {
00574     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00575     SetErrorCode(aFail->GetMessageString());
00576     return NULL;
00577   }
00578 
00579   //Make a Python command
00580   GEOM::TPythonDump(aFunction) << aVector << " = geompy.MakeVector("
00581                                << thePnt1 << ", " << thePnt2 << ")";
00582 
00583   SetErrorCode(OK);
00584   return aVector;
00585 }
00586 
00587 
00588 //=============================================================================
00592 //=============================================================================
00593 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLine
00594                      (Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theDir)
00595 {
00596   SetErrorCode(KO);
00597 
00598   if (thePnt.IsNull() || theDir.IsNull()) return NULL;
00599 
00600   //Add a new Line object
00601   Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
00602 
00603   //Add a new Line function
00604   Handle(GEOM_Function) aFunction =
00605     aLine->AddFunction(GEOMImpl_LineDriver::GetID(), LINE_PNT_DIR);
00606 
00607   //Check if the function is set correctly
00608   if (aFunction->GetDriverGUID() != GEOMImpl_LineDriver::GetID()) return NULL;
00609 
00610   GEOMImpl_ILine aPI (aFunction);
00611 
00612   Handle(GEOM_Function) aRef1 = thePnt->GetLastFunction();
00613   Handle(GEOM_Function) aRef2 = theDir->GetLastFunction();
00614   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
00615 
00616   aPI.SetPoint1(aRef1);
00617   aPI.SetPoint2(aRef2);
00618 
00619   //Compute the Line value
00620   try {
00621 #if OCC_VERSION_LARGE > 0x06010000
00622     OCC_CATCH_SIGNALS;
00623 #endif
00624     if (!GetSolver()->ComputeFunction(aFunction)) {
00625       SetErrorCode("Line driver failed");
00626       return NULL;
00627     }
00628   }
00629   catch (Standard_Failure) {
00630     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00631     SetErrorCode(aFail->GetMessageString());
00632     return NULL;
00633   }
00634 
00635   //Make a Python command
00636   GEOM::TPythonDump(aFunction) << aLine << " = geompy.MakeLine("
00637                                << thePnt << ", " << theDir << ")";
00638 
00639   SetErrorCode(OK);
00640   return aLine;
00641 }
00642 
00643 //=============================================================================
00647 //=============================================================================
00648 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoPnt
00649                      (Handle(GEOM_Object) thePnt1, Handle(GEOM_Object) thePnt2)
00650 {
00651   SetErrorCode(KO);
00652 
00653   if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
00654 
00655   //Add a new Line object
00656   Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
00657 
00658   //Add a new Line function
00659   Handle(GEOM_Function) aFunction =
00660     aLine->AddFunction(GEOMImpl_LineDriver::GetID(), LINE_TWO_PNT);
00661 
00662   //Check if the function is set correctly
00663   if (aFunction->GetDriverGUID() != GEOMImpl_LineDriver::GetID()) return NULL;
00664 
00665   GEOMImpl_ILine aPI (aFunction);
00666 
00667   Handle(GEOM_Function) aRef1 = thePnt1->GetLastFunction();
00668   Handle(GEOM_Function) aRef2 = thePnt2->GetLastFunction();
00669   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
00670 
00671   aPI.SetPoint1(aRef1);
00672   aPI.SetPoint2(aRef2);
00673 
00674   //Compute the Line value
00675   try {
00676 #if OCC_VERSION_LARGE > 0x06010000
00677     OCC_CATCH_SIGNALS;
00678 #endif
00679     if (!GetSolver()->ComputeFunction(aFunction)) {
00680       SetErrorCode("Line driver failed");
00681       return NULL;
00682     }
00683   }
00684   catch (Standard_Failure) {
00685     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00686     SetErrorCode(aFail->GetMessageString());
00687     return NULL;
00688   }
00689 
00690   //Make a Python command
00691   GEOM::TPythonDump(aFunction) << aLine << " = geompy.MakeLineTwoPnt("
00692                                << thePnt1 << ", " << thePnt2 << ")";
00693 
00694   SetErrorCode(OK);
00695   return aLine;
00696 }
00697 
00698 //=============================================================================
00702 //=============================================================================
00703 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoFaces
00704                      (Handle(GEOM_Object) theFace1, Handle(GEOM_Object) theFace2)
00705 {
00706   SetErrorCode(KO);
00707 
00708   if (theFace1.IsNull() || theFace2.IsNull()) return NULL;
00709 
00710   //Add a new Line object
00711   Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
00712 
00713   //Add a new Line function
00714   Handle(GEOM_Function) aFunction =
00715     aLine->AddFunction(GEOMImpl_LineDriver::GetID(), LINE_TWO_FACES);
00716 
00717   //Check if the function is set correctly
00718   if (aFunction->GetDriverGUID() != GEOMImpl_LineDriver::GetID()) return NULL;
00719 
00720   GEOMImpl_ILine aPI (aFunction);
00721 
00722   Handle(GEOM_Function) aRef1 = theFace1->GetLastFunction();
00723   Handle(GEOM_Function) aRef2 = theFace2->GetLastFunction();
00724   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
00725 
00726   aPI.SetFace1(aRef1);
00727   aPI.SetFace2(aRef2);
00728 
00729   //Compute the Line value
00730   try {
00731 #if OCC_VERSION_LARGE > 0x06010000
00732     OCC_CATCH_SIGNALS;
00733 #endif
00734     if (!GetSolver()->ComputeFunction(aFunction)) {
00735       SetErrorCode("Line driver failed");
00736       return NULL;
00737     }
00738   }
00739   catch (Standard_Failure) {
00740     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00741     SetErrorCode(aFail->GetMessageString());
00742     return NULL;
00743   }
00744 
00745   //Make a Python command
00746   GEOM::TPythonDump(aFunction) << aLine << " = geompy.MakeLineTwoFaces("
00747                                << theFace1 << ", " << theFace2 << ")";
00748 
00749   SetErrorCode(OK);
00750   return aLine;
00751 }
00752 
00753 //=============================================================================
00757 //=============================================================================
00758 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneThreePnt
00759                      (Handle(GEOM_Object) thePnt1, Handle(GEOM_Object) thePnt2,
00760                       Handle(GEOM_Object) thePnt3, double theSize)
00761 {
00762   SetErrorCode(KO);
00763 
00764   if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
00765 
00766   //Add a new Plane object
00767   Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
00768 
00769   //Add a new Plane function
00770   Handle(GEOM_Function) aFunction =
00771     aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_THREE_PNT);
00772 
00773   //Check if the function is set correctly
00774   if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
00775 
00776   GEOMImpl_IPlane aPI (aFunction);
00777 
00778   Handle(GEOM_Function) aRef1 = thePnt1->GetLastFunction();
00779   Handle(GEOM_Function) aRef2 = thePnt2->GetLastFunction();
00780   Handle(GEOM_Function) aRef3 = thePnt3->GetLastFunction();
00781   if (aRef1.IsNull() || aRef2.IsNull() || aRef3.IsNull()) return NULL;
00782 
00783   aPI.SetPoint1(aRef1);
00784   aPI.SetPoint2(aRef2);
00785   aPI.SetPoint3(aRef3);
00786   aPI.SetSize(theSize);
00787 
00788   //Compute the Plane value
00789   try {
00790 #if OCC_VERSION_LARGE > 0x06010000
00791     OCC_CATCH_SIGNALS;
00792 #endif
00793     if (!GetSolver()->ComputeFunction(aFunction)) {
00794       SetErrorCode("Plane driver failed");
00795       return NULL;
00796     }
00797   }
00798   catch (Standard_Failure) {
00799     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00800     SetErrorCode(aFail->GetMessageString());
00801     return NULL;
00802   }
00803 
00804   //Make a Python command
00805   GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlaneThreePnt("
00806     << thePnt1 << ", " << thePnt2 << ", " << thePnt3 << ", " << theSize << ")";
00807 
00808   SetErrorCode(OK);
00809   return aPlane;
00810 }
00811 
00812 //=============================================================================
00816 //=============================================================================
00817 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlanePntVec
00818                        (Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theVec,
00819                         double theSize)
00820 {
00821   SetErrorCode(KO);
00822 
00823   if (thePnt.IsNull() || theVec.IsNull()) return NULL;
00824 
00825   //Add a new Plane object
00826   Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
00827 
00828   //Add a new Plane function
00829   Handle(GEOM_Function) aFunction =
00830     aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_PNT_VEC);
00831 
00832   //Check if the function is set correctly
00833   if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
00834 
00835   GEOMImpl_IPlane aPI (aFunction);
00836 
00837   Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
00838   Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
00839   if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
00840 
00841   aPI.SetPoint(aRefPnt);
00842   aPI.SetVector(aRefVec);
00843   aPI.SetSize(theSize);
00844 
00845   //Compute the Plane value
00846   try {
00847 #if OCC_VERSION_LARGE > 0x06010000
00848     OCC_CATCH_SIGNALS;
00849 #endif
00850     if (!GetSolver()->ComputeFunction(aFunction)) {
00851       SetErrorCode("Plane driver failed");
00852       return NULL;
00853     }
00854   }
00855   catch (Standard_Failure) {
00856     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00857     SetErrorCode(aFail->GetMessageString());
00858     return NULL;
00859   }
00860 
00861   //Make a Python command
00862   GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlane("
00863     << thePnt << ", " << theVec << ", " << theSize << ")";
00864 
00865   SetErrorCode(OK);
00866   return aPlane;
00867 }
00868 
00869 //=============================================================================
00873 //=============================================================================
00874 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneFace
00875                        (Handle(GEOM_Object) theFace, double theSize)
00876 {
00877   SetErrorCode(KO);
00878 
00879   if (theFace.IsNull()) return NULL;
00880 
00881   //Add a new Plane object
00882   Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
00883 
00884   //Add a new Plane function
00885   Handle(GEOM_Function) aFunction =
00886     aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_FACE);
00887 
00888   //Check if the function is set correctly
00889   if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
00890 
00891   GEOMImpl_IPlane aPI (aFunction);
00892 
00893   Handle(GEOM_Function) aRef = theFace->GetLastFunction();
00894   if (aRef.IsNull()) return NULL;
00895 
00896   aPI.SetFace(aRef);
00897   aPI.SetSize(theSize);
00898 
00899   //Compute the Plane value
00900   try {
00901 #if OCC_VERSION_LARGE > 0x06010000
00902     OCC_CATCH_SIGNALS;
00903 #endif
00904     if (!GetSolver()->ComputeFunction(aFunction)) {
00905       SetErrorCode("Plane driver failed");
00906       return NULL;
00907     }
00908   }
00909   catch (Standard_Failure) {
00910     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00911     SetErrorCode(aFail->GetMessageString());
00912     return NULL;
00913   }
00914 
00915   //Make a Python command
00916   GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlaneFace("
00917                                << theFace << ", " << theSize << ")";
00918 
00919   SetErrorCode(OK);
00920   return aPlane;
00921 }
00922 
00923 //=============================================================================
00927 //=============================================================================
00928 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlane2Vec
00929                        (Handle(GEOM_Object) theVec1, Handle(GEOM_Object) theVec2,
00930                         double theSize)
00931 {
00932   SetErrorCode(KO);
00933 
00934   if (theVec1.IsNull() || theVec2.IsNull()) return NULL;
00935 
00936   //Add a new Plane object
00937   Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
00938 
00939   //Add a new Plane function
00940   Handle(GEOM_Function) aFunction =
00941     aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_2_VEC);
00942 
00943   //Check if the function is set correctly
00944   if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
00945 
00946   GEOMImpl_IPlane aPI (aFunction);
00947 
00948   Handle(GEOM_Function) aRefVec1 = theVec1->GetLastFunction();
00949   Handle(GEOM_Function) aRefVec2 = theVec2->GetLastFunction();
00950   if (aRefVec1.IsNull() || aRefVec2.IsNull()) return NULL;
00951 
00952   aPI.SetVector1(aRefVec1);
00953   aPI.SetVector2(aRefVec2);
00954   aPI.SetSize(theSize);
00955 
00956   //Compute the Plane value
00957   try {
00958 #if OCC_VERSION_LARGE > 0x06010000
00959     OCC_CATCH_SIGNALS;
00960 #endif
00961     if (!GetSolver()->ComputeFunction(aFunction)) {
00962       SetErrorCode("Plane driver failed");
00963       return NULL;
00964     }
00965   }
00966   catch (Standard_Failure) {
00967     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00968     SetErrorCode(aFail->GetMessageString());
00969     return NULL;
00970   }
00971 
00972   //Make a Python command
00973   GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlane2Vec("
00974     << theVec1 << ", " << theVec2 << ", " << theSize << ")";
00975 
00976   SetErrorCode(OK);
00977   return aPlane;
00978 }
00979 
00980 //=============================================================================
00984 //=============================================================================
00985 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneLCS
00986                        (Handle(GEOM_Object) theLCS, double theSize, int theOrientation)
00987 {
00988   SetErrorCode(KO);
00989 
00990   //Add a new Plane object
00991   Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
00992 
00993   //Add a new Plane function
00994   Handle(GEOM_Function) aFunction =
00995     aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_LCS);
00996 
00997   //Check if the function is set correctly
00998   if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
00999 
01000   GEOMImpl_IPlane aPI (aFunction);
01001 
01002   if ( !theLCS.IsNull() ) {
01003     Handle(GEOM_Function) aRef = theLCS->GetLastFunction();
01004     aPI.SetLCS(aRef);
01005   }
01006 
01007   aPI.SetSize(theSize);
01008   aPI.SetOrientation(theOrientation);
01009 
01010   //Compute the Plane value
01011   try {
01012 #if OCC_VERSION_LARGE > 0x06010000
01013     OCC_CATCH_SIGNALS;
01014 #endif
01015     if (!GetSolver()->ComputeFunction(aFunction)) {
01016       SetErrorCode("Plane driver failed");
01017       return NULL;
01018     }
01019   }
01020   catch (Standard_Failure) {
01021     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
01022     SetErrorCode(aFail->GetMessageString());
01023     return NULL;
01024   }
01025 
01026   //Make a Python command
01027   GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlaneLCS("
01028                                << theLCS << ", " << theSize << ", " << theOrientation << ")";
01029 
01030   SetErrorCode(OK);
01031   return aPlane;
01032 }
01033 
01034 
01035 //=============================================================================
01039 //=============================================================================
01040 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker
01041                                   (double theOX,  double theOY,  double theOZ,
01042                                    double theXDX, double theXDY, double theXDZ,
01043                                    double theYDX, double theYDY, double theYDZ)
01044 {
01045   SetErrorCode(KO);
01046 
01047   //Add a new Marker object
01048   Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
01049 
01050   //Add a new Marker function
01051   Handle(GEOM_Function) aFunction =
01052     aMarker->AddFunction(GEOMImpl_MarkerDriver::GetID(), MARKER_CS);
01053   if (aFunction.IsNull()) return NULL;
01054 
01055   //Check if the function is set correctly
01056   if (aFunction->GetDriverGUID() != GEOMImpl_MarkerDriver::GetID()) return NULL;
01057 
01058   GEOMImpl_IMarker aPI(aFunction);
01059 
01060   aPI.SetOrigin(theOX, theOY, theOZ);
01061   aPI.SetXDir(theXDX, theXDY, theXDZ);
01062   aPI.SetYDir(theYDX, theYDY, theYDZ);
01063 
01064   //Compute the marker value
01065   try {
01066 #if OCC_VERSION_LARGE > 0x06010000
01067     OCC_CATCH_SIGNALS;
01068 #endif
01069     if (!GetSolver()->ComputeFunction(aFunction)) {
01070       SetErrorCode("Marker driver failed");
01071       return NULL;
01072     }
01073   }
01074   catch (Standard_Failure) {
01075     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
01076     SetErrorCode(aFail->GetMessageString());
01077     return NULL;
01078   }
01079 
01080   //Make a Python command
01081   GEOM::TPythonDump(aFunction) << aMarker << " = geompy.MakeMarker("
01082     << theOX << ", " << theOY << ", " << theOZ << ", "
01083       << theXDX << ", " << theXDY << ", " << theXDZ << ", "
01084         << theYDX << ", " << theYDY << ", " << theYDZ << ")";
01085 
01086   SetErrorCode(OK);
01087   return aMarker;
01088 }
01089 
01090 //=============================================================================
01094 //=============================================================================
01095 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerFromShape
01096                                   (const Handle(GEOM_Object)& theShape)
01097 {
01098   SetErrorCode(KO);
01099 
01100   //Add a new Marker object
01101   Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
01102 
01103   //Add a new Marker function
01104   Handle(GEOM_Function) aFunction =
01105     aMarker->AddFunction(GEOMImpl_MarkerDriver::GetID(), MARKER_SHAPE);
01106   if (aFunction.IsNull()) return NULL;
01107 
01108   //Check if the function is set correctly
01109   if (aFunction->GetDriverGUID() != GEOMImpl_MarkerDriver::GetID()) return NULL;
01110 
01111   GEOMImpl_IMarker aPI(aFunction);
01112 
01113   Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
01114   if (aRefShape.IsNull()) return NULL;
01115 
01116   aPI.SetShape(aRefShape);
01117 
01118   //Compute the marker value
01119   try {
01120 #if OCC_VERSION_LARGE > 0x06010000
01121     OCC_CATCH_SIGNALS;
01122 #endif
01123     if (!GetSolver()->ComputeFunction(aFunction)) {
01124       SetErrorCode("Marker driver failed");
01125       return NULL;
01126     }
01127   }
01128   catch (Standard_Failure) {
01129     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
01130     SetErrorCode(aFail->GetMessageString());
01131     return NULL;
01132   }
01133 
01134   //Make a Python command
01135   GEOM::TPythonDump(aFunction) << aMarker << " = geompy.MakeMarkerFromShape(" << theShape << ")";
01136 
01137   SetErrorCode(OK);
01138   return aMarker;
01139 }
01140 
01141 //=============================================================================
01145 //=============================================================================
01146 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerPntTwoVec
01147                                               (const Handle(GEOM_Object)& theOrigin,
01148                                                const Handle(GEOM_Object)& theXVec,
01149                                                const Handle(GEOM_Object)& theYVec)
01150 {
01151   SetErrorCode(KO);
01152 
01153   //Add a new Marker object
01154   Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
01155 
01156   //Add a new Marker function
01157   Handle(GEOM_Function) aFunction =
01158     aMarker->AddFunction(GEOMImpl_MarkerDriver::GetID(), MARKER_PNT2VEC);
01159   if (aFunction.IsNull()) return NULL;
01160 
01161   //Check if the function is set correctly
01162   if (aFunction->GetDriverGUID() != GEOMImpl_MarkerDriver::GetID()) return NULL;
01163 
01164   GEOMImpl_IMarker aPI(aFunction);
01165 
01166   Handle(GEOM_Function) aRefOrigin = theOrigin->GetLastFunction();
01167   Handle(GEOM_Function) aRefXVec = theXVec->GetLastFunction();
01168   Handle(GEOM_Function) aRefYVec = theYVec->GetLastFunction();
01169   if (aRefOrigin.IsNull() || aRefXVec.IsNull() || aRefYVec.IsNull()) return NULL;
01170 
01171   aPI.SetOrigin(aRefOrigin);
01172   aPI.SetXVec(aRefXVec);
01173   aPI.SetYVec(aRefYVec);
01174 
01175   //Compute the marker value
01176   try {
01177 #if OCC_VERSION_LARGE > 0x06010000
01178     OCC_CATCH_SIGNALS;
01179 #endif
01180     if (!GetSolver()->ComputeFunction(aFunction)) {
01181       SetErrorCode("Marker driver failed");
01182       return NULL;
01183     }
01184   }
01185   catch (Standard_Failure) {
01186     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
01187     SetErrorCode(aFail->GetMessageString());
01188     return NULL;
01189   }
01190 
01191   //Make a Python command
01192   GEOM::TPythonDump(aFunction) << aMarker << " = geompy.MakeMarkerPntTwoVec("
01193     << theOrigin << ", " << theXVec << ", " << theYVec << ")";
01194 
01195   SetErrorCode(OK);
01196   return aMarker;
01197 }
01198 
01199 //=============================================================================
01203 //=============================================================================
01204 
01205 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Handle(GEOM_Object)& theFace,
01206                                                                       double theParamU,
01207                                                                       double theParamV,
01208                                                                       double theSize)
01209 {
01210    SetErrorCode(KO);
01211 
01212   if (theFace.IsNull()) return NULL;
01213 
01214   //Add a new Plane object
01215   Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
01216 
01217   //Add a new Plane function
01218   Handle(GEOM_Function) aFunction =
01219     aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_TANGENT_FACE);
01220 
01221   //Check if the function is set correctly
01222   if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
01223 
01224   GEOMImpl_IPlane aPI (aFunction);
01225 
01226   Handle(GEOM_Function) aRef = theFace->GetLastFunction();
01227   if (aRef.IsNull()) return NULL;
01228 
01229   aPI.SetFace(aRef);
01230   aPI.SetSize(theSize);
01231   aPI.SetParameterU(theParamU);
01232   aPI.SetParameterV(theParamV);
01233 
01234   //Compute the Plane value
01235   try {
01236 #if OCC_VERSION_LARGE > 0x06010000
01237     OCC_CATCH_SIGNALS;
01238 #endif
01239     if (!GetSolver()->ComputeFunction(aFunction)) {
01240       SetErrorCode("Plane driver failed");
01241       return NULL;
01242     }
01243   }
01244   catch (Standard_Failure) {
01245     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
01246     SetErrorCode(aFail->GetMessageString());
01247     return NULL;
01248   }
01249 
01250   //Make a Python command
01251   GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakeTangentPlaneOnFace("
01252                                << theFace << ", " <<theParamU <<", "<<theParamV <<", "<< theSize << ")";
01253 
01254   SetErrorCode(OK);
01255   return aPlane;
01256 }